Psi4
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
psi::mcscf::SCF Class Reference

#include <scf.h>

Inheritance diagram for psi::mcscf::SCF:
psi::Wavefunction

Public Member Functions

 SCF (SharedWavefunction ref_wfn, Options &options_, std::shared_ptr< PSIO > psio)
 
 ~SCF ()
 
double compute_energy ()
 Compute energy. Subclasses override this function to compute its energy. More...
 
- Public Member Functions inherited from psi::Wavefunction
 Wavefunction (std::shared_ptr< Molecule > molecule, std::shared_ptr< BasisSet > basis, Options &options)
 Constructor for an entirely new wavefunction with an existing basis. More...
 
 Wavefunction (std::shared_ptr< Molecule > molecule, std::shared_ptr< BasisSet > basis)
 Constructor for an entirely new wavefunction with an existing basis and global options. More...
 
 Wavefunction (Options &options)
 Blank constructor for derived classes. More...
 
void shallow_copy (SharedWavefunction other)
 
void shallow_copy (const Wavefunction *other)
 
void deep_copy (SharedWavefunction other)
 
void deep_copy (const Wavefunction *other)
 
virtual ~Wavefunction ()
 
virtual SharedMatrix compute_gradient ()
 Compute gradient. Subclasses override this function to compute the gradient. More...
 
virtual SharedMatrix compute_hessian ()
 Compute Hessian. Subclasses override this function to compute the Hessian. More...
 
bool same_a_b_orbs () const
 Is this a restricted wavefunction? More...
 
bool same_a_b_dens () const
 
Dimension map_irreps (const Dimension &dimpi)
 
std::shared_ptr< Moleculemolecule () const
 Returns the molecule object that pertains to this wavefunction. More...
 
std::shared_ptr< PSIOpsio () const
 
Optionsoptions () const
 
std::shared_ptr< IntegralFactoryintegral () const
 An integral factory with basisset() on each center. More...
 
std::shared_ptr< BasisSetbasisset () const
 Returns the basis set object that pertains to this wavefunction. More...
 
std::shared_ptr< SOBasisSetsobasisset () const
 Returns the SO basis set object that pertains to this wavefunction. More...
 
std::shared_ptr< BasisSetget_basisset (std::string label)
 Getters and setters for other basis sets. More...
 
void set_basisset (std::string label, std::shared_ptr< BasisSet > basis)
 
bool basisset_exists (std::string label)
 
std::shared_ptr< MatrixFactorymatrix_factory () const
 Returns the MatrixFactory object that pertains to this wavefunction. More...
 
std::shared_ptr< Wavefunctionreference_wavefunction () const
 Returns the reference wavefunction. More...
 
void set_reference_wavefunction (const std::shared_ptr< Wavefunction > wfn)
 Sets the reference wavefunction. More...
 
bool density_fitted () const
 Returns whether this wavefunction was obtained using density fitting or not. More...
 
int get_print () const
 Returns the print level. More...
 
const Dimensiondoccpi () const
 Returns the DOCC per irrep array. More...
 
const Dimensionsoccpi () const
 Returns the SOCC per irrep array. More...
 
const Dimensionnsopi () const
 Returns the number of SOs per irrep array. More...
 
const Dimensionnmopi () const
 Returns the number of MOs per irrep array. More...
 
const Dimensionnalphapi () const
 Returns the number of alpha electrons per irrep array. More...
 
const Dimensionnbetapi () const
 Returns the number of beta electrons per irrep array. More...
 
const Dimensionfrzcpi () const
 Returns the frozen core orbitals per irrep array. More...
 
const Dimensionfrzvpi () const
 Returns the frozen virtual orbitals per irrep array. More...
 
void set_doccpi (const Dimension &doccpi)
 
void set_soccpi (const Dimension &soccpi)
 
void set_frzvpi (const Dimension &frzvpi)
 Sets the frozen virtual orbitals per irrep array. More...
 
int nfrzc () const
 Return the number of frozen core orbitals. More...
 
int nalpha () const
 Return the number of alpha electrons. More...
 
int nbeta () const
 Return the number of beta electrons. More...
 
int nso () const
 Returns the number of SOs. More...
 
int nmo () const
 Returns the number of MOs. More...
 
int nirrep () const
 Returns the number of irreps. More...
 
double reference_energy () const
 Returns the reference energy. More...
 
double efzc () const
 Returns the frozen-core energy. More...
 
void set_efzc (double efzc)
 Sets the frozen-core energy. More...
 
SharedMatrix S () const
 Returns the overlap matrix. More...
 
SharedMatrix H () const
 Returns the core Hamiltonian matrix. More...
 
SharedMatrix Ca () const
 Returns the alpha electrons MO coefficients. More...
 
SharedMatrix Cb () const
 Returns the beta electrons MO coefficients. More...
 
SharedMatrix Fa () const
 Returns the (SO basis) alpha Fock matrix. More...
 
SharedMatrix Fb () const
 Returns the (SO basis) beta Fock matrix. More...
 
SharedVector epsilon_a () const
 Returns the alpha orbital energies. More...
 
SharedVector epsilon_b () const
 Returns the beta orbital energies. More...
 
SharedMatrix Lagrangian () const
 Returns the SO basis Lagrangian. More...
 
SharedMatrix aotoso () const
 
const SharedMatrix Da () const
 Returns the alpha OPDM for the wavefunction. More...
 
SharedMatrix Db () const
 Returns the beta OPDM for the wavefunction. More...
 
SharedMatrix Ca_subset (const std::string &basis="SO", const std::string &subset="ALL")
 
SharedMatrix Cb_subset (const std::string &basis="SO", const std::string &subset="ALL")
 
OrbitalSpace alpha_orbital_space (const std::string &id, const std::string &basis="SO", const std::string &subset="ALL")
 Creates an OrbitalSpace object containing information about the request alpha orbital space. More...
 
OrbitalSpace beta_orbital_space (const std::string &id, const std::string &basis="SO", const std::string &subset="ALL")
 Creates an OrbitalSpace object containing information about the request beta orbital space. More...
 
SharedMatrix Da_subset (const std::string &basis="SO")
 
SharedMatrix Db_subset (const std::string &basis="SO")
 
SharedMatrix D_subset_helper (SharedMatrix D, SharedMatrix C, const std::string &basis)
 
SharedVector epsilon_a_subset (const std::string &basis="SO", const std::string &subset="ALL")
 
SharedVector epsilon_b_subset (const std::string &basis="SO", const std::string &subset="ALL")
 
SharedMatrix basis_projection (SharedMatrix Cold, Dimension noccpi, std::shared_ptr< BasisSet > old_basis, std::shared_ptr< BasisSet > new_basis)
 
SharedMatrix X () const
 Returns the Lagrangian in SO basis for the wavefunction. More...
 
SharedMatrix gradient () const
 Returns the gradient. More...
 
void set_gradient (SharedMatrix &grad)
 Set the gradient for the wavefunction. More...
 
SharedMatrix hessian () const
 Returns the Hessian. More...
 
void set_hessian (SharedMatrix &hess)
 Set the Hessian for the wavefunction. More...
 
std::shared_ptr< std::vector
< double > > 
atomic_point_charges () const
 Returns the atomic point charges. More...
 
SharedVector get_atomic_point_charges () const
 Returns the atomic point charges in Vector form for python output. More...
 
void set_atomic_point_charges (const std::shared_ptr< std::vector< double >> &apcs)
 Sets the atomic point charges. More...
 
SharedVector frequencies () const
 Returns the frequencies. More...
 
void set_frequencies (SharedVector &freqs)
 Set the frequencies for the wavefunction. More...
 
SharedVector normalmodes () const
 Returns the normalmodes. More...
 
void set_normalmodes (SharedVector &norms)
 Set the normalmodes for the wavefunction. More...
 
void set_name (const std::string &name)
 Set the wavefunction name (e.g. "RHF", "ROHF", "UHF", "CCEnergyWavefunction") More...
 
