20 #ifndef TWODM_CHEMPS2_H 21 #define TWODM_CHEMPS2_H 29 #include "SyBookkeeper.h" 68 double getTwoDMA_DMRG(
const int cnt1,
const int cnt2,
const int cnt3,
const int cnt4)
const;
76 double getTwoDMB_DMRG(
const int cnt1,
const int cnt2,
const int cnt3,
const int cnt4)
const;
82 double get1RDM_DMRG(
const int cnt1,
const int cnt2)
const;
96 double getTwoDMA_HAM(
const int cnt1,
const int cnt2,
const int cnt3,
const int cnt4)
const;
104 double getTwoDMB_HAM(
const int cnt1,
const int cnt2,
const int cnt3,
const int cnt4)
const;
110 double get1RDM_HAM(
const int cnt1,
const int cnt2)
const;
132 double trace()
const;
149 void save_HAM(
const string filename )
const;
174 void set_2rdm_A_DMRG(
const int cnt1,
const int cnt2,
const int cnt3,
const int cnt4,
const double value);
175 void set_2rdm_B_DMRG(
const int cnt1,
const int cnt2,
const int cnt3,
const int cnt4,
const double value);
185 double doD8(
TensorT * denT,
TensorL * Lleft,
TensorL * Lright,
double * workmem,
double * workmem2,
int Irrep_g);
186 void doD9andD10andD11(
TensorT * denT,
TensorL * Lleft,
TensorL * Lright,
double * workmem,
double * workmem2,
double * d9,
double * d10,
double * d11,
int Irrep_g);
187 double doD12(
TensorT * denT,
TensorL * Lleft,
TensorL * Lright,
double * workmem,
double * workmem2,
int Irrep_g);
188 double doD13(
TensorT * denT,
TensorL * Lleft,
TensorS0 * S0right,
double * workmem,
double * workmem2,
int Irrep_g);
189 double doD14(
TensorT * denT,
TensorL * Lleft,
TensorS0 * S0right,
double * workmem,
double * workmem2,
int Irrep_g);
190 double doD15(
TensorT * denT,
TensorL * Lleft,
TensorS1 * S1right,
double * workmem,
double * workmem2,
int Irrep_g);
191 double doD16(
TensorT * denT,
TensorL * Lleft,
TensorS1 * S1right,
double * workmem,
double * workmem2,
int Irrep_g);
192 double doD17orD21(
TensorT * denT,
TensorL * Lleft,
TensorF0 * F0right,
double * workmem,
double * workmem2,
int Irrep_g,
bool shouldIdoD17);
193 double doD18orD22(
TensorT * denT,
TensorL * Lleft,
TensorF0 * F0right,
double * workmem,
double * workmem2,
int Irrep_g,
bool shouldIdoD18);
194 double doD19orD23(
TensorT * denT,
TensorL * Lleft,
TensorF1 * F1right,
double * workmem,
double * workmem2,
int Irrep_g,
bool shouldIdoD19);
195 double doD20orD24(
TensorT * denT,
TensorL * Lleft,
TensorF1 * F1right,
double * workmem,
double * workmem2,
int Irrep_g,
bool shouldIdoD20);
void FillSite(TensorT *denT, TensorL ***Ltens, TensorF0 ****F0tens, TensorF1 ****F1tens, TensorS0 ****S0tens, TensorS1 ****S1tens)
Fill the 2DM terms with as second site index denT->gIndex()
virtual ~TwoDM()
Destructor.
double get1RDM_HAM(const int cnt1, const int cnt2) const
Get a 1-RDM term, using the HAM indices.
void save() const
Save the TwoDMs to disk.
double getTwoDMB_DMRG(const int cnt1, const int cnt2, const int cnt3, const int cnt4) const
Get a 2DM_B term, using the DMRG indices.
double energy() const
Calculate the energy based on the 2DM-A.
double spin_density_dmrg(const int cnt1, const int cnt2) const
Get a spin-density term, using the DMRG indices.
void correct_higher_multiplicities()
After the whole 2-RDM is filled, a prefactor for higher multiplicities should be applied.
double getTwoDMA_HAM(const int cnt1, const int cnt2, const int cnt3, const int cnt4) const
Get a 2DM_A term, using the HAM indices.
double get1RDM_DMRG(const int cnt1, const int cnt2) const
Get a 1-RDM term, using the DMRG indices.
double getTwoDMA_DMRG(const int cnt1, const int cnt2, const int cnt3, const int cnt4) const
Get a 2DM_A term, using the DMRG indices.
double trace() const
Return the double trace of 2DM-A (should be N(N-1))
double spin_density_ham(const int cnt1, const int cnt2) const
Get a spin-density term, using the HAM indices.
void mpi_allreduce()
Add the 2-RDM elements of all MPI processes.
double getTwoDMB_HAM(const int cnt1, const int cnt2, const int cnt3, const int cnt4) const
Get a 2DM_B term, using the HAM indices.
void print_noon() const
Print the natural orbital occupation numbers.
void read()
Load the TwoDMs from disk.
void save_HAM(const string filename) const
Save the 2-RDM-A to disk in Hamiltonian indices.
TwoDM(const SyBookkeeper *denBKIn, const Problem *ProbIn)
Constructor.
void write2DMAfile(const string filename) const
Write the 2-RDM-A to a file.