20 #ifndef CASSCF_CHEMPS2_H 21 #define CASSCF_CHEMPS2_H 25 #include "Hamiltonian.h" 32 #include "ConvergenceScheme.h" 33 #include "DMRGSCFindices.h" 34 #include "DMRGSCFunitary.h" 35 #include "DMRGSCFoptions.h" 36 #include "DMRGSCFwtilde.h" 37 #include "DMRGSCFmatrix.h" 38 #include "DMRGSCFintegrals.h" 176 CASSCF(
Hamiltonian * ham_in,
int * docc,
int * socc,
int * nocc,
int * ndmrg,
int * nvirt,
const string tmp_folder=CheMPS2::defaultTMPpath );
208 double caspt2(
const int Nelectrons,
const int TwoS,
const int Irrep,
ConvergenceScheme * OptScheme,
const int rootNum,
DMRGSCFoptions * scf_options,
const double IPEA,
const double IMAG,
const bool PSEUDOCANONICAL,
const bool CHECKPOINT =
false,
const bool CUMULANT =
false );
212 static void deleteStoredUnitary(
const string filename=CheMPS2::DMRGSCF_unitary_storage_name ){ delete_file( filename ); }
216 static void deleteStoredDIIS(
const string filename=CheMPS2::DMRGSCF_diis_storage_name ){ delete_file( filename ); }
254 static void copy2DMover(
TwoDM * theDMRG2DM,
const int LAS,
double * two_dm );
261 static void setDMRG1DM(
const int num_elec,
const int LAS,
double * one_dm,
double * two_dm );
315 static void write_f4rdm_checkpoint(
const string f4rdm_file,
int * hamorb1,
int * hamorb2,
const int tot_dmrg_power6,
double * contract );
324 static bool read_f4rdm_checkpoint(
const string f4rdm_file,
int * hamorb1,
int * hamorb2,
const int tot_dmrg_power6,
double * contract );
350 bool successful_solve;
376 void checkHF(
int * docc,
int * socc );
379 void fillConstAndTmatDMRG(
Hamiltonian * HamDMRG )
const;
391 static void DGEMM_WRAP(
double prefactor,
char transA,
char transB,
double * A,
double * B,
double * C,
int m,
int n,
int k,
int lda,
int ldb,
int ldc );
392 static void DGEMV_WRAP(
double prefactor,
double * matrix,
double * result,
double * vector,
int rowdim,
int coldim,
int ldmat,
int incres,
int incvec );
396 static void rotate_active_space_object(
const int num_indices,
double *
object,
double * work,
double * rotation,
const int LAS,
const int NJUMP,
const int NROTATE );
413 void coeff_fe2(
DMRG * theDMRG );
415 static void delete_file(
const string filename );
static void write_f4rdm_checkpoint(const string f4rdm_file, int *hamorb1, int *hamorb2, const int tot_dmrg_power6, double *contract)
Write the checkpoint file for the contraction of the generalized Fock operator with the 4-RDM to disk...
static void buildWtilde(DMRGSCFwtilde *localwtilde, const DMRGSCFmatrix *localTmat, const DMRGSCFmatrix *localJKocc, const DMRGSCFmatrix *localJKact, const DMRGSCFindices *localIdx, const DMRGSCFintegrals *theInts, double *local2DM, double *local1DM)
Build the Wtilde-matrix (Eq. (20b) in the Siegbahn paper [CAS3])
static void copy_active(double *origin, DMRGSCFmatrix *result, const DMRGSCFindices *idx, const bool one_rdm)
Copy a one-orbital quantity from array format to DMRGSCFmatrix format.
static void construct_fock(DMRGSCFmatrix *Fock, const DMRGSCFmatrix *Tmat, const DMRGSCFmatrix *Qocc, const DMRGSCFmatrix *Qact, const DMRGSCFindices *idx)
Construct the Fock matrix.
static void augmentedHessianNR(DMRGSCFmatrix *localFmat, DMRGSCFwtilde *localwtilde, const DMRGSCFindices *localIdx, const DMRGSCFunitary *localUmat, double *theupdate, double *updateNorm, double *gradNorm)
Calculate the augmented Hessian Newton-Raphson update for the orthogonal orbital rotation matrix...
static void copy2DMover(TwoDM *theDMRG2DM, const int LAS, double *two_dm)
Copy over the DMRG 2-RDM.
double caspt2(const int Nelectrons, const int TwoS, const int Irrep, ConvergenceScheme *OptScheme, const int rootNum, DMRGSCFoptions *scf_options, const double IPEA, const double IMAG, const bool PSEUDOCANONICAL, const bool CHECKPOINT=false, const bool CUMULANT=false)
Calculate the caspt2 correction energy for a converged casscf wavefunction.
static void block_diagonalize(const char space, const DMRGSCFmatrix *Mat, DMRGSCFunitary *Umat, double *work1, double *work2, const DMRGSCFindices *idx, const bool invert, double *two_dm, double *three_dm, double *contract)
Block-diagonalize Mat.
static void fillLocalizedOrbitalRotations(DMRGSCFunitary *umat, DMRGSCFindices *idx, double *eigenvecs)
From an Edmiston-Ruedenberg active space rotation, fetch the eigenvectors and store them in eigenvecs...
static void fock_dot_4rdm(double *fockmx, CheMPS2::DMRG *dmrgsolver, CheMPS2::Hamiltonian *ham, int next_orb1, int next_orb2, double *work, double *result, const bool CHECKPOINT, const bool PSEUDOCANONICAL)
Build the contraction of the fock matrix with the 4-RDM.
double solve(const int Nelectrons, const int TwoS, const int Irrep, ConvergenceScheme *OptScheme, const int rootNum, DMRGSCFoptions *scf_options)
Do the CASSCF cycles with the augmented Hessian Newton-Raphson method.
int get_num_irreps()
Get the number of irreps.
static void setDMRG1DM(const int num_elec, const int LAS, double *one_dm, double *two_dm)
Construct the 1-RDM from the 2-RDM.
static void deleteStoredDIIS(const string filename=CheMPS2::DMRGSCF_diis_storage_name)
CASSCF DIIS vectors remove call.
static void deleteStoredUnitary(const string filename=CheMPS2::DMRGSCF_unitary_storage_name)
CASSCF unitary rotation remove call.
virtual ~CASSCF()
Destructor.
static bool read_f4rdm_checkpoint(const string f4rdm_file, int *hamorb1, int *hamorb2, const int tot_dmrg_power6, double *contract)
Read the checkpoint file for the contraction of the generalized Fock operator with the 4-RDM from dis...
static double deviation_from_blockdiag(DMRGSCFmatrix *matrix, const DMRGSCFindices *idx)
Return the RMS deviation from block-diagonal.
CASSCF(Hamiltonian *ham_in, int *docc, int *socc, int *nocc, int *ndmrg, int *nvirt, const string tmp_folder=CheMPS2::defaultTMPpath)
Constructor.
static void buildFmat(DMRGSCFmatrix *localFmat, const DMRGSCFmatrix *localTmat, const DMRGSCFmatrix *localJKocc, const DMRGSCFmatrix *localJKact, const DMRGSCFindices *localIdx, const DMRGSCFintegrals *theInts, double *local2DM, double *local1DM)
Build the F-matrix (Eq. (11) in the Siegbahn paper [CAS3])