ergo
|
#include <Purification_scaled.h>
Classes | |
class | Time |
Public Types | |
typedef Tmatrix::real | real |
Public Member Functions | |
Purification_scaled (Tmatrix &F_and_D, mat::Interval< real > const &eigFInt, mat::Interval< real > const &hoF, mat::Interval< real > const &luF, real const toleratedEigenvalError, real const toleratedSubspaceError, int const max_steps, mat::normType normForTruncation, bool const use_scaling) | |
void | purify () |
void | get_homo_lumo_intervals (mat::Interval< real > &hoF, mat::Interval< real > &luF) |
Computed eigenvalues of F. More... | |
void | mInfo (std::ostream &file) const |
void | mTime (std::ostream &file) const |
Private Member Functions | |
void | improve_homo_lumo_based_on_normXmX2 (mat::Interval< real > &homo, mat::Interval< real > &lumo, bool &homo_was_computed, bool &lumo_was_computed) |
Computes interval containing spectral norm of X-X^2 matrix. More... | |
real | accumulated_error () |
Total accumulated error due to removal of small matrix elements up to current iteration. More... | |
void | propagate_homo_information () |
Go through step vector and improve homo information in each step possible. More... | |
void | propagate_lumo_information () |
Go through step vector and improve lumo information in each step possible. More... | |
bool | converged () |
Static Private Member Functions | |
static int | get_poly (real const homo, real const lumo) |
static int | estimated_steps_left (mat::Interval< real > eig_homo, mat::Interval< real > eig_lumo, real const toleratedEigenvalError, int const max_steps, bool const use_scaling) |
Estimates number of remaining iterations. More... | |
static real | get_threshold (real const gap, int const steps_left, real const acc_error, real const toleratedSubspaceError) |
Compute acceptable error due to truncation in an iteration based on the current band gap, the number of steps left, and the total tolerated error in the occupied subspace ( tolSubspaceError ) as measured by the largest canonical angle between exact and perturbed subspaces. More... | |
Private Attributes | |
Tmatrix & | X |
Tmatrix | X2 |
int | n |
std::vector< Step< real > > | puri_steps |
mat::Interval< real > const & | eigFInt |
real const | tolEigenvalError |
Tolerated error in eigenvalues at convergence. More... | |
real const | tolSubspaceError |
Tolerated subspace error. More... | |
unsigned int | current_step |
mat::normType | normTruncation |
bool | use_scaling |
bool | homo_is_computed |
bool | lumo_is_computed |
typedef Tmatrix::real pur::Purification_scaled< Tmatrix >::real |
pur::Purification_scaled< Tmatrix >::Purification_scaled | ( | Tmatrix & | F_and_D, |
mat::Interval< real > const & | eigFInt, | ||
mat::Interval< real > const & | hoF, | ||
mat::Interval< real > const & | luF, | ||
real const | toleratedEigenvalError, | ||
real const | toleratedSubspaceError, | ||
int const | max_steps, | ||
mat::normType | normForTruncation, | ||
bool const | use_scaling | ||
) |
F_and_D | (input/output) F on input, D on output |
eigFInt | (input) Interval containing all eigenvalues. |
hoF | (input) Interval containing the HOMO eigenvalue. |
luF | (input) Interval containing the LUMO eigenvalue. |
toleratedEigenvalError | Tolerated deviation of eigenvalues from 0 and 1 in the final result. |
toleratedSubspaceError | Tolerated error in the occupied subspace in the final result (measured by sin(theta)). |
max_steps | Max nr of iterations. |
normForTruncation | Norm to use for truncation. |
use_scaling | Use scaling technique to speed up calculation. |
References pur::Purification_scaled< Tmatrix >::accumulated_error(), pur::Purification_scaled< Tmatrix >::current_step, mat::Interval< Treal >::empty(), pur::Purification_scaled< Tmatrix >::estimated_steps_left(), pur::Purification_scaled< Tmatrix >::get_threshold(), mat::Interval< Treal >::increase(), mat::Interval< Treal >::intersect(), mat::Interval< Treal >::low(), pur::Purification_scaled< Tmatrix >::n, pur::Purification_scaled< Tmatrix >::normTruncation, pur::Purification_scaled< Tmatrix >::puri_steps, pur::Purification_scaled< Tmatrix >::Time::tic(), pur::Purification_scaled< Tmatrix >::Time::toc(), pur::Purification_scaled< Tmatrix >::tolEigenvalError, pur::Purification_scaled< Tmatrix >::tolSubspaceError, mat::Interval< Treal >::upp(), pur::Purification_scaled< Tmatrix >::use_scaling, pur::Purification_scaled< Tmatrix >::X, and pur::Purification_scaled< Tmatrix >::X2.
|
private |
Total accumulated error due to removal of small matrix elements up to current iteration.
This value is (cheaply) recalculated in each iteration since information about HOMO/LUMO eigenvalues may have changed.
References pur::Purification_scaled< Tmatrix >::current_step, and pur::Purification_scaled< Tmatrix >::puri_steps.
Referenced by pur::Purification_scaled< Tmatrix >::get_poly(), pur::Purification_scaled< Tmatrix >::Purification_scaled(), and pur::Purification_scaled< Tmatrix >::purify().
|
private |
References pur::Purification_scaled< Tmatrix >::current_step, pur::Purification_scaled< Tmatrix >::get_homo_lumo_intervals(), mat::Interval< Treal >::low(), pur::Purification_scaled< Tmatrix >::puri_steps, pur::Purification_scaled< Tmatrix >::tolEigenvalError, and mat::Interval< Treal >::upp().
Referenced by pur::Purification_scaled< Tmatrix >::get_homo_lumo_intervals(), pur::Purification_scaled< Tmatrix >::get_poly(), and pur::Purification_scaled< Tmatrix >::purify().
|
staticprivate |
Estimates number of remaining iterations.
Possible movements of eigenvalues due to truncation is not taken into account. The computed number is actually the number of truncations left and since the function is always called just before a truncation, it is always larger than or equal to 1.
References pur::Purification_scaled< Tmatrix >::get_poly(), pur::Purification_scaled< Tmatrix >::get_threshold(), mat::Interval< Treal >::low(), mat::Interval< Treal >::puriStep(), and mat::Interval< Treal >::upp().
Referenced by pur::Purification_scaled< Tmatrix >::get_poly(), pur::Purification_scaled< Tmatrix >::Purification_scaled(), and pur::Purification_scaled< Tmatrix >::purify().
void pur::Purification_scaled< Tmatrix >::get_homo_lumo_intervals | ( | mat::Interval< real > & | hoF, |
mat::Interval< real > & | luF | ||
) |
Computed eigenvalues of F.
Can only be called after convergence.
References pur::Purification_scaled< Tmatrix >::converged(), pur::Purification_scaled< Tmatrix >::eigFInt, mat::Interval< Treal >::increase(), mat::Interval< Treal >::low(), pur::Purification_scaled< Tmatrix >::mInfo(), pur::Purification_scaled< Tmatrix >::puri_steps, and mat::Interval< Treal >::upp().
Referenced by pur::Purification_scaled< Tmatrix >::converged(), get_dens_from_fock_sparse(), and main().
|
inlinestaticprivate |
References pur::Purification_scaled< Tmatrix >::accumulated_error(), pur::Purification_scaled< Tmatrix >::converged(), pur::Purification_scaled< Tmatrix >::estimated_steps_left(), pur::Purification_scaled< Tmatrix >::get_threshold(), pur::Purification_scaled< Tmatrix >::improve_homo_lumo_based_on_normXmX2(), pur::Purification_scaled< Tmatrix >::propagate_homo_information(), pur::Purification_scaled< Tmatrix >::propagate_lumo_information(), and pur::Purification_scaled< Tmatrix >::use_scaling.
Referenced by pur::Purification_scaled< Tmatrix >::estimated_steps_left(), and pur::Purification_scaled< Tmatrix >::purify().
|
staticprivate |
Compute acceptable error due to truncation in an iteration based on the current band gap, the number of steps left, and the total tolerated error in the occupied subspace ( tolSubspaceError ) as measured by the largest canonical angle between exact and perturbed subspaces.
Information about the total error accumulated so far is also used.
References pur::Purification_scaled< Tmatrix >::improve_homo_lumo_based_on_normXmX2().
Referenced by pur::Purification_scaled< Tmatrix >::estimated_steps_left(), pur::Purification_scaled< Tmatrix >::get_poly(), pur::Purification_scaled< Tmatrix >::Purification_scaled(), and pur::Purification_scaled< Tmatrix >::purify().
|
private |
Computes interval containing spectral norm of X-X^2 matrix.
Computed accurately if HOMO or LUMO eigenvalue has not previously been computed and is the eigenvalue closest to 0.5, and if the norm is small (which it usually is only in later iterations when there is larger separation between eigenvalues). The HOMO and LUMO eigenvalues may be improved.
References pur::Purification_scaled< Tmatrix >::current_step, mat::euclNorm, mat::frobNorm, pur::Purification_scaled< Tmatrix >::homo_is_computed, mat::Interval< Treal >::intersect_always_non_empty(), mat::Interval< Treal >::length(), mat::Interval< Treal >::low(), pur::Purification_scaled< Tmatrix >::lumo_is_computed, mat::Interval< Treal >::overlap(), pur::Purification_scaled< Tmatrix >::puri_steps, mat::sqrtInt(), mat::Interval< Treal >::upp(), pur::Purification_scaled< Tmatrix >::X, and pur::Purification_scaled< Tmatrix >::X2.
Referenced by pur::Purification_scaled< Tmatrix >::get_poly(), pur::Purification_scaled< Tmatrix >::get_threshold(), and pur::Purification_scaled< Tmatrix >::purify().
void pur::Purification_scaled< Tmatrix >::mInfo | ( | std::ostream & | file | ) | const |
References pur::Purification_scaled< Tmatrix >::current_step, mat::getNormTypeString(), pur::Purification_scaled< Tmatrix >::mTime(), pur::Purification_scaled< Tmatrix >::n, pur::Purification_scaled< Tmatrix >::normTruncation, pur::Purification_scaled< Tmatrix >::puri_steps, pur::Purification_scaled< Tmatrix >::tolEigenvalError, and pur::Purification_scaled< Tmatrix >::tolSubspaceError.
Referenced by get_dens_from_fock_sparse(), pur::Purification_scaled< Tmatrix >::get_homo_lumo_intervals(), and main().
void pur::Purification_scaled< Tmatrix >::mTime | ( | std::ostream & | file | ) | const |
References pur::Purification_scaled< Tmatrix >::current_step, mat::getNormTypeString(), pur::Purification_scaled< Tmatrix >::n, pur::Purification_scaled< Tmatrix >::normTruncation, pur::Purification_scaled< Tmatrix >::puri_steps, pur::Purification_scaled< Tmatrix >::tolEigenvalError, and pur::Purification_scaled< Tmatrix >::tolSubspaceError.
Referenced by get_dens_from_fock_sparse(), main(), and pur::Purification_scaled< Tmatrix >::mInfo().
|
private |
Go through step vector and improve homo information in each step possible.
References pur::Purification_scaled< Tmatrix >::current_step, and pur::Purification_scaled< Tmatrix >::puri_steps.
Referenced by pur::Purification_scaled< Tmatrix >::get_poly(), and pur::Purification_scaled< Tmatrix >::purify().
|
private |
Go through step vector and improve lumo information in each step possible.
References pur::Purification_scaled< Tmatrix >::current_step, and pur::Purification_scaled< Tmatrix >::puri_steps.
Referenced by pur::Purification_scaled< Tmatrix >::get_poly(), and pur::Purification_scaled< Tmatrix >::purify().
void pur::Purification_scaled< Tmatrix >::purify | ( | ) |
References pur::Purification_scaled< Tmatrix >::accumulated_error(), pur::Purification_scaled< Tmatrix >::converged(), pur::Purification_scaled< Tmatrix >::current_step, pur::Purification_scaled< Tmatrix >::estimated_steps_left(), pur::Purification_scaled< Tmatrix >::get_poly(), pur::Purification_scaled< Tmatrix >::get_threshold(), pur::Purification_scaled< Tmatrix >::homo_is_computed, pur::Purification_scaled< Tmatrix >::improve_homo_lumo_based_on_normXmX2(), mat::Interval< Treal >::increase(), mat::Interval< Treal >::low(), pur::Purification_scaled< Tmatrix >::lumo_is_computed, pur::Purification_scaled< Tmatrix >::normTruncation, pur::Purification_scaled< Tmatrix >::propagate_homo_information(), pur::Purification_scaled< Tmatrix >::propagate_lumo_information(), pur::Purification_scaled< Tmatrix >::puri_steps, mat::Interval< Treal >::puriStep(), pur::Purification_scaled< Tmatrix >::Time::tic(), pur::Purification_scaled< Tmatrix >::Time::toc(), pur::Purification_scaled< Tmatrix >::tolEigenvalError, pur::Purification_scaled< Tmatrix >::tolSubspaceError, mat::Interval< Treal >::upp(), pur::Purification_scaled< Tmatrix >::use_scaling, pur::Purification_scaled< Tmatrix >::X, and pur::Purification_scaled< Tmatrix >::X2.
Referenced by get_dens_from_fock_sparse(), and main().
|
private |
Referenced by pur::Purification_scaled< Tmatrix >::accumulated_error(), pur::Purification_scaled< Tmatrix >::converged(), pur::Purification_scaled< Tmatrix >::improve_homo_lumo_based_on_normXmX2(), pur::Purification_scaled< Tmatrix >::mInfo(), pur::Purification_scaled< Tmatrix >::mTime(), pur::Purification_scaled< Tmatrix >::propagate_homo_information(), pur::Purification_scaled< Tmatrix >::propagate_lumo_information(), pur::Purification_scaled< Tmatrix >::Purification_scaled(), and pur::Purification_scaled< Tmatrix >::purify().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by pur::Purification_scaled< Tmatrix >::accumulated_error(), pur::Purification_scaled< Tmatrix >::converged(), pur::Purification_scaled< Tmatrix >::get_homo_lumo_intervals(), pur::Purification_scaled< Tmatrix >::improve_homo_lumo_based_on_normXmX2(), pur::Purification_scaled< Tmatrix >::mInfo(), pur::Purification_scaled< Tmatrix >::mTime(), pur::Purification_scaled< Tmatrix >::propagate_homo_information(), pur::Purification_scaled< Tmatrix >::propagate_lumo_information(), pur::Purification_scaled< Tmatrix >::Purification_scaled(), and pur::Purification_scaled< Tmatrix >::purify().
|
private |
Tolerated error in eigenvalues at convergence.
Referenced by pur::Purification_scaled< Tmatrix >::converged(), pur::Purification_scaled< Tmatrix >::mInfo(), pur::Purification_scaled< Tmatrix >::mTime(), pur::Purification_scaled< Tmatrix >::Purification_scaled(), and pur::Purification_scaled< Tmatrix >::purify().
|
private |
Tolerated subspace error.
Referenced by pur::Purification_scaled< Tmatrix >::mInfo(), pur::Purification_scaled< Tmatrix >::mTime(), pur::Purification_scaled< Tmatrix >::Purification_scaled(), and pur::Purification_scaled< Tmatrix >::purify().
|
private |
|
private |
|
private |