MADNESS  version 0.9
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
madness::SeparatedConvolution< Q, NDIM > Class Template Reference

Convolutions in separated form (including Gaussian) More...

#include <operator.h>

Inheritance diagram for madness::SeparatedConvolution< Q, NDIM >:
Inheritance graph
[legend]
Collaboration diagram for madness::SeparatedConvolution< Q, NDIM >:
Collaboration graph
[legend]

Public Types

typedef Q opT
 The apply function uses this to infer resultT=opT*inputT. More...
 
typedef Key< NDIMkeyT
 

Public Member Functions

bool & modified ()
 
const bool & modified () const
 
int & particle ()
 
const int & particle () const
 
bool & destructive ()
 
const bool & destructive () const
 
const double & gamma () const
 
const double & mu () const
 
 SeparatedConvolution (World &world, std::vector< std::shared_ptr< Convolution1D< Q > > > &argops, const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), long k=FunctionDefaults< NDIM >::get_k(), bool doleaves=false)
 
 SeparatedConvolution (World &world, std::vector< ConvolutionND< Q, NDIM > > &argops, const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), long k=FunctionDefaults< NDIM >::get_k(), bool doleaves=false)
 
 SeparatedConvolution (World &world, const Tensor< Q > &coeff, const Tensor< double > &expnt, const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), int k=FunctionDefaults< NDIM >::get_k(), bool doleaves=false, double mu=0.0)
 Constructor for Gaussian Convolutions (mostly for backward compatability) More...
 
 SeparatedConvolution (World &world, Vector< double, NDIM > args, const Tensor< Q > &coeff, const Tensor< double > &expnt, const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), int k=FunctionDefaults< NDIM >::get_k(), bool doleaves=false)
 WSTHORNTON Constructor for Gaussian Convolutions (mostly for backward compatability) More...
 
virtual ~SeparatedConvolution ()
 
void print_timer () const
 
void reset_timer () const
 
const BoundaryConditions< NDIM > & get_bc () const
 
const std::vector< Key< NDIM > > & get_disp (Level n) const
 
double norm (Level n, const Key< NDIM > &d, const Key< NDIM > &source_key) const
 return the operator norm for all terms, all dimensions and 1 displacement More...
 
template<size_t FDIM>
disable_if_c< FDIM==NDIM, Key
< NDIM > >::type 
get_source_key (const Key< FDIM > key) const
 return that part of a hi-dim key that serves as the base for displacements of this operator More...
 
template<size_t FDIM>
enable_if_c< FDIM==NDIM, Key
< NDIM > >::type 
get_source_key (const Key< FDIM > key) const
 return that part of a hi-dim key that serves as the base for displacements of this operator More...
 
template<typename T , size_t FDIM>
Function< TENSOR_RESULT_TYPE(T,
Q), FDIM > 
operator() (const Function< T, FDIM > &f) const
 apply this operator on a function f More...
 
template<typename T , size_t LDIM>
Function< TENSOR_RESULT_TYPE(T,
Q), LDIM+LDIM > 
operator() (const Function< T, LDIM > &f1, const Function< Q, LDIM > &f2) const
 apply this operator on a separable function f(1,2) = f(1) f(2) More...
 
template<typename T >
Tensor< TENSOR_RESULT_TYPE(T, Q)> apply (const Key< NDIM > &source, const Key< NDIM > &shift, const Tensor< T > &coeff, double tol) const
 apply this operator on coefficients in full rank form More...
 
template<typename T >
GenTensor< TENSOR_RESULT_TYPE(T,
Q)> 
apply2_lowdim (const Key< NDIM > &source, const Key< NDIM > &shift, const GenTensor< T > &coeff, double tol, double tol2) const
 apply this operator on only 1 particle of the coefficients in low rank form More...
 
template<typename T >
GenTensor< TENSOR_RESULT_TYPE(T,
Q)> 
apply2 (const Key< NDIM > &source, const Key< NDIM > &shift, const GenTensor< T > &coeff, double tol, double tol2) const
 apply this operator on coefficients in low rank form More...
 
template<typename T >
double estimate_costs (const Key< NDIM > &source, const Key< NDIM > &shift, const GenTensor< T > &coeff, double tol, double tol2) const
 estimate the ratio of cost of full rank versus low rank More...
 
