ergo
SCF_unrestricted.h
Go to the documentation of this file.
1 /* Ergo, version 3.8, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2019 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4  * and Anastasia Kruchinina.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Primary academic reference:
20  * Ergo: An open-source program for linear-scaling electronic structure
21  * calculations,
22  * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23  * Kruchinina,
24  * SoftwareX 7, 107 (2018),
25  * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26  *
27  * For further information about Ergo, see <http://www.ergoscf.org>.
28  */
29 
38 #ifndef SCF_UNRESTRICTED_HEADER
39 #define SCF_UNRESTRICTED_HEADER
40 
41 #include "SCF_general.h"
42 
43 
45 {
46  public:
47 
48  // Constructor
49  SCF_unrestricted(const Molecule& molecule_,
50  const Molecule& extraCharges_,
51  const BasisInfoStruct & basisInfo_,
52  const IntegralInfo & integralInfo_,
53  const char* guessDmatFileName_,
54  const JK::Params& J_K_params_,
55  const Dft::GridParams& gridParams_,
56  const SCF::Options& scfopts,
57  const SCF::MatOptions& matOpts,
58  ergo_real threshold_integrals_1el_input,
59  int alpha_beta_diff_input);
60 
61  // Destructor
63 
64  void get_Fock_matrices(symmMatrix & FockMatrix_a, symmMatrix & FockMatrix_b);
65  void get_no_of_electrons(int & noOfElectrons_a, int & noOfElectrons_b);
66 
67  private:
68  void initialize_matrices();
69  void check_params();
75  void calculate_energy();
76  void get_FDSminusSDF();
77  void get_error_measure();
78  void add_to_DIIS_list();
80  void combine_old_fock_matrices(ergo_real stepLength);
82  void clear_diis_list();
83  void clear_error_matrices();
86  void write_density_to_file();
87  void save_final_potential();
90  void output_density_images();
91  void output_density_images_orbital(generalVector &eigVec, const std::string &filename_id);
93  void report_final_results();
95  void update_subspace_diff();
96  void disturb_fock_matrix(ergo_real subspaceError);
97  void disturb_dens_matrix(ergo_real subspaceError);
98  void do_spin_flip(int atomCount);
99  void disturb_dens_matrix_exact(ergo_real subspaceError);
102  void create_mtx_files_F(int const scfIter);
103  void create_mtx_files_D(int const scfIter);
104  void create_eigenvalues_files() const;
105  void create_eigenvectors_files() const;
106  void create_eigvec_file(const generalVector &eigVec_alpha,
107  const generalVector &eigVec_beta,
108  const char *vector_name,
109  const char *filename_id) const;
110  void create_gabedit_file() const;
111  void compute_dipole_moment();
112  void do_mulliken_pop_stuff();
114 
115  void get_S2(ergo_real & S2_exact, ergo_real & S2);
116 
125  symmMatrix F_ort_prev_alpha; // Used by purification
126  symmMatrix F_ort_prev_beta; // Used by purification
127  symmMatrix D_ort_prev_alpha; // Used for computing eigenvectors
128  symmMatrix D_ort_prev_beta; // Used for computing eigenvectors
137 
138  // HOMO/LUMO info
147 
151 
152  std::vector<generalVector> eigVecOCC_alpha;
153  std::vector<generalVector> eigVecUNOCC_alpha;
154  std::vector<ergo_real> eigValOCC_alpha;
155  std::vector<ergo_real> eigValUNOCC_alpha;
156  std::vector<generalVector> eigVecOCC_beta;
157  std::vector<generalVector> eigVecUNOCC_beta;
158  std::vector<ergo_real> eigValOCC_beta;
159  std::vector<ergo_real> eigValUNOCC_beta;
160 };
161 
162 
163 
164 
165 
166 #endif
SCF_unrestricted::get_FDSminusSDF
void get_FDSminusSDF()
Definition: SCF_unrestricted.cc:558
determine_number_of_electrons_unrestricted
int determine_number_of_electrons_unrestricted(int noOfElectrons, int alpha_beta_diff, int *noOfElectrons_alpha, int *noOfElectrons_beta)
Definition: scf_utils.cc:2201
SCF_general::S_symm
symmMatrix S_symm
Definition: SCF_general.h:114
SCF_general::DensFromFock
GetDensFromFock DensFromFock
Definition: SCF_general.h:125
SCF_unrestricted::clear_diis_list
void clear_diis_list()
Definition: SCF_unrestricted.cc:720
GetDensFromFock::set_no_occupied_orbs
void set_no_occupied_orbs(int noOfOccupiedOrbs_)
Definition: GetDensFromFock.h:282
SCF_unrestricted::get_no_of_electrons
void get_no_of_electrons(int &noOfElectrons_a, int &noOfElectrons_b)
Definition: SCF_unrestricted.cc:105
ShellSpecStruct::coeffList
ergo_real coeffList[MAX_NO_OF_CONTR_GAUSSIANS]
Definition: basisinfo.h:72
SquareFuncIntegrator
Provides temporary storage for compute_integral_of_square_of_basis_func.
Definition: basisinfo.h:189
GetDensFromFock::set_use_diag_on_error
void set_use_diag_on_error()
Definition: GetDensFromFock.h:386
SCF_general
Definition: SCF_general.h:52
SCF_unrestricted::report_final_results
void report_final_results()
Definition: SCF_unrestricted.cc:1127
get_dipole_moment
void get_dipole_moment(const symmMatrix &densityMatrix, const BasisInfoStruct &basisInfo, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, const Molecule &molecule, int logArea, const char *label)
Definition: dipole_moment.cc:74
SCF_unrestricted::get_S2
void get_S2(ergo_real &S2_exact, ergo_real &S2)
Definition: SCF_unrestricted.cc:1135
LOG_CAT_RESULTS
#define LOG_CAT_RESULTS
Definition: output.h:51
SCF_general::nuclearEnergy
ergo_real nuclearEnergy
Definition: SCF_general.h:98
GetDensFromFock::get_eigs_Fprev
void get_eigs_Fprev(intervalType &homoInterval_Finput_, intervalType &lumoInterval_Finput_) const
Definition: GetDensFromFock.h:523
SCF::MatOptions::sparse_threshold
ergo_real sparse_threshold
threshold value for sparse matrix truncation.
Definition: scf.h:280
SCF::Options::starting_guess_disturbance
ergo_real starting_guess_disturbance
Definition: scf.h:89
SCF::DISTURB_ELEMENT_MAX_COUNT
static const int DISTURB_ELEMENT_MAX_COUNT
Definition: scf.h:51
GetDensFromFock::get_output_homo_and_lumo_eigenvectors
int get_output_homo_and_lumo_eigenvectors() const
Definition: GetDensFromFock.h:337
BasisInfoStruct::noOfBasisFuncs
int noOfBasisFuncs
Definition: basisinfo.h:120
SCF_unrestricted::eigValUNOCC_alpha
std::vector< ergo_real > eigValUNOCC_alpha
Definition: SCF_unrestricted.h:155
GetDensFromFock::set_SCF_step
void set_SCF_step(int step)
Definition: GetDensFromFock.h:212
SCF::Options::eigensolver_maxiter
int eigensolver_maxiter
Definition: scf.h:156
dipole_moment.h
Functionality for computing the dipole moment of a molecule for a given density matrix.
matrix_description_struct
Definition: density_description_file.h:50
SCF_unrestricted::disturb_dens_matrix
void disturb_dens_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1677
SCF_unrestricted::noOfElectrons_alpha
int noOfElectrons_alpha
Definition: SCF_unrestricted.h:149
SCF_unrestricted::eigValOCC_alpha
std::vector< ergo_real > eigValOCC_alpha
Definition: SCF_unrestricted.h:154
output_sparsity
void output_sparsity(int n, const normalMatrix &M, const char *matrixName)
Definition: scf_utils.cc:371
SCF_unrestricted::homoInterval_Fprev_alpha
intervalType homoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:143
SCF_unrestricted::create_gabedit_file
void create_gabedit_file() const
Definition: SCF_unrestricted.cc:1496
SCF_unrestricted::write_density_to_file
void write_density_to_file()
Definition: SCF_unrestricted.cc:900
SCF::Options::disturbedElementIndexVector
int disturbedElementIndexVector[DISTURB_ELEMENT_MAX_COUNT]
Definition: scf.h:91
SCF_unrestricted::get_Fock_matrices
void get_Fock_matrices(symmMatrix &FockMatrix_a, symmMatrix &FockMatrix_b)
Definition: SCF_unrestricted.cc:94
SCF_unrestricted::bestFockMatrixSoFar2_beta
symmMatrix bestFockMatrixSoFar2_beta
Definition: SCF_unrestricted.h:132
UNIT_one_Angstrom
#define UNIT_one_Angstrom
Definition: units.h:43
SCF_unrestricted::FockMatrix_beta
symmMatrix FockMatrix_beta
Definition: SCF_unrestricted.h:120
SCF_unrestricted::add_random_disturbance_to_starting_guess
void add_random_disturbance_to_starting_guess()
Definition: SCF_unrestricted.cc:286
LOG_CAT_ERROR
#define LOG_CAT_ERROR
Definition: output.h:47
LOG_CAT_WARNING
#define LOG_CAT_WARNING
Definition: output.h:48
SCF_unrestricted::add_to_DIIS_list
void add_to_DIIS_list()
Definition: SCF_unrestricted.cc:619
SCF_general::GetEuclideanNormOfMatrix
ergo_real GetEuclideanNormOfMatrix(const symmMatrix &A)
Definition: SCF_general.cc:493
SCF_general::H_core_Matrix
symmMatrix H_core_Matrix
Definition: SCF_general.h:117
printMat
static void printMat(const T &m, const char *msg, int nbast)
Definition: SCF_unrestricted.cc:354
atom_labels.h
Provides a way to map atom labels to their charges. The main procedure provided by this file is get_c...
ergo_real
double ergo_real
Definition: realtype.h:69
SCF_unrestricted::lumoInterval_F_ort_prev_beta
intervalType lumoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:142
SCF::Options::eigensolver_accuracy
ergo_real eigensolver_accuracy
Definition: scf.h:155
output_orbital_coeffs_in_gabedit_order
static void output_orbital_coeffs_in_gabedit_order(const BasisInfoStruct &basisInfo, std::vector< int > const &shellIdxList, std::ofstream &ff, std::vector< ergo_real > const &orbital_vec)
Definition: SCF_unrestricted.cc:1443
SCF_unrestricted::SCF_unrestricted
SCF_unrestricted(const Molecule &molecule_, const Molecule &extraCharges_, const BasisInfoStruct &basisInfo_, const IntegralInfo &integralInfo_, const char *guessDmatFileName_, const JK::Params &J_K_params_, const Dft::GridParams &gridParams_, const SCF::Options &scfopts, const SCF::MatOptions &matOpts, ergo_real threshold_integrals_1el_input, int alpha_beta_diff_input)
Definition: SCF_unrestricted.cc:54
SCF_unrestricted::create_eigvec_file
void create_eigvec_file(const generalVector &eigVec_alpha, const generalVector &eigVec_beta, const char *vector_name, const char *filename_id) const
Definition: SCF_unrestricted.cc:1387
prep_matrix_description_struct
static void prep_matrix_description_struct(matrix_description_struct &mat, int nvalues, std::vector< int > &rowind, std::vector< int > &colind, std::vector< ergo_real > &values)
Definition: SCF_unrestricted.cc:882
SCF_unrestricted::Dprev_beta
symmMatrix Dprev_beta
Definition: SCF_unrestricted.h:124
SCF::Options::calculation_identifier
std::string calculation_identifier
Definition: scf.h:54
SCF_unrestricted::disturb_fock_matrix
void disturb_fock_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1672
ShellSpecStruct::shellType
int shellType
Definition: basisinfo.h:78
SCF_unrestricted::use_diis_to_get_new_fock_matrix
void use_diis_to_get_new_fock_matrix()
Definition: SCF_unrestricted.cc:695
SCF_unrestricted::check_params
void check_params()
Definition: SCF_unrestricted.cc:154
symmMatrix
MatrixSymmetric< real, matri > symmMatrix
Definition: test_LanczosSeveralLargestEig.cc:69
SCF::Options::min_number_of_iterations
int min_number_of_iterations
Definition: scf.h:109
SCF_unrestricted::get_new_density_matrix
void get_new_density_matrix()
Definition: SCF_unrestricted.cc:756
SCF_unrestricted::bestFockMatrixSoFar2_alpha
symmMatrix bestFockMatrixSoFar2_alpha
Definition: SCF_unrestricted.h:131
BasisInfoStruct::shellList
ShellSpecStruct * shellList
Definition: basisinfo.h:119
SCF_general::errorMeasure
ergo_real errorMeasure
Definition: SCF_general.h:110
SCF_unrestricted::ErrorMatrix_beta
normalMatrix ErrorMatrix_beta
Definition: SCF_unrestricted.h:134
ShellSpecStruct::centerCoords
ergo_real centerCoords[3]
Definition: basisinfo.h:76
BasisInfoStruct
Definition: basisinfo.h:112
SCF_general::J_K_params
const JK::Params & J_K_params
Definition: SCF_general.h:84
SCF_statistics
Definition: SCF_statistics.h:57
Molecule::getNoOfAtoms
int getNoOfAtoms() const
Definition: molecule.h:114
ShellSpecStruct::exponentList
ergo_real exponentList[MAX_NO_OF_CONTR_GAUSSIANS]
Definition: basisinfo.h:73
SCF_unrestricted::clear_error_matrices
void clear_error_matrices()
Definition: SCF_unrestricted.cc:728
SCF_unrestricted::create_mtx_files_D
void create_mtx_files_D(int const scfIter)
Definition: SCF_unrestricted.cc:1279
ddf_writeShellListAndDensityMatricesToFile_sparse
int ddf_writeShellListAndDensityMatricesToFile_sparse(const BasisInfoStruct &basisInfo, int noOfDensityMatrices, matrix_description_struct *densityMatrixList, const char *fileName)
Writes basisInfo and sparse matrices in a format that can be later read by ddf_load_density.
Definition: density_description_file.cc:640
DIISManagerUnrestricted
Definition: diis_unrestricted.h:45
get_atom_label_from_charge_int
int get_atom_label_from_charge_int(int charge, char *atomLabelString, size_t bufferSize)
Definition: atom_labels.cc:141
do_mulliken_spin_densities
void do_mulliken_spin_densities(const symmMatrix &spinDensityMatrix, const symmMatrix &S_symm, const BasisInfoStruct &basisInfo, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML, const Molecule &molecule)
Definition: scf_utils.cc:2325
JK::Params
Definition: integrals_2el.h:45
SCF::Options::eigenvectors_iterative_method
std::string eigenvectors_iterative_method
Definition: scf.h:154
template_blas_fabs
Treal template_blas_fabs(Treal x)
SCF_unrestricted::eigVecOCC_alpha
std::vector< generalVector > eigVecOCC_alpha
Definition: SCF_unrestricted.h:152
get_diag_matrix_from_file
int get_diag_matrix_from_file(int n, symmMatrix &M, const char *fileName, std::vector< int > const &permutationHML)
Definition: scf_utils.cc:840
SCF_unrestricted::F_ort_prev_alpha
symmMatrix F_ort_prev_alpha
Definition: SCF_unrestricted.h:125
GetDensFromFock::unset_use_diag_on_error
void unset_use_diag_on_error()
Definition: GetDensFromFock.h:388
SCF::MatOptions
An object respresenting the configuration of the matrix library.
Definition: scf.h:276
SCF_unrestricted::update_best_fock_so_far
void update_best_fock_so_far()
Definition: SCF_unrestricted.cc:639
do_mulliken_atomic_charges
void do_mulliken_atomic_charges(const symmMatrix &densityMatrix, const symmMatrix &S_symm, const BasisInfoStruct &basisInfo, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML, const Molecule &molecule)
Definition: scf_utils.cc:2296
write_matrix_in_matrix_market_format
void write_matrix_in_matrix_market_format(Tmatrix const &A, std::vector< int > const &inversePermutation, std::string filename, std::string identifier, std::string method_and_basis)
Definition: matrix_utilities.h:149
SCF_general::gridParams
const Dft::GridParams & gridParams
Definition: SCF_general.h:85
Dft::GridParams
A structure describing the grid settings.
Definition: grid_params.h:59
SCF_unrestricted::Fprev_beta
symmMatrix Fprev_beta
Definition: SCF_unrestricted.h:122
get_2e_matrices_and_energy_restricted_open
int get_2e_matrices_and_energy_restricted_open(const BasisInfoStruct &basisInfo, const Molecule &molecule, const IntegralInfo &integralInfo, const JK::ExchWeights &CAM_params, symmMatrix &twoelMatrix_Fc, symmMatrix &twoelMatrix_Fo, symmMatrix &densityMatrix_sparse_alpha, symmMatrix &densityMatrix_sparse_beta, const JK::Params &J_K_params, const Dft::GridParams &gridParams, int do_xc, ergo_real *energy_2el, int noOfElectrons, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML)
Computes G_c and G_o.
Definition: scf_utils.cc:1929
SCF_unrestricted::do_mulliken_pop_stuff
void do_mulliken_pop_stuff()
Definition: SCF_unrestricted.cc:1226
GetDensFromFock::get_dens_from_fock
int get_dens_from_fock(symmMatrix &Finput, symmMatrix &resultDens, symmMatrix &F_ort_prev)
Choose which method to use for computing the density matrix from Fock matrix.
Definition: GetDensFromFock.cc:76
SCF_unrestricted::disturb_dens_matrix_exact
void disturb_dens_matrix_exact(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1682
SCF_unrestricted::eigValOCC_beta
std::vector< ergo_real > eigValOCC_beta
Definition: SCF_unrestricted.h:158
SCF_general::CAM_params
JK::ExchWeights CAM_params
Definition: SCF_general.h:92
SCF::MatOptions::inversePermutationHML
std::vector< int > inversePermutationHML
Definition: scf.h:279
GetDensFromFock::do_unrestricted_calculations
void do_unrestricted_calculations()
Definition: GetDensFromFock.h:279
SCF_unrestricted::bestFockMatrixSoFar_alpha
symmMatrix bestFockMatrixSoFar_alpha
Definition: SCF_unrestricted.h:129
scf_utils.h
Various utilities used by self-consistent field (SCF) code. For example, interface routines convertin...
SCF_unrestricted::lumoInterval_Fprev_beta
intervalType lumoInterval_Fprev_beta
Definition: SCF_unrestricted.h:146
SCF_unrestricted::eigVecUNOCC_alpha
std::vector< generalVector > eigVecUNOCC_alpha
Definition: SCF_unrestricted.h:153
IntegralInfo
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:94
BasisInfoStruct::noOfShells
int noOfShells
Definition: basisinfo.h:118
SCF_unrestricted::save_final_potential
void save_final_potential()
Definition: SCF_unrestricted.cc:948
SCF_unrestricted::D_ort_prev_beta
symmMatrix D_ort_prev_beta
Definition: SCF_unrestricted.h:128
SCF_unrestricted::update_subspace_diff
void update_subspace_diff()
Definition: SCF_unrestricted.cc:1666
SCF::Options::use_diag_guess_from_file
int use_diag_guess_from_file
Definition: scf.h:87
GetDensFromFock::compute_eigenvectors_extra
void compute_eigenvectors_extra(int puri_compute_eigv_in_each_iteration_, int run_shift_and_square_method_on_F_)
Definition: GetDensFromFock.h:588
SCF_general::guessDmatFileName
const char * guessDmatFileName
Definition: SCF_general.h:83
SCF_unrestricted::lumoInterval_Fprev_alpha
intervalType lumoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:144
compute_FDSminusSDF_sparse
int compute_FDSminusSDF_sparse(int n, symmMatrix &F_symm, symmMatrix &D_symm, symmMatrix &S_symm, normalMatrix &result, ergo_real sparse_threshold)
Definition: scf_utils.cc:2084
matrix_utilities.h
Utilities related to the hierarchical matrix library (HML), including functions for setting up permut...
SCF_unrestricted::compute_gradient_fixeddens
void compute_gradient_fixeddens()
Definition: SCF_unrestricted.cc:1687
SCF_general::SCF_step
int SCF_step
Definition: SCF_general.h:95
densitymanager.h
Functionality for working with the electron density as a function of space, for a given basis set and...
SCF_unrestricted::D_ort_prev_alpha
symmMatrix D_ort_prev_alpha
Definition: SCF_unrestricted.h:127
mat::VectorGeneral::is_empty
bool is_empty() const
Definition: VectorGeneral.h:56
ShellSpecStruct::noOfContr
int noOfContr
Definition: basisinfo.h:77
SCF_unrestricted::Fprev_alpha
symmMatrix Fprev_alpha
Definition: SCF_unrestricted.h:121
do_density_images
void do_density_images(const BasisInfoStruct &basisInfo, const Molecule &molecule, const ergo_real *densityMatrixFull_tot, const ergo_real *densityMatrixFull_spin, double output_density_images_boxwidth, const std::string &filename_id)
Definition: scf_utils.cc:2410
compute_maxabs_sparse
ergo_real compute_maxabs_sparse(const Tmatrix &M)
Definition: matrix_utilities.h:97
mat::VectorGeneral
Definition: MatrixBase.h:55
Util::TimeMeter::print
void print(int area, const char *routine)
Definition: utilities.h:111
SCF::Options::force_restricted
int force_restricted
use a restricted determinant for open shell.
Definition: scf.h:96
SCF_unrestricted::combine_old_fock_matrices
void combine_old_fock_matrices(ergo_real stepLength)
Definition: SCF_unrestricted.cc:668
mat::MatrixGeneral
Normal matrix.
Definition: MatrixBase.h:49
Molecule::getAtom
const Atom & getAtom(int i) const
Definition: molecule.h:113
SCF_unrestricted::F_ort_prev_beta
symmMatrix F_ort_prev_beta
Definition: SCF_unrestricted.h:126
GetDensFromFock::get_eigs_F_ort_prev
void get_eigs_F_ort_prev(intervalType &homoInterval_F_ort_prev_, intervalType &lumoInterval_F_ort_prev_) const
Definition: GetDensFromFock.h:539
mat::MatrixGeneral::frob
Treal frob() const
Definition: MatrixGeneral.h:284
mat::transpose
Xtrans< TX > transpose(TX const &A)
Transposition.
Definition: matrix_proxy.h:131
SCF::Options::starting_guess_spin_diff
int starting_guess_spin_diff
Definition: scf.h:99
SCF_unrestricted
Definition: SCF_unrestricted.h:45
SCF_unrestricted::densityMatrix_beta
symmMatrix densityMatrix_beta
Definition: SCF_unrestricted.h:118
write_diag_elements_to_file
int write_diag_elements_to_file(int n, const symmMatrix &M, const char *fileName, std::vector< int > const &permutationHML)
Definition: scf_utils.cc:917
utilities.h
Basic OS access utilities.
SCF_general::get_overlap_matrix
void get_overlap_matrix(symmMatrix &S)
Definition: SCF_general.cc:500
GetDensFromFock::compute_eigenvectors
void compute_eigenvectors(std::string eigenvectors_method_, std::string eigenvectors_iterative_method_, ergo_real eigensolver_accuracy_, int eigensolver_maxiter_, int use_prev_vector_as_initial_guess_, int try_eigv_on_next_iteration_if_fail_)
Definition: GetDensFromFock.h:553
SCF::Options::sg_disturb_specific_elements
int sg_disturb_specific_elements
Definition: scf.h:90
mat
Definition: allocate.cc:39
LOG_CAT_INFO
#define LOG_CAT_INFO
Definition: output.h:49
SCF_general::scfopts
const SCF::Options & scfopts
Definition: SCF_general.h:86
SCF_unrestricted::initialize_matrices
void initialize_matrices()
Definition: SCF_unrestricted.cc:112
SCF_unrestricted::get_2e_part_and_energy
void get_2e_part_and_energy()
Definition: SCF_unrestricted.cc:369
SCF::Options::try_eigv_on_next_iteration_if_fail
int try_eigv_on_next_iteration_if_fail
Definition: scf.h:125
SCF_unrestricted::noOfElectrons_beta
int noOfElectrons_beta
Definition: SCF_unrestricted.h:150
SCF_general::matOpts
const SCF::MatOptions & matOpts
Definition: SCF_general.h:87
SCF::MatOptions::permutationHML
std::vector< int > permutationHML
Definition: scf.h:278
SCF_general::noOfElectrons
int noOfElectrons
Definition: SCF_general.h:121
SCF_general::energy_2el
ergo_real energy_2el
Definition: SCF_general.h:100
GetDensFromFock::set_generate_figures
void set_generate_figures(std::string str="")
Plot figures from the recursive expansion.
Definition: GetDensFromFock.h:220
GetDensFromFock::get_result_entropy_term
ergo_real get_result_entropy_term() const
Definition: GetDensFromFock.h:506
SCF_unrestricted::create_eigenvalues_files
void create_eigenvalues_files() const
Definition: SCF_unrestricted.cc:1304
SCF::Options::use_simple_starting_guess
int use_simple_starting_guess
Definition: scf.h:86
SCF_unrestricted::compute_dipole_moment
void compute_dipole_moment()
Definition: SCF_unrestricted.cc:1214
SCF_unrestricted::alpha_beta_diff
int alpha_beta_diff
Definition: SCF_unrestricted.h:148
SCF_general.h
Class for self-consistent field (SCF) procedure; base class that can be used for both restricted and ...
GetDensFromFock::get_use_diag_on_error_guess
int get_use_diag_on_error_guess() const
Definition: GetDensFromFock.h:376
BasisInfoStruct::basisFuncList
BasisFuncStruct * basisFuncList
Definition: basisinfo.h:121
mat::Interval< ergo_real >
SCF_unrestricted::do_spin_flip
void do_spin_flip(int atomCount)
Definition: SCF_unrestricted.cc:1015
BasisFuncStruct::centerCoords
Vector3D centerCoords
Definition: basisinfo.h:90
LOG_AREA_SCF
#define LOG_AREA_SCF
Definition: output.h:58
SCF::Options::method_and_basis_set
std::string method_and_basis_set
Definition: scf.h:55
GetDensFromFock::get_use_diag_on_error
int get_use_diag_on_error() const
Definition: GetDensFromFock.h:384
SCF::Options::run_shift_and_square_method_on_F
int run_shift_and_square_method_on_F
Definition: scf.h:127
SCF_unrestricted::bestFockMatrixSoFar_beta
symmMatrix bestFockMatrixSoFar_beta
Definition: SCF_unrestricted.h:130
units.h
Constants for conversion between units for some common units like Angstrom, electron-volt (eV),...
SCF_unrestricted.h
Class for self-consistent field (SCF) procedure; spin-unrestricted case.
density_description_file.h
An interface file for writing and reading density matrices to/from a file, including basis set inform...
SCF_unrestricted::write_diag_dens_to_file
void write_diag_dens_to_file()
Definition: SCF_unrestricted.cc:1105
BasisInfoStruct::use_6_d_funcs
int use_6_d_funcs
Whether to use 6 d-type basis functions instead of the usual 5 functions.
Definition: basisinfo.h:113
SCF_unrestricted::output_density_images
void output_density_images()
Definition: SCF_unrestricted.cc:971
SCF::Options::use_dft
int use_dft
Definition: scf.h:85
mat::VectorGeneral::fullvector
void fullvector(std::vector< Treal > &fullVector) const
Definition: VectorGeneral.h:88
SCF_unrestricted::homoInterval_F_ort_prev_alpha
intervalType homoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:139
SCF_unrestricted::ErrorMatrix_alpha
normalMatrix ErrorMatrix_alpha
Definition: SCF_unrestricted.h:133
SCF::Options::eigenvectors_method
std::string eigenvectors_method
Definition: scf.h:153
add_disturbance_to_matrix
int add_disturbance_to_matrix(int n, symmMatrix &A, ergo_real disturbance, int specificElementCount, const int *elementIndexVector, std::vector< int > const &permutationHML)
Definition: scf_utils.cc:761
GetDensFromFock::get_use_purification
int get_use_purification() const
Definition: GetDensFromFock.h:368
Atom::charge
ergo_real charge
Definition: molecule.h:52
ShellSpecStruct::startIndexInMatrix
int startIndexInMatrix
Definition: basisinfo.h:81
SCF_unrestricted::initialize_homo_lumo_limits
void initialize_homo_lumo_limits()
Definition: SCF_unrestricted.cc:314
SCF_unrestricted::report_density_difference
void report_density_difference()
Definition: SCF_unrestricted.cc:1190
SCF_unrestricted::save_density_as_prevdens
void save_density_as_prevdens()
Definition: SCF_unrestricted.cc:1172
Molecule
Representation of a molecule as a set of nuclei and total charge.
Definition: molecule.h:87
SCF_unrestricted::write_matrices_to_file
void write_matrices_to_file()
Definition: SCF_unrestricted.cc:329
SCF::Options::output_density_images_boxwidth
ergo_real output_density_images_boxwidth
Definition: scf.h:118
SCF_unrestricted::create_eigenvectors_files
void create_eigenvectors_files() const
Definition: SCF_unrestricted.cc:1347
SCF_unrestricted::densityMatrix_alpha
symmMatrix densityMatrix_alpha
Definition: SCF_unrestricted.h:117
SCF::Options::puri_compute_eigv_in_each_iteration
int puri_compute_eigv_in_each_iteration
Definition: scf.h:126
SCF_unrestricted::eigValUNOCC_beta
std::vector< ergo_real > eigValUNOCC_beta
Definition: SCF_unrestricted.h:159
GetDensFromFock::unset_generate_figures
void unset_generate_figures()
Do not plot figures from the recursive expansion.
Definition: GetDensFromFock.h:232
SCF_general::electronicEntropyTerm
ergo_real electronicEntropyTerm
Definition: SCF_general.h:108
SCF::Options::use_prev_vector_as_initial_guess
int use_prev_vector_as_initial_guess
Definition: scf.h:147
SCF::Options
Definition: scf.h:53
output_sparsity_symm
void output_sparsity_symm(int n, const symmMatrix &M, const char *matrixName)
Definition: scf_utils.cc:376
SCF::MatOptions::size_block_info
mat::SizesAndBlocks size_block_info
Definition: scf.h:277
density_projection.h
Functionality for preparing a starting guess density matrix given a previous density matrix....
GetDensFromFock::get_computed_eigenpairs
void get_computed_eigenpairs(std::vector< generalVector > &eigVecUNOCCref, std::vector< generalVector > &eigVecOCCref, std::vector< ergo_real > &eigValUNOCCref, std::vector< ergo_real > &eigValOCCref)
Definition: GetDensFromFock.h:180
SCF_unrestricted::create_mtx_files_F
void create_mtx_files_F(int const scfIter)
Definition: SCF_unrestricted.cc:1256
SCF_general::molecule
const Molecule & molecule
Definition: SCF_general.h:79
SCF_unrestricted::save_full_matrices_for_matlab
void save_full_matrices_for_matlab()
Definition: SCF_unrestricted.cc:1121
SCF_unrestricted::save_current_fock_as_fprev
void save_current_fock_as_fprev()
Definition: SCF_unrestricted.cc:737
SCF_unrestricted::eigVecOCC_beta
std::vector< generalVector > eigVecOCC_beta
Definition: SCF_unrestricted.h:156
SCF_unrestricted::Dprev_alpha
symmMatrix Dprev_alpha
Definition: SCF_unrestricted.h:123
GetDensFromFock::set_eigs_F_ort_prev
void set_eigs_F_ort_prev(intervalType &homoInterval_F_ort_prev_, intervalType &lumoInterval_F_ort_prev_)
Definition: GetDensFromFock.h:532
GetDensFromFock::clean_eigs_intervals
void clean_eigs_intervals()
Set bounds for HOMO and LUMO eigenvalues to -/+ inf, thus remove any known bounds.
Definition: GetDensFromFock.h:196
SCF_unrestricted::G_alpha
symmMatrix G_alpha
Definition: SCF_unrestricted.h:135
get_simple_starting_guess_sparse
int get_simple_starting_guess_sparse(int n, int noOfElectrons, symmMatrix &densityMatrix)
Definition: scf_utils.cc:818
SCF_general::basisInfo
const BasisInfoStruct & basisInfo
Definition: SCF_general.h:81
get_2e_matrices_and_energy_sparse_unrestricted
int get_2e_matrices_and_energy_sparse_unrestricted(const BasisInfoStruct &basisInfo, const Molecule &molecule, const IntegralInfo &integralInfo, const JK::ExchWeights &CAM_params, symmMatrix &twoelMatrix_sparse_alpha, symmMatrix &twoelMatrix_sparse_beta, symmMatrix &densityMatrix_sparse_alpha, symmMatrix &densityMatrix_sparse_beta, const JK::Params &J_K_params, const Dft::GridParams &gridParams, int do_xc, ergo_real *energy_2el, int noOfElectrons, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML)
Definition: scf_utils.cc:1721
SquareFuncIntegrator::getShellFactor
ergo_real getShellFactor(const IntegralInfo &integralInfo, ergo_real exponent, int shellType, int use_6_d_funcs)
Definition: basisinfo.cc:277
SCF_general::integralInfo
const IntegralInfo & integralInfo
Definition: SCF_general.h:82
SCF_unrestricted::homoInterval_F_ort_prev_beta
intervalType homoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:141
SCF_unrestricted::output_density_images_orbital
void output_density_images_orbital(generalVector &eigVec, const std::string &filename_id)
Definition: SCF_unrestricted.cc:964
Atom::coords
ergo_real coords[3]
Definition: molecule.h:53
SCF_unrestricted::FockMatrix_alpha
symmMatrix FockMatrix_alpha
Definition: SCF_unrestricted.h:119
SCF_unrestricted::eigVecUNOCC_beta
std::vector< generalVector > eigVecUNOCC_beta
Definition: SCF_unrestricted.h:157
do_output
void do_output(int logCategory, int logArea, const char *format,...)
Definition: output.cc:53
SCF_unrestricted::get_starting_guess_density
void get_starting_guess_density()
Definition: SCF_unrestricted.cc:161
SCF_unrestricted::output_expected_values_pos_operator
void output_expected_values_pos_operator()
Definition: SCF_unrestricted.cc:956
SCF_unrestricted::calculate_energy
void calculate_energy()
Definition: SCF_unrestricted.cc:539
SCF_unrestricted::homoInterval_Fprev_beta
intervalType homoInterval_Fprev_beta
Definition: SCF_unrestricted.h:145
SCF_general::energy
ergo_real energy
Definition: SCF_general.h:101
densfromf_full.h
Routine get_dens_from_fock_full() for getting density matrix from a given Fock matrix using diagonali...
SCF_general::DIIS
DIISManager * DIIS
Definition: SCF_general.h:119
SCF_unrestricted::output_sparsity_S_F_D
void output_sparsity_S_F_D(SCF_statistics &stats)
Definition: SCF_unrestricted.cc:516
diis_unrestricted.h
DIISManagerUnrestricted class implementing direct inversion in the iterative subspace (DIIS) for unre...
load_density_and_project_sparse
int load_density_and_project_sparse(GetDensFromFock &DensFromFock, const char *densityFileName, int noOfDensityMatrices, const IntegralInfo *integralInfo, const BasisInfoStruct &basisInfo, symmMatrix &S_symm, symmMatrix **densityMatrixList, const int *noOfElectronsList, mat::SizesAndBlocks matrix_size_block_info, std::vector< int > const &matrixPermutationVec, ergo_real sparse_threshold)
load_density_and_project_sparse loads one or two density matrices (depending on value of noOfDensityM...
Definition: density_projection.cc:123
SCF_unrestricted::~SCF_unrestricted
~SCF_unrestricted()
Definition: SCF_unrestricted.cc:88
Util::TimeMeter
Time-measuring class.
Definition: utilities.h:80
SCF_unrestricted::get_error_measure
void get_error_measure()
Definition: SCF_unrestricted.cc:599
output.h
Functionality for writing output messages to a text file.
SCF_unrestricted::G_beta
symmMatrix G_beta
Definition: SCF_unrestricted.h:136
SCF_unrestricted::lumoInterval_F_ort_prev_alpha
intervalType lumoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:140