MADNESS 0.10.1
Public Member Functions | Public Attributes | Friends | List of all members
madness::LowRankFunction< T, NDIM, LDIM > Class Template Reference

LowRankFunction represents a hi-dimensional (NDIM) function as a sum of products of low-dimensional (LDIM) functions. More...

#include <lowrankfunction.h>

Collaboration diagram for madness::LowRankFunction< T, NDIM, LDIM >:
Collaboration graph
[legend]

Public Member Functions

 LowRankFunction (const LowRankFunction &other)
 shallow copy ctor
 
 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
 
TensorTypeData< T >::scalar_type norm2 () const
 l2 norm
 
T operator() (const Vector< double, NDIM > &r) const
 function evaluation
 
template<typename Q >
LowRankFunction operator* (const Q a) const
 scale by a scalar
 
LowRankFunction operator* (const T a) const
 out-of-place scale by a scalar (no type conversion)
 
LowRankFunctionoperator*= (const T a)
 in-place scale by a scalar (no type conversion)
 
LowRankFunction operator+ (const LowRankFunction &b) const
 addition
 
LowRankFunctionoperator+= (const LowRankFunction &b)
 in-place addition
 
LowRankFunction operator- (const LowRankFunction &b) const
 subtraction
 
LowRankFunctionoperator-= (const LowRankFunction &b)
 in-place subtraction
 
LowRankFunctionoperator= (const LowRankFunction &f)
 
void optimize (const LRFunctorBase< T, NDIM > &lrfunctor1, const long nopt=1)
 optimize the lrf using the lrfunctor
 
std::vector< Function< T, LDIM > > orthonormalize (const std::vector< Function< T, LDIM > > &g) const
 orthonormalize the argument vector
 
long rank () const
 
Function< T, NDIMreconstruct () const
 
void remove_linear_depdencies (double thresh=-1.0)
 remove linear dependencies without orthonormalization
 
void reorthonormalize (double thresh=-1.0)
 after external operations g might not be orthonormal and/or optimal – reorthonormalize
 
double size () const
 return the size in GByte
 

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
 
Worldworld
 

Friends

LowRankFunction copy (const LowRankFunction &other)
 deep copy
 
LowRankFunction operator* (const T a, const LowRankFunction &other)
 multiplication with a scalar
 

Detailed Description

template<typename T, std::size_t NDIM, std::size_t LDIM = NDIM/2>
class madness::LowRankFunction< T, NDIM, LDIM >

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)

Constructor & Destructor Documentation

◆ LowRankFunction() [1/3]

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
madness::LowRankFunction< T, NDIM, LDIM >::LowRankFunction ( World world)
inline

◆ LowRankFunction() [2/3]

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
madness::LowRankFunction< T, NDIM, LDIM >::LowRankFunction ( std::vector< Function< T, LDIM > >  g,
std::vector< Function< T, LDIM > >  h,
double  tol,
std::string  orthomethod 
)
inline

◆ LowRankFunction() [3/3]

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
madness::LowRankFunction< T, NDIM, LDIM >::LowRankFunction ( const LowRankFunction< T, NDIM, LDIM > &  other)
inline

shallow copy ctor

Member Function Documentation

◆ check_orthonormality() [1/2]

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
double madness::LowRankFunction< T, NDIM, LDIM >::check_orthonormality ( const std::vector< Function< T, LDIM > > &  v) const
inline

◆ check_orthonormality() [2/2]

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
double madness::LowRankFunction< T, NDIM, LDIM >::check_orthonormality ( const Tensor< T > &  ovlp) const
inline

◆ get_functions()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
std::vector< Function< T, LDIM > > madness::LowRankFunction< T, NDIM, LDIM >::get_functions ( const particle< LDIM > &  p) const
inline

◆ get_g()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
std::vector< Function< T, LDIM > > madness::LowRankFunction< T, NDIM, LDIM >::get_g ( ) const
inline

◆ get_h()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
std::vector< Function< T, LDIM > > madness::LowRankFunction< T, NDIM, LDIM >::get_h ( ) const
inline

◆ l2error()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
double madness::LowRankFunction< T, NDIM, LDIM >::l2error ( const LRFunctorBase< T, NDIM > &  lrfunctor1) const
inline

◆ norm2()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
TensorTypeData< T >::scalar_type madness::LowRankFunction< T, NDIM, LDIM >::norm2 ( ) const
inline

