StatMech
Loading...
Searching...
No Matches
Representative.cpp File Reference

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)
8 {
9 if(argc != 5) {
10 std::cerr
11 << "Usage: Representative(Integer_t StateNo, Integer_t n, Integer_t k, Integer_t dloc)"
12 << std::endl;
13 std::exit(EX_USAGE);
14 }
15 Integer_t id = (Integer_t)std::atoi(argv[1]);
16 Integer_t n = (Integer_t)std::atoi(argv[2]);
17 Integer_t k = (Integer_t)std::atoi(argv[3]);
18 Integer_t dloc = (Integer_t)std::atoi(argv[4]);
19 TransSector Sector(k, n, dloc);
20 std::vector<Integer_t> spin(n);
21
22 if(id >= Sector.dim()) {
23 std::cerr << "Error: StateId(" << id << ") >= Sector.dim(" << Sector.dim() << ")"
24 << std::endl;
25 std::exit(EX_USAGE);
26 }
27
28 i_to_spin(Sector.representative(id), spin, dloc, n);
29
30 std::cout << "Representative(" << id << "," << n << "," << k << "," << dloc << ")" << std::endl;
31 std::cout << "Representatives: (dim=" << Sector.dim()
32 << ", #ParityEigens=" << Sector.dim() - 2 * Sector.parityOp().numPairs << ")"
33 << std::endl;
34 print(spin, spin.size());
35 std::cout << "Periodicity: " << Sector.periodicity(id) << std::endl;
36 std::cout << "Parity pair: " << Sector.parityOp(id) << std::endl;
37 return 0;
38}
std::vector< TransSector > Sector(n_max+1)
Translation invariant sector of a many-body Hilbert space.
Definition TransSector.hpp:19
MKL_INT Integer_t
Definition mytypes.hpp:359
void i_to_spin(int i, int *spin, int dim_loc, int n)
Definition translation.c:78