MADNESS 0.10.1
madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM > Struct Template Reference

given a ket and the 1- and 2-electron potentials, construct the function V phi More...

#include <funcimpl.h>

Collaboration diagram for madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >:

Public Types

typedef CoeffTracker< T, LDIM > ctL
typedef CoeffTracker< T, NDIM > ctT
typedef Vphi_op_NS< opT, LDIM > this_type

Public Member Functions

 Vphi_op_NS ()
 Vphi_op_NS (implT *result, const opT &leaf_op, const ctT &iaket, const ctL &iap1, const ctL &iap2, const ctL &iav1, const ctL &iav2, const implT *eri)
void accumulate_into_result (const Key< NDIM > &key, const coeffT &coeff) const
Future< this_type > activate () const
double compute_error_from_inaccurate_refinement (const keyT &key, const tensorT &ceri) const
 the error is computed from the d coefficients of the constituent functions
std::pair< bool, coeffT > continue_recursion (const std::vector< bool > child_is_leaf, const tensorT &coeffs, const keyT &key) const
 loop over all children and either insert their sum coeffs or continue the recursion
tensorT eri_coeffs (const keyT &key) const
this_type forward_ctor (implT *result1, const opT &leaf_op, const ctT &iaket1, const ctL &iap11, const ctL &iap21, const ctL &iav11, const ctL &iav21, const implT *eri1)
bool have_eri () const
bool have_ket () const
bool have_v1 () const
bool have_v2 () const
this_type make_child (const keyT &child) const
std::pair< coeffT, double > make_sum_coeffs (const keyT &key) const
 make the sum coeffs for key
std::pair< bool, coeffT > operator() (const Key< NDIM > &key) const
 make and insert the coefficients into result's tree
bool randomize () const
template<typename Archive>
void serialize (const Archive &ar)
 serialize this (needed for use in recursive_op)

Public Attributes

const implT * eri
 2-particle potential, must be on-demand
ctT iaket
 the ket of a pair function (exclusive with p1, p2)
ctL iap1
ctL iap2
 the particles 1 and 2 (exclusive with ket)
ctL iav1
ctL iav2
 potentials for particles 1 and 2
opT leaf_op
 deciding if a given FunctionNode will be a leaf node
implT * result
 where to construct Vphi, no need to track parents

Detailed Description

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
struct madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >

given a ket and the 1- and 2-electron potentials, construct the function V phi

small memory footstep version of Vphi_op: use the NS form to have information about parent and children to determine if a box is a leaf. This will require compression of the constituent functions, which will lead to more memory usage there, but will avoid oversampling of the result function.

Member Typedef Documentation

◆ ctL

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
typedef CoeffTracker<T,LDIM> madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::ctL

◆ ctT

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
typedef CoeffTracker<T,NDIM> madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::ctT

◆ this_type

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
typedef Vphi_op_NS<opT,LDIM> madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::this_type

Constructor & Destructor Documentation

◆ Vphi_op_NS() [1/2]

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::Vphi_op_NS ( )
inline

References eri, and result.

Referenced by continue_recursion().

◆ Vphi_op_NS() [2/2]

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::Vphi_op_NS ( implT * result,
const opT & leaf_op,
const ctT & iaket,
const ctL & iap1,
const ctL & iap2,
const ctL & iav1,
const ctL & iav2,
const implT * eri )
inline

References eri, iaket, iap1, iap2, iav1, iav2, leaf_op, MADNESS_ASSERT, and result.

Member Function Documentation

◆ accumulate_into_result()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
void madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::accumulate_into_result ( const Key< NDIM > & key,
const coeffT & coeff ) const
inline

◆ activate()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
Future< this_type > madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::activate ( ) const
inline

◆ compute_error_from_inaccurate_refinement()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
double madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::compute_error_from_inaccurate_refinement ( const keyT & key,
const tensorT & ceri ) const
inline

the error is computed from the d coefficients of the constituent functions