const std::string & name () const
 Returns the wavefunction name. More...
 
void set_print (size_t print)
 
void set_debug (size_t debug)
 
virtual void save () const
 Save the wavefunction to checkpoint. More...
 
void set_external_potential (std::shared_ptr< ExternalPotential > external)
 
double get_variable (const std::string key)
 Get and set variables dictionary. More...
 
void set_variable (const std::string key, double value)
 
std::map< std::string, double > variables (void)
 
SharedMatrix get_array (const std::string key)
 Get and set arrays dictionary. More...
 
void set_array (const std::string key, SharedMatrix value)
 
std::map< std::string,
SharedMatrix
arrays (void)
 

Private Member Functions

void startup ()
 
void cleanup ()
 
void generate_pairs ()
 
void read_so_oei ()
 
void read_so_tei ()
 
void read_so_tei_form_PK ()
 
void read_so_tei_form_PK_and_K ()
 
void read_Raffanetti (const char *integral_type, double *integrals, int batch)
 
void write_Raffanetti (const char *integral_type, double *integrals, int batch)
 
void construct_S_inverse_sqrt ()
 
void iterate_scf_equations ()
 
void guess_occupation ()
 
void canonicalize_MO ()
 
void save_info ()
 
void check_orthonormality ()
 
void print_eigenvectors_and_MO ()
 
void initial_guess ()
 
void density_matrix ()
 
void construct_G (SBlockMatrix &density, SBlockMatrix &G, double *integrals, int batch, double factor)
 
void construct_G (SBlockMatrix &density, SBlockMatrix &G, double *integrals, int batch)
 
void construct_F ()
 
void construct_Favg ()
 
void construct_Feff (int cycle)
 
double energy (int cycle, double old_energy)
 
void diis (int cycle)
 
void transform (SBlockMatrix &Initial, SBlockMatrix &Final, SBlockMatrix &Transformation)
 

Private Attributes

ReferenceType reference
 
int nirreps
 
int nso
 
size_t * ioff
 
intvec sopi
 
intvec docc
 
intvec actv
 
int turn_on_actv
 
int root
 
int ndiis
 
int current_diis
 
bool use_diis
 
double total_energy
 
bool out_of_core
 
int nbatch
 
size_t batch_pq_min [maxbatches]
 
size_t batch_pq_max [maxbatches]
 
size_t batch_index_min [maxbatches]
 
size_t batch_index_max [maxbatches]
 
size_t batch_size [maxbatches]
 
size_t total_symmetric_block_size
 
size_t nin_core
 
int * block_offset
 
int npairs
 
int * pairpi
 
int * pairs
 
int ** pair
 
int ** pair_sym
 
int * pair_offset
 
double * PK
 
double * K
 
SBlockVector epsilon
 
SBlockMatrix C
 
SBlockMatrix C_t
 
SBlockMatrix C_T
 
SBlockMatrix Dc
 
SBlockMatrix Dc_old
 
SBlockMatrix Do
 
SBlockMatrix Dtc [maxci]
 
SBlockMatrix Dtc_old [maxci]
 
SBlockMatrix Dsum [maxci]
 
SBlockMatrix Fc
 
SBlockMatrix Fc_t
 
SBlockMatrix Fo
 
SBlockMatrix Fo_t
 
SBlockMatrix Favg
 
SBlockMatrix Favg_t
 
SBlockMatrix Ftc [maxci]
 
SBlockMatrix Ftc_t [maxci]
 
SBlockMatrix Feff_t
 
SBlockMatrix Feff_t_old
 
SBlockMatrix Feff_oAO
 
SBlockMatrix G
 
SBlockMatrix T
 
SBlockMatrix H
 
SBlockMatrix O
 
SBlockMatrix S
 
SBlockMatrix S_sqrt_inv
 
SBlockMatrix S_sqrt
 
SBlockMatrix e
 
SBlockMatrix diis_F [maxdiis]
 
SBlockMatrix diis_e [maxdiis]
 
double diis_ci [maxci][maxdiis]
 
