CheMPS2
|
#include <Hamiltonian.h>
Public Member Functions | |
Hamiltonian (const int Norbitals, const int nGroup, const int *OrbIrreps) | |
Constructor. More... | |
Hamiltonian (const string filename, const int psi4groupnumber) | |
Constructor which loads a FCIDUMP from disk. More... | |
Hamiltonian (const bool fileh5, const string main_file=HAMILTONIAN_ParentStorageName, const string file_tmat=HAMILTONIAN_TmatStorageName, const string file_vmat=HAMILTONIAN_VmatStorageName) | |
Constructor which loads a Hamiltonian from disk in HDF5 format. An HDF5 dump can be generated with the plugin psi4plugins/mointegrals.cc_SAVEHAM; or by (1) creating a Hamiltonian with one of the other constructors, (2) filling it with setEconst(), setTmat() and setVmat(), and (3) calling save(). More... | |
virtual | ~Hamiltonian () |
Destructor. | |
int | getL () const |
Get the number of orbitals. More... | |
int | getNGroup () const |
Get the group number. More... | |
int | getOrbitalIrrep (const int nOrb) const |
Get an orbital irrep number. More... | |
void | setEconst (const double val) |
Set the constant energy. More... | |
void | setTmat (const int index1, const int index2, const double val) |
Set a Tmat element. More... | |
void | setVmat (const int index1, const int index2, const int index3, const int index4, const double val) |
Set a Vmat element. More... | |
void | addToVmat (const int index1, const int index2, const int index3, const int index4, const double val) |
Add to Vmat element. More... | |
double | getEconst () const |
Get the constant energy. More... | |
double | getTmat (const int index1, const int index2) const |
Get a Tmat element. More... | |
double | getVmat (const int index1, const int index2, const int index3, const int index4) const |
Get a Vmat element. More... | |
const TwoIndex * | getTmat () |
Get the pointer to the one-electron integrals. More... | |
FourIndex * | getVmat () |
Get the pointer to the two-electron integrals. More... | |
void | save (const string file_parent=HAMILTONIAN_ParentStorageName, const string file_tmat=HAMILTONIAN_TmatStorageName, const string file_vmat=HAMILTONIAN_VmatStorageName) const |
Save the Hamiltonian. More... | |
void | read (const string file_parent=HAMILTONIAN_ParentStorageName, const string file_tmat=HAMILTONIAN_TmatStorageName, const string file_vmat=HAMILTONIAN_VmatStorageName) |
Load the Hamiltonian. More... | |
void | writeFCIDUMP (const string fcidumpfile, const int Nelec, const int TwoS, const int TargetIrrep) const |
Write the Hamiltonian to a FCIDUMP file. More... | |
void | debugcheck () const |
Debug check certain elements and sums. | |
void | readfock (const string fockfile, double *fockmx, const bool printinfo) const |
Read in a FOCK file. More... | |
Hamiltonian class.
Container class for the Hamiltonian matrix elements.
Class containing all Hamiltonian information:
The targeted spin, particle number and point group symmetry are not defined here. For convenience, the second quantized formulation of the Hamiltonian is given here:
where the latin letters denote site-indices and the greek letters spin projections. This Hamiltonian preserves spin, spin projection, particle number, and Abelian point group symmetry (if its character table is real at least).
Definition at line 53 of file Hamiltonian.h.
CheMPS2::Hamiltonian::Hamiltonian | ( | const int | Norbitals, |
const int | nGroup, | ||
const int * | OrbIrreps | ||
) |
Constructor.
Norbitals | The number of orbitals (L) |
nGroup | The group number |
OrbIrreps | Pointer to array containing the orbital irreps |
Definition at line 39 of file Hamiltonian.cpp.
CheMPS2::Hamiltonian::Hamiltonian | ( | const string | filename, |
const int | psi4groupnumber | ||
) |
Constructor which loads a FCIDUMP from disk.
filename | The filename of the FCIDUMP (which can be generated with the plugin psi4plugins/fcidump.cc and has Molpro orbital symmetries!) |
psi4groupnumber | The group number according to psi4's conventions |
Definition at line 65 of file Hamiltonian.cpp.
CheMPS2::Hamiltonian::Hamiltonian | ( | const bool | fileh5, |
const string | main_file = HAMILTONIAN_ParentStorageName , |
||
const string | file_tmat = HAMILTONIAN_TmatStorageName , |
||
const string | file_vmat = HAMILTONIAN_VmatStorageName |
||
) |
Constructor which loads a Hamiltonian from disk in HDF5 format. An HDF5 dump can be generated with the plugin psi4plugins/mointegrals.cc_SAVEHAM; or by (1) creating a Hamiltonian with one of the other constructors, (2) filling it with setEconst(), setTmat() and setVmat(), and (3) calling save().
fileh5 | If true, attempt to load a Hamiltonian in HDF5 format. All three filenames should be set then! The option false was deprecated. |
main_file | The HDF5 Hamiltonian parent filename. |
file_tmat | The HDF5 Hamiltonian Tmat filename |
file_vmat | The HDF5 Hamiltonian Vmat filename |
Definition at line 72 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::addToVmat | ( | const int | index1, |
const int | index2, | ||
const int | index3, | ||
const int | index4, | ||
const double | val | ||
) |
Add to Vmat element.
index1 | The first index |
index2 | The second index |
index3 | The third index |
index4 | The fourth index |
val | The value which should be added |
Definition at line 129 of file Hamiltonian.cpp.
double CheMPS2::Hamiltonian::getEconst | ( | ) | const |
Get the constant energy.
Definition at line 101 of file Hamiltonian.cpp.
int CheMPS2::Hamiltonian::getL | ( | ) | const |
Get the number of orbitals.
Definition at line 93 of file Hamiltonian.cpp.
int CheMPS2::Hamiltonian::getNGroup | ( | ) | const |
Get the group number.
Definition at line 95 of file Hamiltonian.cpp.
int CheMPS2::Hamiltonian::getOrbitalIrrep | ( | const int | nOrb | ) | const |
Get an orbital irrep number.
nOrb | The orbital number |
Definition at line 97 of file Hamiltonian.cpp.
double CheMPS2::Hamiltonian::getTmat | ( | const int | index1, |
const int | index2 | ||
) | const |
Get a Tmat element.
index1 | The first index |
index2 | The second index |
Definition at line 110 of file Hamiltonian.cpp.
const CheMPS2::TwoIndex * CheMPS2::Hamiltonian::getTmat | ( | ) |
Get the pointer to the one-electron integrals.
Definition at line 120 of file Hamiltonian.cpp.
double CheMPS2::Hamiltonian::getVmat | ( | const int | index1, |
const int | index2, | ||
const int | index3, | ||
const int | index4 | ||
) | const |
Get a Vmat element.
index1 | The first index |
index2 | The second index |
index3 | The third index |
index4 | The fourth index |
Definition at line 136 of file Hamiltonian.cpp.
CheMPS2::FourIndex * CheMPS2::Hamiltonian::getVmat | ( | ) |
Get the pointer to the two-electron integrals.
Definition at line 146 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::read | ( | const string | file_parent = HAMILTONIAN_ParentStorageName , |
const string | file_tmat = HAMILTONIAN_TmatStorageName , |
||
const string | file_vmat = HAMILTONIAN_VmatStorageName |
||
) |
Load the Hamiltonian.
file_parent | The HDF5 Hamiltonian parent filename |
file_tmat | The HDF5 Hamiltonian Tmat filename |
file_vmat | The HDF5 Hamiltonian Vmat filename |
Definition at line 199 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::readfock | ( | const string | fockfile, |
double * | fockmx, | ||
const bool | printinfo | ||
) | const |
Read in a FOCK file.
fockfile | The FOCK file to read in |
fockmx | The array to store the Fock matrix in |
printinfo | Whether or not to print information regarding the read in values |
Definition at line 424 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::save | ( | const string | file_parent = HAMILTONIAN_ParentStorageName , |
const string | file_tmat = HAMILTONIAN_TmatStorageName , |
||
const string | file_vmat = HAMILTONIAN_VmatStorageName |
||
) | const |
Save the Hamiltonian.
file_parent | The HDF5 Hamiltonian parent filename |
file_tmat | The HDF5 Hamiltonian Tmat filename |
file_vmat | The HDF5 Hamiltonian Vmat filename |
Definition at line 148 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::setEconst | ( | const double | val | ) |
Set the constant energy.
val | The new constant energy |
Definition at line 99 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::setTmat | ( | const int | index1, |
const int | index2, | ||
const double | val | ||
) |
Set a Tmat element.
index1 | The first index |
index2 | The second index |
val | The new Tmat element |
Definition at line 103 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::setVmat | ( | const int | index1, |
const int | index2, | ||
const int | index3, | ||
const int | index4, | ||
const double | val | ||
) |
Set a Vmat element.
index1 | The first index |
index2 | The second index |
index3 | The third index |
index4 | The fourth index |
val | The new Vmat element |
Definition at line 122 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::writeFCIDUMP | ( | const string | fcidumpfile, |
const int | Nelec, | ||
const int | TwoS, | ||
const int | TargetIrrep | ||
) | const |
Write the Hamiltonian to a FCIDUMP file.
fcidumpfile | The filename for the FCIDUMP file |
Nelec | The number of electrons |
TwoS | Two times the spin; multiplicity minus one |
TargetIrrep | The target irrep (in psi4 numbering conventions) |
Definition at line 538 of file Hamiltonian.cpp.