v2DM-DOCI
1.0
|
#include <Hamiltonian.h>
Public Member Functions | |
Hamiltonian (const int Norbitals, const int nGroup, const int *OrbIrreps) | |
Constructor. More... | |
Hamiltonian (const string file_psi4text) | |
Constructor which loads a Psi4 text dump of the Hamiltonian from disk. A Psi4 text dump can be generated with the plugin psi4plugins/mointegrals.cc_PRINT. 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 which was previously saved as a Psi4 text dump or in HDF5 format. A Psi4 text dump can be generated with the plugin psi4plugins/mointegrals.cc_PRINT. 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... | |
Hamiltonian (const Hamiltonian &) | |
Hamiltonian (Hamiltonian &&)=default | |
Hamiltonian & | operator= (const Hamiltonian &) |
Hamiltonian & | operator= (Hamiltonian &&)=default |
virtual | ~Hamiltonian ()=default |
Destructor. More... | |
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... | |
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 | save2 (const string filename) const |
void | read2 (const string filename) |
void | setNe (int) |
int | getNe () const |
void | debugcheck () const |
Debug check certain elements and sums. More... | |
void | reset () |
set everything to zero More... | |
Static Public Member Functions | |
static Hamiltonian | CreateFromH5 (const string filename) |
Private Member Functions | |
void | CreateAndFillFromH5 (const string file_parent, const string file_tmat, const string file_vmat) |
void | CreateAndFillFromPsi4dump (const string filename) |
Private Attributes | |
int | L |
int | Ne |
Irreps | SymmInfo |
std::unique_ptr< int[]> | orb2irrep |
std::unique_ptr< int[]> | irrep2num_orb |
std::unique_ptr< int[]> | orb2indexSy |
std::unique_ptr< TwoIndex > | Tmat |
std::unique_ptr< FourIndex > | Vmat |
double | Econst |
Friends | |
class | simanneal::OptIndex |
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:
\( \hat{H} = E_{const} + \sum\limits_{ij\sigma} T_{ij} \delta_{I_i,I_j} \hat{a}_{i \sigma}^{\dagger} \hat{a}_{j \sigma} + \frac{1}{2} \sum\limits_{ijkl\sigma\tau} V_{ijkl} \delta_{I_i \otimes I_j \otimes I_k \otimes I_l, I_{trivial}} \hat{a}_{i \sigma}^{\dagger} \hat{a}_{j \tau}^{\dagger} \hat{a}_{l \tau} \hat{a}_{k \sigma} \)
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 56 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 38 of file Hamiltonian.cpp.
CheMPS2::Hamiltonian::Hamiltonian | ( | const string | file_psi4text | ) |
Constructor which loads a Psi4 text dump of the Hamiltonian from disk. A Psi4 text dump can be generated with the plugin psi4plugins/mointegrals.cc_PRINT.
file_psi4text | The filename of the Psi4 text dump of the Hamiltonian |
Definition at line 106 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 which was previously saved as a Psi4 text dump or in HDF5 format. A Psi4 text dump can be generated with the plugin psi4plugins/mointegrals.cc_PRINT. 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! If false, attempt to load a Hamiltonian which was previously saved as a Psi4 text dump. Only the first filename should be set then! |
main_file | If fileh5, the HDF5 Hamiltonian parent filename. If not fileh5, the filename of the Psi4 text dump of the Hamiltonian. |
file_tmat | The HDF5 Hamiltonian Tmat filename |
file_vmat | The HDF5 Hamiltonian Vmat filename |
Definition at line 112 of file Hamiltonian.cpp.
CheMPS2::Hamiltonian::Hamiltonian | ( | const Hamiltonian & | orig | ) |
Definition at line 64 of file Hamiltonian.cpp.
|
default |
|
virtualdefault |
Destructor.
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 170 of file Hamiltonian.cpp.
|
private |
Definition at line 287 of file Hamiltonian.cpp.
|
private |
Definition at line 341 of file Hamiltonian.cpp.
|
static |
Definition at line 631 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::debugcheck | ( | ) | const |
Debug check certain elements and sums.
Definition at line 472 of file Hamiltonian.cpp.
double CheMPS2::Hamiltonian::getEconst | ( | ) | const |
Get the constant energy.
Definition at line 144 of file Hamiltonian.cpp.
int CheMPS2::Hamiltonian::getL | ( | ) | const |
Get the number of orbitals.
Definition at line 136 of file Hamiltonian.cpp.
int CheMPS2::Hamiltonian::getNe | ( | ) | const |
int CheMPS2::Hamiltonian::getNGroup | ( | ) | const |
Get the group number.
Definition at line 138 of file Hamiltonian.cpp.
int CheMPS2::Hamiltonian::getOrbitalIrrep | ( | const int | nOrb | ) | const |
Get an orbital irrep number.
nOrb | The orbital number |
Definition at line 140 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 153 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 177 of file Hamiltonian.cpp.
CheMPS2::Hamiltonian & CheMPS2::Hamiltonian::operator= | ( | const Hamiltonian & | orig | ) |
Definition at line 84 of file Hamiltonian.cpp.
|
default |
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 238 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::read2 | ( | const string | filename | ) |
void CheMPS2::Hamiltonian::reset | ( | ) |
set everything to zero
Definition at line 669 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 187 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::save2 | ( | const string | filename | ) | const |
Definition at line 516 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::setEconst | ( | const double | val | ) |
Set the constant energy.
val | The new constant energy |
Definition at line 142 of file Hamiltonian.cpp.
void CheMPS2::Hamiltonian::setNe | ( | int | ne | ) |
Definition at line 625 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 146 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 163 of file Hamiltonian.cpp.
|
friend |
Definition at line 58 of file Hamiltonian.h.
|
private |
Definition at line 202 of file Hamiltonian.h.
|
private |
Definition at line 190 of file Hamiltonian.h.
|
private |
Definition at line 178 of file Hamiltonian.h.
|
private |
Definition at line 181 of file Hamiltonian.h.
|
private |
Definition at line 193 of file Hamiltonian.h.
|
private |
Definition at line 187 of file Hamiltonian.h.
|
private |
Definition at line 184 of file Hamiltonian.h.
|
private |
Definition at line 196 of file Hamiltonian.h.
|
private |
Definition at line 199 of file Hamiltonian.h.