MADNESS  0.10.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | 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]

Classes

struct  ApplyTerms
 laziness for calling lists: which terms to apply More...
 
struct  Transformation
 too lazy for extended calling lists More...
 

Public Types

typedef Key< NDIMkeyT
 
typedef Q opT
 The apply function uses this to infer resultT=opT*inputT. More...
 
- Public Types inherited from madness::WorldObject< SeparatedConvolution< Q, NDIM > >
typedef WorldObject< SeparatedConvolution< Q, NDIM > > objT
 

Public Member Functions

 SeparatedConvolution (World &world, const OperatorInfo info1, const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), int k=FunctionDefaults< NDIM >::get_k(), bool doleaves=false)
 Constructor for Gaussian Convolutions (mostly for backward compatability) More...
 
 SeparatedConvolution (World &world, const Tensor< Q > &coeff, const Tensor< double > &expnt, double lo, double thresh, 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, 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, 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, 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 ()
 
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 (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 >
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...
 
bool & destructive ()
 
const bool & destructive () const
 
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...
 
const double & gamma () const
 
const BoundaryConditions< NDIM > & get_bc () const
 
const std::vector< Key< NDIM > > & get_disp (Level n) const
 
template<size_t FDIM>
std::enable_if< 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>
std::enable_if< 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...
 
void initialize (const Tensor< Q > &coeff, const Tensor< double > &expnt)
 
TensorTrain< double > make_tt_representation (const Key< NDIM > &source, const Key< NDIM > &shift, double tol, bool do_R, bool do_T) const
 construct the tensortrain representation of the operator More...
 
bool & modified ()
 
const bool & modified () const
 
const double & mu () 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<typename argT >
argT operator() (const argT &argument) const
 apply this onto another suitable argument, returning the same type 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 , size_t FDIM>
std::vector< Function< TENSOR_RESULT_TYPE(T, Q), FDIM > > operator() (const std::vector< Function< T, FDIM >> &f) const
 apply this on a vector of functions More...
 
template<typename T , size_t LDIM>
Function< TENSOR_RESULT_TYPE(T, Q), LDIM+LDIM > operator() (const std::vector< Function< T, LDIM >> &f1, const std::vector< Function< Q, LDIM >> &f2) const
 apply this operator on a sum of separable functions f(1,2) = \sum_i f_i(1) f_i(2) More...
 
int & particle ()
 
const int & particle () const
 
void print_timer () const
 
void reset_timer () const
 
SeparatedConvolution< Q, NDIM > & set_particle (const int p)
 
- Public Member Functions inherited from madness::WorldObject< SeparatedConvolution< Q, NDIM > >
 WorldObject (const WorldObject &other)
 
 WorldObject (World &world)
 Constructor that associates an object (via the derived class) with a globally unique ID. More...
 
virtual ~WorldObject ()
 
Worldget_world () const
 Returns a reference to the world. More...
 
const uniqueidTid () const
 Returns the globally unique object ID. More...
 
WorldObjectoperator= (const WorldObject &)=delete
 
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 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...
 
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 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 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 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 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 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 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 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 TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(). More...
 
- Public Member Functions inherited from madness::WorldObjectBase
virtual ~WorldObjectBase ()=default
 

Static Public Member Functions

static bool can_combine (const SeparatedConvolution< Q, NDIM > &left, const SeparatedConvolution< Q, NDIM > &right)
 
static SeparatedConvolution< Q, NDIMcombine (const SeparatedConvolution< Q, NDIM > &left, const SeparatedConvolution< Q, NDIM > &right)
 combine 2 convolution operators to one More...
 
static OperatorInfo combine_OT (const SeparatedConvolution< Q, NDIM > &left, const SeparatedConvolution< Q, NDIM > &right)
 return operator type and other info of the combined operator (e.g. fg = f(1,2)* g(1,2) More...
 

Public Attributes

bool destructive_ =false
 destroy the argument or restore it (expensive for 6d functions) More...
 
bool doleaves
 If should be applied to leaf coefficients ... false by default. More...
 
OperatorInfo info
 
bool isperiodicsum
 
bool modified_ =false
 use modified NS form More...
 
int particle_ =1
 must only be 1 or 2 More...
 
bool print_timings =false
 
Timer timer_full
 
Timer timer_low_accumulate
 
Timer timer_low_transf
 
Timer timer_stats_accumulate
 

Static Public Attributes

static const size_t opdim =NDIM
 

Private Member Functions

template<typename T , typename R >
void apply_transformation (long dimk, const Transformation trans[NDIM], const Tensor< T > &f, Tensor< R > &work1, Tensor< R > &work2, const Q mufac, Tensor< R > &result) const
 
More...
 
template<typename T , typename R >
void apply_transformation2 (Level n, long dimk, double tol, const Tensor< T > trans2[NDIM], const GenTensor< T > &f, GenTensor< R > &work1, GenTensor< R > &work2, const Q mufac, GenTensor< R > &result) const
 don't accumulate, since we want to do this at apply() More...
 
template<typename T , typename R >
void apply_transformation3 (const Tensor< T > trans2[NDIM], const Tensor< T > &f, const Q mufac, Tensor< R > &result) const
 accumulate into result More...
 
void check_cubic ()
 
const SeparatedConvolutionInternal< Q, NDIMgetmuop (int mu, Level n, const Key< NDIM > &disp) const
 get the transformation matrices for 1 term and all dimensions and one displacement More...
 
const SeparatedConvolutionInternal< Q, NDIMgetmuop_modified (int mu, Level n, const Key< NDIM > &disp, const Key< NDIM > &source) const
 get the transformation matrices for 1 term and all dimensions and one displacement More...
 
const SeparatedConvolutionData< Q, NDIM > * getop (Level n, const Key< NDIM > &d, const Key< NDIM > &source) const
 get the data for all terms and all dimensions for one displacement More...
 
const SeparatedConvolutionData< Q, NDIM > * getop_modified (Level n, const Key< NDIM > &disp, const Key< NDIM > &source) const
 get the data for all terms and all dimensions for one displacement (modified NS form) More...
 
const SeparatedConvolutionData< Q, NDIM > * getop_ns (Level n, const Key< NDIM > &d) const
 get the data for all terms and all dimensions for one displacement More...
 
double munorm2 (Level n, const ConvolutionData1D< Q > *ops[]) const
 
double munorm2_modified (Level n, const ConvolutionData1D< Q > *ops_1d[]) const
 
double munorm2_ns (Level n, const ConvolutionData1D< Q > *ops[]) const
 
template<typename T >
void muopxv_fast (ApplyTerms at, const ConvolutionData1D< Q > *const ops_1d[NDIM], const Tensor< T > &f, const Tensor< T > &f0, Tensor< TENSOR_RESULT_TYPE(T, Q)> &result, Tensor< TENSOR_RESULT_TYPE(T, Q)> &result0, double tol, const Q mufac, Tensor< TENSOR_RESULT_TYPE(T, Q)> &work1, Tensor< TENSOR_RESULT_TYPE(T, Q)> &work2) const
 Apply one of the separated terms, accumulating into the result. More...
 
template<typename T >
void muopxv_fast2 (Level n, const ConvolutionData1D< Q > *const ops_1d[NDIM], const GenTensor< T > &f, const GenTensor< T > &f0, GenTensor< TENSOR_RESULT_TYPE(T, Q)> &result, GenTensor< TENSOR_RESULT_TYPE(T, Q)> &result0, double tol, const Q mufac, GenTensor< TENSOR_RESULT_TYPE(T, Q)> &work1, GenTensor< TENSOR_RESULT_TYPE(T, Q)> &work2) const
 Apply one of the separated terms, accumulating into the result. More...
 
template<typename T , size_t FDIM>
GenTensor< Tpartial_upsample (const Key< FDIM > &key, const GenTensor< T > &coeff, const int particle) const
 upsample some of the dimensions of coeff to its child indicated by key More...
 
template<typename T , size_t FDIM>
GenTensor< Tupsample (const Key< FDIM > &key, const GenTensor< T > &coeff) const
 upsample the sum coefficients of level 1 to sum coeffs on level n+1 More...
 

Static Private Member Functions

static std::pair< Tensor< Q >, Tensor< Q > > make_coeff_for_operator (World &world, double mu, double lo, double eps, OpType type, const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc())
 
static std::pair< Tensor< double >, Tensor< double > > make_coeff_for_operator (World &world, OperatorInfo info, const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc())
 

Private Attributes

const BoundaryConditions< NDIMbc
 
const FunctionCommonData< Q, NDIM > & cdata
 
SimpleCache< SeparatedConvolutionData< Q, NDIM >, NDIMdata
 cache for all terms, dims and displacements More...
 
const int k
 
SimpleCache< SeparatedConvolutionData< Q, NDIM >, 2 *NDIMmod_data
 cache for all terms, dims and displacements More...
 
std::vector< ConvolutionND< Q, NDIM > > ops
 ConvolutionND keeps data for 1 term, all dimensions, 1 displacement. More...
 
int rank
 
const std::vector< Slices0
 
const std::vector< long > v2k
 
const std::vector< long > vk
 

Friends

SeparatedConvolution< Q, NDIMcombine (const std::shared_ptr< SeparatedConvolution< Q, NDIM >> left, const std::shared_ptr< SeparatedConvolution< Q, NDIM >> right)
 combine 2 convolution operators to one More...
 

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

◆ keyT

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

◆ opT

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

◆ SeparatedConvolution() [1/5]

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

◆ SeparatedConvolution() [2/5]

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

◆ SeparatedConvolution() [3/5]

template<typename Q , std::size_t NDIM>
madness::SeparatedConvolution< Q, NDIM >::SeparatedConvolution ( World world,
const OperatorInfo  info1,
const BoundaryConditions< NDIM > &  bc = FunctionDefaults<NDIM>::get_bc(),
int  k = FunctionDefaults<NDIM>::get_k(),
bool  doleaves = false 
)
inline

◆ SeparatedConvolution() [4/5]

template<typename Q , std::size_t NDIM>
madness::SeparatedConvolution< Q, NDIM >::SeparatedConvolution ( World world,
const Tensor< Q > &  coeff,
const Tensor< double > &  expnt,
double  lo,
double  thresh,
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)

References madness::SeparatedConvolution< Q, NDIM >::initialize().

◆ SeparatedConvolution() [5/5]

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

◆ ~SeparatedConvolution()

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

Member Function Documentation

◆ apply()

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

◆ apply2()

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

◆ apply2_lowdim()

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
Tthe dimension of the function this operator is applied on.
Todo:
MGR: Make sure info on T is correct. Was previously labeled FDIM.
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

References madness::_(), std::abs(), madness::Timer::accumulate(), madness::copy(), madness::cpu_time(), madness::GenTensor< T >::dim(), madness::SRConf< T >::dim_per_vector(), madness::SeparatedConvolution< Q, NDIM >::doleaves, madness::GenTensor< T >::get_svdtensor(), madness::SeparatedConvolution< Q, NDIM >::getop(), madness::GenTensor< T >::is_svd_tensor(), madness::SeparatedConvolution< Q, NDIM >::k, MADNESS_ASSERT, madness::SeparatedConvolution< Q, NDIM >::modified(), madness::SeparatedConvolution< Q, NDIM >::mu(), madness::SeparatedConvolution< Q, NDIM >::muopxv_fast(), NDIM, madness::GenTensor< T >::ndim(), op(), madness::SeparatedConvolutionInternal< Q, NDIM >::ops, madness::SeparatedConvolution< Q, NDIM >::ops, madness::SeparatedConvolution< Q, NDIM >::particle(), Q(), madness::SeparatedConvolution< Q, NDIM >::ApplyTerms::r_term, madness::SeparatedConvolution< Q, NDIM >::rank, madness::GenTensor< T >::rank(), madness::GenTensor< T >::reduce_rank(), madness::SRConf< T >::ref_vector(), shift, source(), T(), madness::SeparatedConvolution< Q, NDIM >::ApplyTerms::t_term, madness::TENSOR_RESULT_TYPE(), madness::SeparatedConvolution< Q, NDIM >::timer_low_accumulate, madness::SeparatedConvolution< Q, NDIM >::timer_low_transf, madness::SeparatedConvolution< Q, NDIM >::v2k, and madness::SeparatedConvolution< Q, NDIM >::vk.

◆ apply_transformation()

template<typename Q , std::size_t NDIM>
template<typename T , typename R >
void madness::SeparatedConvolution< Q, NDIM >::apply_transformation ( long  dimk,
const Transformation  trans[NDIM],
const Tensor< T > &  f,
Tensor< R > &  work1,
Tensor< R > &  work2,
const Q  mufac,
Tensor< R > &  result 
) const
inlineprivate

◆ apply_transformation2()

template<typename Q , std::size_t NDIM>
template<typename T , typename R >
void madness::SeparatedConvolution< Q, NDIM >::apply_transformation2 ( Level  n,
long  dimk,
double  tol,
const Tensor< T trans2[NDIM],
const GenTensor< T > &  f,
GenTensor< R > &  work1,
GenTensor< R > &  work2,
const Q  mufac,
GenTensor< R > &  result 
) const
inlineprivate

◆ apply_transformation3()

template<typename Q , std::size_t NDIM>
template<typename T , typename R >
void madness::SeparatedConvolution< Q, NDIM >::apply_transformation3 ( const Tensor< T trans2[NDIM],
const Tensor< T > &  f,
const Q  mufac,
Tensor< R > &  result 
) const
inlineprivate

accumulate into result

References madness::f, madness::general_transform(), and madness::Tensor< T >::scale().

◆ can_combine()

template<typename Q , std::size_t NDIM>
static bool madness::SeparatedConvolution< Q, NDIM >::can_combine ( const SeparatedConvolution< Q, NDIM > &  left,
const SeparatedConvolution< Q, NDIM > &  right 
)
inlinestatic

◆ check_cubic()

template<typename Q , std::size_t NDIM>
void madness::SeparatedConvolution< Q, NDIM >::check_cubic ( )
inlineprivate

◆ combine()

template<typename Q , std::size_t NDIM>
static SeparatedConvolution<Q,NDIM> madness::SeparatedConvolution< Q, NDIM >::combine ( const SeparatedConvolution< Q, NDIM > &  left,
const SeparatedConvolution< Q, NDIM > &  right 
)
inlinestatic

◆ combine_OT()

template<typename Q , std::size_t NDIM>
static OperatorInfo madness::SeparatedConvolution< Q, NDIM >::combine_OT ( const SeparatedConvolution< Q, NDIM > &  left,
const SeparatedConvolution< Q, NDIM > &  right 
)
inlinestatic

◆ destructive() [1/2]

template<typename Q , std::size_t NDIM>
bool& madness::SeparatedConvolution< Q, NDIM >::destructive ( )
inline

◆ destructive() [2/2]

template<typename Q , std::size_t NDIM>
const bool& madness::SeparatedConvolution< Q, NDIM >::destructive ( ) const
inline

◆ estimate_costs()

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

◆ gamma()

template<typename Q , std::size_t NDIM>
const double& madness::SeparatedConvolution< Q, NDIM >::gamma ( ) const
inline

◆ get_bc()

template<typename Q , std::size_t NDIM>
const BoundaryConditions<NDIM>& madness::SeparatedConvolution< Q, NDIM >::get_bc ( ) const
inline

◆ get_disp()

template<typename Q , std::size_t NDIM>
const std::vector< Key<NDIM> >& madness::SeparatedConvolution< Q, NDIM >::get_disp ( Level  n) const
inline

◆ get_source_key() [1/2]

template<typename Q , std::size_t NDIM>
template<size_t FDIM>
std::enable_if<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

References madness::Key< NDIM >::break_apart(), NDIM, madness::SeparatedConvolution< Q, NDIM >::particle(), and source().

◆ get_source_key() [2/2]

template<typename Q , std::size_t NDIM>
template<size_t FDIM>
std::enable_if<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

◆ getmuop()

template<typename Q , std::size_t NDIM>
const SeparatedConvolutionInternal<Q,NDIM> madness::SeparatedConvolution< Q, NDIM >::getmuop ( int  mu,
Level  n,
const Key< NDIM > &  disp 
) const
inlineprivate

get the transformation matrices for 1 term and all dimensions and one displacement

use ConvolutionND, which uses ConvolutionData1D to collect the transformation matrices

References std::abs(), d(), madness::SeparatedConvolution< Q, NDIM >::mu(), madness::SeparatedConvolution< Q, NDIM >::munorm2(), NDIM, op(), madness::SeparatedConvolution< Q, NDIM >::ops, and madness::Key< NDIM >::translation().

Referenced by madness::SeparatedConvolution< Q, NDIM >::getop_ns().

◆ getmuop_modified()

template<typename Q , std::size_t NDIM>
const SeparatedConvolutionInternal<Q,NDIM> madness::SeparatedConvolution< Q, NDIM >::getmuop_modified ( int  mu,
Level  n,
const Key< NDIM > &  disp,
const Key< NDIM > &  source 
) const
inlineprivate

◆ getop()

template<typename Q , std::size_t NDIM>
const SeparatedConvolutionData<Q,NDIM>* madness::SeparatedConvolution< Q, NDIM >::getop ( Level  n,
const Key< NDIM > &  d,
const Key< NDIM > &  source 
) const
inlineprivate

◆ getop_modified()

template<typename Q , std::size_t NDIM>
const SeparatedConvolutionData<Q,NDIM>* madness::SeparatedConvolution< Q, NDIM >::getop_modified ( Level  n,
const Key< NDIM > &  disp,
const Key< NDIM > &  source 
) const
inlineprivate

get the data for all terms and all dimensions for one displacement (modified NS form)

remember that the operator in the modified NS form is not Toeplitz, so we need information about the displacement and the source key

Parameters
[in]nlevel (=scale) (actually redundant, since included in source)
[in]dispdisplacement key
[in]sourcesource key
Returns
pointer to cached operator

References madness::SeparatedConvolution< Q, NDIM >::getmuop_modified(), madness::Key< NDIM >::merge_with(), madness::SeparatedConvolution< Q, NDIM >::mod_data, madness::SeparatedConvolution< Q, NDIM >::mu(), NDIM, madness::SeparatedConvolution< Q, NDIM >::norm(), op(), p(), madness::SeparatedConvolution< Q, NDIM >::rank, and source().

Referenced by madness::SeparatedConvolution< Q, NDIM >::getop().

◆ getop_ns()

template<typename Q , std::size_t NDIM>
const SeparatedConvolutionData<Q,NDIM>* madness::SeparatedConvolution< Q, NDIM >::getop_ns ( Level  n,
const Key< NDIM > &  d 
) const
inlineprivate

get the data for all terms and all dimensions for one displacement

uses SeparatedConvolutionInternal (ConvolutionND, ConvolutionData1D) to construct the transformation matrices.

Parameters
[in]ddisplacement
Returns
pointer to cached operator

References d(), madness::SeparatedConvolution< Q, NDIM >::getmuop(), madness::SeparatedConvolution< Q, NDIM >::mu(), madness::SeparatedConvolution< Q, NDIM >::norm(), op(), p(), and madness::SeparatedConvolution< Q, NDIM >::rank.

Referenced by madness::SeparatedConvolution< Q, NDIM >::getop().

◆ initialize()

template<typename Q , std::size_t NDIM>
void madness::SeparatedConvolution< Q, NDIM >::initialize ( const Tensor< Q > &  coeff,
const Tensor< double > &  expnt 
)
inline

◆ make_coeff_for_operator() [1/2]

template<typename Q , std::size_t NDIM>
static std::pair<Tensor<Q>,Tensor<Q> > madness::SeparatedConvolution< Q, NDIM >::make_coeff_for_operator ( World world,
double  mu,
double  lo,
double  eps,
OpType  type,
const BoundaryConditions< NDIM > &  bc = FunctionDefaults<NDIM>::get_bc() 
)
inlinestaticprivate

◆ make_coeff_for_operator() [2/2]

template<typename Q , std::size_t NDIM>
static std::pair<Tensor<double>,Tensor<double> > madness::SeparatedConvolution< Q, NDIM >::make_coeff_for_operator ( World world,
OperatorInfo  info,
const BoundaryConditions< NDIM > &  bc = FunctionDefaults<NDIM>::get_bc() 
)
inlinestaticprivate

◆ make_tt_representation()

template<typename Q , std::size_t NDIM>
TensorTrain<double> madness::SeparatedConvolution< Q, NDIM >::make_tt_representation ( const Key< NDIM > &  source,
const Key< NDIM > &  shift,
double  tol,
bool  do_R,
bool  do_T 
) const
inline

construct the tensortrain representation of the operator

Parameters
[in]sourcesource coefficient box
[in]shiftdisplacement
[in]tolthreshold for the TT truncation
[in]do_Rcompute the R term of the operator (2k^d)
[in]do_Tcompute the T term of the operator (k^d), including factor -1 Both do_R and do_T may be used simultaneously, then the final operator will have dimensions (2k^d)

References madness::_(), d(), madness::SeparatedConvolution< Q, NDIM >::getop(), madness::SeparatedConvolution< Q, NDIM >::k, lo, MADNESS_EXCEPTION, madness::TensorTrain< T >::make_operator(), madness::TensorTrain< T >::make_tensor(), madness::SeparatedConvolution< Q, NDIM >::mu(), NDIM, op(), madness::SeparatedConvolutionInternal< Q, NDIM >::ops, madness::SeparatedConvolution< Q, NDIM >::ops, madness::print(), Q(), madness::SeparatedConvolution< Q, NDIM >::rank, shift, source(), and madness::TensorTrain< T >::truncate().

◆ modified() [1/2]

template<typename Q , std::size_t NDIM>
bool& madness::SeparatedConvolution< Q, NDIM >::modified ( )
inline

◆ modified() [2/2]

template<typename Q , std::size_t NDIM>
const bool& madness::SeparatedConvolution< Q, NDIM >::modified ( ) const
inline

◆ mu()

template<typename Q , std::size_t NDIM>
const double& madness::SeparatedConvolution< Q, NDIM >::mu ( ) const
inline

◆ munorm2()

template<typename Q , std::size_t NDIM>
double madness::SeparatedConvolution< Q, NDIM >::munorm2 ( Level  n,
const ConvolutionData1D< Q > *  ops[] 
) const
inlineprivate

◆ munorm2_modified()

template<typename Q , std::size_t NDIM>
double madness::SeparatedConvolution< Q, NDIM >::munorm2_modified ( Level  n,
const ConvolutionData1D< Q > *  ops_1d[] 
) const
inlineprivate

Computes the operator norm of one of the separated terms of the modified NS form ... WITHOUT FACTOR INCLUDED compute for 1 term, all dim, 1 disp, essentially for SeparatedConvolutionInternal

References d(), factorial(), madness::ConvolutionData1D< Q >::N_diff, madness::ConvolutionData1D< Q >::N_F, madness::ConvolutionData1D< Q >::N_up, NDIM, madness::SeparatedConvolution< Q, NDIM >::norm(), and PROFILE_MEMBER_FUNC.

Referenced by madness::SeparatedConvolution< Q, NDIM >::munorm2().

◆ munorm2_ns()

template<typename Q , std::size_t NDIM>
double madness::SeparatedConvolution< Q, NDIM >::munorm2_ns ( Level  n,
const ConvolutionData1D< Q > *  ops[] 
) const
inlineprivate

Computes the Frobenius norm of one of the separated terms for the NS form ... WITHOUT FACTOR INCLUDED compute for 1 term, all dim, 1 disp, essentially for SeparatedConvolutionInternal

References a, aa, b, d(), max, NDIM, madness::SeparatedConvolution< Q, NDIM >::ops, and madness::sum().

Referenced by madness::SeparatedConvolution< Q, NDIM >::munorm2().

◆ muopxv_fast()

template<typename Q , std::size_t NDIM>
template<typename T >
void madness::SeparatedConvolution< Q, NDIM >::muopxv_fast ( ApplyTerms  at,
const ConvolutionData1D< Q > *const  ops_1d[NDIM],
const Tensor< T > &  f,
const Tensor< T > &  f0,
Tensor< TENSOR_RESULT_TYPE(T, Q)> &  result,
Tensor< TENSOR_RESULT_TYPE(T, Q)> &  result0,
double  tol,
const Q  mufac,
Tensor< TENSOR_RESULT_TYPE(T, Q)> &  work1,
Tensor< TENSOR_RESULT_TYPE(T, Q)> &  work2 
) const
inlineprivate

◆ muopxv_fast2()

template<typename Q , std::size_t NDIM>
template<typename T >
void madness::SeparatedConvolution< Q, NDIM >::muopxv_fast2 ( Level  n,
const ConvolutionData1D< Q > *const  ops_1d[NDIM],
const GenTensor< T > &  f,
const GenTensor< T > &  f0,
GenTensor< TENSOR_RESULT_TYPE(T, Q)> &  result,
GenTensor< TENSOR_RESULT_TYPE(T, Q)> &  result0,
double  tol,
const Q  mufac,
GenTensor< TENSOR_RESULT_TYPE(T, Q)> &  work1,
GenTensor< TENSOR_RESULT_TYPE(T, Q)> &  work2 
) const
inlineprivate

◆ norm()

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

◆ operator()() [1/5]

template<typename Q , std::size_t NDIM>
template<typename argT >
argT madness::SeparatedConvolution< Q, NDIM >::operator() ( const argT &  argument) const
inline

apply this onto another suitable argument, returning the same type

argT must implement argT::apply(const SeparatedConvolution& op, const argT& arg)

References madness::apply().

◆ operator()() [2/5]

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

References madness::apply(), and madness::f.

◆ operator()() [3/5]

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')

References madness::apply(), f1, and f2.

◆ operator()() [4/5]

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

apply this on a vector of functions

References madness::apply(), and madness::f.

◆ operator()() [5/5]

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 std::vector< Function< T, LDIM >> &  f1,
const std::vector< Function< Q, LDIM >> &  f2 
) const
inline

apply this operator on a sum of separable functions f(1,2) = \sum_i f_i(1) f_i(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')

References madness::apply(), f1, and f2.

◆ partial_upsample()

template<typename Q , std::size_t NDIM>
template<typename T , size_t FDIM>
GenTensor<T> madness::SeparatedConvolution< Q, NDIM >::partial_upsample ( const Key< FDIM > &  key,
const GenTensor< T > &  coeff,
const int  particle 
) const
inlineprivate

upsample some of the dimensions of coeff to its child indicated by key

Parameters
[in]coeffthe coeffs of dim 2*NDIM that will be upsampled
[in]keythe key indicating the child – only some dimensions will be "reproductive"
[in]particleif 0: upsample dimensions 0-2 if 1: upsample dimensions 3-5
Returns
a partially upsampled coefficient tensor

References madness::SeparatedConvolution< Q, NDIM >::cdata, madness::GenTensor< T >::dim(), madness::general_transform(), h(), madness::FunctionCommonData< T, NDIM >::h0, madness::FunctionCommonData< T, NDIM >::h1, madness::SeparatedConvolution< Q, NDIM >::k, MADNESS_ASSERT, MADNESS_EXCEPTION, NDIM, madness::GenTensor< T >::ndim(), madness::GenTensor< T >::rank(), and madness::Key< NDIM >::translation().

◆ particle() [1/2]

template<typename Q , std::size_t NDIM>
int& madness::SeparatedConvolution< Q, NDIM >::particle ( )
inline

◆ particle() [2/2]

template<typename Q , std::size_t NDIM>
const int& madness::SeparatedConvolution< Q, NDIM >::particle ( ) const
inline

◆ print_timer()

template<typename Q , std::size_t NDIM>
void madness::SeparatedConvolution< Q, NDIM >::print_timer ( ) const
inline

◆ reset_timer()

template<typename Q , std::size_t NDIM>
void madness::SeparatedConvolution< Q, NDIM >::reset_timer ( ) const
inline

◆ set_particle()

template<typename Q , std::size_t NDIM>
SeparatedConvolution<Q,NDIM>& madness::SeparatedConvolution< Q, NDIM >::set_particle ( const int  p)
inline

◆ upsample()

template<typename Q , std::size_t NDIM>
template<typename T , size_t FDIM>
GenTensor<T> madness::SeparatedConvolution< Q, NDIM >::upsample ( const Key< FDIM > &  key,
const GenTensor< T > &  coeff 
) const
inlineprivate

upsample the sum coefficients of level 1 to sum coeffs on level n+1

specialization of the unfilter method, will transform only the sum coefficients

Parameters
[in]keykey of level n+1
[in]coeffsum coefficients of level n (does NOT belong to key!!)
Returns
sum coefficients on level n+1

References madness::SeparatedConvolution< Q, NDIM >::cdata, madness::general_transform(), h(), madness::FunctionCommonData< T, NDIM >::h0, madness::FunctionCommonData< T, NDIM >::h1, and madness::Key< NDIM >::translation().

Friends And Related Function Documentation

◆ combine

template<typename Q , std::size_t NDIM>
SeparatedConvolution<Q,NDIM> combine ( const std::shared_ptr< SeparatedConvolution< Q, NDIM >>  left,
const std::shared_ptr< SeparatedConvolution< Q, NDIM >>  right 
)
friend

combine 2 convolution operators to one

Member Data Documentation

◆ bc

template<typename Q , std::size_t NDIM>
const BoundaryConditions<NDIM> madness::SeparatedConvolution< Q, NDIM >::bc
private

◆ cdata

template<typename Q , std::size_t NDIM>
const FunctionCommonData<Q,NDIM>& madness::SeparatedConvolution< Q, NDIM >::cdata
private

◆ data

template<typename Q , std::size_t NDIM>
SimpleCache< SeparatedConvolutionData<Q,NDIM>, NDIM > madness::SeparatedConvolution< Q, NDIM >::data
mutableprivate

cache for all terms, dims and displacements

◆ destructive_

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

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

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

◆ doleaves

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 madness::SeparatedConvolution< Q, NDIM >::apply2_lowdim().

◆ info

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

◆ isperiodicsum

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

Referenced by madness::SeparatedConvolution< Q, NDIM >::SeparatedConvolution(), madness::SeparatedConvolution< Q, NDIM >::get_disp(), and madness::SeparatedConvolution< Q, NDIM >::initialize().

◆ k

template<typename Q , std::size_t NDIM>
const int madness::SeparatedConvolution< Q, NDIM >::k
private

◆ mod_data

template<typename Q , std::size_t NDIM>
SimpleCache< SeparatedConvolutionData<Q,NDIM>, 2*NDIM > madness::SeparatedConvolution< Q, NDIM >::mod_data
mutableprivate

cache for all terms, dims and displacements

Referenced by madness::SeparatedConvolution< Q, NDIM >::getop_modified().

◆ modified_

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

use modified NS form

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

◆ opdim

template<typename Q , std::size_t NDIM>
const size_t madness::SeparatedConvolution< Q, NDIM >::opdim =NDIM
static

◆ ops

template<typename Q , std::size_t NDIM>
std::vector< ConvolutionND<Q,NDIM> > madness::SeparatedConvolution< Q, NDIM >::ops
mutableprivate

◆ particle_

template<typename Q , std::size_t NDIM>
int madness::SeparatedConvolution< Q, NDIM >::particle_ =1

◆ print_timings

template<typename Q , std::size_t NDIM>
bool madness::SeparatedConvolution< Q, NDIM >::print_timings =false

◆ rank

template<typename Q , std::size_t NDIM>
int madness::SeparatedConvolution< Q, NDIM >::rank
private

◆ s0

template<typename Q , std::size_t NDIM>
const std::vector<Slice> madness::SeparatedConvolution< Q, NDIM >::s0
private

◆ timer_full

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

◆ timer_low_accumulate

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

◆ timer_low_transf

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

◆ timer_stats_accumulate

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

◆ v2k

template<typename Q , std::size_t NDIM>
const std::vector<long> madness::SeparatedConvolution< Q, NDIM >::v2k
private

◆ vk

template<typename Q , std::size_t NDIM>
const std::vector<long> madness::SeparatedConvolution< Q, NDIM >::vk
private

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