ergo
SCF_restricted.h
Go to the documentation of this file.
1 /* Ergo, version 3.2, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2012 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  private:
55  void initialize_matrices();
56  void check_params();
62  void calculate_energy();
63  void get_FDSminusSDF();
64  void get_error_measure();
65  void add_to_DIIS_list();
67  void combine_old_fock_matrices(ergo_real stepLength);
69  void clear_diis_list();
70  void clear_error_matrices();
73  void write_density_to_file();
74  void save_final_potential();
76  void output_density_images();
78  void do_electron_dynamics();
80  void report_final_results();
82  void update_subspace_diff();
83  void disturb_fock_matrix(ergo_real subspaceError);
84  void disturb_dens_matrix(ergo_real subspaceError);
85  void do_spin_flip(int atomCount);
86  void disturb_dens_matrix_exact(ergo_real subspaceError);
89  void create_mtx_files_F(int const scfIter);
90  void create_mtx_files_D(int const scfIter);
91  void create_homo_eigvec_file() const;
92  void create_lumo_eigvec_file() const;
93  void create_gabedit_file() const;
94  void compute_dipole_moment();
95  void do_mulliken_pop_stuff();
96 
97  void get_non_ort_err_mat_normalized_in_ort_basis(symmMatrix & randomMatrix, int transform_with_S_also);
100 
101  void disturb_dens_matrix_exact_try(const symmMatrix & randomMatrix,
102  const symmMatrix & orgDensMatrix,
103  ergo_real disturbanceFactor,
104  ergo_real & resultSinTheta,
105  symmMatrix & resultDensMatrix);
106 
111  symmMatrix F_ort_prev; // Used by purification
115  // The following three matrices are only used when doing sparsity investigation, otherwise they are empty
119 
122 
123 
128 
129 };
130 
131 
132 
133 
134 
135 #endif