MADNESS
0.10.1
|
LowRankFunction represents a hi-dimensional (NDIM) function as a sum of products of low-dimensional (LDIM) functions. More...
#include <lowrankfunction.h>
Public Member Functions | |
LowRankFunction (const LowRankFunction &other) | |
shallow copy ctor More... | |
LowRankFunction (std::vector< Function< T, LDIM >> g, std::vector< Function< T, LDIM >> h, double tol, std::string orthomethod) | |
LowRankFunction (World &world) | |
double | check_orthonormality (const std::vector< Function< T, LDIM >> &v) const |
double | check_orthonormality (const Tensor< T > &ovlp) const |
std::vector< Function< T, LDIM > > | get_functions (const particle< LDIM > &p) const |
std::vector< Function< T, LDIM > > | get_g () const |
std::vector< Function< T, LDIM > > | get_h () const |
double | l2error (const LRFunctorBase< T, NDIM > &lrfunctor1) const |
compute the l2 error |functor - \sum_i g_ih_i|_2 More... | |
TensorTypeData< T >::scalar_type | norm2 () const |
l2 norm More... | |
T | operator() (const Vector< double, NDIM > &r) const |
function evaluation More... | |
template<typename Q > | |
LowRankFunction | operator* (const Q a) const |
scale by a scalar More... | |
LowRankFunction | operator* (const T a) const |
out-of-place scale by a scalar (no type conversion) More... | |
LowRankFunction & | operator*= (const T a) |
in-place scale by a scalar (no type conversion) More... | |
LowRankFunction | operator+ (const LowRankFunction &b) const |
addition More... | |
LowRankFunction & | operator+= (const LowRankFunction &b) |
in-place addition More... | |
LowRankFunction | operator- (const LowRankFunction &b) const |
subtraction More... | |
LowRankFunction & | operator-= (const LowRankFunction &b) |
in-place subtraction More... | |
LowRankFunction & | operator= (const LowRankFunction &f) |
void | optimize (const LRFunctorBase< T, NDIM > &lrfunctor1, const long nopt=1) |
optimize the lrf using the lrfunctor More... | |
std::vector< Function< T, LDIM > > | orthonormalize (const std::vector< Function< T, LDIM >> &g) const |
orthonormalize the argument vector More... | |
long | rank () const |
Function< T, NDIM > | reconstruct () const |
void | remove_linear_depdencies (double thresh=-1.0) |
remove linear dependencies without orthonormalization More... | |
void | reorthonormalize (double thresh=-1.0) |
after external operations g might not be orthonormal and/or optimal – reorthonormalize More... | |
double | size () const |
return the size in GByte More... | |
Public Attributes | |
bool | do_print =false |
std::vector< Function< T, LDIM > > | g |
std::vector< Function< T, LDIM > > | h |
std::string | orthomethod ="canonical" |
const particle< LDIM > | p1 =particle<LDIM>::particle1() |
const particle< LDIM > | p2 =particle<LDIM>::particle2() |
double | rank_revealing_tol =1.e-8 |
World & | world |
Friends | |
LowRankFunction | copy (const LowRankFunction &other) |
deep copy More... | |
LowRankFunction | operator* (const T a, const LowRankFunction &other) |
multiplication with a scalar More... | |
LowRankFunction represents a hi-dimensional (NDIM) function as a sum of products of low-dimensional (LDIM) functions.
f(1,2) = \sum_i g_i(1) h_i(2) a LowRankFunction can be created from a hi-dim function directly, or from a composite like f(1,2) phi(1) psi(2), where f(1,2) is a two-particle function (e.g. a Slater function)
|
inline |
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::operator*().
|
inline |
|
inline |
shallow copy ctor
|
inline |
References madness::matrix_inner(), v, and madness::LowRankFunction< T, NDIM, LDIM >::world.
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::l2error().
|
inline |
References madness::Tensor< T >::absmax(), madness::BaseTensor::dim(), madness::LowRankFunction< T, NDIM, LDIM >::do_print, madness::timer::do_print, madness::Tensor< T >::normf(), madness::print(), madness::World::rank(), madness::BaseTensor::size(), madness::timer::tag(), and madness::LowRankFunction< T, NDIM, LDIM >::world.
|
inline |
|
inline |
|
inline |
compute the l2 error |functor - \sum_i g_ih_i|_2
\int (f(1,2) - gh(1,2))^2 = \int f(1,2)^2 - 2\int f(1,2) gh(1,2) + \int gh(1,2)^2 since we are subtracting large numbers the numerics are sensitive, and NaN may be returned..
References madness::arg(), madness::LowRankFunction< T, NDIM, LDIM >::check_orthonormality(), madness::LowRankFunction< T, NDIM, LDIM >::do_print, madness::timer::do_print, madness::error(), madness::LowRankFunction< T, NDIM, LDIM >::g, madness::LowRankFunction< T, NDIM, LDIM >::h, madness::inner(), madness::matrix_inner(), madness::LRFunctorBase< T, NDIM, LDIM >::norm2(), madness::LowRankFunction< T, NDIM, LDIM >::p1, madness::LowRankFunction< T, NDIM, LDIM >::p2, madness::print(), madness::World::rank(), madness::timer::tag(), and madness::LowRankFunction< T, NDIM, LDIM >::world.
|
inline |
|
inline |
function evaluation
References madness::LowRankFunction< T, NDIM, LDIM >::g, madness::LowRankFunction< T, NDIM, LDIM >::h, and madness::LowRankFunction< T, NDIM, LDIM >::rank().
|
inline |
|
inline |
out-of-place scale by a scalar (no type conversion)
References madness::LowRankFunction< T, NDIM, LDIM >::LowRankFunction(), a, madness::LowRankFunction< T, NDIM, LDIM >::g, madness::LowRankFunction< T, NDIM, LDIM >::h, madness::LowRankFunction< T, NDIM, LDIM >::orthomethod, and madness::LowRankFunction< T, NDIM, LDIM >::rank_revealing_tol.
|
inline |
in-place scale by a scalar (no type conversion)
References a, and madness::LowRankFunction< T, NDIM, LDIM >::g.
|
inline |
addition
References b, and madness::LowRankFunction< T, NDIM, LDIM >::copy.
|
inline |
in-place addition
References madness::append(), b, madness::LowRankFunction< T, NDIM, LDIM >::copy, madness::LowRankFunction< T, NDIM, LDIM >::g, and madness::LowRankFunction< T, NDIM, LDIM >::h.
|
inline |
subtraction
References b, and madness::LowRankFunction< T, NDIM, LDIM >::copy.
|
inline |
in-place subtraction
References madness::append(), b, madness::LowRankFunction< T, NDIM, LDIM >::copy, madness::LowRankFunction< T, NDIM, LDIM >::g, and madness::LowRankFunction< T, NDIM, LDIM >::h.
|
inline |
|
inline |
optimize the lrf using the lrfunctor
[in] | nopt | number of iterations (wrt to Alg. 4.3 in Halko) |
References madness::LowRankFunction< T, NDIM, LDIM >::do_print, madness::timer::do_print, madness::LowRankFunction< T, NDIM, LDIM >::g, madness::LowRankFunction< T, NDIM, LDIM >::h, madness::inner(), madness::LowRankFunction< T, NDIM, LDIM >::orthonormalize(), madness::LowRankFunction< T, NDIM, LDIM >::p1, madness::LowRankFunction< T, NDIM, LDIM >::p2, madness::timer::tag(), madness::truncate(), and madness::LowRankFunction< T, NDIM, LDIM >::world.
Referenced by madness::CCPairFunction< T, NDIM >::op_dec_to_dec().
|
inline |
orthonormalize the argument vector
References madness::LowRankFunction< T, NDIM, LDIM >::g, madness::FunctionDefaults< NDIM >::get_thresh(), MADNESS_EXCEPTION, madness::matrix_inner(), madness::LowRankFunction< T, NDIM, LDIM >::orthomethod, madness::orthonormalize_canonical(), madness::orthonormalize_rrcd(), madness::print(), madness::LowRankFunction< T, NDIM, LDIM >::rank_revealing_tol, madness::truncate(), and madness::LowRankFunction< T, NDIM, LDIM >::world.
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::optimize().
|
inline |
References madness::LowRankFunction< T, NDIM, LDIM >::g.
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::operator()().
|
inline |
remove linear dependencies without orthonormalization
|
inline |
after external operations g might not be orthonormal and/or optimal – reorthonormalize
orthonormalization similar to Bischoff, Harrison, Valeev, JCP 137 104103 (2012), Sec II C 3 f =\sum_i g_i h_i = g X- (X+)^T (Y+)^T Y- h = g X- U S V^T Y- h = g (X- U) (S V^T Y-) h requires 2 matrix_inner and 2 transforms. g and h are optimal, but contain all cusps etc..
[in] | thresh | SVD threshold |
References madness::_(), madness::LowRankFunction< T, NDIM, LDIM >::copy, madness::LowRankFunction< T, NDIM, LDIM >::g, madness::LowRankFunction< T, NDIM, LDIM >::h, madness::inner(), MADNESS_CHECK_THROW, madness::matrix_inner(), pow(), madness::LowRankFunction< T, NDIM, LDIM >::rank_revealing_tol, madness::svd(), madness::syev(), thresh, madness::transform(), madness::truncate(), and madness::LowRankFunction< T, NDIM, LDIM >::world.
Referenced by madness::CCPairFunction< T, NDIM >::remove_linearly_dependent_terms().
|
inline |
return the size in GByte
References madness::LowRankFunction< T, NDIM, LDIM >::g, madness::get_size(), madness::LowRankFunction< T, NDIM, LDIM >::h, and madness::LowRankFunction< T, NDIM, LDIM >::world.
|
friend |
deep copy
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::operator+(), madness::LowRankFunction< T, NDIM, LDIM >::operator+=(), madness::LowRankFunction< T, NDIM, LDIM >::operator-(), madness::LowRankFunction< T, NDIM, LDIM >::operator-=(), and madness::LowRankFunction< T, NDIM, LDIM >::reorthonormalize().
|
friend |
multiplication with a scalar
bool madness::LowRankFunction< T, NDIM, LDIM >::do_print =false |
std::vector<Function<T,LDIM> > madness::LowRankFunction< T, NDIM, LDIM >::g |
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::get_functions(), madness::LowRankFunction< T, NDIM, LDIM >::get_g(), madness::inner(), madness::LowRankFunction< T, NDIM, LDIM >::l2error(), madness::LowRankFunction< T, NDIM, LDIM >::norm2(), madness::LowRankFunction< T, NDIM, LDIM >::operator()(), madness::LowRankFunction< T, NDIM, LDIM >::operator*(), madness::LowRankFunction< T, NDIM, LDIM >::operator*=(), madness::LowRankFunction< T, NDIM, LDIM >::operator+=(), madness::LowRankFunction< T, NDIM, LDIM >::operator-=(), madness::LowRankFunction< T, NDIM, LDIM >::operator=(), madness::LowRankFunction< T, NDIM, LDIM >::optimize(), madness::LowRankFunction< T, NDIM, LDIM >::orthonormalize(), madness::LowRankFunction< T, NDIM, LDIM >::rank(), madness::LowRankFunction< T, NDIM, LDIM >::reconstruct(), madness::LowRankFunction< T, NDIM, LDIM >::reorthonormalize(), madness::LowRankFunction< T, NDIM, LDIM >::size(), and test_Kcommutator().
std::vector<Function<T,LDIM> > madness::LowRankFunction< T, NDIM, LDIM >::h |
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::get_functions(), madness::LowRankFunction< T, NDIM, LDIM >::get_h(), madness::inner(), madness::LowRankFunction< T, NDIM, LDIM >::l2error(), madness::LowRankFunction< T, NDIM, LDIM >::norm2(), madness::LowRankFunction< T, NDIM, LDIM >::operator()(), madness::LowRankFunction< T, NDIM, LDIM >::operator*(), madness::LowRankFunction< T, NDIM, LDIM >::operator+=(), madness::LowRankFunction< T, NDIM, LDIM >::operator-=(), madness::LowRankFunction< T, NDIM, LDIM >::operator=(), madness::LowRankFunction< T, NDIM, LDIM >::optimize(), madness::LowRankFunction< T, NDIM, LDIM >::reconstruct(), madness::LowRankFunction< T, NDIM, LDIM >::reorthonormalize(), madness::LowRankFunction< T, NDIM, LDIM >::size(), and test_Kcommutator().
std::string madness::LowRankFunction< T, NDIM, LDIM >::orthomethod ="canonical" |
const particle<LDIM> madness::LowRankFunction< T, NDIM, LDIM >::p1 =particle<LDIM>::particle1() |
const particle<LDIM> madness::LowRankFunction< T, NDIM, LDIM >::p2 =particle<LDIM>::particle2() |
double madness::LowRankFunction< T, NDIM, LDIM >::rank_revealing_tol =1.e-8 |
World& madness::LowRankFunction< T, NDIM, LDIM >::world |
Referenced by madness::LowRankFunction< T, NDIM, LDIM >::check_orthonormality(), madness::LowRankFunction< T, NDIM, LDIM >::l2error(), madness::LowRankFunction< T, NDIM, LDIM >::norm2(), madness::LowRankFunction< T, NDIM, LDIM >::optimize(), madness::LowRankFunction< T, NDIM, LDIM >::orthonormalize(), madness::LowRankFunction< T, NDIM, LDIM >::reorthonormalize(), and madness::LowRankFunction< T, NDIM, LDIM >::size().