int nci
 
double norm_ci_grad
 
double * ci
 
double * ci_grad
 
double ** H_tcscf
 
int tcscf_mos [maxci]
 
int tcscf_sym [maxci]
 

Static Private Attributes

static const int maxci = 8
 
static const int maxdiis = 10
 
static const int maxbatches = 50
 

Additional Inherited Members

- Static Public Member Functions inherited from psi::Wavefunction
static void initialize_singletons ()
 
- Protected Member Functions inherited from psi::Wavefunction
SharedMatrix C_subset_helper (SharedMatrix C, const Dimension &noccpi, SharedVector epsilon, const std::string &basis, const std::string &subset)
 Helpers for C/D/epsilon transformers. More...
 
SharedMatrix F_subset_helper (SharedMatrix F, SharedMatrix C, const std::string &basis)
 
SharedVector epsilon_subset_helper (SharedVector epsilon, const Dimension &noccpi, const std::string &basis, const std::string &subset)
 
std::vector< std::vector< int > > subset_occupation (const Dimension &noccpi, const std::string &subset)
 
- Protected Attributes inherited from psi::Wavefunction
std::string name_
 Name of the wavefunction. More...
 
std::map< std::string,
std::shared_ptr< BasisSet > > 
basissets_
 DF/RI/F12/etc basis sets. More...
 
std::shared_ptr< BasisSetbasisset_
 The ORBITAL basis. More...
 
std::shared_ptr< SOBasisSetsobasisset_
 Primary basis set for SO integrals. More...
 
SharedMatrix AO2SO_
 AO2SO conversion matrix (AO in rows, SO in cols) More...
 
std::shared_ptr< Moleculemolecule_
 Molecule that this wavefunction is run on. More...
 
Optionsoptions_
 Options object. More...
 
std::shared_ptr< PSIOpsio_
 
std::shared_ptr< IntegralFactoryintegral_
 Integral factory. More...
 
std::shared_ptr< MatrixFactoryfactory_
 Matrix factory for creating standard sized matrices. More...
 
std::shared_ptr< Wavefunctionreference_wavefunction_
 
long int memory_
 How much memory you have access to. More...
 
size_t debug_
 Debug flag. More...
 
size_t print_
 Print flag. More...
 
int nalpha_
 Total alpha and beta electrons. More...
 
int nbeta_
 
int nfrzc_
 Total frozen core orbitals. More...
 
Dimension doccpi_
 Number of doubly occupied per irrep. More...
 
Dimension soccpi_
 Number of singly occupied per irrep. More...
 
Dimension frzcpi_
 Number of frozen core per irrep. More...
 
Dimension frzvpi_
 Number of frozen virtuals per irrep. More...
 
Dimension nalphapi_
 Number of alpha electrons per irrep. More...
 
Dimension nbetapi_
 Number of beta electrons per irrep. More...
 
Dimension nsopi_
 Number of so per irrep. More...
 
Dimension nmopi_
 Number of mo per irrep. More...
 
bool density_fitted_
 Whether this wavefunction was obtained using density fitting. More...
 
double energy_
 The energy associated with this wavefunction. More...
 
double efzc_
 Frozen-core energy associated with this wavefunction. More...
 
int nso_
 Total number of SOs. More...
 
int nmo_
 Total number of MOs. More...
 
int nirrep_
 Number of irreps. More...
 
SharedMatrix S_
 Overlap matrix. More...
 
SharedMatrix H_
 Core Hamiltonian matrix. More...
 
SharedMatrix Ca_
 Alpha MO coefficients. More...
 
SharedMatrix Cb_
 Beta MO coefficients. More...
 
SharedMatrix Da_
 Alpha density matrix. More...
 
SharedMatrix Db_
 Beta density matrix. More...
 
SharedMatrix Lagrangian_
 Lagrangian matrix. More...
 
SharedMatrix Fa_
 Alpha Fock matrix. More...
 
SharedMatrix Fb_
 Beta Fock matrix. More...
 
SharedVector epsilon_a_
 Alpha orbital eneriges. More...
 
