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
Darray type D::element_type must be defined and D 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_typesolve (value_type &guess, Operator &&op, const DavidsonDiagPred< D > *const pred, double convergence, std::size_t max_iter)
 
virtual value_typeeigen_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_typeeigen_vector_
 
value_type HB_
 
value_type B_
 
RowMatrix< element_typesubspace_
 

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 >
mpqc::math::DavidsonDiag< D >::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 
)
inline
Parameters
n_rootsnumber of lowest roots to solve
symmetricif matrix is symmetric
n_guessnumber of eigen vector per root at subspace collapse, default is 2
max_n_guessmax number of guess vector per root, default is 4
vector_thresholdthreshold for the norm of new guess vector in gram schmidt orthonormalization

◆ ~DavidsonDiag()

template<typename D >
virtual mpqc::math::DavidsonDiag< D >::~DavidsonDiag ( )
inlinevirtual

Member Function Documentation

◆ eigen_vector()

template<typename D >
virtual value_type& mpqc::math::DavidsonDiag< D >::eigen_vector ( )
inlinevirtual
Returns
return current eigen vector in Davidson

Reimplemented in mpqc::math::SingleStateDavidsonDiag< D >.

◆ extrapolate()

template<typename D >
std::tuple<EigenVector<element_type>, EigenVector<element_type> > mpqc::math::DavidsonDiag< D >::extrapolate ( value_type HB,
value_type B,
const DavidsonDiagPred< D > *const  pred 
)
inline
Parameters
HBproduct with A and guess vector
Bguess vector
predpreconditioner, which inherit from DavidsonDiagPred
Returns
B updated guess vector
updated eigen values, norm of residual

◆ reset()

template<typename D >
void mpqc::math::DavidsonDiag< D >::reset ( )
inline

clean the cached values

◆ solve()

template<typename D >
template<typename Operator >
EigenVector<element_type> mpqc::math::DavidsonDiag< D >::solve ( value_type guess,
Operator &&  op,
const DavidsonDiagPred< D > *const  pred,
double  convergence,
std::size_t  max_iter 
)
inline
Template Parameters
Operatoroperator that computes the product of H*B
Parameters
guessinitial guess vector
opop(B) should compute HB
predpreconditioner, which inherit from DavidsonDiagPred
convergenceconvergence threshold
max_itermax number of iteration allowed
Returns

Member Data Documentation

◆ B_

template<typename D >
value_type mpqc::math::DavidsonDiag< D >::B_
protected

◆ eigen_vector_

template<typename D >
std::deque<value_type> mpqc::math::DavidsonDiag< D >::eigen_vector_
protected

◆ HB_

template<typename D >
value_type mpqc::math::DavidsonDiag< D >::HB_
protected

◆ max_n_guess_

template<typename D >
unsigned int mpqc::math::DavidsonDiag< D >::max_n_guess_
protected

◆ n_guess_

template<typename D >
unsigned int mpqc::math::DavidsonDiag< D >::n_guess_
protected

◆ n_roots_

template<typename D >
unsigned int mpqc::math::DavidsonDiag< D >::n_roots_
protected

◆ subspace_

template<typename D >
RowMatrix<element_type> mpqc::math::DavidsonDiag< D >::subspace_
protected

◆ symmetric_

template<typename D >
bool mpqc::math::DavidsonDiag< D >::symmetric_
protected

◆ vector_threshold_

template<typename D >
double mpqc::math::DavidsonDiag< D >::vector_threshold_
protected

The documentation for this class was generated from the following file: