20 #ifndef DMRG_CHEMPS2_H 21 #define DMRG_CHEMPS2_H 30 #include "SyBookkeeper.h" 35 #include "TensorOperator.h" 38 #include "Tensor3RDM.h" 39 #include "TensorGYZ.h" 43 #include "Correlations.h" 46 #include "ConvergenceScheme.h" 50 #define CHEMPS2_TIME_S_JOIN 0 51 #define CHEMPS2_TIME_S_SOLVE 1 52 #define CHEMPS2_TIME_S_SPLIT 2 53 #define CHEMPS2_TIME_TENS_TOTAL 3 54 #define CHEMPS2_TIME_TENS_ALLOC 4 55 #define CHEMPS2_TIME_TENS_FREE 5 56 #define CHEMPS2_TIME_DISK_WRITE 6 57 #define CHEMPS2_TIME_DISK_READ 7 58 #define CHEMPS2_TIME_TENS_CALC 8 59 #define CHEMPS2_TIME_VECLENGTH 9 91 DMRG(
Problem * Probin,
ConvergenceScheme * OptSchemeIn,
const bool makechkpt=CheMPS2::DMRG_storeMpsOnDisk,
const string tmpfolder=CheMPS2::defaultTMPpath);
124 void Symm4RDM(
double * output,
const int ham_orb1,
const int ham_orb2,
const bool last_case );
140 double getFCIcoefficient(
int * alpha,
int * beta,
const bool mpi_chemps2_master_only=
true)
const;
162 void setupBookkeeperAndMPS();
165 string MPSstoragename;
183 double TotalMinEnergy;
186 double LastMinEnergy;
189 double MaxDiscWeightLastSweep;
258 double sweepleft(
const bool change,
const int instruction,
const bool am_i_master );
259 double sweepright(
const bool change,
const int instruction,
const bool am_i_master );
260 double solve_site(
const int index,
const double dvdson_rtol,
const double noise_level,
const int virtual_dimension,
const bool am_i_master,
const bool moving_right,
const bool change );
263 void MY_HDF5_WRITE_BATCH(
const hid_t file_id,
const int number,
Tensor ** batch,
const long long totalsize,
const std::string tag);
264 void MY_HDF5_READ_BATCH(
const hid_t file_id,
const int number,
Tensor ** batch,
const long long totalsize,
const std::string tag);
265 void OperatorsOnDisk(
const int index,
const bool movingRight,
const bool store);
268 void saveMPS(
const std::string name,
TensorT ** MPSlocation,
SyBookkeeper * BKlocation,
bool isConverged)
const;
269 void loadDIM(
const std::string name,
SyBookkeeper * BKlocation);
270 void loadMPS(
const std::string name,
TensorT ** MPSlocation,
bool * isConverged);
271 bool makecheckpoints;
274 void updateMovingRight(
const int index);
275 void updateMovingLeft(
const int index);
276 void deleteTensors(
const int index,
const bool movingRight);
277 void allocateTensors(
const int index,
const bool movingRight);
278 void updateMovingRightSafe(
const int cnt);
279 void updateMovingRightSafeFirstTime(
const int cnt);
280 void updateMovingRightSafe2DM(
const int cnt);
281 void updateMovingLeftSafe(
const int cnt);
282 void updateMovingLeftSafeFirstTime(
const int cnt);
283 void updateMovingLeftSafe2DM(
const int cnt);
284 void deleteAllBoundaryOperators();
287 void update_safe_3rdm_operators(
const int boundary );
288 void allocate_3rdm_operators(
const int boundary );
289 void update_3rdm_operators(
const int boundary );
290 void delete_3rdm_operators(
const int boundary );
293 void solve_fock(
const int dmrg_orb1,
const int dmrg_orb2,
const double alpha,
const double beta );
294 static void solve_fock_update_helper(
const int index,
const int dmrg_orb1,
const int dmrg_orb2,
const bool moving_right,
TensorT ** new_mps,
TensorT ** old_mps,
SyBookkeeper * new_bk,
SyBookkeeper * old_bk,
TensorO ** overlaps,
TensorL ** regular,
TensorL ** trans );
295 static void left_normalize(
TensorT * left_mps,
TensorT * right_mps );
296 static void right_normalize(
TensorT * left_mps,
TensorT * right_mps );
297 void symm_4rdm_helper(
double * output,
const int ham_orb1,
const int ham_orb2,
const double alpha,
const double beta,
const bool add,
const double factor );
300 void update_correlations_tensors(
const int siteindex);
306 double * Exc_Eshifts;
310 double ** prepare_excitations(
Sobject * denS);
311 void cleanup_excitations(
double ** VeffTilde)
const;
312 void calcVeffTilde(
double * result,
Sobject * currentS,
int state_number);
313 void calc_overlaps(
const bool moving_right );
316 double timings[ CHEMPS2_TIME_VECLENGTH ];
317 long long num_double_write_disk;
318 long long num_double_read_disk;
319 void print_tensor_update_performance()
const;
void Symm4RDM(double *output, const int ham_orb1, const int ham_orb2, const bool last_case)
Obtain the symmetrized 4-RDM terms 0.5 * ( Gamma4_ijkl,pqrt + Gamma4_ijkt,pqrl ) with l and t fixed...
void deleteStoredMPS()
Call "rm " + CheMPS2::DMRG_MPS_storage_prefix + "*.h5".
DMRG(Problem *Probin, ConvergenceScheme *OptSchemeIn, const bool makechkpt=CheMPS2::DMRG_storeMpsOnDisk, const string tmpfolder=CheMPS2::defaultTMPpath)
Constructor.
Correlations * getCorrelations()
Get the pointer to the Correlations.
TwoDM * get2DM()
Get the pointer to the 2-RDM.
double getFCIcoefficient(int *alpha, int *beta, const bool mpi_chemps2_master_only=true) const
Get a specific FCI coefficient. The arrays alpha and beta contain the alpha and beta occupation numbe...
void PreSolve()
Reconstruct the renormalized operators when you overwrite the matrix elements with Prob->setMxElement...
void newExcitation(const double EshiftIn)
Push back current calculation and set everything up to calculate a (new) excitation.
static void PrintLicense()
Print the license.
double getSpecificCoefficient(int *coeff) const
Get a specific FCI coefficient. The array coeff contains the occupation numbers of the L Hamiltonian ...
void activateExcitations(const int maxExcIn)
Activate the necessary storage and machinery to handle excitations.
virtual ~DMRG()
Destructor.
ThreeDM * get3DM()
Get the pointer to the 3-RDM.
void calc_rdms_and_correlations(const bool do_3rdm, const bool disk_3rdm=false)
Calculate the reduced density matrices and correlations. Afterwards the MPS is again in LLLLLLLC gaug...
void deleteStoredOperators()
Call "rm " + tempfolder + "/" + CheMPS2::DMRG_OPERATOR_storage_prefix + string(thePID) + "*...
void calc2DMandCorrelations()
Calculate the 2-RDM and correlations. Afterwards the MPS is again in LLLLLLLC gauge.