mpqc::math::DavidsonDiag< D > Class Template Reference
Documentation
template<typename D>
class mpqc::math::DavidsonDiag< D >
Davidson Algorithm.
Solves eigen value problem H x = e x
for the lowest n
eigenpairs
it starts with orthogonal guess vector B {b1, b2, ... bn} the eigen vector is a linear combination of B extrapolate() will update the vector B and store new x
- Template Parameters
-
D array type D::element_type
must be defined andD
must provide the following stand-alone functions:D copy(const D&)
element_type inner_product(const D& a, const D& b)
void scale(D& y , element_type a)
void axpy(D&y , element_tye a, const D& z)
void zero(D& x)
element_type norm2(const D& x)
Public Types | |
using | element_type = typename TA::detail::numeric_type< D >::type |
using | result_type = EigenVector< element_type > |
using | value_type = std::vector< D > |
Public Member Functions | |
DavidsonDiag (unsigned int n_roots, bool symmetric=true, unsigned int n_guess=2, unsigned int max_n_guess=4, double vector_threshold=1.0e-5) | |
virtual | ~DavidsonDiag () |
template<typename Operator > | |
EigenVector< element_type > | solve (value_type &guess, Operator &&op, const DavidsonDiagPred< D > *const pred, double convergence, std::size_t max_iter) |
virtual value_type & | eigen_vector () |
std::tuple< EigenVector< element_type >, EigenVector< element_type > > | extrapolate (value_type &HB, value_type &B, const DavidsonDiagPred< D > *const pred) |
void | reset () |
clean the cached values More... | |
Protected Attributes | |
unsigned int | n_roots_ |
bool | symmetric_ |
unsigned int | n_guess_ |
unsigned int | max_n_guess_ |
double | vector_threshold_ |
std::deque< value_type > | eigen_vector_ |
value_type | HB_ |
value_type | B_ |
RowMatrix< element_type > | subspace_ |
Member Typedef Documentation
◆ element_type
template<typename D >
using mpqc::math::DavidsonDiag< D >::element_type = typename TA::detail::numeric_type<D>::type |
◆ result_type
template<typename D >
using mpqc::math::DavidsonDiag< D >::result_type = EigenVector<element_type> |
◆ value_type
template<typename D >
using mpqc::math::DavidsonDiag< D >::value_type = std::vector<D> |
Constructor & Destructor Documentation
◆ DavidsonDiag()
template<typename D >
|
inline |
- Parameters
-
n_roots number of lowest roots to solve symmetric if matrix is symmetric n_guess number of eigen vector per root at subspace collapse, default is 2 max_n_guess max number of guess vector per root, default is 4 vector_threshold threshold for the norm of new guess vector in gram schmidt orthonormalization
◆ ~DavidsonDiag()
template<typename D >
|
inlinevirtual |
Member Function Documentation
◆ eigen_vector()
template<typename D >
|
inlinevirtual |
- Returns
- return current eigen vector in Davidson
Reimplemented in mpqc::math::SingleStateDavidsonDiag< D >.
◆ extrapolate()
template<typename D >
|
inline |
- Parameters
-
HB product with A and guess vector B guess vector pred preconditioner, which inherit from DavidsonDiagPred
- Returns
- B updated guess vector
- updated eigen values, norm of residual
◆ reset()
template<typename D >
|
inline |
clean the cached values
◆ solve()
template<typename D >
template<typename Operator >
|
inline |
- Template Parameters
-
Operator operator that computes the product of H*B
- Parameters
-
guess initial guess vector op op(B) should compute HB pred preconditioner, which inherit from DavidsonDiagPred convergence convergence threshold max_iter max number of iteration allowed
- Returns
Member Data Documentation
◆ B_
template<typename D >
|
protected |
◆ eigen_vector_
template<typename D >
|
protected |
◆ HB_
template<typename D >
|
protected |
◆ max_n_guess_
template<typename D >
|
protected |
◆ n_guess_
template<typename D >
|
protected |
◆ n_roots_
template<typename D >
|
protected |
◆ subspace_
template<typename D >
|
protected |
◆ symmetric_
template<typename D >
|
protected |
◆ vector_threshold_
template<typename D >
|
protected |
The documentation for this class was generated from the following file:
- mpqc/math/linalg/davidson_diag.h