◆ operator()()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
T madness::LowRankFunction< T, NDIM, LDIM >::operator() ( const Vector< double, NDIM > &  r) const
inline

◆ operator*() [1/2]

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
template<typename Q >
LowRankFunction madness::LowRankFunction< T, NDIM, LDIM >::operator* ( const Q  a) const
inline

◆ operator*() [2/2]

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction madness::LowRankFunction< T, NDIM, LDIM >::operator* ( const T  a) const
inline

◆ operator*=()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction & madness::LowRankFunction< T, NDIM, LDIM >::operator*= ( const T  a)
inline

in-place scale by a scalar (no type conversion)

References a, and madness::LowRankFunction< T, NDIM, LDIM >::g.

◆ operator+()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction madness::LowRankFunction< T, NDIM, LDIM >::operator+ ( const LowRankFunction< T, NDIM, LDIM > &  b) const
inline

◆ operator+=()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction & madness::LowRankFunction< T, NDIM, LDIM >::operator+= ( const LowRankFunction< T, NDIM, LDIM > &  b)
inline

◆ operator-()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction madness::LowRankFunction< T, NDIM, LDIM >::operator- ( const LowRankFunction< T, NDIM, LDIM > &  b) const
inline

subtraction

References b, and madness::LowRankFunction< T, NDIM, LDIM >::copy.

◆ operator-=()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction & madness::LowRankFunction< T, NDIM, LDIM >::operator-= ( const LowRankFunction< T, NDIM, LDIM > &  b)
inline

◆ operator=()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction & madness::LowRankFunction< T, NDIM, LDIM >::operator= ( const LowRankFunction< T, NDIM, LDIM > &  f)
inline

◆ optimize()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
void madness::LowRankFunction< T, NDIM, LDIM >::optimize ( const LRFunctorBase< T, NDIM > &  lrfunctor1,
const long  nopt = 1 
)
inline

◆ orthonormalize()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
std::vector< Function< T, LDIM > > madness::LowRankFunction< T, NDIM, LDIM >::orthonormalize ( const std::vector< Function< T, LDIM > > &  g) const
inline

◆ rank()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
long madness::LowRankFunction< T, NDIM, LDIM >::rank ( ) const
inline

◆ reconstruct()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
Function< T, NDIM > madness::LowRankFunction< T, NDIM, LDIM >::reconstruct ( ) const
inline

◆ remove_linear_depdencies()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
void madness::LowRankFunction< T, NDIM, LDIM >::remove_linear_depdencies ( double  thresh = -1.0)
inline

remove linear dependencies without orthonormalization

◆ reorthonormalize()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
void madness::LowRankFunction< T, NDIM, LDIM >::reorthonormalize ( double  thresh = -1.0)
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..

Parameters
[in]threshSVD 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(), 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().

◆ size()

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
double madness::LowRankFunction< T, NDIM, LDIM >::size ( ) const
inline

Friends And Related Symbol Documentation

◆ copy

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction copy ( const LowRankFunction< T, NDIM, LDIM > &  other)
friend

◆ operator*

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
LowRankFunction operator* ( const T  a,
const LowRankFunction< T, NDIM, LDIM > &  other 
)
friend

multiplication with a scalar

Member Data Documentation

◆ do_print

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
bool madness::LowRankFunction< T, NDIM, LDIM >::do_print =false

◆ g

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
std::vector<Function<T,LDIM> > madness::LowRankFunction< T, NDIM, LDIM >::g

◆ h

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
std::vector<Function<T,LDIM> > madness::LowRankFunction< T, NDIM, LDIM >::h

◆ orthomethod

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
std::string madness::LowRankFunction< T, NDIM, LDIM >::orthomethod ="canonical"

◆ p1

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
const particle<LDIM> madness::LowRankFunction< T, NDIM, LDIM >::p1 =particle<LDIM>::particle1()

◆ p2

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
const particle<LDIM> madness::LowRankFunction< T, NDIM, LDIM >::p2 =particle<LDIM>::particle2()

◆ rank_revealing_tol

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
double madness::LowRankFunction< T, NDIM, LDIM >::rank_revealing_tol =1.e-8

◆ world

template<typename T , std::size_t NDIM, std::size_t LDIM = NDIM/2>
World& madness::LowRankFunction< T, NDIM, LDIM >::world

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