42 int main(
int argc,
char **argv)
50 std::string inputfile =
"rdm.h5";
51 std::string integralsfile;
57 struct option long_options[] =
59 {
"integrals", required_argument, 0,
'i'},
60 {
"unitary", required_argument, 0,
'u'},
61 {
"rdm", required_argument, 0,
'r'},
62 {
"2dm", no_argument, 0,
'2'},
63 {
"1dm", no_argument, 0,
'1'},
64 {
"sort", no_argument, 0,
's'},
65 {
"help", no_argument, 0,
'h'},
71 while( (j = getopt_long (argc, argv,
"h12si:u:r:", long_options, &i)) != -1)
76 cout <<
"Usage: " << argv[0] <<
" [OPTIONS]\n"
78 " -r, --rdm=rdm-file Read this RDM\n"
79 " -i, --integrals=integrals-file Set the input integrals file\n"
80 " -u, --unitary=unitary-file Use the unitary matrix in this file\n"
81 " -1, --1dm Print the 1DM\n"
82 " -2, --2dm Print the 2DM\n"
83 " -s, --sort Sort the 1DM elements\n"
84 " -h, --help Display this help\n"
89 integralsfile = optarg;
108 cout <<
"Reading: " << inputfile << endl;
112 std::unique_ptr<CheMPS2::Hamiltonian> ham;
114 if(!integralsfile.empty())
116 cout <<
"Reading ham: " << integralsfile << endl;
122 cout <<
"Found L=" << L <<
" N=" << N << endl;
129 cout <<
"Read: L=" << L <<
" N=" << N << endl;
131 if(!integralsfile.empty() && !unitary.empty())
156 cout <<
"2DM:" << endl;
158 cout <<
"Trace: " << rdm.
trace() << endl;
167 cout <<
"1DM:" << endl;
174 cout <<
"Trace: " << spm.
trace() << endl;
static Hamiltonian CreateFromH5(const string filename)
static TPM CreateFromFile(std::string filename)
sig_atomic_t stopping_min
int main(int argc, char **argv)
std::vector< double > energyperirrep(const CheMPS2::Hamiltonian &, bool print=false)
std::vector< double > Particlesperirrep(const simanneal::OptIndex &index, bool print=true) const
int getL() const
Get the number of orbitals.