xdiag icon indicating copy to clipboard operation
xdiag copied to clipboard

Use of `generated_group` is unclear

Open Spuriosity1 opened this issue 7 months ago • 1 comments

#include <xdiag/all.hpp>
#include <xdiag/blocks/spinhalf/spinhalf.hpp>
#include <xdiag/common.hpp>
#include <xdiag/symmetries/generated_group.hpp>
#include <xdiag/symmetries/representation.hpp>
#include <xdiag/utils/logger.hpp>
#include "geometry.hpp"

using namespace xdiag;


const int N_SITES = 7;

/* Set up the spins in opposing pyramids:
 *      1
 *     2 3 
 *
 *      0
 *
 *     6 5
 *      4
 *
 *  Top View:
 *
 *       1
 *  6         5
 *       0
 *  2         3
 *       4
 *
 */
const std::vector<std::pair<int, int>> cluster_bonds = {
  {1,2},
  {2,3},
  {3,1},
  {0,1},
  {0,2},
  {0,3},
  {0,4},
  {0,5},
  {0,6},
  {4,5},
  {5,6},
  {6,4}
};


int main(int argc, char* argv[]) try {
 
  BondList bonds;

  // Generate all the bonds
  for (auto& [i1, i2] : cluster_bonds) {
    bonds << Bond("HB", "J", {i1, i2});
  }

  bonds["J"] = 1.0; // Sets bond strength of bondspec "J"

  // generate the symmetries
  std::vector<Permutation> perm_generators = {
    //                             {0, 1, 2, 3, 4, 5, 6}
      Permutation(std::vector<int>({0, 2, 3, 1, 5, 6, 4})),
      Permutation(std::vector<int>({0, 1, 3, 2, 4, 6, 5})),
      Permutation(std::vector<int>({0, 4, 5, 6, 1, 2, 3}))
      };

  set_verbosity(3);
    
  // Create the symmetry group
  auto group = generated_group(perm_generators);
  auto irrep = Representation(static_cast<std::vector<complex>>(symmetry::irreps_D3d[argv[1]]));

  auto block = Spinhalf(N_SITES, group, irrep);
  double e0 = eigval0(bonds, block);
  Log("e0: {}", e0);

} catch (Error e) {
  error_trace(e);
}

Running this code yields the log Error constructing PermutationGroup: group multiplication not closed which is clearly untrue, since $D_{3d}$ is a perfectly well defined group. Where is the mistake here?

For reference, I'm running XDiag Version: 0.2.0 Git hash : 4891db93d76818dd84bd2db434326f30590060da

Spuriosity1 avatar Jul 22 '24 16:07 Spuriosity1