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. | |
virtual int | getInitialGuess (VarVectorCollection &vecs) |
generate the starting guess for the HOMO-LUMO excitation by placing one in th the right position. | |
virtual bool | getResidual (VarVectorCollection &residualv) |
get residual of the eigenvalue problem. | |
virtual void | increaseSubspaceLimit (int newSize) |
expands above the default limit | |
ergo_real | getFreq (int i) const |
void | computeMoments (OneElOperator &dipx, OneElOperator &dipy, OneElOperator &dipz) |
ergo_real | getTransitionMoment2 (int i) const |
Private Attributes | |
ergo_real * | ritzVals |
recent ritz values in the subspace. | |
ergo_real * | transMoms2 |
most recent SQUARED transition moments. | |
int | nStates |
number of excited states to compute | |
int | nConverged |
number of already converged eigenvalues | |
ergo_real * | last_ev |
most recent eigenvectors in the reduced space |
Iterative Eigenvalue solver, extending the generic LRSolver.
LR::EigenSolver::EigenSolver | ( | int | nbast, |
int | nocc, | ||
const ergo_real * | fock_matrix, | ||
const ergo_real * | overlap, | ||
int | n | ||
) | [inline] |
References ritzVals, and LR::LRSolver::setE2diag().
virtual LR::EigenSolver::~EigenSolver | ( | ) | [inline, virtual] |
References last_ev, ritzVals, and transMoms2.
void LR::EigenSolver::computeMoments | ( | OneElOperator & | dipx, |
OneElOperator & | dipy, | ||
OneElOperator & | dipz | ||
) |
References LR::LRSolver::subspaceSize, nStates, transMoms2, LR::LRSolver::operToVec(), LR::LRSolver::nbast, LR::OneElOperator::getOper(), LR::LRSolver::ao2mo(), LR::VarVector::setFromFull(), LR::LRSolver::nocc, LR::LRSolver::projectOnSubspace(), LR::dot(), last_ev, ritzVals, and UNIT_one_eV.
Referenced by es_getexc().
ergo_real LR::EigenSolver::getFreq | ( | int | i | ) | const [inline] |
References ritzVals.
Referenced by es_getexc().
int LR::EigenSolver::getInitialGuess | ( | VarVectorCollection & | v | ) | [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::nbast, LR::LRSolver::nocc, LR::VarVectorCollection::setSize(), nStates, LR::LRSolver::e2diag, and LR::VarVector::nvar.
virtual ergo_real LR::EigenSolver::getPreconditionerShift | ( | int | i | ) | const [inline, virtual] |
returns the preconditioning shift.
Proper preconditioning is vital for the quick convergence.
Implements LR::LRSolver.
References ritzVals, and nConverged.
bool LR::EigenSolver::getResidual | ( | VarVectorCollection & | residualv | ) | [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::subspaceSize, LR::LRSolver::eSub, LR::LRSolver::sSub, mat::ggev(), ritzVals, nStates, last_ev, LR::dot(), nConverged, LR::LRSolver::getAvMinusFreqSv(), LR::LRSolver::convThreshold, do_output(), LOG_CAT_INFO, LOG_AREA_LR, LR::VarVectorCollection::setSize(), and LOG_CAT_ERROR.
ergo_real LR::EigenSolver::getTransitionMoment2 | ( | int | i | ) | const [inline] |
References transMoms2.
Referenced by es_getexc().
void LR::EigenSolver::increaseSubspaceLimit | ( | int | newSize | ) | [virtual] |
expands above the default limit
Reimplemented from LR::LRSolver.
References LR::LRSolver::maxSubspaceSize, ritzVals, and transMoms2.
Referenced by es_getexc().
ergo_real* LR::EigenSolver::last_ev [private] |
most recent eigenvectors in the reduced space
Referenced by getResidual(), computeMoments(), and ~EigenSolver().
int LR::EigenSolver::nConverged [private] |
number of already converged eigenvalues
Referenced by getResidual(), and getPreconditionerShift().
int LR::EigenSolver::nStates [private] |
number of excited states to compute
Referenced by getResidual(), getInitialGuess(), and computeMoments().
ergo_real* LR::EigenSolver::ritzVals [private] |
recent ritz values in the subspace.
Referenced by getResidual(), increaseSubspaceLimit(), computeMoments(), EigenSolver(), ~EigenSolver(), getPreconditionerShift(), and getFreq().
ergo_real* LR::EigenSolver::transMoms2 [private] |
most recent SQUARED transition moments.
Referenced by increaseSubspaceLimit(), computeMoments(), ~EigenSolver(), and getTransitionMoment2().