ergo
|
Iterative Eigenvalue solver, extending the generic LRSolver. More...
#include <slr.h>
Public Member Functions | |
EigenSolver (int nbast, int nocc, const ergo_real *fock_matrix, const ergo_real *overlap, int n) | |
virtual | ~EigenSolver () |
virtual ergo_real | getPreconditionerShift (int i) const |
returns the preconditioning shift. More... | |
virtual int | getInitialGuess (VarVectorCollection &vecs) |
generate the starting guess for the HOMO-LUMO excitation by placing one in th the right position. More... | |
virtual bool | getResidual (VarVectorCollection &residualv) |
get residual of the eigenvalue problem. More... | |
virtual void | increaseSubspaceLimit (int newSize) |
expands above the default limit More... | |
ergo_real | getFreq (int i) const |
void | computeMoments (OneElOperator &dipx, OneElOperator &dipy, OneElOperator &dipz) |
ergo_real | getTransitionMoment2 (int i) const |
![]() | |
LRSolver (int nbast, int nocc, const ergo_real *fock_matrix, const ergo_real *s) | |
Initialize the solver by computing the diagonal of the E2 operator as needed for preconditioning. More... | |
virtual | ~LRSolver () |
bool | solve (E2Evaluator &e, bool diskMode=false) |
Solves the problem defined by the subclass. More... | |
void | computeExactE2Diag (E2Evaluator &e2) |
Private Attributes | |
ergo_real * | ritzVals |
recent ritz values in the subspace. More... | |
ergo_real * | transMoms2 |
most recent SQUARED transition moments. More... | |
int | nStates |
number of excited states to compute More... | |
int | nConverged |
number of already converged eigenvalues More... | |
ergo_real * | last_ev |
most recent eigenvectors in the reduced space More... | |
Additional Inherited Members | |
![]() | |
ergo_real | convThreshold |
iterative method convergence threshold More... | |
int | maxSubspaceSize |
current subspace size limit. More... | |
![]() | |
void | getAvMinusFreqSv (ergo_real f, ergo_real *weights, VarVector &r) |
Computes a vector built of base vectors with specified vectors. More... | |
void | projectOnSubspace (const VarVector &full, ergo_real *w) |
Projects vector. More... | |
void | buildVector (const ergo_real *w, VarVector &full) |
Build full fector from the reduced form. More... | |
void | operToVec (OneElOperator &oper, VarVector &res) const |
Transform square operator to the vector form. More... | |
ergo_real | setE2diag (int nbast, int nocc, const ergo_real *fock_matrix, const ergo_real *s) |
setE2diag is called by the constructor to fill in the approximation of the E[2] operator diagonal. More... | |
virtual void | addToSpace (VarVectorCollection &vecs, E2Evaluator &e2) |
extends the subspace with v and its transformed vector Av. More... | |
void | mo2ao (int nbast, const ergo_real *mo, ergo_real *ao) const |
void | ao2mo (int nbast, const ergo_real *ao, ergo_real *mo) const |
computes mo := cmo'*ao*cmo More... | |
![]() | |
VarVector | e2diag |
approximation to the diagonal of E2 operator More... | |
int | subspaceSize |
current subspace size More... | |
SmallMatrix | eSub |
E[2] matrix projected onto subspace. More... | |
SmallMatrix | sSub |
S[2] matrix projected onto subspace. More... | |
ergo_real * | xSub |
solution vector projected onto subspace More... | |
int | nbast |
number of basis functions More... | |
int | nocc |
number of occupied orbitals More... | |
VarVectorCollection | vects |
base vectors More... | |
![]() | |
static const int | MVEC = 200 |
default limit for subspace size More... | |
Iterative Eigenvalue solver, extending the generic LRSolver.
|
inline |
References LR::LRSolver::nbast, LR::LRSolver::nocc, ritzVals, and LR::LRSolver::setE2diag().
|
inlinevirtual |
References last_ev, ritzVals, and transMoms2.
void LR::EigenSolver::computeMoments | ( | OneElOperator & | dipx, |
OneElOperator & | dipy, | ||
OneElOperator & | dipz | ||
) |
References LR::LRSolver::ao2mo(), LR::dot(), LR::OneElOperator::getOper(), last_ev, LR::LRSolver::nbast, LR::LRSolver::nocc, nStates, LR::LRSolver::operToVec(), LR::LRSolver::projectOnSubspace(), ritzVals, LR::VarVector::setFromFull(), LR::LRSolver::subspaceSize, transMoms2, and UNIT_one_eV.
Referenced by es_getexc().
|
inline |
References ritzVals.
Referenced by es_getexc().
|
virtual |
generate the starting guess for the HOMO-LUMO excitation by placing one in th the right position.
Do it the lazy way: creating VarVector directly risks inconsistiency when the internal representation of VarVector changes.
Implements LR::LRSolver.
References LR::LRSolver::e2diag, LR::LRSolver::nbast, LR::LRSolver::nocc, nStates, LR::VarVector::nvar, and LR::VarVectorCollection::setSize().
|
inlinevirtual |
returns the preconditioning shift.
Proper preconditioning is vital for the quick convergence.
Implements LR::LRSolver.
References nConverged, and ritzVals.
|
virtual |
get residual of the eigenvalue problem.
This is done in following steps: Solution in the subspace: [ Xsub, lambda ] = eig(eSub, Ssub); Pick first positive eigenvalue l1 = lambda(step+1); Pick corresponding eigenvector: Xsub = Xsub(:,step+1); Residual Vector: residualv = (Av-l1*Sv)*Xsub;
Implements LR::LRSolver.
References LR::LRSolver::convThreshold, do_output(), LR::dot(), LR::LRSolver::eSub, LR::LRSolver::getAvMinusFreqSv(), mat::ggev(), last_ev, LOG_AREA_LR, LOG_CAT_ERROR, LOG_CAT_INFO, nConverged, nStates, ritzVals, LR::VarVectorCollection::setSize(), LR::LRSolver::sSub, LR::LRSolver::subspaceSize, and template_blas_sqrt().
|
inline |
References transMoms2.
Referenced by es_getexc().
|
virtual |
expands above the default limit
Reimplemented from LR::LRSolver.
References LR::LRSolver::increaseSubspaceLimit(), LR::LRSolver::maxSubspaceSize, ritzVals, and transMoms2.
Referenced by es_getexc().
|
private |
most recent eigenvectors in the reduced space
Referenced by computeMoments(), getResidual(), and ~EigenSolver().
|
private |
number of already converged eigenvalues
Referenced by getPreconditionerShift(), and getResidual().
|
private |
number of excited states to compute
Referenced by computeMoments(), getInitialGuess(), and getResidual().
|
private |
recent ritz values in the subspace.
Referenced by computeMoments(), EigenSolver(), getFreq(), getPreconditionerShift(), getResidual(), increaseSubspaceLimit(), and ~EigenSolver().
|
private |
most recent SQUARED transition moments.
Referenced by computeMoments(), getTransitionMoment2(), increaseSubspaceLimit(), and ~EigenSolver().