ergo
SCF_restricted.h
Go to the documentation of this file.
1 /* Ergo, version 3.3, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2013 Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Primary academic reference:
19  * Kohn−Sham Density Functional Theory Electronic Structure Calculations
20  * with Linearly Scaling Computational Time and Memory Usage,
21  * Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek,
22  * J. Chem. Theory Comput. 7, 340 (2011),
23  * <http://dx.doi.org/10.1021/ct100611z>
24  *
25  * For further information about Ergo, see <http://www.ergoscf.org>.
26  */
27 
28 #ifndef SCF_RESTRICTED_HEADER
29 #define SCF_RESTRICTED_HEADER
30 
31 #include "SCF_general.h"
32 
33 
35 {
36  public:
37 
38  // Constructor
39  SCF_restricted(const Molecule& molecule_,
40  const Molecule& extraCharges_,
41  const BasisInfoStruct & basisInfo_,
42  const BasisInfoStruct & basisInfoDensFit_,
43  const IntegralInfo& integralInfo_,
44  const char* guessDmatFileNamePtr,
45  const JK::Params& J_K_paramsPtr,
46  const Dft::GridParams& gridParams_,
47  const SCF::Options& scfopts,
48  const SCF::MatOptions& matOpts,
49  ergo_real threshold_integrals_1el_input);
50 
51  // Destructor
53 
54  void get_Fock_matrix(symmMatrix & FockMatrix_);
55  void get_density_matrix(symmMatrix & densityMatrix_);
56 
57  private:
58  void initialize_matrices();
59  void check_params();
65  void calculate_energy();
66  void get_FDSminusSDF();
67  void get_error_measure();
68  void add_to_DIIS_list();
70  void combine_old_fock_matrices(ergo_real stepLength);
72  void clear_diis_list();
73  void clear_error_matrices();
76  void write_density_to_file();
77  void save_final_potential();
79  void output_density_images();
82  void report_final_results();
84  void update_subspace_diff();
85  void disturb_fock_matrix(ergo_real subspaceError);
86  void disturb_dens_matrix(ergo_real subspaceError);
87  void do_spin_flip(int atomCount);
88  void disturb_dens_matrix_exact(ergo_real subspaceError);
91  void create_mtx_files_F(int const scfIter);
92  void create_mtx_files_D(int const scfIter);
93  void create_homo_eigvec_file() const;
94  void create_lumo_eigvec_file() const;
95  void create_gabedit_file() const;
96  void compute_dipole_moment();
97  void do_mulliken_pop_stuff();
99 
100  void get_non_ort_err_mat_normalized_in_ort_basis(symmMatrix & randomMatrix, int transform_with_S_also);
101  void transform_with_S(symmMatrix & A);
103 
104  void disturb_dens_matrix_exact_try(const symmMatrix & randomMatrix,
105  const symmMatrix & orgDensMatrix,
106  ergo_real disturbanceFactor,
107  ergo_real & resultSinTheta,
108  symmMatrix & resultDensMatrix);
109 
114  symmMatrix F_ort_prev; // Used by purification
118  // The following three matrices are only used when doing sparsity investigation, otherwise they are empty
122 
125 
126 
131 
132 };
133 
134 
135 
136 
137 
138 #endif
#define A
void update_subspace_diff()
Definition: SCF_restricted.cc:1266
void create_gabedit_file() const
Definition: SCF_restricted.cc:1163
double ergo_real
Definition: realtype.h:53
symmMatrix FockMatrix
Definition: SCF_restricted.h:111
void clear_error_matrices()
Definition: SCF_restricted.cc:699
void report_density_difference()
Definition: SCF_restricted.cc:1008
symmMatrix Fxc_matrix
Definition: SCF_restricted.h:121
A structure describing the grid settings.
Definition: grid_params.h:49
void calculate_energy()
Definition: SCF_restricted.cc:596
symmMatrix bestFockMatrixSoFar
Definition: SCF_restricted.h:115
void use_diis_to_get_new_fock_matrix()
Definition: SCF_restricted.cc:679
void disturb_dens_matrix_exact_try(const symmMatrix &randomMatrix, const symmMatrix &orgDensMatrix, ergo_real disturbanceFactor, ergo_real &resultSinTheta, symmMatrix &resultDensMatrix)
Definition: SCF_restricted.cc:1388
symmMatrix bestFockMatrixSoFar2
Definition: SCF_restricted.h:116
void do_mulliken_pop_stuff()
Definition: SCF_restricted.cc:1036
void compute_gradient_fixeddens()
Definition: SCF_restricted.cc:1621
void save_density_as_prevdens()
Definition: SCF_restricted.cc:998
Definition: integrals_2el.h:36
void add_to_DIIS_list()
Definition: SCF_restricted.cc:638
intervalType lumoInterval_Fprev
Definition: SCF_restricted.h:130
const SCF::MatOptions & matOpts
Definition: SCF_general.h:79
Definition: SCF_statistics.h:47
void transform_with_S(symmMatrix &A)
Transform matrix A to S*A*S.
Definition: SCF_restricted.cc:1302
const SCF::Options & scfopts
Definition: SCF_general.h:78
void output_csr_matrices_for_gao()
Definition: SCF_restricted.cc:954
void check_params()
Definition: SCF_restricted.cc:115
symmMatrix Dprev
Definition: SCF_restricted.h:113
Representation of a molecule as a set of nuclei and total charge.
Definition: molecule.h:76
Definition: SCF_general.h:41
void get_new_density_matrix()
Definition: SCF_restricted.cc:716
void initialize_homo_lumo_limits()
Definition: SCF_restricted.cc:258
void get_density_matrix(symmMatrix &densityMatrix_)
Definition: SCF_restricted.cc:85
void get_2e_part_and_energy()
Definition: SCF_restricted.cc:297
void disturb_dens_matrix(ergo_real subspaceError)
Definition: SCF_restricted.cc:1366
symmMatrix J_matrix
Definition: SCF_restricted.h:119
void output_density_images()
Definition: SCF_restricted.cc:916
symmMatrix densityMatrix
Definition: SCF_restricted.h:110
intervalType homoInterval_Fprev
Definition: SCF_restricted.h:129
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:81
void transform_with_invChol(symmMatrix &A)
Transform matrix A to invCholT*A*invChol.
Definition: SCF_restricted.cc:1321
void create_mtx_files_D(int const scfIter)
Definition: SCF_restricted.cc:1064
void save_final_potential()
Definition: SCF_restricted.cc:884
void create_homo_eigvec_file() const
Definition: SCF_restricted.cc:1077
void create_lumo_eigvec_file() const
Definition: SCF_restricted.cc:1099
void add_random_disturbance_to_starting_guess()
Definition: SCF_restricted.cc:242
generalVector eigVecHOMO
Definition: SCF_restricted.h:124
void do_spin_flip(int atomCount)
Definition: SCF_restricted.cc:992
~SCF_restricted()
Definition: SCF_restricted.cc:71
Definition: SCF_restricted.h:34
void write_density_to_file()
Definition: SCF_restricted.cc:852
void save_full_matrices_for_matlab()
Definition: SCF_restricted.cc:895
Definition: basisinfo.h:111
Definition: scf.h:43
void combine_old_fock_matrices(ergo_real stepLength)
Definition: SCF_restricted.cc:665
void disturb_fock_matrix(ergo_real subspaceError)
Definition: SCF_restricted.cc:1519
void save_current_fock_as_fprev()
Definition: SCF_restricted.cc:705
void initialize_matrices()
Definition: SCF_restricted.cc:93
void write_diag_dens_to_file()
Definition: SCF_restricted.cc:976
void get_Fock_matrix(symmMatrix &FockMatrix_)
Definition: SCF_restricted.cc:77
void clear_diis_list()
Definition: SCF_restricted.cc:693
void output_sparsity_S_F_D(SCF_statistics &stats)
Definition: SCF_restricted.cc:578
void disturb_dens_matrix_exact(ergo_real subspaceError)
Definition: SCF_restricted.cc:1473
void write_matrices_to_file()
Definition: SCF_restricted.cc:268
void compute_dipole_moment()
Definition: SCF_restricted.cc:1028
void get_error_measure()
Definition: SCF_restricted.cc:628
generalVector eigVecLUMO
Definition: SCF_restricted.h:123
void create_mtx_files_F(int const scfIter)
Definition: SCF_restricted.cc:1052
normalMatrix ErrorMatrix
Definition: SCF_restricted.h:117
void update_best_fock_so_far()
Definition: SCF_restricted.cc:650
SCF_restricted(const Molecule &molecule_, const Molecule &extraCharges_, const BasisInfoStruct &basisInfo_, const BasisInfoStruct &basisInfoDensFit_, const IntegralInfo &integralInfo_, const char *guessDmatFileNamePtr, const JK::Params &J_K_paramsPtr, const Dft::GridParams &gridParams_, const SCF::Options &scfopts, const SCF::MatOptions &matOpts, ergo_real threshold_integrals_1el_input)
Definition: SCF_restricted.cc:44
void report_final_results()
Definition: SCF_restricted.cc:986
symmMatrix F_ort_prev
Definition: SCF_restricted.h:114
symmMatrix K_matrix
Definition: SCF_restricted.h:120
symmMatrix Fprev
Definition: SCF_restricted.h:112
void get_starting_guess_density()
Definition: SCF_restricted.cc:125
An object respresenting the configuration of the matrix library.
Definition: scf.h:225
void get_non_ort_err_mat_normalized_in_ort_basis(symmMatrix &randomMatrix, int transform_with_S_also)
Definition: SCF_restricted.cc:1329
intervalType homoInterval_F_ort_prev
Definition: SCF_restricted.h:127
void get_FDSminusSDF()
Definition: SCF_restricted.cc:608
intervalType lumoInterval_F_ort_prev
Definition: SCF_restricted.h:128