mpqc::cc::Solver< T > Class Template Referenceabstract

Documentation

template<typename T>
class mpqc::cc::Solver< T >

Solver updates the CC T amplitudes given the current values and the amplitude equation residuals

Template Parameters
Tthe type representing the n-body amplitude set

Public Member Functions

virtual ~Solver ()=default
 
virtual void update (std::vector< std::reference_wrapper< T >> &t_pack, const std::vector< std::reference_wrapper< const T >> &r_pack, double dE=0)=0
 
virtual double error (const std::vector< std::reference_wrapper< const T >> &r_pack)
 Computes the error for the given residuals pack. More...
 
virtual double error (const T &r1, const T &r2, const T &r3)
 
virtual bool is_converged (double target_precision, double error, double dE) const =0
 

Static Public Member Functions

template<typename... U>
static auto make_refpack (U &... args)
 
template<typename... U>
static auto make_crefpack (U &... args)
 

Constructor & Destructor Documentation

◆ ~Solver()

template<typename T >
virtual mpqc::cc::Solver< T >::~Solver ( )
virtualdefault

Member Function Documentation

◆ error() [1/2]

template<typename T >
virtual double mpqc::cc::Solver< T >::error ( const std::vector< std::reference_wrapper< const T >> &  r_pack)
inlinevirtual

Computes the error for the given residuals pack.

The error is defined as the 2-norm per element, i.e. $ \sqrt{\sum_i ||r_i||_2^2}/(\sum_i \mathrm{size}(r_i)) $ .

Parameters
[in]r_packa pack of amplitude equation residuals
Returns
the error

◆ error() [2/2]

template<typename T >
virtual double mpqc::cc::Solver< T >::error ( const T &  r1,
const T &  r2,
const T &  r3 
)
inlinevirtual

◆ is_converged()

template<typename T >
virtual bool mpqc::cc::Solver< T >::is_converged ( double  target_precision,
double  error,
double  dE 
) const
pure virtual

Tests if the solver has converged

Parameters
target_precisionThe desired precision for the final CC energy
errorThe value of the error computed from the one- and two-body residuals
dEThe energy change between two consecutive solver iterations
Returns
Whether or not the solver has converged

◆ make_crefpack()

template<typename T >
template<typename... U>
static auto mpqc::cc::Solver< T >::make_crefpack ( U &...  args)
inlinestatic

◆ make_refpack()

template<typename T >
template<typename... U>
static auto mpqc::cc::Solver< T >::make_refpack ( U &...  args)
inlinestatic

◆ update()

template<typename T >
virtual void mpqc::cc::Solver< T >::update ( std::vector< std::reference_wrapper< T >> &  t_pack,
const std::vector< std::reference_wrapper< const T >> &  r_pack,
double  dE = 0 
)
pure virtual

Updates amplitude set using the residual set.

Warning
This function assumes that {t1 , t2, ... } and {r1 , r2 , ... } are congruent, but does not assume any particular structure. Derived classes may impose additional assumptions on the structure of the arguments.
Parameters
[in,out]t_packthe amplitudes, in the order of increasing rank (current values on input, updated values on output)
[in]r_packthe amplitude equation residuals, in the order of increasing rank

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