docs: def hamming_emd(d1, d2):
      """Return the Earth Mover's Distance between two distributions (indexed
      by state, one dimension per node) using the Hamming distance between states
      as the transportation cost function.
  
      Singleton dimensions are sqeezed out.
      """
      N = d1.squeeze().ndim
      d1, d2 = flatten(d1), flatten(d2)
      return emd(d1, d2, _hamming_matrix(N))