- Public Member Functions inherited from madness::WorldObject< SeparatedConvolution< Q, NDIM > >
 WorldObject (World &world)
 Associates object with globally unique ID. More...
 
const uniqueidTid () const
 Returns the globally unique object ID. More...
 
Worldget_world () const
 Returns a reference to the world. More...
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8) const
 
detail::task_result_type
< memfnT >::futureT 
send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9) const
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8,a9)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4,a5)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4,a5,a6)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8)". More...
 
detail::task_result_type
< memfnT >::futureT 
task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8,a9)". More...
 
virtual ~WorldObject ()
 

Public Attributes

bool doleaves
 If should be applied to leaf coefficients ... false by default. More...
 
bool isperiodicsum
 
bool modified_
 use modified NS form More...
 
int particle_
 
bool destructive_
 destroy the argument or restore it (expensive for 6d functions) More...
 
Timer timer_full
 
Timer timer_low_transf
 
Timer timer_low_accumulate
 
bool is_slaterf12
 
double mu_
 
- Public Attributes inherited from madness::WorldObject< SeparatedConvolution< Q, NDIM > >
Worldworld
 Think globally act locally. More...
 

Static Public Attributes

static const size_t opdim =NDIM
 

Additional Inherited Members

- Protected Member Functions inherited from madness::WorldObject< SeparatedConvolution< Q, NDIM > >
void process_pending ()
 To be called from derived constructor to process pending messages. More...
 

Detailed Description

template<typename Q, std::size_t NDIM>
class madness::SeparatedConvolution< Q, NDIM >

Convolutions in separated form (including Gaussian)

Member Typedef Documentation

template<typename Q, std::size_t NDIM>
typedef Key<NDIM> madness::SeparatedConvolution< Q, NDIM >::keyT
template<typename Q, std::size_t NDIM>
typedef Q madness::SeparatedConvolution< Q, NDIM >::opT

The apply function uses this to infer resultT=opT*inputT.

Constructor & Destructor Documentation

template<typename Q, std::size_t NDIM>
madness::SeparatedConvolution< Q, NDIM >::SeparatedConvolution ( World world,
std::vector< std::shared_ptr< Convolution1D< Q > > > &  argops,
const BoundaryConditions< NDIM > &  bc = FunctionDefaults<NDIM>::get_bc(),
long  k = FunctionDefaults<NDIM>::get_k(),
bool  doleaves = false 
)
inline
template<typename Q, std::size_t NDIM>
madness::SeparatedConvolution< Q, NDIM >::SeparatedConvolution ( World world,
std::vector< ConvolutionND< Q, NDIM > > &  argops,
const BoundaryConditions< NDIM > &  bc = FunctionDefaults<NDIM>::get_bc(),
long  k = FunctionDefaults<NDIM>::get_k(),
bool  doleaves = false 
)
inline
template<typename Q, std::size_t NDIM>
madness::SeparatedConvolution< Q, NDIM >::SeparatedConvolution ( World world,
const Tensor< Q > &  coeff,
const Tensor< double > &  expnt,
const BoundaryConditions< NDIM > &  bc = FunctionDefaults<NDIM>::get_bc(),
int  k = FunctionDefaults<NDIM>::get_k(),
bool  doleaves = false,
double  mu = 0.0 
)
inline

Constructor for Gaussian Convolutions (mostly for backward compatability)

template<typename Q, std::size_t NDIM>
madness::SeparatedConvolution< Q, NDIM >::SeparatedConvolution ( World world,
Vector< double, NDIM args,
const Tensor< Q > &  coeff,
const Tensor< double > &  expnt,
const BoundaryConditions< NDIM > &  bc = FunctionDefaults<NDIM>::get_bc(),
int  k = FunctionDefaults<NDIM>::get_k(),
bool  doleaves = false 
)
inline

WSTHORNTON Constructor for Gaussian Convolutions (mostly for backward compatability)

template<typename Q, std::size_t NDIM>
virtual madness::SeparatedConvolution< Q, NDIM >::~SeparatedConvolution ( )
inlinevirtual

Member Function Documentation

template<typename Q, std::size_t NDIM>
template<typename T >
Tensor<TENSOR_RESULT_TYPE(T,Q)> madness::SeparatedConvolution< Q, NDIM >::apply ( const Key< NDIM > &  source,
const Key< NDIM > &  shift,
const Tensor< T > &  coeff,
double  tol 
) const
inline

