|
MADNESS 0.10.1
|
Adaptive sum-of-products operator over a vector of composite_terms. More...
#include <composite_product_op.h>

Classes | |
| struct | TermImpl |
| internal serialisable view of a term (CoeffTracker-based) More... | |
Public Types | |
| using | coeffT = typename implT::coeffT |
| using | ctL = CoeffTracker<T, LDIM> |
| using | ctT = CoeffTracker<T, NDIM> |
| using | implL = FunctionImpl<T, LDIM> |
| using | implT = FunctionImpl<T, NDIM> |
| using | keyL = Key<LDIM> |
| using | keyT = Key<NDIM> |
| enum class | Mode { function , inner } |
| using | nodeT = typename implT::nodeT |
| using | tensorT = Tensor<T> |
| using | this_type = composite_product_op_NS<T, NDIM, opT, LDIM> |
Public Member Functions | |
| composite_product_op_NS () | |
| composite_product_op_NS (implT *result, const opT &leaf_op, const std::vector< TermImpl > &terms, Mode mode, const implT *bra, double target_precision, int oversampling, const ctT &cbra=ctT{}) | |
| void | accumulate_into_result (const keyT &key, const coeffT &coeff) const |
| Future< this_type > | activate () const |
| std::pair< bool, coeffT > | continue_recursion (const std::vector< bool > child_is_leaf, const tensorT &coeffs, const keyT &key) const |
| this_type | forward_ctor (implT *result1, const opT &leaf_op1, const std::vector< TermImpl > &orig_terms, Mode mode1, const implT *bra1, double target_precision1, int oversampling1, const std::vector< Future< ctT > > &t_futs, const std::vector< Future< ctL > > &l_futs) |
| bool | have_explicit_bra () const |
| void | leaf_action (const keyT &key, const coeffT &coeff) const |
| this_type | make_child (const keyT &child) const |
| std::pair< coeffT, double > | make_sum_coeffs (const keyT &key) const |
| std::pair< coeffT, double > | make_term_coeffs (const TermImpl &t, const keyT &key) const |
| coeffT | make_term_ket (const TermImpl &t, const keyT &key, const keyL &k1, const keyL &k2) const |
| std::pair< bool, coeffT > | operator() (const keyT &key) const |
| bool | randomize () const |
| std::pair< double, double > | sd_norm_pair_sum (const std::vector< ctL > &iap1, const std::vector< ctL > &iap2, const keyL &k1, const keyL &k2) const |
| template<typename Archive> | |
| void | serialize (Archive &ar) |
| double | term_refinement_error (const TermImpl &t, const keyT &key, const keyL &k1, const keyL &k2) const |
| full inaccurate-refinement error for one term, scaled by the term's coeff. | |
Static Public Member Functions | |
| static double | cross_term_error (const std::vector< std::pair< double, double > > &sd) |
| static tensorT | eri_coeffs (const implT *eri, const keyT &key) |
| fetch coeffs of an on-demand NDIM function at key | |
| template<typename CT, typename KEY> | |
| static std::pair< double, double > | sd_norm (const CT &ct, const KEY &key) |
| retrieve scaling- and detail-norm at the given key from a CoeffTracker | |
| static std::pair< double, double > | sd_norm_extra (const implT *extra, const keyT &key) |
Public Attributes | |
| const implT * | bra = nullptr |
| inner-mode on-demand bra (e.g., ERI) | |
| ctT | cbra |
| opT | leaf_op |
| Mode | mode = Mode::function |
| int | oversampling = 1 |
| implT * | result |
| output tree (function mode) or scalar sink (inner) | |
| double | target_precision = 0.0 |
| std::vector< TermImpl > | terms |
Adaptive sum-of-products operator over a vector of composite_terms.
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::coeffT = typename implT::coeffT |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::ctL = CoeffTracker<T, LDIM> |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::ctT = CoeffTracker<T, NDIM> |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::implL = FunctionImpl<T, LDIM> |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::implT = FunctionImpl<T, NDIM> |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::keyL = Key<LDIM> |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::keyT = Key<NDIM> |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::nodeT = typename implT::nodeT |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::tensorT = Tensor<T> |
| using madness::composite_product_op_NS< T, NDIM, opT, LDIM >::this_type = composite_product_op_NS<T, NDIM, opT, LDIM> |
|
strong |
|
inline |
References result.
|
inline |
References bra, cbra, leaf_op, mode, oversampling, result, target_precision, and terms.
|
inline |
References result.
Referenced by leaf_action().
|
inline |
References bra, cbra, forward_ctor(), have_explicit_bra(), leaf_op, mode, N, oversampling, p(), result, target_precision, terms, and madness::detail::wrap_mem_fn().
|
inline |
References madness::copy(), make_child(), p(), and result.
Referenced by operator()().
|
inlinestatic |
Σ over all non-trivial cross-products of (s_i + d_i) − ∏ s_i. Each factor contributes (s,d); error = total − product_of_s.
References d.
Referenced by term_refinement_error().
|
inlinestatic |
fetch coeffs of an on-demand NDIM function at key
References madness::FunctionImpl< T, NDIM >::fcube(), madness::FunctionImpl< T, NDIM >::get_cdata(), madness::FunctionImpl< T, NDIM >::get_functor(), MADNESS_ASSERT, and madness::FunctionImpl< T, NDIM >::values2coeffs().
Referenced by make_sum_coeffs(), make_term_coeffs(), and sd_norm_extra().
|
inline |
References madness::FunctionDefaults< NDIM >::k, N, and np.
Referenced by activate().
|
inline |
References cbra.
Referenced by activate(), make_child(), and make_sum_coeffs().
|
inline |
References accumulate_into_result(), function, mode, and result.
Referenced by operator()().
|
inline |
References bra, madness::Key< NDIM >::break_apart(), cbra, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::coeff, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::extra, have_explicit_bra(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iaket, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iap1, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iap2, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::ifactor1, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::ifactor2, k1, k2, leaf_op, madness::CoeffTracker< T, NDIM >::make_child(), mode, oversampling, p(), result, target_precision, and terms.
Referenced by continue_recursion().
|
inline |
Σ over terms. Function mode: returns the sum of NDIM coeffs. Inner mode: returns a degenerate coeff (the scalar lives elsewhere); here we return the sum of contractions packed as the (0,…) element of a vk-shaped tensor.
References bra, madness::Key< NDIM >::break_apart(), c, cbra, e(), eri_coeffs(), madness::error(), madness::Tensor< T >::flat(), function, have_explicit_bra(), k1, k2, L, make_term_coeffs(), mode, result, madness::sum(), term_refinement_error(), terms, and madness::TT_FULL.
Referenced by operator()().
|
inline |
multiply one term: ket * factor1(1) * factor2(2) * extra(1,2) Returns (coeffs at key, accumulated tnorm/oversampling error).
References std::abs(), madness::Key< NDIM >::break_apart(), madness::CoeffTracker< T, NDIM >::coeff(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::coeff, eri_coeffs(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::extra, madness::GenTensor< T >::full_tensor(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_extra(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_factor1(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_factor2(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::ifactor1, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::ifactor2, k1, k2, make_term_ket(), oversampling, result, and v.
Referenced by make_sum_coeffs().
|
inline |
build the NDIM ket coefficients at key for a term: either the explicit NDIM ket or the sum Σ_k outer(p1[k](k1), p2[k](k2)).
References madness::CoeffTracker< T, NDIM >::coeff(), madness::FunctionDefaults< NDIM >::k, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_ket(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iaket, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iap1, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iap2, k1, k2, MADNESS_ASSERT, madness::outer(), and result.
Referenced by make_term_coeffs().
|
inline |
|
inline |
|
inlinestatic |
retrieve scaling- and detail-norm at the given key from a CoeffTracker
Referenced by sd_norm_pair_sum(), and term_refinement_error().
|
inlinestatic |
scaling- and detail-norm for an on-demand NDIM extra factor. Returns (snorm, dnorm) ~ (||P_n eri||, ||Q_n eri||), with dnorm computed from the NS s0 / non-s0 split of the eri coeff tensor.
References c, madness::copy(), d, eri_coeffs(), and madness::FunctionImpl< T, NDIM >::get_cdata().
Referenced by term_refinement_error().
|
inline |
(s,d) of a sum-of-hartree-products ket: snorm = Σ_k s1_k s2_k, dnorm = Σ_k (s1_k d2_k + d1_k s2_k + d1_k d2_k). Upper-bound on the true (s,d) of the rank-r sum.
References d, madness::FunctionDefaults< NDIM >::k, k1, k2, MADNESS_ASSERT, and sd_norm().
Referenced by term_refinement_error().
|
inline |
References bra, cbra, leaf_op, mode, oversampling, result, target_precision, and terms.
|
inline |
full inaccurate-refinement error for one term, scaled by the term's coeff.
References std::abs(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::coeff, cross_term_error(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::extra, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_extra(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_factor1(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_factor2(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::have_ket(), madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iaket, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iap1, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::iap2, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::ifactor1, madness::composite_product_op_NS< T, NDIM, opT, LDIM >::TermImpl::ifactor2, k1, k2, sd_norm(), sd_norm_extra(), and sd_norm_pair_sum().
Referenced by make_sum_coeffs().
| const implT* madness::composite_product_op_NS< T, NDIM, opT, LDIM >::bra = nullptr |
inner-mode on-demand bra (e.g., ERI)
Referenced by composite_product_op_NS(), activate(), make_child(), make_sum_coeffs(), and serialize().
| ctT madness::composite_product_op_NS< T, NDIM, opT, LDIM >::cbra |
inner-mode explicit-NDIM bra (tracked). At most one of {bra, cbra} is active.
Referenced by composite_product_op_NS(), activate(), have_explicit_bra(), make_child(), make_sum_coeffs(), and serialize().
| opT madness::composite_product_op_NS< T, NDIM, opT, LDIM >::leaf_op |
Referenced by composite_product_op_NS(), activate(), make_child(), operator()(), and serialize().
| Mode madness::composite_product_op_NS< T, NDIM, opT, LDIM >::mode = Mode::function |
Referenced by composite_product_op_NS(), activate(), leaf_action(), make_child(), make_sum_coeffs(), and serialize().
| int madness::composite_product_op_NS< T, NDIM, opT, LDIM >::oversampling = 1 |
Referenced by composite_product_op_NS(), activate(), make_child(), make_term_coeffs(), and serialize().
| implT* madness::composite_product_op_NS< T, NDIM, opT, LDIM >::result |
output tree (function mode) or scalar sink (inner)
Referenced by composite_product_op_NS(), composite_product_op_NS(), accumulate_into_result(), activate(), continue_recursion(), leaf_action(), make_child(), make_sum_coeffs(), make_term_coeffs(), make_term_ket(), operator()(), and serialize().
| double madness::composite_product_op_NS< T, NDIM, opT, LDIM >::target_precision = 0.0 |
Referenced by composite_product_op_NS(), activate(), make_child(), operator()(), and serialize().
| std::vector<TermImpl> madness::composite_product_op_NS< T, NDIM, opT, LDIM >::terms |
Referenced by composite_product_op_NS(), activate(), make_child(), make_sum_coeffs(), and serialize().