ergo
puri_info.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 
42 #ifndef PURI_INFO_HEADER
43 #define PURI_INFO_HEADER
44 
45 #include "output.h"
46 #include "matrix_typedefs.h" // definitions of matrix types and interval type
47 #include "realtype.h" // definitions of types
48 
49 //#define CHECK_IF_STOPPED_TOO_LATE_OR_TOO_EARLY
50 
51 
53  public:
54  typedef ergo_real real;
55 
56  int it; //iteration number
78  int poly;
79  real gap; // estimated gap
82  // bounds for homo and lumo during iterations
83  // [lumo_low, lumo_upp] and [1-homo_upp, 1-homo_low]
88 
90 
91  real alpha; // for SP2 accelerated
92 
94 
95 
97  it(-1),
98  threshold_X(0),
99  Xsquare_time(0),
100  trunc_time(0),
101  purify_time(0),
102  total_time(0),
104  eucl_diff_time(0),
105  trace_diff_time(0),
106  mixed_diff_time(0),
107  frob_diff_time(0),
114  XmX2_trace(-1),
115  XmX2_fro_norm(-1),
116  XmX2_mixed_norm(-1),
117  XmX2_eucl(-1),
118  order(0),
119  poly(-1),
120  gap(-1),
121  NNZ_X(0),
122  NNZ_X2(0),
123  homo_bound_low(0),
124  homo_bound_upp(0),
125  lumo_bound_low(0),
126  lumo_bound_upp(0),
128  alpha(0),
129  constantC(0)
130  {};
131 
132 
133 };
134 
135 
136 class PuriInfo{
137  public:
138  typedef ergo_real real;
139 
141  method(0),
143  total_it(0),
144  converged(0),
145  error_subspace(0),
156  debug_output(0)
157  {};
158 
159 
160  void print_collected_info();
162 
163  void get_poly_seq(std::vector<int> &norms);
164  void get_vec_frob_norms(std::vector<real> &norms);
165  void get_vec_mixed_norms(std::vector<real> &norms);
166  void get_vec_traces(std::vector<real> & traces);
167 
168  void get_spectrum_bounds(real &lower_spectrum_bound_, real &upper_spectrum_bound_) const;
169  void set_spectrum_bounds(const real lower_spectrum_bound_, const real upper_spectrum_bound_);
170 
171  int method; // 1 for SP2, 2 for SP2 accelerated
172 
173  int stopping_criterion; // 1 if new, 0 if not
176  int total_it;
180 
181  int converged; // 1 if converged, 0 otherwise
182 
183  real error_subspace; // expected maximum error in subspace
184  real accumulated_error_subspace; // accumulated error in subspace
185 
190 
202 
203  std::vector<IterationInfo> Iterations;
205 
208 
209 };
210 
211 #endif
real accumulated_error_subspace
Definition: puri_info.h:184
real lumo_estim_low_F
Definition: puri_info.h:189
real total_time
Definition: puri_info.h:61
real lumo_bound_upp
Definition: puri_info.h:87
void set_spectrum_bounds(const real lower_spectrum_bound_, const real upper_spectrum_bound_)
Definition: puri_info.cc:92
double ergo_real
Definition: realtype.h:69
Functionality for writing output messages to a text file.
real homo_estim_upp_F
Definition: puri_info.h:186
void get_vec_traces(std::vector< real > &traces)
Definition: puri_info.cc:76
int estim_total_it
Definition: puri_info.h:178
real lumo_bound_low
Definition: puri_info.h:86
real homo_bound_upp
Definition: puri_info.h:85
int debug_output
Definition: puri_info.h:204
real lower_spectrum_bound
Definition: puri_info.h:207
real upper_spectrum_bound
Definition: puri_info.h:206
real total_time
Definition: puri_info.h:175
bool homo_eigenvector_is_computed
Definition: puri_info.h:192
int lumo_eigenvector_is_computed_in_iter
Definition: puri_info.h:195
int homo_eigensolver_iter
Definition: puri_info.h:196
int stopping_criterion
Definition: puri_info.h:173
real eigValLUMO
Definition: puri_info.h:201
real alpha
Definition: puri_info.h:91
real homo_bound_low
Definition: puri_info.h:84
real XmX2_mixed_norm
Definition: puri_info.h:75
double homo_eigensolver_time
Definition: puri_info.h:198
void get_spectrum_bounds(real &lower_spectrum_bound_, real &upper_spectrum_bound_) const
Definition: puri_info.cc:86
int poly
Definition: puri_info.h:78
void get_poly_seq(std::vector< int > &norms)
Definition: puri_info.cc:47
std::vector< IterationInfo > Iterations
Definition: puri_info.h:203
real DX_mult_homo_time
Definition: puri_info.h:69
real trunc_time
Definition: puri_info.h:59
void get_vec_mixed_norms(std::vector< real > &norms)
Definition: puri_info.cc:66
ergo_real real
Definition: test.cc:46
real frob_diff_time
Definition: puri_info.h:66
ergo_real real
Definition: puri_info.h:138
int total_it
Definition: puri_info.h:176
real Xsquare_time
Definition: puri_info.h:58
Definition of the main floating-point datatype used; the ergo_real type.
ergo_real real
Definition: puri_info.h:54
void print_collected_info_printf()
Definition: puri_info.cc:180
real NNZ_X
Definition: puri_info.h:80
real error_subspace
Definition: puri_info.h:183
PuriInfo()
Definition: puri_info.h:140
real orbital_homo_time
Definition: puri_info.h:67
real purify_time
Definition: puri_info.h:60
real commutation_error
Definition: puri_info.h:89
int method
Definition: puri_info.h:171
int it
Definition: puri_info.h:56
real constantC
Definition: puri_info.h:93
Header file with typedefs for matrix and vector types.
Definition: puri_info.h:136
real mixed_diff_time
Definition: puri_info.h:65
real eigValHOMO
Definition: puri_info.h:200
real homo_eig_solver_time
Definition: puri_info.h:71
Definition: puri_info.h:52
real lumo_eig_solver_time
Definition: puri_info.h:72
int homo_eigenvector_is_computed_in_iter
Definition: puri_info.h:194
int additional_iterations
Definition: puri_info.h:179
real XmX2_eucl
Definition: puri_info.h:76
real XmX2_fro_norm
Definition: puri_info.h:74
int converged
Definition: puri_info.h:181
void print_collected_info()
Definition: puri_info.cc:98
bool compute_eigenvectors_in_this_SCF_cycle
Definition: puri_info.h:191
real trace_diff_time
Definition: puri_info.h:64
real order
Definition: puri_info.h:77
real NNZ_X2
Definition: puri_info.h:81
real lumo_estim_upp_F
Definition: puri_info.h:188
real eucl_diff_time
Definition: puri_info.h:63
real XmX2_trace
Definition: puri_info.h:73
void get_vec_frob_norms(std::vector< real > &norms)
Definition: puri_info.cc:56
IterationInfo()
Definition: puri_info.h:96
real DX_mult_lumo_time
Definition: puri_info.h:70
real gap
Definition: puri_info.h:79
real norm_F_Fprev
Definition: puri_info.h:174
double lumo_eigensolver_time
Definition: puri_info.h:199
real homo_estim_low_F
Definition: puri_info.h:187
real orbital_lumo_time
Definition: puri_info.h:68
real time_spectrum_bounds
Definition: puri_info.h:177
int lumo_eigensolver_iter
Definition: puri_info.h:197
bool lumo_eigenvector_is_computed
Definition: puri_info.h:193
real stopping_criterion_time
Definition: puri_info.h:62
real threshold_X
Definition: puri_info.h:57