CheMPS2
CheMPS2::Hamiltonian Class Reference

#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 TwoIndexgetTmat ()
 Get the pointer to the one-electron integrals. More...
 
FourIndexgetVmat ()
 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...
 

Detailed Description

Hamiltonian class.

Author
Sebastian Wouters sebas.nosp@m.tian.nosp@m.woute.nosp@m.rs@g.nosp@m.mail..nosp@m.com
Date
February 8, 2013

Container class for the Hamiltonian matrix elements.

Specific Hamiltonian information

Class containing all Hamiltonian information:

  • L: the number of orbitals
  • groupNumber (in SymmInfo): the number of the Abelian point group symmetry with real-valued character table (see Irreps.h)
  • orb2irrep: array with the irrep number for each orbital
  • Econst: nuclear repulsion energy; or any constant part of the energy not contained in the 1- or 2-particle matrix elements
  • Tmat: 1-particle matrix elements; Tmat $_{a,b}$ = 0 if $I_a$ is different from $I_b$
  • Vmat: 2-particle matrix elements; Vmat $_{a,b,c,d}$ = 0 if $I_a \otimes I_b$ is not equal to $I_c \otimes I_d$; the matrix elements are not antisymmetrized and are stored with the convention that both (a & c) and (b & d) have the same spatial variable for the nuclear repulsion integral (physics notation).

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 53 of file Hamiltonian.h.

Constructor & Destructor Documentation

CheMPS2::Hamiltonian::Hamiltonian ( const int  Norbitals,
const int  nGroup,
const int *  OrbIrreps 
)

Constructor.

Parameters
NorbitalsThe number of orbitals (L)
nGroupThe group number
OrbIrrepsPointer to array containing the orbital irreps

Definition at line 39 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

CheMPS2::Hamiltonian::Hamiltonian ( const string  filename,
const int  psi4groupnumber 
)

Constructor which loads a FCIDUMP from disk.

Parameters
filenameThe filename of the FCIDUMP (which can be generated with the plugin psi4plugins/fcidump.cc and has Molpro orbital symmetries!)
psi4groupnumberThe group number according to psi4's conventions

Definition at line 65 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

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().

Parameters
fileh5If true, attempt to load a Hamiltonian in HDF5 format. All three filenames should be set then! The option false was deprecated.
main_fileThe HDF5 Hamiltonian parent filename.
file_tmatThe HDF5 Hamiltonian Tmat filename
file_vmatThe HDF5 Hamiltonian Vmat filename

Definition at line 72 of file Hamiltonian.cpp.

Member Function Documentation

void CheMPS2::Hamiltonian::addToVmat ( const int  index1,
const int  index2,
const int  index3,
const int  index4,
const double  val 
)

Add to Vmat element.

Parameters
index1The first index
index2The second index
index3The third index
index4The fourth index
valThe value which should be added

Definition at line 129 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

double CheMPS2::Hamiltonian::getEconst ( ) const

Get the constant energy.

Returns
The constant part of the Hamiltonian (nuclear repulsion & condensed orbitals)

Definition at line 101 of file Hamiltonian.cpp.

+ Here is the caller graph for this function:

int CheMPS2::Hamiltonian::getL ( ) const

Get the number of orbitals.

Returns
The number of orbitals

Definition at line 93 of file Hamiltonian.cpp.

+ Here is the caller graph for this function:

int CheMPS2::Hamiltonian::getNGroup ( ) const

Get the group number.

Returns
The group number

Definition at line 95 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int CheMPS2::Hamiltonian::getOrbitalIrrep ( const int  nOrb) const

Get an orbital irrep number.

Parameters
nOrbThe orbital number
Returns
The irrep of orbital nOrb

Definition at line 97 of file Hamiltonian.cpp.

+ Here is the caller graph for this function:

double CheMPS2::Hamiltonian::getTmat ( const int  index1,
const int  index2 
) const

Get a Tmat element.

Parameters
index1The first index
index2The second index
Returns
$T_{index1,index2}$

Definition at line 110 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const CheMPS2::TwoIndex * CheMPS2::Hamiltonian::getTmat ( )

Get the pointer to the one-electron integrals.

Returns
The pointer to the one-electron integrals

Definition at line 120 of file Hamiltonian.cpp.

+ Here is the caller graph for this function:

double CheMPS2::Hamiltonian::getVmat ( const int  index1,
const int  index2,
const int  index3,
const int  index4 
) const

Get a Vmat element.

Parameters
index1The first index
index2The second index
index3The third index
index4The fourth index
Returns
$V_{index1,index2,index3,index4}$

Definition at line 136 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CheMPS2::FourIndex * CheMPS2::Hamiltonian::getVmat ( )

Get the pointer to the two-electron integrals.

Returns
The pointer to the two-electron integrals

Definition at line 146 of file Hamiltonian.cpp.

+ Here is the caller graph for this function:

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.

Parameters
file_parentThe HDF5 Hamiltonian parent filename
file_tmatThe HDF5 Hamiltonian Tmat filename
file_vmatThe HDF5 Hamiltonian Vmat filename

Definition at line 199 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

void CheMPS2::Hamiltonian::readfock ( const string  fockfile,
double *  fockmx,
const bool  printinfo 
) const

Read in a FOCK file.

Parameters
fockfileThe FOCK file to read in
fockmxThe array to store the Fock matrix in
printinfoWhether or not to print information regarding the read in values

Definition at line 424 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

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.

Parameters
file_parentThe HDF5 Hamiltonian parent filename
file_tmatThe HDF5 Hamiltonian Tmat filename
file_vmatThe HDF5 Hamiltonian Vmat filename

Definition at line 148 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

void CheMPS2::Hamiltonian::setEconst ( const double  val)

Set the constant energy.

Parameters
valThe new constant energy

Definition at line 99 of file Hamiltonian.cpp.

+ Here is the caller graph for this function:

void CheMPS2::Hamiltonian::setTmat ( const int  index1,
const int  index2,
const double  val 
)

Set a Tmat element.

Parameters
index1The first index
index2The second index
valThe new Tmat element

Definition at line 103 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CheMPS2::Hamiltonian::setVmat ( const int  index1,
const int  index2,
const int  index3,
const int  index4,
const double  val 
)

Set a Vmat element.

Parameters
index1The first index
index2The second index
index3The third index
index4The fourth index
valThe new Vmat element

Definition at line 122 of file Hamiltonian.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CheMPS2::Hamiltonian::writeFCIDUMP ( const string  fcidumpfile,
const int  Nelec,
const int  TwoS,
const int  TargetIrrep 
) const

Write the Hamiltonian to a FCIDUMP file.

Parameters
fcidumpfileThe filename for the FCIDUMP file
NelecThe number of electrons
TwoSTwo times the spin; multiplicity minus one
TargetIrrepThe target irrep (in psi4 numbering conventions)

Definition at line 538 of file Hamiltonian.cpp.

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: