code: def im_to_am(im):
      r
      if im.shape[0] == im.shape[1]:
          print('Warning: Received matrix is square which is unlikely')
      if im.shape[0] > im.shape[1]:
          print('Warning: Received matrix has more sites than bonds')
      if im.format != 'coo':
          im = im.tocoo(copy=False)
docs: r"""
      Convert an incidence matrix into an adjacency matrix