SharedVector epsilon_b_
 Beta orbital energies. More...
 
SharedMatrix gradient_
 If a gradient is available it will be here: More...
 
SharedMatrix hessian_
 If a Hessian is available it will be here: More...
 
std::shared_ptr< std::vector
< double > > 
atomic_point_charges_
 If atomic point charges are available they will be here. More...
 
SharedVector frequencies_
 If frequencies are available, they will be here: More...
 
SharedVector normalmodes_
 If normal modes are available, they will be here: More...
 
bool same_a_b_dens_
 Same orbs or dens. More...
 
bool same_a_b_orbs_
 
std::shared_ptr
< ExternalPotential
external_pot_
 
std::map< std::string, double > variables_
 
std::map< std::string,
SharedMatrix
arrays_
 

Constructor & Destructor Documentation

psi::mcscf::SCF::SCF ( SharedWavefunction  ref_wfn,
Options options_,
std::shared_ptr< PSIO psio 
)
explicit
psi::mcscf::SCF::~SCF ( )

Member Function Documentation

void psi::mcscf::SCF::canonicalize_MO ( )
private
void psi::mcscf::SCF::check_orthonormality ( )
private
void psi::mcscf::SCF::cleanup ( void  )
private
double psi::mcscf::SCF::compute_energy ( )
virtual

Compute energy. Subclasses override this function to compute its energy.

Reimplemented from psi::Wavefunction.

void psi::mcscf::SCF::construct_F ( )
private
void psi::mcscf::SCF::construct_Favg ( )
private
void psi::mcscf::SCF::construct_Feff ( int  cycle)
private
void psi::mcscf::SCF::construct_G ( SBlockMatrix density,
SBlockMatrix G,
double *  integrals,
int  batch,
double  factor 
)
private
void psi::mcscf::SCF::construct_G ( SBlockMatrix density,
SBlockMatrix G,
double *  integrals,
int  batch 
)
private
void psi::mcscf::SCF::construct_S_inverse_sqrt ( )
private
void psi::mcscf::SCF::density_matrix ( )
private
void psi::mcscf::SCF::diis ( int  cycle)
private
double psi::mcscf::SCF::energy ( int  cycle,
double  old_energy 
)
private
void psi::mcscf::SCF::generate_pairs ( )
private
void psi::mcscf::SCF::guess_occupation ( )
private
void psi::mcscf::SCF::initial_guess ( )
private
void psi::mcscf::SCF::iterate_scf_equations ( )
private
void psi::mcscf::SCF::print_eigenvectors_and_MO ( )
private
void psi::mcscf::SCF::read_Raffanetti ( const char *  integral_type,
double *  integrals,
int  batch 
)
private
void psi::mcscf::SCF::read_so_oei ( )
private
void psi::mcscf::SCF::read_so_tei ( )
private
void psi::mcscf::SCF::read_so_tei_form_PK ( )
private
void psi::mcscf::SCF::read_so_tei_form_PK_and_K ( )
private
void psi::mcscf::SCF::save_info ( )
private
void psi::mcscf::SCF::startup ( )
private
void psi::mcscf::SCF::transform ( SBlockMatrix Initial,
SBlockMatrix Final,
SBlockMatrix Transformation 
)
private
void psi::mcscf::SCF::write_Raffanetti ( const char *  integral_type,
double *  integrals,
int  batch 
)
private

Member Data Documentation

