ergo
SCF_unrestricted.h
Go to the documentation of this file.
1 /* Ergo, version 3.7, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2018 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_homo_eigvec_file() const; */
105  /* void create_lumo_eigvec_file() const; */
106  void create_eigenvectors_files() const;
107  void create_eigvec_file(const generalVector &eigVec_alpha,
108  const generalVector &eigVec_beta,
109  const char *vector_name,
110  const char *filename_id) const;
111  void create_gabedit_file() const;
112  void create_gabedit_file_2() const;
113  void compute_dipole_moment();
114  void do_mulliken_pop_stuff();
116 
117  void get_S2(ergo_real & S2_exact, ergo_real & S2);
118 
127  symmMatrix F_ort_prev_alpha; // Used by purification
128  symmMatrix F_ort_prev_beta; // Used by purification
129  symmMatrix D_ort_prev_alpha; // Used for computing eigenvectors
130  symmMatrix D_ort_prev_beta; // Used for computing eigenvectors
139 
140  // HOMO/LUMO info
149 
153 
158 };
159 
160 
161 
162 
163 
164 #endif
void get_error_measure()
Definition: SCF_unrestricted.cc:599
symmMatrix G_beta
Definition: SCF_unrestricted.h:138
intervalType homoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:145
double ergo_real
Definition: realtype.h:69
void get_FDSminusSDF()
Definition: SCF_unrestricted.cc:558
void clear_diis_list()
Definition: SCF_unrestricted.cc:720
void get_Fock_matrices(symmMatrix &FockMatrix_a, symmMatrix &FockMatrix_b)
Definition: SCF_unrestricted.cc:94
void add_random_disturbance_to_starting_guess()
Definition: SCF_unrestricted.cc:286
symmMatrix FockMatrix_beta
Definition: SCF_unrestricted.h:122
void get_S2(ergo_real &S2_exact, ergo_real &S2)
Definition: SCF_unrestricted.cc:1132
Normal matrix.
Definition: MatrixBase.h:49
Definition: SCF_unrestricted.h:44
A structure describing the grid settings.
Definition: grid_params.h:59
void add_to_DIIS_list()
Definition: SCF_unrestricted.cc:619
generalVector eigVecHOMO_alpha
Definition: SCF_unrestricted.h:155
void disturb_fock_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1685
void disturb_dens_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1690
int noOfElectrons_alpha
Definition: SCF_unrestricted.h:151
void use_diis_to_get_new_fock_matrix()
Definition: SCF_unrestricted.cc:695
void create_gabedit_file() const
Definition: SCF_unrestricted.cc:1517
void write_density_to_file()
Definition: SCF_unrestricted.cc:897
symmMatrix bestFockMatrixSoFar2_beta
Definition: SCF_unrestricted.h:134
symmMatrix bestFockMatrixSoFar2_alpha
Definition: SCF_unrestricted.h:133
normalMatrix ErrorMatrix_beta
Definition: SCF_unrestricted.h:136
Definition: integrals_2el.h:44
intervalType lumoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:144
const SCF::MatOptions & matOpts
Definition: SCF_general.h:87
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
Definition: SCF_statistics.h:57
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:1408
void clear_error_matrices()
Definition: SCF_unrestricted.cc:728
symmMatrix Dprev_beta
Definition: SCF_unrestricted.h:126
const SCF::Options & scfopts
Definition: SCF_general.h:86
MatrixSymmetric< real, matri > symmMatrix
Definition: test_LanczosSeveralLargestEig.cc:69
void check_params()
Definition: SCF_unrestricted.cc:154
void get_new_density_matrix()
Definition: SCF_unrestricted.cc:756
Representation of a molecule as a set of nuclei and total charge.
Definition: molecule.h:87
void create_mtx_files_D(int const scfIter)
Definition: SCF_unrestricted.cc:1276
Definition: SCF_general.h:51
void do_mulliken_pop_stuff()
Definition: SCF_unrestricted.cc:1223
symmMatrix F_ort_prev_alpha
Definition: SCF_unrestricted.h:127
void update_best_fock_so_far()
Definition: SCF_unrestricted.cc:639
generalVector eigVecLUMO_alpha
Definition: SCF_unrestricted.h:154
symmMatrix bestFockMatrixSoFar_alpha
Definition: SCF_unrestricted.h:131
void save_final_potential()
Definition: SCF_unrestricted.cc:945
symmMatrix Fprev_beta
Definition: SCF_unrestricted.h:124
symmMatrix D_ort_prev_beta
Definition: SCF_unrestricted.h:130
void update_subspace_diff()
Definition: SCF_unrestricted.cc:1679
Class for self-consistent field (SCF) procedure; base class that can be used for both restricted and ...
void disturb_dens_matrix_exact(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1695
intervalType lumoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:146
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:93
generalVector eigVecLUMO_beta
Definition: SCF_unrestricted.h:156
symmMatrix Fprev_alpha
Definition: SCF_unrestricted.h:123
intervalType lumoInterval_Fprev_beta
Definition: SCF_unrestricted.h:148
symmMatrix F_ort_prev_beta
Definition: SCF_unrestricted.h:128
symmMatrix densityMatrix_beta
Definition: SCF_unrestricted.h:120
int noOfElectrons_beta
Definition: SCF_unrestricted.h:152
void compute_gradient_fixeddens()
Definition: SCF_unrestricted.cc:1700
symmMatrix D_ort_prev_alpha
Definition: SCF_unrestricted.h:129
int alpha_beta_diff
Definition: SCF_unrestricted.h:150
void combine_old_fock_matrices(ergo_real stepLength)
Definition: SCF_unrestricted.cc:668
symmMatrix bestFockMatrixSoFar_beta
Definition: SCF_unrestricted.h:132
Definition: basisinfo.h:112
Definition: scf.h:53
void write_diag_dens_to_file()
Definition: SCF_unrestricted.cc:1102
intervalType homoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:141
void initialize_matrices()
Definition: SCF_unrestricted.cc:112
void get_2e_part_and_energy()
Definition: SCF_unrestricted.cc:369
generalVector eigVecHOMO_beta
Definition: SCF_unrestricted.h:157
void initialize_homo_lumo_limits()
Definition: SCF_unrestricted.cc:314
void compute_dipole_moment()
Definition: SCF_unrestricted.cc:1211
void save_density_as_prevdens()
Definition: SCF_unrestricted.cc:1169
void create_eigenvectors_files() const
Definition: SCF_unrestricted.cc:1394
void do_spin_flip(int atomCount)
Definition: SCF_unrestricted.cc:1012
symmMatrix densityMatrix_alpha
Definition: SCF_unrestricted.h:119
void create_gabedit_file_2() const
Definition: SCF_unrestricted.cc:1674
void output_density_images()
Definition: SCF_unrestricted.cc:968
void save_current_fock_as_fprev()
Definition: SCF_unrestricted.cc:737
void save_full_matrices_for_matlab()
Definition: SCF_unrestricted.cc:1118
normalMatrix ErrorMatrix_alpha
Definition: SCF_unrestricted.h:135
symmMatrix Dprev_alpha
Definition: SCF_unrestricted.h:125
symmMatrix G_alpha
Definition: SCF_unrestricted.h:137
void report_density_difference()
Definition: SCF_unrestricted.cc:1187
intervalType homoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:143
symmMatrix FockMatrix_alpha
Definition: SCF_unrestricted.h:121
void write_matrices_to_file()
Definition: SCF_unrestricted.cc:329
void create_mtx_files_F(int const scfIter)
Definition: SCF_unrestricted.cc:1253
void output_sparsity_S_F_D(SCF_statistics &stats)
Definition: SCF_unrestricted.cc:516
An object respresenting the configuration of the matrix library.
Definition: scf.h:268
~SCF_unrestricted()
Definition: SCF_unrestricted.cc:88
void output_density_images_orbital(generalVector &eigVec, const std::string &filename_id)
Definition: SCF_unrestricted.cc:961
intervalType lumoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:142
void get_starting_guess_density()
Definition: SCF_unrestricted.cc:161
void output_expected_values_pos_operator()
Definition: SCF_unrestricted.cc:953
void calculate_energy()
Definition: SCF_unrestricted.cc:539
void get_no_of_electrons(int &noOfElectrons_a, int &noOfElectrons_b)
Definition: SCF_unrestricted.cc:105
intervalType homoInterval_Fprev_beta
Definition: SCF_unrestricted.h:147
void report_final_results()
Definition: SCF_unrestricted.cc:1124