PurificationGeneral is an abstract class which provides an interface for SP2, SP2ACC and possibly other recursive expansions. More...
#include <purification_general.h>
Public Types | |
typedef ergo_real | real |
typedef intervalType | IntervalType |
typedef mat::normType | NormType |
typedef std::vector< int > | VectorTypeInt |
typedef std::vector< real > | VectorTypeReal |
typedef generalVector | VectorType |
typedef MatrixType | MatrixTypeWrapper |
Public Member Functions | |
PurificationGeneral () | |
virtual void | initialize (const MatrixType &F_, const IntervalType &lumo_bounds_, const IntervalType &homo_bounds_, int maxit_, real error_sub_, real error_eig_, int use_new_stopping_criterion_, NormType norm_truncation, NormType norm_stop_crit, int nocc_) |
Set imporatant parameters for the recursive expansion. | |
virtual bool | is_initialized () const |
Check is function initialize() is already called. | |
virtual bool | puri_is_prepared () const |
Check is function prepare_to_purification() is already called. | |
virtual void | PurificationStart () |
Start recursive expansion. | |
virtual void | prepare_to_purification () |
Prepare data for recursive expansion. | |
virtual void | purification_process () |
Run recursive expansion. | |
virtual void | eigenvalue_bounds_estimation () |
Estimate eigenvalues near homo-lumo gap. | |
virtual | ~PurificationGeneral () |
virtual void | clear () |
Clear all matrices in the class. | |
void | set_spectrum_bounds (real eigmin, real eigmax) |
Set spectrum bounds. | |
void | get_spectrum_bounds (real &eigmin, real &eigmax) |
Get spectrum bounds. | |
int | get_exact_number_of_puri_iterations () |
int | get_est_number_of_puri_iterations () |
virtual real | total_subspace_error (int it) |
void | gen_matlab_file_norm_diff (const char *filename) const |
Create MATLAB .m file which plots the idempotency error in each recursive expansion iteration. | |
void | gen_matlab_file_threshold (const char *filename) const |
Create MATLAB .m file which plots the actual introduced error after truncation of the matrix X_i in each recursive expansion iteration. | |
void | gen_matlab_file_nnz (const char *filename) const |
Create MATLAB .m file which plots the number of non-zero elements in matrices X_i and X_i^2 in each recursive expansion iteration. | |
void | gen_matlab_file_eigs (const char *filename) const |
Create MATLAB .m file which plots the homo and lumo bounds in each recursive expansion iteration. | |
void | gen_matlab_file_time (const char *filename) const |
Create MATLAB .m file which creates a bar plot presenting time spent on various parts of the iteration (such as matrix square and computation of eigenvectors) in each recursive expansion iteration. | |
void | gen_matlab_file_cond_num (const char *filename) const |
Create MATLAB .m file which plots a condition number of a problem of computing the density matrix in each recursive expansion iteration. | |
void | gen_python_file_nnz (const char *filename) const |
Create PYTHON .py file which plots number of non-zero elements in matrices X_i and X_i^2 in each recursive expansion iteration. | |
void | set_eigenvectors_params (string eigenvectors_method_, string eigenvectors_iterative_method_, real eigensolver_accuracy_, int eigensolver_maxiter_, int scf_step_, int use_prev_vector_as_initial_guess_, int try_eigv_on_next_iteration_if_fail_, VectorType *eigVecLUMO_, VectorType *eigVecHOMO_) |
Set parameters for computing eigenvectors. | |
void | set_compute_eigenvectors_in_each_iteration () |
void | unset_compute_eigenvectors_in_each_iteration () |
void | compute_eigenvectors_without_diagonalization_on_F (const MatrixType &F, int eigensolver_maxiter_for_F) |
Static Public Member Functions | |
static real | get_epsilon () |
Get machine epsilon. | |
static real | get_max_double () |
Get largest number. | |
static real | get_min_double () |
Get smallest number. | |
Public Attributes | |
PuriInfo | info |
Fill in during purification with useful information. | |
MatrixType | X |
Matrix X. | |
MatrixType | Xsq |
Matrix X^2. | |
Protected Member Functions | |
void | save_matrix_now (string str) |
void | compute_spectrum_bounds () |
Compute spectrum bounds. | |
void | compute_X () |
Get matrix X0 by mapping spectrum of F into [0,1] in reverse order. | |
void | map_bounds_to_0_1 () |
Get eigenvalue bounds for X0. | |
virtual void | check_standard_stopping_criterion (const real XmX2_norm, int &stop) |
Check stopping criterion (obsolete). | |
virtual void | check_new_stopping_criterion (const int it, const real XmX2_norm_it, const real XmX2_norm_itm2, const real XmX2_trace, int &stop, real &estim_order) |
Check stopping criterion. | |
virtual void | stopping_criterion (IterationInfo &iter_info, int &stop, real &estim_order) |
Choose stopping criterion and check it. | |
int | get_int_eig_iter_method (string eigenvectors_iterative_method) |
int | get_int_eig_method (string eigenvectors_method) |
void | compute_eigenvectors_without_diagonalization (int it, IterationInfo &iter_info) |
Compute HOMO and LUMO eigenvalues and eigenvectors of the matrix F. | |
void | compute_eigenvectors_without_diagonalization_last_iter_proj () |
void | compute_eigenvector (MatrixType const &M, VectorType *eigVecHOMOorLUMO, int it, bool is_homo) |
double | get_nnz_X (size_t &nnzX) |
Get nnz of X in %. | |
double | get_nnz_X () |
Get nnz of X in %. | |
double | get_nnz_Xsq (size_t &nnzXsq) |
Get nnz of X^2 in %. | |
double | get_nnz_Xsq () |
Get nnz of X^2 in %. | |
void | estimate_homo_lumo (const VectorTypeReal &XmX2_norm_mixed, const VectorTypeReal &XmX2_norm_frob, const VectorTypeReal &XmX2_trace) |
Get homo and lumo bounds from traces and norms of Xi-Xi^2. | |
void | get_frob_norm_est (const VectorTypeReal &XmX2_norm_frob, const std::vector< real > &h_in, const std::vector< real > &l_in, VectorTypeReal &YmY2_norm_frob_est) |
void | get_eigenvalue_estimates (const VectorTypeReal &XmX2_norm_mixed, const VectorTypeReal &XmX2_norm_frob, const VectorTypeReal &XmX2_trace) |
void | propagate_values_in_each_iter (real value_unocc, real value_occ, VectorTypeReal &out_unocc, VectorTypeReal &out_occ, int nmax) |
void | determine_iteration_for_eigenvectors () |
void | get_iterations_for_lumo_and_homo (int &chosen_iter_lumo, int &chosen_iter_homo) |
Find the best iterations for computing eigenvectors. | |
void | check_eigenvectors_at_the_end () |
void | discard_homo_eigenvector () |
void | discard_lumo_eigenvector () |
void | output_norms_and_traces (IterationInfo &iter_info) const |
void | get_interval_with_lambda (real &eigVal, VectorType &eigVec, bool &is_homo, bool &is_lumo, const int iter) |
void | get_eigenvalue_of_F_from_eigv_of_Xi (real &eigVal, const VectorType &eigVec) |
void | save_eigenvectors_to_file (bool is_homo, bool is_lumo, int it) |
void | set_truncation_parameters () |
void | find_truncation_thresh_every_iter () |
void | find_shifts_every_iter () |
/brief Find shifts sigma which will be used for construction of the filtering polynomial for computing eigenvectors. | |
void | find_eig_gaps_every_iter () |
void | writeToTmpFile (MatrixType &A) const |
void | readFromTmpFile (MatrixType &A) const |
virtual void | set_init_params ()=0 |
virtual void | truncate_matrix (real &thresh, int it)=0 |
virtual void | estimate_number_of_iterations (int &estim_num_iter)=0 |
virtual void | purify_X (const int it)=0 |
virtual void | purify_bounds (const int it)=0 |
virtual void | save_other_iter_info (IterationInfo &iter_info, int it)=0 |
virtual void | apply_inverse_poly_vector (const int it, VectorTypeReal &bounds_from_it)=0 |
virtual void | return_constant_C (const int it, real &Cval)=0 |
virtual real | apply_poly (const int it, real x)=0 |
virtual void | apply_poly_to_eigs (const int it, real &homo, real &lumo)=0 |
virtual real | compute_derivative (const int it, real x, real &DDf)=0 |
Protected Attributes | |
MatrixType | F |
Matrix F. | |
MatrixType | X_homo |
MatrixType | X_lumo |
Save matrix Xi in certain iterations for computing eigenvectors (projection method). | |
bool | initialized_flag |
bool | puri_is_prepared_flag |
int | use_new_stopping_criterion |
True for new stopping criterion. | |
int | additional_iterations |
Do a few more iterations after convergence. | |
int | maxit |
Maximum number of iterations. | |
int | check_stopping_criterion_iter |
Iteration when to start to check stopping criterion. | |
int | nocc |
Number of occupied orbitals. | |
NormType | normPuriTrunc |
Norm used for the truncation of matrices. | |
NormType | normPuriStopCrit |
Norm used in the stopping criterion Can be mat::frobNorm, mat::mixedNorm, or mat::euclNorm. | |
real | error_sub |
Allowed error in invariant subspaces. | |
real | error_eig |
Error in eigenvalues (used just in old stopping criterion). | |
real | error_per_it |
Error allowed in each iteration due to truncation. | |
real | constant_C |
Asymptotic constant C needed for the new stopping criterion. | |
real | gammaStopEstim |
Used on the stopping criterion for estimation of eigenvalues from purification. | |
VectorTypeInt | VecPoly |
Polynomials computed in the function estimated_number_of_iterations() VecPoly[i] = 1 if we use X=X^2 VecPoly[i] = 0 if we use X=2X-X^2 (or their accelerated versions). | |
VectorTypeReal | VecGap |
Gap computed using inner homo and lumo bounds on each iteration. | |
VectorTypeReal | ITER_ERROR_VEC |
(Eigenvectors) Maximum error introduced in each iteration. | |
VectorTypeReal | SIGMA_HOMO_VEC |
VectorTypeReal | SIGMA_LUMO_VEC |
(Eigenvectors) Approximation of shifts in each iteration. | |
VectorTypeReal | EIG_ABS_GAP_LUMO_VEC |
VectorTypeReal | EIG_ABS_GAP_HOMO_VEC |
(Eigenvectors) Absolute and relative gap in filter for lumo eigenvalue. | |
VectorTypeReal | EIG_REL_GAP_LUMO_VEC |
VectorTypeReal | EIG_REL_GAP_HOMO_VEC |
(Eigenvectors) Absolute and relative gap in filter for homo eigenvalue. | |
int | number_of_eigenvalues |
IntervalType | homo_bounds |
(1-homo) bounds for Xi in iteration i | |
IntervalType | lumo_bounds |
Lumo bounds for Xi in iteration i. | |
IntervalType | homo_bounds_X0 |
Initial lumo bounds for X. | |
IntervalType | lumo_bounds_X0 |
Initial lumo bounds for X. | |
IntervalType | homo_bounds_F |
Initial lumo bounds for F. | |
IntervalType | lumo_bounds_F |
Initial homo bounds for F. | |
IntervalType | homo_bounds_F_new |
IntervalType | lumo_bounds_F_new |
IntervalType | spectrum_bounds |
Outer bounds for the whole spectrum of F/Xi. | |
bool | computed_spectrum_bounds |
int | eigenvectors_method |
Chosen method for computing eigenvectors. | |
int | eigenvectors_iterative_method |
Chosen eigensolver. | |
real | eigensolver_accuracy |
int | eigensolver_maxiter |
string | eigenvectors_method_str |
string | eigenvectors_iterative_method_str |
int | use_prev_vector_as_initial_guess |
bool | compute_eigenvectors_in_this_SCF_cycle |
bool | try_eigv_on_next_iteration_if_fail |
VectorType * | eigVecLUMO |
VectorType * | eigVecHOMO |
VectorType | eigVecLUMORef |
VectorType | eigVecHOMORef |
real | eigValLUMO |
real | eigValHOMO |
int | iter_for_homo |
int | iter_for_lumo |
VectorTypeInt | good_iterations_homo |
Iterations where homo eigenvector can be computed. | |
VectorTypeInt | good_iterations_lumo |
Iterations where homo eigenvector can be computed. | |
VectorTypeInt | really_good_iterations_homo |
Iterations where homo eigenvector is actually computed. | |
VectorTypeInt | really_good_iterations_lumo |
Iterations where lumo eigenvector is actually computed. | |
int | scf_step |
bool | compute_eigenvectors_in_each_iteration |
Compute homo and lumo eigenpairs in every iteration and save eigenvectors in txt files. |
PurificationGeneral is an abstract class which provides an interface for SP2, SP2ACC and possibly other recursive expansions.
MatrixType | Type of a matrix (ex. symmMatrix). |
typedef intervalType PurificationGeneral< MatrixType >::IntervalType |
Reimplemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
typedef MatrixType PurificationGeneral< MatrixType >::MatrixTypeWrapper |
typedef mat::normType PurificationGeneral< MatrixType >::NormType |
Reimplemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
typedef ergo_real PurificationGeneral< MatrixType >::real |
Reimplemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
typedef generalVector PurificationGeneral< MatrixType >::VectorType |
Reimplemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
typedef std::vector<int> PurificationGeneral< MatrixType >::VectorTypeInt |
Reimplemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
typedef std::vector<real> PurificationGeneral< MatrixType >::VectorTypeReal |
Reimplemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
PurificationGeneral< MatrixType >::PurificationGeneral | ( | ) | [inline] |
References PurificationGeneral< MatrixType >::compute_eigenvectors_in_each_iteration, PurificationGeneral< MatrixType >::computed_spectrum_bounds, PurificationGeneral< MatrixType >::eigVecHOMO, PurificationGeneral< MatrixType >::eigVecLUMO, PurificationGeneral< MatrixType >::initialized_flag, PurificationGeneral< MatrixType >::number_of_eigenvalues, and PurificationGeneral< MatrixType >::puri_is_prepared_flag.
virtual PurificationGeneral< MatrixType >::~PurificationGeneral | ( | ) | [inline, virtual] |
virtual void PurificationGeneral< MatrixType >::apply_inverse_poly_vector | ( | const int | it, | |
VectorTypeReal & | bounds_from_it | |||
) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::estimate_homo_lumo().
virtual real PurificationGeneral< MatrixType >::apply_poly | ( | const int | it, | |
real | x | |||
) | [protected, pure virtual] |
virtual void PurificationGeneral< MatrixType >::apply_poly_to_eigs | ( | const int | it, | |
real & | homo, | |||
real & | lumo | |||
) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::propagate_values_in_each_iter().
void PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end | ( | ) | [inline, protected] |
References PurificationGeneral< MatrixType >::compute_eigenvectors_in_this_SCF_cycle, PuriInfo::converged, PurificationGeneral< MatrixType >::discard_homo_eigenvector(), PurificationGeneral< MatrixType >::discard_lumo_eigenvector(), do_output(), PuriInfo::eigValHOMO, PurificationGeneral< MatrixType >::eigValHOMO, PuriInfo::eigValLUMO, PurificationGeneral< MatrixType >::eigValLUMO, PurificationGeneral< MatrixType >::eigVecHOMO, PurificationGeneral< MatrixType >::eigVecLUMO, PuriInfo::homo_eigenvector_is_computed, PuriInfo::homo_estim_low_F, PuriInfo::homo_estim_upp_F, PurificationGeneral< MatrixType >::info, mat::VectorGeneral< Treal, Tvector >::is_empty(), PurificationGeneral< MatrixType >::iter_for_homo, PurificationGeneral< MatrixType >::iter_for_lumo, LOG_AREA_DENSFROMF, LOG_CAT_INFO, LOG_CAT_WARNING, PuriInfo::lumo_eigenvector_is_computed, PuriInfo::lumo_estim_low_F, PuriInfo::lumo_estim_upp_F, THRESHOLD_EIG_TOLERANCE, PuriInfo::total_it, and UNIT_one_eV.
Referenced by PurificationGeneral< MatrixType >::PurificationStart().
void PurificationGeneral< MatrixType >::check_new_stopping_criterion | ( | const int | it, | |
const real | XmX2_norm_it, | |||
const real | XmX2_norm_itm2, | |||
const real | XmX2_trace, | |||
int & | stop, | |||
real & | estim_order | |||
) | [inline, protected, virtual] |
Check stopping criterion.
The new stopping criterion based on the order of convergence is used, see article "Parameterless Stopping Criteria for Recursive Density Matrix Expansions", J. Chem. Theory Comput., 2016, 12 (12), pp 5788–5802 DOI: 10.1021/acs.jctc.6b00626
References PurificationGeneral< MatrixType >::constant_C, do_output(), PurificationGeneral< MatrixType >::get_epsilon(), LOG_AREA_DENSFROMF, LOG_CAT_INFO, ORDER, PurificationGeneral< MatrixType >::return_constant_C(), template_blas_log(), template_blas_pow(), template_blas_sqrt(), and PurificationGeneral< MatrixType >::VecPoly.
Referenced by PurificationGeneral< MatrixType >::stopping_criterion().
void PurificationGeneral< MatrixType >::check_standard_stopping_criterion | ( | const real | XmX2_norm, | |
int & | stop | |||
) | [inline, protected, virtual] |
Check stopping criterion (obsolete).
Use stopping criterion based on user defined threshold values.
References do_output(), PurificationGeneral< MatrixType >::error_eig, PurificationGeneral< MatrixType >::homo_bounds, LOG_AREA_DENSFROMF, LOG_CAT_INFO, PurificationGeneral< MatrixType >::lumo_bounds, and mat::Interval< Treal >::upp().
Referenced by PurificationGeneral< MatrixType >::stopping_criterion().
virtual void PurificationGeneral< MatrixType >::clear | ( | ) | [inline, virtual] |
Clear all matrices in the class.
Needed to be called if Chunks and Tasks are used, since we need to delete all ChunkIDs before exiting the program.
References PurificationGeneral< MatrixType >::X, and PurificationGeneral< MatrixType >::Xsq.
Referenced by GetDensFromFock::get_dens_from_fock_sparse(), and main().
virtual real PurificationGeneral< MatrixType >::compute_derivative | ( | const int | it, | |
real | x, | |||
real & | DDf | |||
) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo().
void PurificationGeneral< MatrixType >::compute_eigenvector | ( | MatrixType const & | M, | |
VectorType * | eigVecHOMOorLUMO, | |||
int | it, | |||
bool | is_homo | |||
) | [inline, protected] |
References PurificationGeneral< MatrixType >::compute_eigenvectors_in_each_iteration, eigvec::computeEigenvectors(), do_output(), PurificationGeneral< MatrixType >::eigensolver_accuracy, PurificationGeneral< MatrixType >::eigensolver_maxiter, PurificationGeneral< MatrixType >::eigenvectors_iterative_method_str, PurificationGeneral< MatrixType >::eigValHOMO, PurificationGeneral< MatrixType >::eigValLUMO, PurificationGeneral< MatrixType >::eigVecHOMO, PurificationGeneral< MatrixType >::eigVecHOMORef, PurificationGeneral< MatrixType >::eigVecLUMO, PurificationGeneral< MatrixType >::eigVecLUMORef, Util::TimeMeter::get_elapsed_wall_seconds(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), PuriInfo::homo_eigensolver_iter, PuriInfo::homo_eigensolver_time, PuriInfo::homo_eigenvector_is_computed, PuriInfo::homo_eigenvector_is_computed_in_iter, PurificationGeneral< MatrixType >::info, mat::VectorGeneral< Treal, Tvector >::is_empty(), LOG_AREA_DENSFROMF, LOG_CAT_INFO, PuriInfo::lumo_eigensolver_iter, PuriInfo::lumo_eigensolver_time, PuriInfo::lumo_eigenvector_is_computed, PuriInfo::lumo_eigenvector_is_computed_in_iter, PurificationGeneral< MatrixType >::number_of_eigenvalues, Util::TimeMeter::print(), PurificationGeneral< MatrixType >::really_good_iterations_homo, PurificationGeneral< MatrixType >::really_good_iterations_lumo, rows, PurificationGeneral< MatrixType >::save_eigenvectors_to_file(), PurificationGeneral< MatrixType >::use_prev_vector_as_initial_guess, and PurificationGeneral< MatrixType >::X.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), and PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj().
void PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization | ( | int | it, | |
IterationInfo & | iter_info | |||
) | [inline, protected] |
Compute HOMO and LUMO eigenvalues and eigenvectors of the matrix F.
The method uses the polynomial constructed during the recursive expansion, so no additional matrix multiplications are required. See article J. Chem. Theory Comput., Just Accepted Manuscript, DOI: 10.1021/acs.jctc.7b00968
References PurificationGeneral< MatrixType >::compute_eigenvector(), PurificationGeneral< MatrixType >::compute_eigenvectors_in_each_iteration, do_output(), EIG_SQUARE_INT, PurificationGeneral< MatrixType >::eigenvectors_method, PurificationGeneral< MatrixType >::eigVecHOMO, PurificationGeneral< MatrixType >::eigVecLUMO, Util::TimeMeter::get_elapsed_wall_seconds(), PurificationGeneral< MatrixType >::good_iterations_homo, PurificationGeneral< MatrixType >::good_iterations_lumo, IterationInfo::homo_eig_solver_time, PuriInfo::homo_eigenvector_is_computed, PurificationGeneral< MatrixType >::info, PurificationGeneral< MatrixType >::iter_for_homo, PurificationGeneral< MatrixType >::iter_for_lumo, LOG_AREA_DENSFROMF, LOG_CAT_INFO, IterationInfo::lumo_eig_solver_time, PuriInfo::lumo_eigenvector_is_computed, IterationInfo::orbital_homo_time, IterationInfo::orbital_lumo_time, Util::TimeMeter::print(), PurificationGeneral< MatrixType >::readFromTmpFile(), PurificationGeneral< MatrixType >::save_matrix_now(), PurificationGeneral< MatrixType >::SIGMA_HOMO_VEC, PurificationGeneral< MatrixType >::SIGMA_LUMO_VEC, PurificationGeneral< MatrixType >::writeToTmpFile(), PurificationGeneral< MatrixType >::X, PurificationGeneral< MatrixType >::X_homo, PurificationGeneral< MatrixType >::X_lumo, and PurificationGeneral< MatrixType >::Xsq.
Referenced by PurificationGeneral< MatrixType >::purification_process().
void PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj | ( | ) | [inline, protected] |
References cols, PurificationGeneral< MatrixType >::compute_eigenvector(), PurificationGeneral< MatrixType >::compute_eigenvectors_in_each_iteration, do_output(), PurificationGeneral< MatrixType >::eigVecHOMO, PurificationGeneral< MatrixType >::eigVecLUMO, Util::TimeMeter::get_elapsed_wall_seconds(), PurificationGeneral< MatrixType >::info, PurificationGeneral< MatrixType >::iter_for_homo, PurificationGeneral< MatrixType >::iter_for_lumo, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, output_current_memory_usage(), Util::TimeMeter::print(), PurificationGeneral< MatrixType >::readFromTmpFile(), rows, PuriInfo::total_it, mat::FileWritable::writeAndReadAll(), PurificationGeneral< MatrixType >::X, PurificationGeneral< MatrixType >::X_homo, PurificationGeneral< MatrixType >::X_lumo, and PurificationGeneral< MatrixType >::Xsq.
Referenced by PurificationGeneral< MatrixType >::PurificationStart().
void PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_on_F | ( | const MatrixType & | F, | |
int | eigensolver_maxiter_for_F | |||
) | [inline] |
References eigvec::computeEigenvectors(), PurificationGeneral< MatrixType >::eigensolver_accuracy, PurificationGeneral< MatrixType >::eigenvectors_iterative_method_str, PurificationGeneral< MatrixType >::homo_bounds_F, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds_F, rows, and mat::Interval< Treal >::upp().
Referenced by GetDensFromFock::get_dens_from_fock_sparse(), and main().
void PurificationGeneral< MatrixType >::compute_spectrum_bounds | ( | ) | [inline, protected] |
Compute spectrum bounds.
References PurificationGeneral< MatrixType >::computed_spectrum_bounds, do_output(), PurificationGeneral< MatrixType >::get_epsilon(), LOG_AREA_DENSFROMF, LOG_CAT_INFO, Util::TimeMeter::print(), PurificationGeneral< MatrixType >::spectrum_bounds, template_blas_sqrt(), and PurificationGeneral< MatrixType >::X.
Referenced by PurificationGeneral< MatrixType >::get_spectrum_bounds(), and PurificationGeneral< MatrixType >::prepare_to_purification().
void PurificationGeneral< MatrixType >::compute_X | ( | ) | [inline, protected] |
Get matrix X0 by mapping spectrum of F into [0,1] in reverse order.
References do_output(), mat::Interval< Treal >::empty(), LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::spectrum_bounds, mat::Interval< Treal >::upp(), and PurificationGeneral< MatrixType >::X.
Referenced by PurificationGeneral< MatrixType >::prepare_to_purification().
void PurificationGeneral< MatrixType >::determine_iteration_for_eigenvectors | ( | ) | [inline, protected] |
References do_output(), EIG_PROJECTION_INT, EIG_SQUARE_INT, PurificationGeneral< MatrixType >::eigenvectors_method, PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo(), PurificationGeneral< MatrixType >::iter_for_homo, PurificationGeneral< MatrixType >::iter_for_lumo, LOG_AREA_DENSFROMF, and LOG_CAT_INFO.
Referenced by PurificationGeneral< MatrixType >::prepare_to_purification().
void PurificationGeneral< MatrixType >::discard_homo_eigenvector | ( | ) | [inline, protected] |
References mat::VectorGeneral< Treal, Tvector >::clear_structure(), PuriInfo::eigValHOMO, PurificationGeneral< MatrixType >::eigVecHOMO, PuriInfo::homo_eigenvector_is_computed, PurificationGeneral< MatrixType >::info, and mat::VectorGeneral< Treal, Tvector >::is_empty().
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end().
void PurificationGeneral< MatrixType >::discard_lumo_eigenvector | ( | ) | [inline, protected] |
References mat::VectorGeneral< Treal, Tvector >::clear_structure(), PuriInfo::eigValLUMO, PurificationGeneral< MatrixType >::eigVecLUMO, PurificationGeneral< MatrixType >::info, mat::VectorGeneral< Treal, Tvector >::is_empty(), and PuriInfo::lumo_eigenvector_is_computed.
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end().
void PurificationGeneral< MatrixType >::eigenvalue_bounds_estimation | ( | ) | [inline, virtual] |
Estimate eigenvalues near homo-lumo gap.
References PuriInfo::converged, do_output(), PurificationGeneral< MatrixType >::get_eigenvalue_estimates(), PuriInfo::get_vec_frob_norms(), PuriInfo::get_vec_mixed_norms(), PuriInfo::get_vec_traces(), PurificationGeneral< MatrixType >::homo_bounds_F_new, PuriInfo::homo_estim_low_F, PuriInfo::homo_estim_upp_F, PurificationGeneral< MatrixType >::info, LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds_F_new, PuriInfo::lumo_estim_low_F, PuriInfo::lumo_estim_upp_F, mat::mixedNorm, PurificationGeneral< MatrixType >::normPuriStopCrit, and mat::Interval< Treal >::upp().
Referenced by PurificationGeneral< MatrixType >::PurificationStart().
void PurificationGeneral< MatrixType >::estimate_homo_lumo | ( | const VectorTypeReal & | XmX2_norm_mixed, | |
const VectorTypeReal & | XmX2_norm_frob, | |||
const VectorTypeReal & | XmX2_trace | |||
) | [inline, protected] |
Get homo and lumo bounds from traces and norms of Xi-Xi^2.
Used at the end of the recursive expansion. See article SIAM J. Sci. Comput., 36(2), B147–B170.
References PuriInfo::additional_iterations, PurificationGeneral< MatrixType >::apply_inverse_poly_vector(), PurificationGeneral< MatrixType >::gammaStopEstim, PurificationGeneral< MatrixType >::get_epsilon(), PurificationGeneral< MatrixType >::homo_bounds_F_new, PurificationGeneral< MatrixType >::info, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds_F_new, min(), PurificationGeneral< MatrixType >::spectrum_bounds, template_blas_sqrt(), PuriInfo::total_it, and mat::Interval< Treal >::upp().
Referenced by PurificationGeneral< MatrixType >::get_eigenvalue_estimates().
virtual void PurificationGeneral< MatrixType >::estimate_number_of_iterations | ( | int & | estim_num_iter | ) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::set_truncation_parameters().
void PurificationGeneral< MatrixType >::find_eig_gaps_every_iter | ( | ) | [inline, protected] |
References PurificationGeneral< MatrixType >::apply_poly(), PurificationGeneral< MatrixType >::EIG_ABS_GAP_HOMO_VEC, PurificationGeneral< MatrixType >::EIG_ABS_GAP_LUMO_VEC, PurificationGeneral< MatrixType >::EIG_REL_GAP_HOMO_VEC, PurificationGeneral< MatrixType >::EIG_REL_GAP_LUMO_VEC, PurificationGeneral< MatrixType >::homo_bounds_X0, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds_X0, max, PurificationGeneral< MatrixType >::maxit, min(), PurificationGeneral< MatrixType >::SIGMA_HOMO_VEC, PurificationGeneral< MatrixType >::SIGMA_LUMO_VEC, mat::Interval< Treal >::upp(), and mat::zero.
void PurificationGeneral< MatrixType >::find_shifts_every_iter | ( | ) | [inline, protected] |
/brief Find shifts sigma which will be used for construction of the filtering polynomial for computing eigenvectors.
References PurificationGeneral< MatrixType >::apply_poly(), PurificationGeneral< MatrixType >::homo_bounds, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds, PurificationGeneral< MatrixType >::maxit, PurificationGeneral< MatrixType >::SIGMA_HOMO_VEC, PurificationGeneral< MatrixType >::SIGMA_LUMO_VEC, and mat::Interval< Treal >::upp().
Referenced by PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo().
void PurificationGeneral< MatrixType >::find_truncation_thresh_every_iter | ( | ) | [inline, protected] |
void PurificationGeneral< MatrixType >::gen_matlab_file_cond_num | ( | const char * | filename | ) | const [inline] |
Create MATLAB .m file which plots a condition number of a problem of computing the density matrix in each recursive expansion iteration.
The condition number is equal to inverse of the homo-lumo gap approximation.
References PuriInfo::additional_iterations, do_output(), PurificationGeneral< MatrixType >::info, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, and PuriInfo::total_it.
void PurificationGeneral< MatrixType >::gen_matlab_file_eigs | ( | const char * | filename | ) | const [inline] |
Create MATLAB .m file which plots the homo and lumo bounds in each recursive expansion iteration.
References PuriInfo::additional_iterations, do_output(), PurificationGeneral< MatrixType >::info, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, and PuriInfo::total_it.
Referenced by GetDensFromFock::get_dens_from_fock_sparse().
void PurificationGeneral< MatrixType >::gen_matlab_file_nnz | ( | const char * | filename | ) | const [inline] |
Create MATLAB .m file which plots the number of non-zero elements in matrices X_i and X_i^2 in each recursive expansion iteration.
References PuriInfo::additional_iterations, do_output(), PurificationGeneral< MatrixType >::info, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, and PuriInfo::total_it.
Referenced by GetDensFromFock::get_dens_from_fock_sparse().
void PurificationGeneral< MatrixType >::gen_matlab_file_norm_diff | ( | const char * | filename | ) | const [inline] |
Create MATLAB .m file which plots the idempotency error in each recursive expansion iteration.
References PuriInfo::additional_iterations, do_output(), mat::euclNorm, mat::frobNorm, PurificationGeneral< MatrixType >::info, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::mixedNorm, PurificationGeneral< MatrixType >::normPuriStopCrit, PuriInfo::total_it, and PurificationGeneral< MatrixType >::VecPoly.
Referenced by GetDensFromFock::get_dens_from_fock_sparse().
void PurificationGeneral< MatrixType >::gen_matlab_file_threshold | ( | const char * | filename | ) | const [inline] |
Create MATLAB .m file which plots the actual introduced error after truncation of the matrix X_i in each recursive expansion iteration.
References PuriInfo::additional_iterations, do_output(), PurificationGeneral< MatrixType >::info, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, and PuriInfo::total_it.
Referenced by GetDensFromFock::get_dens_from_fock_sparse().
void PurificationGeneral< MatrixType >::gen_matlab_file_time | ( | const char * | filename | ) | const [inline] |
Create MATLAB .m file which creates a bar plot presenting time spent on various parts of the iteration (such as matrix square and computation of eigenvectors) in each recursive expansion iteration.
References PuriInfo::compute_eigenvectors_in_this_SCF_cycle, do_output(), EIG_SQUARE_INT, PurificationGeneral< MatrixType >::eigenvectors_method, PurificationGeneral< MatrixType >::info, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, and PuriInfo::total_it.
Referenced by GetDensFromFock::get_dens_from_fock_sparse().
void PurificationGeneral< MatrixType >::gen_python_file_nnz | ( | const char * | filename | ) | const [inline] |
Create PYTHON .py file which plots number of non-zero elements in matrices X_i and X_i^2 in each recursive expansion iteration.
References PuriInfo::additional_iterations, do_output(), PurificationGeneral< MatrixType >::info, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, and PuriInfo::total_it.
void PurificationGeneral< MatrixType >::get_eigenvalue_estimates | ( | const VectorTypeReal & | XmX2_norm_mixed, | |
const VectorTypeReal & | XmX2_norm_frob, | |||
const VectorTypeReal & | XmX2_trace | |||
) | [inline, protected] |
References PurificationGeneral< MatrixType >::estimate_homo_lumo(), PurificationGeneral< MatrixType >::get_exact_number_of_puri_iterations(), PurificationGeneral< MatrixType >::get_frob_norm_est(), PurificationGeneral< MatrixType >::homo_bounds_F_new, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds_F_new, PurificationGeneral< MatrixType >::propagate_values_in_each_iter(), PurificationGeneral< MatrixType >::spectrum_bounds, and mat::Interval< Treal >::upp().
Referenced by PurificationGeneral< MatrixType >::eigenvalue_bounds_estimation().
void PurificationGeneral< MatrixType >::get_eigenvalue_of_F_from_eigv_of_Xi | ( | real & | eigVal, | |
const VectorType & | eigVec | |||
) | [inline, protected] |
static real PurificationGeneral< MatrixType >::get_epsilon | ( | ) | [inline, static] |
Get machine epsilon.
Referenced by PurificationGeneral< MatrixType >::check_new_stopping_criterion(), PurificationGeneral< MatrixType >::compute_spectrum_bounds(), PurificationGeneral< MatrixType >::estimate_homo_lumo(), Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), and PurificationGeneral< MatrixType >::find_truncation_thresh_every_iter().
int PurificationGeneral< MatrixType >::get_est_number_of_puri_iterations | ( | ) | [inline] |
References PuriInfo::estim_total_it, and PurificationGeneral< MatrixType >::info.
int PurificationGeneral< MatrixType >::get_exact_number_of_puri_iterations | ( | ) | [inline] |
References PuriInfo::converged, PurificationGeneral< MatrixType >::info, and PuriInfo::total_it.
Referenced by PurificationGeneral< MatrixType >::get_eigenvalue_estimates().
void PurificationGeneral< MatrixType >::get_frob_norm_est | ( | const VectorTypeReal & | XmX2_norm_frob, | |
const std::vector< real > & | h_in, | |||
const std::vector< real > & | l_in, | |||
VectorTypeReal & | YmY2_norm_frob_est | |||
) | [protected] |
int PurificationGeneral< MatrixType >::get_int_eig_iter_method | ( | string | eigenvectors_iterative_method | ) | [inline, protected] |
References EIG_EMPTY, EIG_LANCZOS_INT, and EIG_POWER_INT.
Referenced by PurificationGeneral< MatrixType >::set_eigenvectors_params().
int PurificationGeneral< MatrixType >::get_int_eig_method | ( | string | eigenvectors_method | ) | [inline, protected] |
References EIG_EMPTY, EIG_PROJECTION_INT, and EIG_SQUARE_INT.
Referenced by PurificationGeneral< MatrixType >::set_eigenvectors_params().
void PurificationGeneral< MatrixType >::get_interval_with_lambda | ( | real & | eigVal, | |
VectorType & | eigVec, | |||
bool & | is_homo, | |||
bool & | is_lumo, | |||
const int | iter | |||
) | [inline, protected] |
References do_output(), EIG_PROJECTION_INT, EIG_SQUARE_INT, PurificationGeneral< MatrixType >::eigenvectors_method, PurificationGeneral< MatrixType >::F, PurificationGeneral< MatrixType >::homo_bounds_F, PuriInfo::homo_estim_low_F, PuriInfo::homo_estim_upp_F, PurificationGeneral< MatrixType >::info, PurificationGeneral< MatrixType >::iter_for_homo, PurificationGeneral< MatrixType >::iter_for_lumo, LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds_F, PuriInfo::lumo_estim_low_F, PuriInfo::lumo_estim_upp_F, PurificationGeneral< MatrixType >::readFromTmpFile(), THRESHOLD_EIG_TOLERANCE, PurificationGeneral< MatrixType >::try_eigv_on_next_iteration_if_fail, mat::Interval< Treal >::upp(), and PurificationGeneral< MatrixType >::writeToTmpFile().
Referenced by PurificationGeneral< MatrixType >::compute_eigenvector().
void PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo | ( | int & | chosen_iter_lumo, | |
int & | chosen_iter_homo | |||
) | [inline, protected] |
Find the best iterations for computing eigenvectors.
The best iteration defined by both a small error in the eigenvector and a small number of iterations of an iterative method.
References PurificationGeneral< MatrixType >::apply_poly(), PurificationGeneral< MatrixType >::compute_derivative(), PurificationGeneral< MatrixType >::find_shifts_every_iter(), PurificationGeneral< MatrixType >::get_min_double(), PurificationGeneral< MatrixType >::good_iterations_homo, PurificationGeneral< MatrixType >::good_iterations_lumo, PurificationGeneral< MatrixType >::homo_bounds, PurificationGeneral< MatrixType >::lumo_bounds, PurificationGeneral< MatrixType >::maxit, PurificationGeneral< MatrixType >::SIGMA_HOMO_VEC, PurificationGeneral< MatrixType >::SIGMA_LUMO_VEC, template_blas_fabs(), and mat::Interval< Treal >::upp().
Referenced by PurificationGeneral< MatrixType >::determine_iteration_for_eigenvectors().
static real PurificationGeneral< MatrixType >::get_max_double | ( | ) | [inline, static] |
Get largest number.
References max.
static real PurificationGeneral< MatrixType >::get_min_double | ( | ) | [inline, static] |
Get smallest number.
References min().
Referenced by PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo().
double PurificationGeneral< MatrixType >::get_nnz_X | ( | ) | [inline, protected] |
Get nnz of X in %.
References PurificationGeneral< MatrixType >::X.
Referenced by PurificationGeneral< MatrixType >::initialize(), and PurificationGeneral< MatrixType >::purification_process().
double PurificationGeneral< MatrixType >::get_nnz_X | ( | size_t & | nnzX | ) | [inline, protected] |
Get nnz of X in %.
nnzX | Number of nz of X |
References PurificationGeneral< MatrixType >::X.
double PurificationGeneral< MatrixType >::get_nnz_Xsq | ( | ) | [inline, protected] |
Get nnz of X^2 in %.
References PurificationGeneral< MatrixType >::Xsq.
Referenced by PurificationGeneral< MatrixType >::purification_process().
double PurificationGeneral< MatrixType >::get_nnz_Xsq | ( | size_t & | nnzXsq | ) | [inline, protected] |
Get nnz of X^2 in %.
nnzXsq | Number of nz of X^2 |
References PurificationGeneral< MatrixType >::Xsq.
void PurificationGeneral< MatrixType >::get_spectrum_bounds | ( | real & | eigmin, | |
real & | eigmax | |||
) | [inline] |
Get spectrum bounds.
Return spectrum bounds for the matrix F.
References PurificationGeneral< MatrixType >::compute_spectrum_bounds(), PurificationGeneral< MatrixType >::computed_spectrum_bounds, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::spectrum_bounds, and mat::Interval< Treal >::upp().
void PurificationGeneral< MatrixType >::initialize | ( | const MatrixType & | F_, | |
const IntervalType & | lumo_bounds_, | |||
const IntervalType & | homo_bounds_, | |||
int | maxit_, | |||
real | error_sub_, | |||
real | error_eig_, | |||
int | use_new_stopping_criterion_, | |||
NormType | norm_truncation, | |||
NormType | norm_stop_crit, | |||
int | nocc_ | |||
) | [inline, virtual] |
Set imporatant parameters for the recursive expansion.
[in] | F_ | Effective Hamiltonian matrix. |
[in] | lumo_bounds_ | Bounds for lumo eigenvalue. |
[in] | homo_bounds_ | Bounds for homo eigenvalue. |
[in] | maxit_ | Maximum number of recursive expansion iterations. |
[in] | error_sub_ | Allowed error in invariant subspaces. |
[in] | error_eig_ | Error in eigenvalues (used just in old stopping criterion). |
[in] | use_new_stopping_criterion_ | Set if want to use new stopping criterion. |
[in] | norm_truncation | Truncation norm. |
[in] | norm_stop_crit | Stopping criterion norm. |
[in] | nocc_ | Number of occupied orbitals. |
References PurificationGeneral< MatrixType >::additional_iterations, PurificationGeneral< MatrixType >::check_stopping_criterion_iter, PurificationGeneral< MatrixType >::compute_eigenvectors_in_this_SCF_cycle, PuriInfo::debug_output, do_output(), enable_printf_output(), PurificationGeneral< MatrixType >::error_eig, PurificationGeneral< MatrixType >::error_sub, PuriInfo::error_subspace, mat::euclNorm, mat::frobNorm, PurificationGeneral< MatrixType >::get_nnz_X(), PurificationGeneral< MatrixType >::homo_bounds_F, PurificationGeneral< MatrixType >::info, PurificationGeneral< MatrixType >::initialized_flag, LOG_AREA_DENSFROMF, LOG_CAT_INFO, PurificationGeneral< MatrixType >::lumo_bounds_F, PurificationGeneral< MatrixType >::maxit, mat::mixedNorm, PurificationGeneral< MatrixType >::nocc, PurificationGeneral< MatrixType >::normPuriStopCrit, PurificationGeneral< MatrixType >::normPuriTrunc, NUM_ADDITIONAL_ITERATIONS, PurificationGeneral< MatrixType >::set_init_params(), PuriInfo::stopping_criterion, PurificationGeneral< MatrixType >::use_new_stopping_criterion, and PurificationGeneral< MatrixType >::X.
Referenced by GetDensFromFock::get_dens_from_fock_sparse(), and main().
virtual bool PurificationGeneral< MatrixType >::is_initialized | ( | ) | const [inline, virtual] |
Check is function initialize() is already called.
References PurificationGeneral< MatrixType >::initialized_flag.
Referenced by PurificationGeneral< MatrixType >::prepare_to_purification().
void PurificationGeneral< MatrixType >::map_bounds_to_0_1 | ( | ) | [inline, protected] |
Get eigenvalue bounds for X0.
References do_output(), mat::Interval< Treal >::empty(), PurificationGeneral< MatrixType >::homo_bounds, PurificationGeneral< MatrixType >::homo_bounds_F, PurificationGeneral< MatrixType >::homo_bounds_X0, mat::Interval< Treal >::intersect(), LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds, PurificationGeneral< MatrixType >::lumo_bounds_F, PurificationGeneral< MatrixType >::lumo_bounds_X0, PurificationGeneral< MatrixType >::spectrum_bounds, and mat::Interval< Treal >::upp().
Referenced by PurificationGeneral< MatrixType >::prepare_to_purification().
void PurificationGeneral< MatrixType >::output_norms_and_traces | ( | IterationInfo & | iter_info | ) | const [inline, protected] |
References do_output(), mat::euclNorm, mat::frobNorm, IterationInfo::it, LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::mixedNorm, PurificationGeneral< MatrixType >::normPuriStopCrit, PurificationGeneral< MatrixType >::X, IterationInfo::XmX2_eucl, IterationInfo::XmX2_fro_norm, IterationInfo::XmX2_mixed_norm, and IterationInfo::XmX2_trace.
Referenced by PurificationGeneral< MatrixType >::purification_process().
void PurificationGeneral< MatrixType >::prepare_to_purification | ( | ) | [inline, virtual] |
Prepare data for recursive expansion.
References PuriInfo::compute_eigenvectors_in_this_SCF_cycle, PurificationGeneral< MatrixType >::compute_eigenvectors_in_this_SCF_cycle, PurificationGeneral< MatrixType >::compute_spectrum_bounds(), PurificationGeneral< MatrixType >::compute_X(), PurificationGeneral< MatrixType >::computed_spectrum_bounds, PurificationGeneral< MatrixType >::determine_iteration_for_eigenvectors(), do_output(), PurificationGeneral< MatrixType >::eigVecHOMO, PurificationGeneral< MatrixType >::eigVecLUMO, PurificationGeneral< MatrixType >::F, Util::TimeMeter::get_elapsed_wall_seconds(), PurificationGeneral< MatrixType >::homo_bounds, PurificationGeneral< MatrixType >::info, PurificationGeneral< MatrixType >::is_initialized(), LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::Interval< Treal >::low(), PurificationGeneral< MatrixType >::lumo_bounds, PurificationGeneral< MatrixType >::map_bounds_to_0_1(), Util::TimeMeter::print(), PurificationGeneral< MatrixType >::puri_is_prepared_flag, PuriInfo::set_spectrum_bounds(), PurificationGeneral< MatrixType >::set_truncation_parameters(), PurificationGeneral< MatrixType >::spectrum_bounds, PuriInfo::time_spectrum_bounds, TOL_OVERLAPPING_BOUNDS, mat::Interval< Treal >::upp(), PurificationGeneral< MatrixType >::writeToTmpFile(), and PurificationGeneral< MatrixType >::X.
Referenced by PurificationGeneral< MatrixType >::PurificationStart().
void PurificationGeneral< MatrixType >::propagate_values_in_each_iter | ( | real | value_unocc, | |
real | value_occ, | |||
VectorTypeReal & | out_unocc, | |||
VectorTypeReal & | out_occ, | |||
int | nmax | |||
) | [inline, protected] |
virtual bool PurificationGeneral< MatrixType >::puri_is_prepared | ( | ) | const [inline, virtual] |
Check is function prepare_to_purification() is already called.
References PurificationGeneral< MatrixType >::puri_is_prepared_flag.
Referenced by PurificationGeneral< MatrixType >::purification_process().
void PurificationGeneral< MatrixType >::purification_process | ( | ) | [inline, virtual] |
Run recursive expansion.
References PuriInfo::accumulated_error_subspace, PuriInfo::additional_iterations, PurificationGeneral< MatrixType >::additional_iterations, PurificationGeneral< MatrixType >::check_stopping_criterion_iter, PurificationGeneral< MatrixType >::compute_eigenvectors_in_this_SCF_cycle, PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::constant_C, IterationInfo::constantC, PuriInfo::converged, do_output(), eucl_acc, IterationInfo::eucl_diff_time, mat::euclNorm, IterationInfo::frob_diff_time, IterationInfo::gap, Util::TimeMeter::get_elapsed_wall_seconds(), PurificationGeneral< MatrixType >::get_nnz_X(), PurificationGeneral< MatrixType >::get_nnz_Xsq(), IterationInfo::homo_bound_low, IterationInfo::homo_bound_upp, PurificationGeneral< MatrixType >::homo_bounds, PurificationGeneral< MatrixType >::info, IterationInfo::it, PuriInfo::Iterations, LOG_AREA_DENSFROMF, LOG_CAT_INFO, mat::Interval< Treal >::low(), IterationInfo::lumo_bound_low, IterationInfo::lumo_bound_upp, PurificationGeneral< MatrixType >::lumo_bounds, PurificationGeneral< MatrixType >::maxit, mixed_acc, IterationInfo::mixed_diff_time, mat::mixedNorm, IterationInfo::NNZ_X, IterationInfo::NNZ_X2, PurificationGeneral< MatrixType >::normPuriStopCrit, IterationInfo::order, output_current_memory_usage(), PurificationGeneral< MatrixType >::output_norms_and_traces(), Util::TimeMeter::print(), PurificationGeneral< MatrixType >::puri_is_prepared(), PurificationGeneral< MatrixType >::purify_bounds(), IterationInfo::purify_time, PurificationGeneral< MatrixType >::purify_X(), PurificationGeneral< MatrixType >::save_matrix_now(), PurificationGeneral< MatrixType >::save_other_iter_info(), PurificationGeneral< MatrixType >::stopping_criterion(), IterationInfo::stopping_criterion_time, IterationInfo::threshold_X, PuriInfo::total_it, PurificationGeneral< MatrixType >::total_subspace_error(), IterationInfo::total_time, IterationInfo::trace_diff_time, IterationInfo::trunc_time, PurificationGeneral< MatrixType >::truncate_matrix(), mat::Interval< Treal >::upp(), PurificationGeneral< MatrixType >::use_new_stopping_criterion, PurificationGeneral< MatrixType >::VecPoly, mat::FileWritable::writeAndReadAll(), PurificationGeneral< MatrixType >::X, IterationInfo::XmX2_eucl, IterationInfo::XmX2_fro_norm, IterationInfo::XmX2_mixed_norm, IterationInfo::XmX2_trace, PurificationGeneral< MatrixType >::Xsq, and IterationInfo::Xsquare_time.
Referenced by PurificationGeneral< MatrixType >::PurificationStart().
void PurificationGeneral< MatrixType >::PurificationStart | ( | ) | [inline, virtual] |
Start recursive expansion.
References PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end(), PurificationGeneral< MatrixType >::compute_eigenvectors_in_this_SCF_cycle, PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PuriInfo::converged, do_output(), EIG_PROJECTION_INT, PurificationGeneral< MatrixType >::eigenvalue_bounds_estimation(), PurificationGeneral< MatrixType >::eigenvectors_method, Util::TimeMeter::get_elapsed_wall_seconds(), PurificationGeneral< MatrixType >::info, LOG_AREA_DENSFROMF, LOG_CAT_INFO, PurificationGeneral< MatrixType >::prepare_to_purification(), Util::TimeMeter::print(), PurificationGeneral< MatrixType >::purification_process(), and PuriInfo::total_time.
Referenced by GetDensFromFock::get_dens_from_fock_sparse(), and main().
virtual void PurificationGeneral< MatrixType >::purify_bounds | ( | const int | it | ) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::purification_process().
virtual void PurificationGeneral< MatrixType >::purify_X | ( | const int | it | ) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::purification_process().
void PurificationGeneral< MatrixType >::readFromTmpFile | ( | MatrixType & | A | ) | const [inline, protected] |
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::get_eigenvalue_of_F_from_eigv_of_Xi(), and PurificationGeneral< MatrixType >::get_interval_with_lambda().
virtual void PurificationGeneral< MatrixType >::return_constant_C | ( | const int | it, | |
real & | Cval | |||
) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::check_new_stopping_criterion().
void PurificationGeneral< MatrixType >::save_eigenvectors_to_file | ( | bool | is_homo, | |
bool | is_lumo, | |||
int | it | |||
) | [inline, protected] |
void PurificationGeneral< MatrixType >::save_matrix_now | ( | string | str | ) | [inline, protected] |
virtual void PurificationGeneral< MatrixType >::save_other_iter_info | ( | IterationInfo & | iter_info, | |
int | it | |||
) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::purification_process().
void PurificationGeneral< MatrixType >::set_compute_eigenvectors_in_each_iteration | ( | ) | [inline] |
References PurificationGeneral< MatrixType >::compute_eigenvectors_in_each_iteration.
Referenced by GetDensFromFock::get_dens_from_fock_sparse(), and main().
void PurificationGeneral< MatrixType >::set_eigenvectors_params | ( | string | eigenvectors_method_, | |
string | eigenvectors_iterative_method_, | |||
real | eigensolver_accuracy_, | |||
int | eigensolver_maxiter_, | |||
int | scf_step_, | |||
int | use_prev_vector_as_initial_guess_, | |||
int | try_eigv_on_next_iteration_if_fail_, | |||
VectorType * | eigVecLUMO_, | |||
VectorType * | eigVecHOMO_ | |||
) | [inline] |
Set parameters for computing eigenvectors.
References cols, PurificationGeneral< MatrixType >::compute_eigenvectors_in_each_iteration, do_output(), EIG_EMPTY, PurificationGeneral< MatrixType >::eigensolver_accuracy, PurificationGeneral< MatrixType >::eigensolver_maxiter, PurificationGeneral< MatrixType >::eigenvectors_iterative_method, PurificationGeneral< MatrixType >::eigenvectors_iterative_method_str, PurificationGeneral< MatrixType >::eigenvectors_method, PurificationGeneral< MatrixType >::eigenvectors_method_str, PurificationGeneral< MatrixType >::eigVecHOMO, PurificationGeneral< MatrixType >::eigVecHOMORef, PurificationGeneral< MatrixType >::eigVecLUMO, PurificationGeneral< MatrixType >::eigVecLUMORef, PurificationGeneral< MatrixType >::get_int_eig_iter_method(), PurificationGeneral< MatrixType >::get_int_eig_method(), PuriInfo::homo_eigenvector_is_computed, PurificationGeneral< MatrixType >::info, PurificationGeneral< MatrixType >::iter_for_homo, PurificationGeneral< MatrixType >::iter_for_lumo, LOG_AREA_DENSFROMF, LOG_CAT_INFO, PuriInfo::lumo_eigenvector_is_computed, PurificationGeneral< MatrixType >::number_of_eigenvalues, mat::VectorGeneral< Treal, Tvector >::resetSizesAndBlocks(), PurificationGeneral< MatrixType >::scf_step, PurificationGeneral< MatrixType >::try_eigv_on_next_iteration_if_fail, PurificationGeneral< MatrixType >::use_prev_vector_as_initial_guess, and PurificationGeneral< MatrixType >::X.
Referenced by GetDensFromFock::get_dens_from_fock_sparse(), and main().
virtual void PurificationGeneral< MatrixType >::set_init_params | ( | ) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::initialize().
void PurificationGeneral< MatrixType >::set_spectrum_bounds | ( | real | eigmin, | |
real | eigmax | |||
) | [inline] |
Set spectrum bounds.
Used if we know spectrum bounds or want to compute them outside the class.
References PurificationGeneral< MatrixType >::computed_spectrum_bounds, and PurificationGeneral< MatrixType >::spectrum_bounds.
void PurificationGeneral< MatrixType >::set_truncation_parameters | ( | ) | [inline, protected] |
References do_output(), PurificationGeneral< MatrixType >::error_per_it, PurificationGeneral< MatrixType >::error_sub, PuriInfo::estim_total_it, PurificationGeneral< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::info, LOG_AREA_DENSFROMF, LOG_CAT_INFO, and PurificationGeneral< MatrixType >::maxit.
Referenced by PurificationGeneral< MatrixType >::prepare_to_purification().
void PurificationGeneral< MatrixType >::stopping_criterion | ( | IterationInfo & | iter_info, | |
int & | stop, | |||
real & | estim_order | |||
) | [inline, protected, virtual] |
Choose stopping criterion and check it.
References PurificationGeneral< MatrixType >::check_new_stopping_criterion(), PurificationGeneral< MatrixType >::check_standard_stopping_criterion(), PurificationGeneral< MatrixType >::check_stopping_criterion_iter, mat::euclNorm, mat::frobNorm, PurificationGeneral< MatrixType >::info, IterationInfo::it, PuriInfo::Iterations, mat::mixedNorm, PurificationGeneral< MatrixType >::normPuriStopCrit, PurificationGeneral< MatrixType >::use_new_stopping_criterion, IterationInfo::XmX2_eucl, IterationInfo::XmX2_fro_norm, IterationInfo::XmX2_mixed_norm, and IterationInfo::XmX2_trace.
Referenced by PurificationGeneral< MatrixType >::purification_process().
PurificationGeneral< MatrixType >::real PurificationGeneral< MatrixType >::total_subspace_error | ( | int | it | ) | [inline, virtual] |
virtual void PurificationGeneral< MatrixType >::truncate_matrix | ( | real & | thresh, | |
int | it | |||
) | [protected, pure virtual] |
Implemented in Purification_sp2< MatrixType >, and Purification_sp2acc< MatrixType >.
Referenced by PurificationGeneral< MatrixType >::purification_process().
void PurificationGeneral< MatrixType >::unset_compute_eigenvectors_in_each_iteration | ( | ) | [inline] |
void PurificationGeneral< MatrixType >::writeToTmpFile | ( | MatrixType & | A | ) | const [inline, protected] |
int PurificationGeneral< MatrixType >::additional_iterations [protected] |
Do a few more iterations after convergence.
Referenced by Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::initialize(), and PurificationGeneral< MatrixType >::purification_process().
int PurificationGeneral< MatrixType >::check_stopping_criterion_iter [protected] |
Iteration when to start to check stopping criterion.
Referenced by Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::initialize(), PurificationGeneral< MatrixType >::purification_process(), Purification_sp2acc< MatrixType >::set_init_params(), Purification_sp2acc< MatrixType >::set_poly(), and PurificationGeneral< MatrixType >::stopping_criterion().
bool PurificationGeneral< MatrixType >::compute_eigenvectors_in_each_iteration [protected] |
Compute homo and lumo eigenpairs in every iteration and save eigenvectors in txt files.
NOTE: if we are computing eigenvector in every iteration, we will save eigenvector computed in the last iteration, and it is most probably the wrong eigenvector.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvector(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::PurificationGeneral(), PurificationGeneral< MatrixType >::set_compute_eigenvectors_in_each_iteration(), PurificationGeneral< MatrixType >::set_eigenvectors_params(), and PurificationGeneral< MatrixType >::unset_compute_eigenvectors_in_each_iteration().
bool PurificationGeneral< MatrixType >::compute_eigenvectors_in_this_SCF_cycle [protected] |
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end(), PurificationGeneral< MatrixType >::initialize(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::purification_process(), and PurificationGeneral< MatrixType >::PurificationStart().
bool PurificationGeneral< MatrixType >::computed_spectrum_bounds [protected] |
Referenced by PurificationGeneral< MatrixType >::compute_spectrum_bounds(), PurificationGeneral< MatrixType >::get_spectrum_bounds(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::PurificationGeneral(), and PurificationGeneral< MatrixType >::set_spectrum_bounds().
real PurificationGeneral< MatrixType >::constant_C [protected] |
Asymptotic constant C needed for the new stopping criterion.
Referenced by PurificationGeneral< MatrixType >::check_new_stopping_criterion(), and PurificationGeneral< MatrixType >::purification_process().
VectorTypeReal PurificationGeneral< MatrixType >::EIG_ABS_GAP_HOMO_VEC [protected] |
(Eigenvectors) Absolute and relative gap in filter for lumo eigenvalue.
Referenced by PurificationGeneral< MatrixType >::find_eig_gaps_every_iter().
VectorTypeReal PurificationGeneral< MatrixType >::EIG_ABS_GAP_LUMO_VEC [protected] |
VectorTypeReal PurificationGeneral< MatrixType >::EIG_REL_GAP_HOMO_VEC [protected] |
(Eigenvectors) Absolute and relative gap in filter for homo eigenvalue.
Referenced by PurificationGeneral< MatrixType >::find_eig_gaps_every_iter().
VectorTypeReal PurificationGeneral< MatrixType >::EIG_REL_GAP_LUMO_VEC [protected] |
real PurificationGeneral< MatrixType >::eigensolver_accuracy [protected] |
int PurificationGeneral< MatrixType >::eigensolver_maxiter [protected] |
int PurificationGeneral< MatrixType >::eigenvectors_iterative_method [protected] |
Chosen eigensolver.
Referenced by PurificationGeneral< MatrixType >::set_eigenvectors_params().
string PurificationGeneral< MatrixType >::eigenvectors_iterative_method_str [protected] |
int PurificationGeneral< MatrixType >::eigenvectors_method [protected] |
Chosen method for computing eigenvectors.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::determine_iteration_for_eigenvectors(), PurificationGeneral< MatrixType >::gen_matlab_file_time(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), PurificationGeneral< MatrixType >::PurificationStart(), and PurificationGeneral< MatrixType >::set_eigenvectors_params().
string PurificationGeneral< MatrixType >::eigenvectors_method_str [protected] |
Referenced by PurificationGeneral< MatrixType >::set_eigenvectors_params().
real PurificationGeneral< MatrixType >::eigValHOMO [protected] |
real PurificationGeneral< MatrixType >::eigValLUMO [protected] |
VectorType* PurificationGeneral< MatrixType >::eigVecHOMO [protected] |
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end(), PurificationGeneral< MatrixType >::compute_eigenvector(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::discard_homo_eigenvector(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::PurificationGeneral(), PurificationGeneral< MatrixType >::save_eigenvectors_to_file(), and PurificationGeneral< MatrixType >::set_eigenvectors_params().
VectorType PurificationGeneral< MatrixType >::eigVecHOMORef [protected] |
VectorType* PurificationGeneral< MatrixType >::eigVecLUMO [protected] |
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end(), PurificationGeneral< MatrixType >::compute_eigenvector(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::discard_lumo_eigenvector(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::PurificationGeneral(), PurificationGeneral< MatrixType >::save_eigenvectors_to_file(), and PurificationGeneral< MatrixType >::set_eigenvectors_params().
VectorType PurificationGeneral< MatrixType >::eigVecLUMORef [protected] |
real PurificationGeneral< MatrixType >::error_eig [protected] |
Error in eigenvalues (used just in old stopping criterion).
Referenced by PurificationGeneral< MatrixType >::check_standard_stopping_criterion(), and PurificationGeneral< MatrixType >::initialize().
real PurificationGeneral< MatrixType >::error_per_it [protected] |
Error allowed in each iteration due to truncation.
Referenced by PurificationGeneral< MatrixType >::find_truncation_thresh_every_iter(), PurificationGeneral< MatrixType >::set_truncation_parameters(), Purification_sp2acc< MatrixType >::truncate_matrix(), and Purification_sp2< MatrixType >::truncate_matrix().
real PurificationGeneral< MatrixType >::error_sub [protected] |
Allowed error in invariant subspaces.
Referenced by PurificationGeneral< MatrixType >::initialize(), and PurificationGeneral< MatrixType >::set_truncation_parameters().
MatrixType PurificationGeneral< MatrixType >::F [protected] |
Matrix F.
Needed for computation of eigenvectors.
Referenced by PurificationGeneral< MatrixType >::get_eigenvalue_of_F_from_eigv_of_Xi(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), and PurificationGeneral< MatrixType >::prepare_to_purification().
real PurificationGeneral< MatrixType >::gammaStopEstim [protected] |
Used on the stopping criterion for estimation of eigenvalues from purification.
Referenced by PurificationGeneral< MatrixType >::estimate_homo_lumo(), Purification_sp2acc< MatrixType >::set_init_params(), and Purification_sp2< MatrixType >::set_init_params().
VectorTypeInt PurificationGeneral< MatrixType >::good_iterations_homo [protected] |
Iterations where homo eigenvector can be computed.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), and PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo().
VectorTypeInt PurificationGeneral< MatrixType >::good_iterations_lumo [protected] |
Iterations where homo eigenvector can be computed.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), and PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo().
IntervalType PurificationGeneral< MatrixType >::homo_bounds [protected] |
(1-homo) bounds for Xi in iteration i
Referenced by PurificationGeneral< MatrixType >::check_standard_stopping_criterion(), Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::find_shifts_every_iter(), PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo(), PurificationGeneral< MatrixType >::map_bounds_to_0_1(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::purification_process(), Purification_sp2acc< MatrixType >::purify_bounds(), Purification_sp2< MatrixType >::purify_bounds(), and Purification_sp2acc< MatrixType >::set_poly().
IntervalType PurificationGeneral< MatrixType >::homo_bounds_F [protected] |
Initial lumo bounds for F.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_on_F(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), PurificationGeneral< MatrixType >::initialize(), and PurificationGeneral< MatrixType >::map_bounds_to_0_1().
IntervalType PurificationGeneral< MatrixType >::homo_bounds_F_new [protected] |
IntervalType PurificationGeneral< MatrixType >::homo_bounds_X0 [protected] |
Initial lumo bounds for X.
Referenced by PurificationGeneral< MatrixType >::find_eig_gaps_every_iter(), and PurificationGeneral< MatrixType >::map_bounds_to_0_1().
PuriInfo PurificationGeneral< MatrixType >::info |
Fill in during purification with useful information.
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end(), PurificationGeneral< MatrixType >::compute_eigenvector(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::discard_homo_eigenvector(), PurificationGeneral< MatrixType >::discard_lumo_eigenvector(), PurificationGeneral< MatrixType >::eigenvalue_bounds_estimation(), PurificationGeneral< MatrixType >::estimate_homo_lumo(), PurificationGeneral< MatrixType >::gen_matlab_file_cond_num(), PurificationGeneral< MatrixType >::gen_matlab_file_eigs(), PurificationGeneral< MatrixType >::gen_matlab_file_nnz(), PurificationGeneral< MatrixType >::gen_matlab_file_norm_diff(), PurificationGeneral< MatrixType >::gen_matlab_file_threshold(), PurificationGeneral< MatrixType >::gen_matlab_file_time(), PurificationGeneral< MatrixType >::gen_python_file_nnz(), GetDensFromFock::get_dens_from_fock_sparse(), PurificationGeneral< MatrixType >::get_est_number_of_puri_iterations(), PurificationGeneral< MatrixType >::get_exact_number_of_puri_iterations(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), PurificationGeneral< MatrixType >::initialize(), main(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::purification_process(), PurificationGeneral< MatrixType >::PurificationStart(), Purification_sp2acc< MatrixType >::return_constant_C(), PurificationGeneral< MatrixType >::set_eigenvectors_params(), Purification_sp2acc< MatrixType >::set_init_params(), Purification_sp2< MatrixType >::set_init_params(), PurificationGeneral< MatrixType >::set_truncation_parameters(), PurificationGeneral< MatrixType >::stopping_criterion(), and PurificationGeneral< MatrixType >::total_subspace_error().
bool PurificationGeneral< MatrixType >::initialized_flag [protected] |
VectorTypeReal PurificationGeneral< MatrixType >::ITER_ERROR_VEC [protected] |
(Eigenvectors) Maximum error introduced in each iteration.
Referenced by PurificationGeneral< MatrixType >::find_truncation_thresh_every_iter().
int PurificationGeneral< MatrixType >::iter_for_homo [protected] |
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::determine_iteration_for_eigenvectors(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), and PurificationGeneral< MatrixType >::set_eigenvectors_params().
int PurificationGeneral< MatrixType >::iter_for_lumo [protected] |
Referenced by PurificationGeneral< MatrixType >::check_eigenvectors_at_the_end(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::determine_iteration_for_eigenvectors(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), and PurificationGeneral< MatrixType >::set_eigenvectors_params().
IntervalType PurificationGeneral< MatrixType >::lumo_bounds [protected] |
Lumo bounds for Xi in iteration i.
Referenced by PurificationGeneral< MatrixType >::check_standard_stopping_criterion(), Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::find_shifts_every_iter(), PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo(), PurificationGeneral< MatrixType >::map_bounds_to_0_1(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::purification_process(), Purification_sp2acc< MatrixType >::purify_bounds(), Purification_sp2< MatrixType >::purify_bounds(), and Purification_sp2acc< MatrixType >::set_poly().
IntervalType PurificationGeneral< MatrixType >::lumo_bounds_F [protected] |
Initial homo bounds for F.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_on_F(), PurificationGeneral< MatrixType >::get_interval_with_lambda(), PurificationGeneral< MatrixType >::initialize(), and PurificationGeneral< MatrixType >::map_bounds_to_0_1().
IntervalType PurificationGeneral< MatrixType >::lumo_bounds_F_new [protected] |
IntervalType PurificationGeneral< MatrixType >::lumo_bounds_X0 [protected] |
Initial lumo bounds for X.
Referenced by PurificationGeneral< MatrixType >::find_eig_gaps_every_iter(), and PurificationGeneral< MatrixType >::map_bounds_to_0_1().
int PurificationGeneral< MatrixType >::maxit [protected] |
Maximum number of iterations.
Referenced by Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::find_eig_gaps_every_iter(), PurificationGeneral< MatrixType >::find_shifts_every_iter(), PurificationGeneral< MatrixType >::find_truncation_thresh_every_iter(), PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo(), PurificationGeneral< MatrixType >::initialize(), PurificationGeneral< MatrixType >::purification_process(), and PurificationGeneral< MatrixType >::set_truncation_parameters().
int PurificationGeneral< MatrixType >::nocc [protected] |
Number of occupied orbitals.
Referenced by PurificationGeneral< MatrixType >::initialize(), Purification_sp2acc< MatrixType >::set_poly(), and Purification_sp2< MatrixType >::set_poly().
NormType PurificationGeneral< MatrixType >::normPuriStopCrit [protected] |
Norm used in the stopping criterion Can be mat::frobNorm, mat::mixedNorm, or mat::euclNorm.
Referenced by PurificationGeneral< MatrixType >::eigenvalue_bounds_estimation(), Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::gen_matlab_file_norm_diff(), PurificationGeneral< MatrixType >::initialize(), PurificationGeneral< MatrixType >::output_norms_and_traces(), PurificationGeneral< MatrixType >::purification_process(), and PurificationGeneral< MatrixType >::stopping_criterion().
NormType PurificationGeneral< MatrixType >::normPuriTrunc [protected] |
Norm used for the truncation of matrices.
Can be mat::frobNorm, mat::mixedNorm, or mat::euclNorm.
Referenced by PurificationGeneral< MatrixType >::initialize(), Purification_sp2acc< MatrixType >::truncate_matrix(), and Purification_sp2< MatrixType >::truncate_matrix().
int PurificationGeneral< MatrixType >::number_of_eigenvalues [protected] |
bool PurificationGeneral< MatrixType >::puri_is_prepared_flag [protected] |
VectorTypeInt PurificationGeneral< MatrixType >::really_good_iterations_homo [protected] |
Iterations where homo eigenvector is actually computed.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvector().
VectorTypeInt PurificationGeneral< MatrixType >::really_good_iterations_lumo [protected] |
Iterations where lumo eigenvector is actually computed.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvector().
int PurificationGeneral< MatrixType >::scf_step [protected] |
VectorTypeReal PurificationGeneral< MatrixType >::SIGMA_HOMO_VEC [protected] |
VectorTypeReal PurificationGeneral< MatrixType >::SIGMA_LUMO_VEC [protected] |
(Eigenvectors) Approximation of shifts in each iteration.
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::find_eig_gaps_every_iter(), PurificationGeneral< MatrixType >::find_shifts_every_iter(), and PurificationGeneral< MatrixType >::get_iterations_for_lumo_and_homo().
IntervalType PurificationGeneral< MatrixType >::spectrum_bounds [protected] |
Outer bounds for the whole spectrum of F/Xi.
Referenced by PurificationGeneral< MatrixType >::compute_spectrum_bounds(), PurificationGeneral< MatrixType >::compute_X(), PurificationGeneral< MatrixType >::estimate_homo_lumo(), PurificationGeneral< MatrixType >::get_eigenvalue_estimates(), PurificationGeneral< MatrixType >::get_spectrum_bounds(), PurificationGeneral< MatrixType >::map_bounds_to_0_1(), PurificationGeneral< MatrixType >::prepare_to_purification(), and PurificationGeneral< MatrixType >::set_spectrum_bounds().
bool PurificationGeneral< MatrixType >::try_eigv_on_next_iteration_if_fail [protected] |
int PurificationGeneral< MatrixType >::use_new_stopping_criterion [protected] |
True for new stopping criterion.
Referenced by PurificationGeneral< MatrixType >::initialize(), PurificationGeneral< MatrixType >::purification_process(), and PurificationGeneral< MatrixType >::stopping_criterion().
int PurificationGeneral< MatrixType >::use_prev_vector_as_initial_guess [protected] |
VectorTypeReal PurificationGeneral< MatrixType >::VecGap [protected] |
Gap computed using inner homo and lumo bounds on each iteration.
Referenced by Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::find_truncation_thresh_every_iter(), Purification_sp2acc< MatrixType >::save_other_iter_info(), Purification_sp2< MatrixType >::save_other_iter_info(), PurificationGeneral< MatrixType >::total_subspace_error(), Purification_sp2acc< MatrixType >::truncate_matrix(), and Purification_sp2< MatrixType >::truncate_matrix().
VectorTypeInt PurificationGeneral< MatrixType >::VecPoly [protected] |
Polynomials computed in the function estimated_number_of_iterations() VecPoly[i] = 1 if we use X=X^2 VecPoly[i] = 0 if we use X=2X-X^2 (or their accelerated versions).
Referenced by PurificationGeneral< MatrixType >::check_new_stopping_criterion(), Purification_sp2acc< MatrixType >::estimate_number_of_iterations(), Purification_sp2< MatrixType >::estimate_number_of_iterations(), PurificationGeneral< MatrixType >::gen_matlab_file_norm_diff(), Purification_sp2acc< MatrixType >::get_poly(), Purification_sp2< MatrixType >::get_poly(), PurificationGeneral< MatrixType >::purification_process(), Purification_sp2acc< MatrixType >::purify_bounds(), Purification_sp2< MatrixType >::purify_bounds(), Purification_sp2acc< MatrixType >::save_other_iter_info(), Purification_sp2< MatrixType >::save_other_iter_info(), Purification_sp2acc< MatrixType >::set_poly(), and Purification_sp2< MatrixType >::set_poly().
MatrixType PurificationGeneral< MatrixType >::X |
Matrix X.
Referenced by PurificationGeneral< MatrixType >::clear(), PurificationGeneral< MatrixType >::compute_eigenvector(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::compute_spectrum_bounds(), PurificationGeneral< MatrixType >::compute_X(), GetDensFromFock::get_dens_from_fock_sparse(), PurificationGeneral< MatrixType >::get_nnz_X(), PurificationGeneral< MatrixType >::initialize(), main(), PurificationGeneral< MatrixType >::output_norms_and_traces(), PurificationGeneral< MatrixType >::prepare_to_purification(), PurificationGeneral< MatrixType >::purification_process(), Purification_sp2acc< MatrixType >::purify_X(), Purification_sp2< MatrixType >::purify_X(), PurificationGeneral< MatrixType >::save_matrix_now(), PurificationGeneral< MatrixType >::set_eigenvectors_params(), Purification_sp2acc< MatrixType >::set_poly(), Purification_sp2< MatrixType >::set_poly(), Purification_sp2acc< MatrixType >::truncate_matrix(), and Purification_sp2< MatrixType >::truncate_matrix().
MatrixType PurificationGeneral< MatrixType >::X_homo [protected] |
MatrixType PurificationGeneral< MatrixType >::X_lumo [protected] |
Save matrix Xi in certain iterations for computing eigenvectors (projection method).
Referenced by PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), and PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj().
MatrixType PurificationGeneral< MatrixType >::Xsq |
Matrix X^2.
Referenced by PurificationGeneral< MatrixType >::clear(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_last_iter_proj(), PurificationGeneral< MatrixType >::get_nnz_Xsq(), PurificationGeneral< MatrixType >::purification_process(), Purification_sp2acc< MatrixType >::purify_X(), Purification_sp2< MatrixType >::purify_X(), Purification_sp2acc< MatrixType >::set_poly(), and Purification_sp2< MatrixType >::set_poly().