ergo
SCF_unrestricted.h
Go to the documentation of this file.
1 /* Ergo, version 3.4, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2014 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();
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();
101 
102  void get_S2(ergo_real & S2_exact, ergo_real & S2);
103 
112  symmMatrix F_ort_prev_alpha; // Used by purification
113  symmMatrix F_ort_prev_beta; // Used by purification
122 
123  // HOMO/LUMO info
132 
136 };
137 
138 
139 
140 
141 
142 #endif
void get_error_measure()
Definition: SCF_unrestricted.cc:653
symmMatrix G_beta
Definition: SCF_unrestricted.h:121
intervalType homoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:128
double ergo_real
Definition: realtype.h:53
void get_FDSminusSDF()
Definition: SCF_unrestricted.cc:612
void clear_diis_list()
Definition: SCF_unrestricted.cc:774
void get_Fock_matrices(symmMatrix &FockMatrix_a, symmMatrix &FockMatrix_b)
Definition: SCF_unrestricted.cc:83
void add_random_disturbance_to_starting_guess()
Definition: SCF_unrestricted.cc:336
symmMatrix FockMatrix_beta
Definition: SCF_unrestricted.h:107
void get_S2(ergo_real &S2_exact, ergo_real &S2)
Definition: SCF_unrestricted.cc:1164
Definition: SCF_unrestricted.h:34
A structure describing the grid settings.
Definition: grid_params.h:49
void add_to_DIIS_list()
Definition: SCF_unrestricted.cc:673
void prepare_stochastic_orbitals()
Definition: SCF_unrestricted.cc:1032
void disturb_fock_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1355
void create_homo_eigvec_file() const
Definition: SCF_unrestricted.cc:1332
void disturb_dens_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1360
int noOfElectrons_alpha
Definition: SCF_unrestricted.h:134
void use_diis_to_get_new_fock_matrix()
Definition: SCF_unrestricted.cc:749
void write_density_to_file()
Definition: SCF_unrestricted.cc:926
symmMatrix bestFockMatrixSoFar2_beta
Definition: SCF_unrestricted.h:117
symmMatrix bestFockMatrixSoFar2_alpha
Definition: SCF_unrestricted.h:116
normalMatrix ErrorMatrix_beta
Definition: SCF_unrestricted.h:119
Definition: integrals_2el.h:36
intervalType lumoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:127
const SCF::MatOptions & matOpts
Definition: SCF_general.h:79
Definition: SCF_statistics.h:47
void clear_error_matrices()
Definition: SCF_unrestricted.cc:782
symmMatrix Dprev_beta
Definition: SCF_unrestricted.h:111
const SCF::Options & scfopts
Definition: SCF_general.h:78
void check_params()
Definition: SCF_unrestricted.cc:143
void get_new_density_matrix()
Definition: SCF_unrestricted.cc:810
Representation of a molecule as a set of nuclei and total charge.
Definition: molecule.h:76
void create_mtx_files_D(int const scfIter)
Definition: SCF_unrestricted.cc:1308
Definition: SCF_general.h:41
void do_mulliken_pop_stuff()
Definition: SCF_unrestricted.cc:1255
symmMatrix F_ort_prev_alpha
Definition: SCF_unrestricted.h:112
void update_best_fock_so_far()
Definition: SCF_unrestricted.cc:693
symmMatrix bestFockMatrixSoFar_alpha
Definition: SCF_unrestricted.h:114
void save_final_potential()
Definition: SCF_unrestricted.cc:980
symmMatrix Fprev_beta
Definition: SCF_unrestricted.h:109
void update_subspace_diff()
Definition: SCF_unrestricted.cc:1349
void disturb_dens_matrix_exact(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1365
intervalType lumoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:129
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:81
symmMatrix Fprev_alpha
Definition: SCF_unrestricted.h:108
intervalType lumoInterval_Fprev_beta
Definition: SCF_unrestricted.h:131
symmMatrix F_ort_prev_beta
Definition: SCF_unrestricted.h:113
symmMatrix densityMatrix_beta
Definition: SCF_unrestricted.h:105
int noOfElectrons_beta
Definition: SCF_unrestricted.h:135
void compute_gradient_fixeddens()
Definition: SCF_unrestricted.cc:1370
int alpha_beta_diff
Definition: SCF_unrestricted.h:133
void combine_old_fock_matrices(ergo_real stepLength)
Definition: SCF_unrestricted.cc:722
SCF_unrestricted(const Molecule &molecule_, const Molecule &extraCharges_, const BasisInfoStruct &basisInfo_, const BasisInfoStruct &basisInfoDensFit_, 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:44
symmMatrix bestFockMatrixSoFar_beta
Definition: SCF_unrestricted.h:115
Definition: basisinfo.h:111
Definition: scf.h:43
void write_diag_dens_to_file()
Definition: SCF_unrestricted.cc:1134
intervalType homoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:124
void initialize_matrices()
Definition: SCF_unrestricted.cc:101
void get_2e_part_and_energy()
Definition: SCF_unrestricted.cc:419
void initialize_homo_lumo_limits()
Definition: SCF_unrestricted.cc:364
void compute_dipole_moment()
Definition: SCF_unrestricted.cc:1243
void create_gabedit_file() const
Definition: SCF_unrestricted.cc:1342
void save_density_as_prevdens()
Definition: SCF_unrestricted.cc:1201
void do_spin_flip(int atomCount)
Definition: SCF_unrestricted.cc:1037
symmMatrix densityMatrix_alpha
Definition: SCF_unrestricted.h:104
void create_lumo_eigvec_file() const
Definition: SCF_unrestricted.cc:1337
void output_density_images()
Definition: SCF_unrestricted.cc:988
void save_current_fock_as_fprev()
Definition: SCF_unrestricted.cc:791
void save_full_matrices_for_matlab()
Definition: SCF_unrestricted.cc:1150
normalMatrix ErrorMatrix_alpha
Definition: SCF_unrestricted.h:118
symmMatrix Dprev_alpha
Definition: SCF_unrestricted.h:110
symmMatrix G_alpha
Definition: SCF_unrestricted.h:120
void report_density_difference()
Definition: SCF_unrestricted.cc:1219
intervalType homoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:126
symmMatrix FockMatrix_alpha
Definition: SCF_unrestricted.h:106
void write_matrices_to_file()
Definition: SCF_unrestricted.cc:379
void create_mtx_files_F(int const scfIter)
Definition: SCF_unrestricted.cc:1285
void output_sparsity_S_F_D(SCF_statistics &stats)
Definition: SCF_unrestricted.cc:570
An object respresenting the configuration of the matrix library.
Definition: scf.h:241
~SCF_unrestricted()
Definition: SCF_unrestricted.cc:77
void output_csr_matrices_for_gao()
Definition: SCF_unrestricted.cc:1128
intervalType lumoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:125
void get_starting_guess_density()
Definition: SCF_unrestricted.cc:150
void calculate_energy()
Definition: SCF_unrestricted.cc:593
void get_no_of_electrons(int &noOfElectrons_a, int &noOfElectrons_b)
Definition: SCF_unrestricted.cc:94
intervalType homoInterval_Fprev_beta
Definition: SCF_unrestricted.h:130
void report_final_results()
Definition: SCF_unrestricted.cc:1156