ergo
SCF_unrestricted.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_UNRESTRICTED_HEADER
29 #define SCF_UNRESTRICTED_HEADER
30 
31 #include "SCF_general.h"
32 
33 
35 {
36  public:
37 
38  // Constructor
39  SCF_unrestricted(const Molecule& molecule_,
40  const Molecule& extraCharges_,
41  const BasisInfoStruct & basisInfo_,
42  const BasisInfoStruct & basisInfoDensFit_,
43  const IntegralInfo & integralInfo_,
44  const char* guessDmatFileName_,
45  const JK::Params& J_K_params_,
46  const Dft::GridParams& gridParams_,
47  const SCF::Options& scfopts,
48  const SCF::MatOptions& matOpts,
49  ergo_real threshold_integrals_1el_input,
50  int alpha_beta_diff_input);
51 
52  // Destructor
54 
55  void get_Fock_matrices(symmMatrix & FockMatrix_a, symmMatrix & FockMatrix_b);
56  void get_no_of_electrons(int & noOfElectrons_a, int & noOfElectrons_b);
57 
58  private:
59  void initialize_matrices();
60  void check_params();
66  void calculate_energy();
67  void get_FDSminusSDF();
68  void get_error_measure();
69  void add_to_DIIS_list();
71  void combine_old_fock_matrices(ergo_real stepLength);
73  void clear_diis_list();
74  void clear_error_matrices();
77  void write_density_to_file();
78  void save_final_potential();
80  void output_density_images();
82  void do_electron_dynamics();
84  void report_final_results();
86  void update_subspace_diff();
87  void disturb_fock_matrix(ergo_real subspaceError);
88  void disturb_dens_matrix(ergo_real subspaceError);
89  void do_spin_flip(int atomCount);
90  void disturb_dens_matrix_exact(ergo_real subspaceError);
93  void create_mtx_files_F(int const scfIter);
94  void create_mtx_files_D(int const scfIter);
95  void create_homo_eigvec_file() const;
96  void create_lumo_eigvec_file() const;
97  void create_gabedit_file() const;
98  void compute_dipole_moment();
99  void do_mulliken_pop_stuff();
100 
101  void get_S2(ergo_real & S2_exact, ergo_real & S2);
102 
111  symmMatrix F_ort_prev_alpha; // Used by purification
112  symmMatrix F_ort_prev_beta; // Used by purification
121 
122  // HOMO/LUMO info
131 
135 };
136 
137 
138 
139 
140 
141 #endif