intvec psi::mcscf::SCF::actv
private
size_t psi::mcscf::SCF::batch_index_max[maxbatches]
private
size_t psi::mcscf::SCF::batch_index_min[maxbatches]
private
size_t psi::mcscf::SCF::batch_pq_max[maxbatches]
private
size_t psi::mcscf::SCF::batch_pq_min[maxbatches]
private
size_t psi::mcscf::SCF::batch_size[maxbatches]
private
int* psi::mcscf::SCF::block_offset
private
SBlockMatrix psi::mcscf::SCF::C
private
SBlockMatrix psi::mcscf::SCF::C_t
private
SBlockMatrix psi::mcscf::SCF::C_T
private
double* psi::mcscf::SCF::ci
private
double* psi::mcscf::SCF::ci_grad
private
int psi::mcscf::SCF::current_diis
private
SBlockMatrix psi::mcscf::SCF::Dc
private
SBlockMatrix psi::mcscf::SCF::Dc_old
private
double psi::mcscf::SCF::diis_ci[maxci][maxdiis]
private
SBlockMatrix psi::mcscf::SCF::diis_e[maxdiis]
private
SBlockMatrix psi::mcscf::SCF::diis_F[maxdiis]
private
SBlockMatrix psi::mcscf::SCF::Do
private
intvec psi::mcscf::SCF::docc
private
SBlockMatrix psi::mcscf::SCF::Dsum[maxci]
private
SBlockMatrix psi::mcscf::SCF::Dtc[maxci]
private
SBlockMatrix psi::mcscf::SCF::Dtc_old[maxci]
private
SBlockMatrix psi::mcscf::SCF::e
private
SBlockVector psi::mcscf::SCF::epsilon
private
SBlockMatrix psi::mcscf::SCF::Favg
private
SBlockMatrix psi::mcscf::SCF::Favg_t
private
SBlockMatrix psi::mcscf::SCF::Fc
private
SBlockMatrix psi::mcscf::SCF::Fc_t
private
SBlockMatrix psi::mcscf::SCF::Feff_oAO
private
SBlockMatrix psi::mcscf::SCF::Feff_t
private
SBlockMatrix psi::mcscf::SCF::Feff_t_old
private
SBlockMatrix psi::mcscf::SCF::Fo
private
SBlockMatrix psi::mcscf::SCF::Fo_t
private
SBlockMatrix psi::mcscf::SCF::Ftc[maxci]
private
SBlockMatrix psi::mcscf::SCF::Ftc_t[maxci]
private
SBlockMatrix psi::mcscf::SCF::G
private
SBlockMatrix psi::mcscf::SCF::H
private
double** psi::mcscf::SCF::H_tcscf
private
size_t* psi::mcscf::SCF::ioff
private
double* psi::mcscf::SCF::K
private
const int psi::mcscf::SCF::maxbatches = 50
staticprivate
const int psi::mcscf::SCF::maxci = 8
staticprivate
const int psi::mcscf::SCF::maxdiis = 10
staticprivate
int psi::mcscf::SCF::nbatch
private
int psi::mcscf::SCF::nci
private
int psi::mcscf::SCF::ndiis
private
size_t psi::mcscf::SCF::nin_core
private
int psi::mcscf::SCF::nirreps
private
double psi::mcscf::SCF::norm_ci_grad
private
int psi::mcscf::SCF::npairs
private
int psi::mcscf::SCF::nso
private
SBlockMatrix psi::mcscf::SCF::O
private
bool psi::mcscf::SCF::out_of_core
private
int** psi::mcscf::SCF::pair
private
int* psi::mcscf::SCF::pair_offset
private
int** psi::mcscf::SCF::pair_sym
private
int* psi::mcscf::SCF::pairpi
private
int* psi::mcscf::SCF::pairs
private
double* psi::mcscf::SCF::PK
private
ReferenceType psi::mcscf::SCF::reference
private
int psi::mcscf::SCF::root
private
SBlockMatrix psi::mcscf::SCF::S
private
SBlockMatrix psi::mcscf::SCF::S_sqrt
private
SBlockMatrix psi::mcscf::SCF::S_sqrt_inv
private
intvec psi::mcscf::SCF::sopi
private
SBlockMatrix psi::mcscf::SCF::T
private
int psi::mcscf::SCF::tcscf_mos[maxci]
private
int psi::mcscf::SCF::tcscf_sym[maxci]
private
double psi::mcscf::SCF::total_energy
private
size_t psi::mcscf::SCF::total_symmetric_block_size
private
int psi::mcscf::SCF::turn_on_actv
private
bool psi::mcscf::SCF::use_diis
private

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