the result is h_n = P_n(f g), computed as h_n \approx Pn(f_n g_n) its error is therefore h_n = (f g)_n = ((Pn(f) + Qn(f)) (Pn(g) + Qn(g)) = Pn(fn gn) + Qn(fn gn) + Pn(f) Qn(g) + Qn(f) Pn(g) + Qn(f) Pn(g) the first term is what we compute, the second term is estimated by tnorm (in another function), the third to last terms are estimated in this function by e.g.: Qn(f)Pn(g) < ||Qn(f)|| ||Pn(g)||

References madness::Key< NDIM >::break_apart(), madness::copy(), d, madness::error(), have_eri(), have_ket(), have_v1(), have_v2(), iaket, iap1, iap2, iav1, iav2, key1(), madness::Tensor< T >::normf(), PROFILE_BLOCK, and result.

Referenced by make_sum_coeffs().

◆ continue_recursion()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
std::pair< bool, coeffT > madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion ( const std::vector< bool > child_is_leaf,
const tensorT & coeffs,
const keyT & key ) const
inline

loop over all children and either insert their sum coeffs or continue the recursion

Parameters
[in]child_is_leaffor each child: is it a leaf?
[in]coeffscoefficient tensor with 2^N sum coeffs (=unfiltered NS coeffs)
[in]keythe key for the NS coeffs (=parent key of the children)
Returns
to avoid recursion outside this return: std::pair<is_leaf,coeff> = true,coeffT()

References Vphi_op_NS(), madness::FunctionImpl< T, NDIM >::coeffs, madness::copy(), madness::FunctionImpl< T, NDIM >::forward_traverse(), make_child(), p(), and result.

Referenced by operator()().

◆ eri_coeffs()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
tensorT madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri_coeffs ( const keyT & key) const
inline

◆ forward_ctor()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
this_type madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::forward_ctor ( implT * result1,
const opT & leaf_op,
const ctT & iaket1,
const ctL & iap11,
const ctL & iap21,
const ctL & iav11,
const ctL & iav21,
const implT * eri1 )
inline

References leaf_op.

Referenced by activate().

◆ have_eri()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
bool madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::have_eri ( ) const
inline

◆ have_ket()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
bool madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::have_ket ( ) const
inline

◆ have_v1()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
bool madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::have_v1 ( ) const
inline

◆ have_v2()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
bool madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::have_v2 ( ) const
inline

◆ make_child()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
this_type madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_child ( const keyT & child) const
inline

◆ make_sum_coeffs()

◆ operator()()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
std::pair< bool, coeffT > madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator() ( const Key< NDIM > & key) const
inline

◆ randomize()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
bool madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::randomize ( ) const
inline

◆ serialize()

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
template<typename Archive>
void madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::serialize ( const Archive & ar)
inline

serialize this (needed for use in recursive_op)

References eri, iaket, iap1, iap2, iav1, iav2, leaf_op, and result.

Member Data Documentation

◆ eri

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
const implT* madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri

2-particle potential, must be on-demand

Referenced by Vphi_op_NS(), Vphi_op_NS(), activate(), eri_coeffs(), have_eri(), make_child(), and serialize().

◆ iaket

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
ctT madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::iaket

the ket of a pair function (exclusive with p1, p2)

Referenced by Vphi_op_NS(), activate(), compute_error_from_inaccurate_refinement(), have_ket(), make_child(), make_sum_coeffs(), and serialize().

◆ iap1

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
ctL madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::iap1

◆ iap2

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
ctL madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::iap2

the particles 1 and 2 (exclusive with ket)

Referenced by Vphi_op_NS(), activate(), compute_error_from_inaccurate_refinement(), make_child(), make_sum_coeffs(), and serialize().

◆ iav1

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
ctL madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::iav1

◆ iav2

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
ctL madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::iav2

◆ leaf_op

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
opT madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::leaf_op

deciding if a given FunctionNode will be a leaf node

Referenced by Vphi_op_NS(), activate(), forward_ctor(), make_child(), operator()(), and serialize().

◆ result

template<typename T, std::size_t NDIM>
template<typename opT, size_t LDIM>
implT* madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::result

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