ergo
puri_info.h
Go to the documentation of this file.
1 /* Ergo, version 3.8, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2019 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
58  double Xsquare_time;
59  double trunc_time;
60  double purify_time;
61  double total_time;
64  double trace_diff_time ;
67  double nnz_time;
68  double inf_diff_time;
81  int poly;
82  real gap; // estimated gap
85  // bounds for homo and lumo during iterations
86  // [lumo_low, lumo_upp] and [1-homo_upp, 1-homo_low]
91 
93 
94  real alpha; // for SP2 accelerated
95 
97 
98 
100  it(-1),
101  threshold_X(0),
102  Xsquare_time(0),
103  trunc_time(0),
104  purify_time(0),
105  total_time(0),
107  eucl_diff_time(0),
108  trace_diff_time(0),
109  mixed_diff_time(0),
110  frob_diff_time(0),
111  nnz_time(0),
112  inf_diff_time(0),
119  XmX2_trace(-1),
120  XmX2_fro_norm(-1),
121  XmX2_mixed_norm(-1),
122  XmX2_eucl(-1),
123  order(0),
124  poly(-1),
125  gap(-1),
126  NNZ_X(0),
127  NNZ_X2(0),
128  homo_bound_low(0),
129  homo_bound_upp(0),
130  lumo_bound_low(0),
131  lumo_bound_upp(0),
133  alpha(0),
134  constantC(0)
135  {};
136 
137 
138 };
139 
140 
141 class PuriInfo{
142  public:
143  typedef ergo_real real;
144 
146  method(0),
148  total_it(0),
149  converged(0),
150  error_subspace(0),
162  debug_output(0)
163  {};
164 
165 
166  void print_collected_info();
168 
179 
180  void get_poly_seq(std::vector<int> &norms);
181  void get_vec_frob_norms(std::vector<real> &norms);
182  void get_vec_infty_norms(std::vector<real> &norms);
183  void get_vec_mixed_norms(std::vector<real> &norms);
184  void get_vec_traces(std::vector<real> & traces);
185 
186  void get_spectrum_bounds(real &lower_spectrum_bound_, real &upper_spectrum_bound_) const;
187  void set_spectrum_bounds(const real lower_spectrum_bound_, const real upper_spectrum_bound_);
188 
189  int method; // 1 for SP2, 2 for SP2 accelerated
190 
191  int stopping_criterion; // 1 if new, 0 if not
194  int total_it;
198 
199  int converged; // 1 if converged, 0 otherwise
200 
201  real error_subspace; // expected maximum error in subspace
202  real accumulated_error_subspace; // accumulated error in subspace
203 
205 
210 
222 
223  std::vector<IterationInfo> Iterations;
225 
228 
229 };
230 
231 #endif
Definition: puri_info.h:52
real homo_bound_upp
Definition: puri_info.h:88
real threshold_X
Definition: puri_info.h:57
real lumo_bound_upp
Definition: puri_info.h:90
double mixed_diff_time
Definition: puri_info.h:65
double nnz_time
Definition: puri_info.h:67
real XmX2_eucl
Definition: puri_info.h:79
double trunc_time
Definition: puri_info.h:59
double Xsquare_time
Definition: puri_info.h:58
double DX_mult_lumo_time
Definition: puri_info.h:72
double lumo_eig_solver_time
Definition: puri_info.h:74
real gap
Definition: puri_info.h:82
real order
Definition: puri_info.h:80
real NNZ_X2
Definition: puri_info.h:84
double DX_mult_homo_time
Definition: puri_info.h:71
int poly
Definition: puri_info.h:81
real homo_bound_low
Definition: puri_info.h:87
real constantC
Definition: puri_info.h:96
int it
Definition: puri_info.h:56
double frob_diff_time
Definition: puri_info.h:66
real lumo_bound_low
Definition: puri_info.h:89
double trace_diff_time
Definition: puri_info.h:64
double purify_time
Definition: puri_info.h:60
real XmX2_infty_norm
Definition: puri_info.h:77
ergo_real real
Definition: puri_info.h:54
double inf_diff_time
Definition: puri_info.h:68
real XmX2_fro_norm
Definition: puri_info.h:76
double orbital_homo_time
Definition: puri_info.h:69
IterationInfo()
Definition: puri_info.h:99
double total_time
Definition: puri_info.h:61
double homo_eig_solver_time
Definition: puri_info.h:73
double orbital_lumo_time
Definition: puri_info.h:70
real XmX2_mixed_norm
Definition: puri_info.h:78
real NNZ_X
Definition: puri_info.h:83
real XmX2_trace
Definition: puri_info.h:75
double eucl_diff_time
Definition: puri_info.h:63
double stopping_criterion_time
Definition: puri_info.h:62
real commutation_error
Definition: puri_info.h:92
real alpha
Definition: puri_info.h:94
Definition: puri_info.h:141
real get_total_Xtrunc_time()
Definition: puri_info.cc:56
real get_total_mixed_diff_time()
Definition: puri_info.cc:87
real time_spectrum_bounds
Definition: puri_info.h:195
real homo_estim_low_F
Definition: puri_info.h:207
real norm_F_Fprev
Definition: puri_info.h:192
int lumo_eigensolver_iter
Definition: puri_info.h:217
void print_collected_info()
Definition: puri_info.cc:187
real lumo_estim_upp_F
Definition: puri_info.h:208
void get_vec_mixed_norms(std::vector< real > &norms)
Definition: puri_info.cc:155
int additional_iterations
Definition: puri_info.h:197
real accumulated_error_subspace
Definition: puri_info.h:202
void get_vec_infty_norms(std::vector< real > &norms)
Definition: puri_info.cc:146
int method
Definition: puri_info.h:189
ergo_real real
Definition: puri_info.h:143
real eigValHOMO
Definition: puri_info.h:220
real homo_estim_upp_F
Definition: puri_info.h:206
real get_total_nnz_time()
Definition: puri_info.cc:64
int homo_eigenvector_is_computed_in_iter
Definition: puri_info.h:214
double lumo_eigensolver_time
Definition: puri_info.h:219
double homo_eigensolver_time
Definition: puri_info.h:218
void get_spectrum_bounds(real &lower_spectrum_bound_, real &upper_spectrum_bound_) const
Definition: puri_info.cc:175
real get_total_stopping_criterion_time()
Definition: puri_info.cc:102
real get_total_purify_time()
Definition: puri_info.cc:118
int lumo_eigenvector_is_computed_in_iter
Definition: puri_info.h:215
real error_subspace
Definition: puri_info.h:201
bool homo_eigenvector_is_computed
Definition: puri_info.h:212
real accumulated_time_calls_for_eigenvec_functions
Definition: puri_info.h:204
void print_collected_info_printf()
Definition: puri_info.cc:269
int estim_total_it
Definition: puri_info.h:196
PuriInfo()
Definition: puri_info.h:145
real get_total_trace_diff_time()
Definition: puri_info.cc:110
void get_vec_frob_norms(std::vector< real > &norms)
Definition: puri_info.cc:137
int debug_output
Definition: puri_info.h:224
real get_total_Xsquare_time()
Definition: puri_info.cc:48
bool compute_eigenvectors_in_this_SCF_cycle
Definition: puri_info.h:211
void get_vec_traces(std::vector< real > &traces)
Definition: puri_info.cc:165
real lower_spectrum_bound
Definition: puri_info.h:227
std::vector< IterationInfo > Iterations
Definition: puri_info.h:223
void get_poly_seq(std::vector< int > &norms)
Definition: puri_info.cc:128
int total_it
Definition: puri_info.h:194
int converged
Definition: puri_info.h:199
real get_total_frob_diff_time()
Definition: puri_info.cc:94
int stopping_criterion
Definition: puri_info.h:191
real upper_spectrum_bound
Definition: puri_info.h:226
bool lumo_eigenvector_is_computed
Definition: puri_info.h:213
real get_total_eucl_diff_time()
Definition: puri_info.cc:80
int homo_eigensolver_iter
Definition: puri_info.h:216
real total_time
Definition: puri_info.h:193
void set_spectrum_bounds(const real lower_spectrum_bound_, const real upper_spectrum_bound_)
Definition: puri_info.cc:181
real lumo_estim_low_F
Definition: puri_info.h:209
real eigValLUMO
Definition: puri_info.h:221
real get_total_inf_diff_time()
Definition: puri_info.cc:73
ergo_real real
Definition: test.cc:46
Header file with typedefs for matrix and vector types.
Functionality for writing output messages to a text file.
Definition of the main floating-point datatype used; the ergo_real type.
double ergo_real
Definition: realtype.h:69