apply this operator on coefficients in full rank form

Parameters
[in]coeffsource coeffs in full rank
[in]sourcethe source key
[in]shiftthe displacement, where the source coeffs come from
[in]tolthresh/#neigh*cnorm
Returns
a tensor of full rank with the result op(coeff)

SeparatedConvolutionData keeps data for all terms and all dimensions and 1 displacement

template<typename Q, std::size_t NDIM>
template<typename T >
GenTensor<TENSOR_RESULT_TYPE(T,Q)> madness::SeparatedConvolution< Q, NDIM >::apply2 ( const Key< NDIM > &  source,
const Key< NDIM > &  shift,
const GenTensor< T > &  coeff,
double  tol,
double  tol2 
) const
inline

apply this operator on coefficients in low rank form

Parameters
[in]coeffsource coeffs in SVD (=optimal!) form
[in]tolthresh/#neigh*cnorm
[in]tol2thresh/#neigh
template<typename Q, std::size_t NDIM>
template<typename T >
GenTensor<TENSOR_RESULT_TYPE(T,Q)> madness::SeparatedConvolution< Q, NDIM >::apply2_lowdim ( const Key< NDIM > &  source,
const Key< NDIM > &  shift,
const GenTensor< T > &  coeff,
double  tol,
double  tol2 
) const
inline

apply this operator on only 1 particle of the coefficients in low rank form

note the unfortunate mess with NDIM: here NDIM is the operator dimension, and FDIM is the function's dimension, whereas in the function we have OPDIM for the operator and NDIM for the function

Template Parameters
FDIMthe dimension of the function this operator is applied on
Parameters
[in]coeffsource coeffs in SVD (=optimal!) form, in high dimensionality (FDIM)
[in]sourcethe source key in low dimensionality (NDIM)
[in]shiftthe displacement in low dimensionality (NDIM)
[in]tolthresh/#neigh*cnorm
[in]tol2thresh/#neigh
Returns
coeff result
template<typename Q, std::size_t NDIM>
bool& madness::SeparatedConvolution< Q, NDIM >::destructive ( )
inline

Referenced by madness::apply(), and main().

template<typename Q, std::size_t NDIM>
const bool& madness::SeparatedConvolution< Q, NDIM >::destructive ( ) const
inline
template<typename Q, std::size_t NDIM>
template<typename T >
double madness::SeparatedConvolution< Q, NDIM >::estimate_costs ( const Key< NDIM > &  source,
const Key< NDIM > &  shift,
const GenTensor< T > &  coeff,
double  tol,
double  tol2 
) const
inline

estimate the ratio of cost of full rank versus low rank

Parameters
[in]sourcesource key
[in]shiftdisplacement
[in]tolthresh/#neigh/cnorm
[in]tol2thresh/#neigh
Returns
cost_ratio r=-1: no terms left 0<r<1: better to do full rank 1<r: better to do low rank
template<typename Q, std::size_t NDIM>
const double& madness::SeparatedConvolution< Q, NDIM >::gamma ( ) const
inline
template<typename Q, std::size_t NDIM>
const BoundaryConditions<NDIM>& madness::SeparatedConvolution< Q, NDIM >::get_bc ( ) const
inline
template<typename Q, std::size_t NDIM>
const std::vector< Key<NDIM> >& madness::SeparatedConvolution< Q, NDIM >::get_disp ( Level  n) const
inline
template<typename Q, std::size_t NDIM>
template<size_t FDIM>
disable_if_c<FDIM==NDIM, Key<NDIM> >::type madness::SeparatedConvolution< Q, NDIM >::get_source_key ( const Key< FDIM >  key) const
inline

return that part of a hi-dim key that serves as the base for displacements of this operator

if the function and the operator have the same dimension return key if the function has a higher dimension than the operator (e.g. in the exchange operator) return only that part of key that corresponds to the particle this operator works on

Parameters
[in]keyhi-dim key
Returns
a lo-dim part of key; typically first or second half
template<typename Q, std::size_t NDIM>
template<size_t FDIM>
enable_if_c<FDIM==NDIM, Key<NDIM> >::type madness::SeparatedConvolution< Q, NDIM >::get_source_key ( const Key< FDIM >  key) const
inline

return that part of a hi-dim key that serves as the base for displacements of this operator

if the function and the operator have the same dimension return key if the function has a higher dimension than the operator (e.g. in the exchange operator) return only that part of key that corresponds to the particle this operator works on

