|
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 |
| Public Member Functions inherited from LR::LRSolver | |
| 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. | |
| virtual | ~LRSolver () |
| bool | solve (E2Evaluator &e, bool diskMode=false) |
| Solves the problem defined by the subclass. | |
| void | computeExactE2Diag (E2Evaluator &e2) |
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 | |
Additional Inherited Members | |
| Public Attributes inherited from LR::LRSolver | |
| ergo_real | convThreshold |
| iterative method convergence threshold | |
| int | maxSubspaceSize |
| current subspace size limit. | |
| Protected Member Functions inherited from LR::LRSolver | |
| void | getAvMinusFreqSv (ergo_real f, ergo_real *weights, VarVector &r) |
| Computes a vector built of base vectors with specified vectors. | |
| void | projectOnSubspace (const VarVector &full, ergo_real *w) |
| Projects vector. | |
| void | buildVector (const ergo_real *w, VarVector &full) |
| Build full fector from the reduced form. | |
| void | operToVec (OneElOperator &oper, VarVector &res) const |
| Transform square operator to the vector form. | |
| 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. | |
| virtual void | addToSpace (VarVectorCollection &vecs, E2Evaluator &e2) |
| extends the subspace with v and its transformed vector Av. | |
| 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 | |
| Protected Attributes inherited from LR::LRSolver | |
| VarVector | e2diag |
| approximation to the diagonal of E2 operator | |
| int | subspaceSize |
| current subspace size | |
| SmallMatrix | eSub |
| E[2] matrix projected onto subspace. | |
| SmallMatrix | sSub |
| S[2] matrix projected onto subspace. | |
| ergo_real * | xSub |
| solution vector projected onto subspace | |
| int | nbast |
| number of basis functions | |
| int | nocc |
| number of occupied orbitals | |
| VarVectorCollection | vects |
| base vectors | |
| Static Protected Attributes inherited from LR::LRSolver | |
| static const int | MVEC = 200 |
| default limit for subspace size | |
Iterative Eigenvalue solver, extending the generic LRSolver.
|
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, 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(), EigenSolver(), getResidual(), and ~EigenSolver().
|
private |
number of already converged eigenvalues
Referenced by EigenSolver(), getPreconditionerShift(), and getResidual().
|
private |
number of excited states to compute
Referenced by computeMoments(), EigenSolver(), 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(), EigenSolver(), getTransitionMoment2(), increaseSubspaceLimit(), and ~EigenSolver().