Parameters
[in]keyhi-dim key
Returns
a lo-dim part of key; typically first or second half
template<typename Q, std::size_t NDIM>
bool& madness::SeparatedConvolution< Q, NDIM >::modified ( )
inline
template<typename Q, std::size_t NDIM>
const bool& madness::SeparatedConvolution< Q, NDIM >::modified ( ) const
inline
template<typename Q, std::size_t NDIM>
const double& madness::SeparatedConvolution< Q, NDIM >::mu ( ) const
inline
template<typename Q, std::size_t NDIM>
double madness::SeparatedConvolution< Q, NDIM >::norm ( Level  n,
const Key< NDIM > &  d,
const Key< NDIM > &  source_key 
) const
inline

return the operator norm for all terms, all dimensions and 1 displacement

template<typename Q, std::size_t NDIM>
template<typename T , size_t FDIM>
Function<TENSOR_RESULT_TYPE(T,Q),FDIM> madness::SeparatedConvolution< Q, NDIM >::operator() ( const Function< T, FDIM > &  f) const
inline

apply this operator on a function f

the operator does not need to have the same dimension as the function, e,g, the Poisson kernel for the exchange operator acts only on 1 electron of a given (pair) function.

Parameters
[in]fa function of same or different dimension as this operator
Returns
the result function of the same dimensionality as the input function f
template<typename Q, std::size_t NDIM>
template<typename T , size_t LDIM>
Function<TENSOR_RESULT_TYPE(T,Q),LDIM+LDIM> madness::SeparatedConvolution< Q, NDIM >::operator() ( const Function< T, LDIM > &  f1,
const Function< Q, LDIM > &  f2 
) const
inline

apply this operator on a separable function f(1,2) = f(1) f(2)

Parameters
[in]f1a function of dim LDIM
[in]f2a function of dim LDIM
Returns
the result function of dim NDIM=2*LDIM: g(1,2) = G(1,1',2,2') f(1',2')
template<typename Q, std::size_t NDIM>
int& madness::SeparatedConvolution< Q, NDIM >::particle ( )
inline
template<typename Q, std::size_t NDIM>
const int& madness::SeparatedConvolution< Q, NDIM >::particle ( ) const
inline
template<typename Q, std::size_t NDIM>
void madness::SeparatedConvolution< Q, NDIM >::print_timer ( ) const
inline
template<typename Q, std::size_t NDIM>
void madness::SeparatedConvolution< Q, NDIM >::reset_timer ( ) const
inline

Member Data Documentation

template<typename Q, std::size_t NDIM>
bool madness::SeparatedConvolution< Q, NDIM >::destructive_

destroy the argument or restore it (expensive for 6d functions)

Referenced by madness::SeparatedConvolution< T, NDIM >::destructive().

template<typename Q, std::size_t NDIM>
bool madness::SeparatedConvolution< Q, NDIM >::doleaves

If should be applied to leaf coefficients ... false by default.

Referenced by test_modified().

template<typename Q, std::size_t NDIM>
bool madness::SeparatedConvolution< Q, NDIM >::is_slaterf12

Referenced by madness::apply().

template<typename Q, std::size_t NDIM>
bool madness::SeparatedConvolution< Q, NDIM >::isperiodicsum

If true the operator 1D kernels have been summed over lattice translations and may be non-zero at both ends of the unit cell

template<typename Q, std::size_t NDIM>
bool madness::SeparatedConvolution< Q, NDIM >::modified_

use modified NS form

Referenced by madness::SeparatedConvolution< T, NDIM >::modified().

template<typename Q, std::size_t NDIM>
double madness::SeparatedConvolution< Q, NDIM >::mu_
template<typename Q, std::size_t NDIM>
const size_t madness::SeparatedConvolution< Q, NDIM >::opdim =NDIM
static
template<typename Q, std::size_t NDIM>
int madness::SeparatedConvolution< Q, NDIM >::particle_
template<typename Q, std::size_t NDIM>
Timer madness::SeparatedConvolution< Q, NDIM >::timer_full
template<typename Q, std::size_t NDIM>
Timer madness::SeparatedConvolution< Q, NDIM >::timer_low_accumulate
template<typename Q, std::size_t NDIM>
Timer madness::SeparatedConvolution< Q, NDIM >::timer_low_transf

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