MADNESS  version 0.9
Classes | Namespaces | Functions
gentensor.h File Reference

Provides a tensor with taking advantage of possibly low rank. More...

#include <madness/tensor/tensor.h>
#include <madness/tensor/srconf.h>
#include <madness/tensor/tensortrain.h>
#include <stdexcept>
Include dependency graph for gentensor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

singleton  madness::SliceGenTensor< T >
 
singleton  madness::GenTensor< T >
 
struct  madness::TensorArgs
 TensorArgs holds the arguments for creating a LowRankTensor. More...
 
singleton  madness::GenTensor< T >
 
struct  madness::archive::ArchiveStoreImpl< Archive, GenTensor< T > >
 Serialize a tensor. More...
 
struct  madness::archive::ArchiveLoadImpl< Archive, GenTensor< T > >
 Deserialize a tensor ... existing tensor is replaced. More...
 

Namespaces

 madness
 Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
 
 madness::archive
 

Functions

template<typename T >
bool madness::has_zero_rank (const GenTensor< T > &g)
 true if GenTensor has zero rank or no data More...
 
template<class T >
GenTensor< T > madness::reduce (std::list< GenTensor< T > > &addends, double eps, bool are_optimal=false)
 
template<class T >
GenTensor< T > madness::outer (const GenTensor< T > &left, const GenTensor< T > &right)
 Outer product ... result(i,j,...,p,q,...) = left(i,k,...)*right(p,q,...) More...
 
template<class T >
GenTensor< T > madness::outer_low_rank (const Tensor< T > &left, const Tensor< T > &right)
 Outer product ... result(i,j,...,p,q,...) = left(i,k,...)*right(p,q,...) More...
 
template<typename T >
void madness::change_tensor_type (GenTensor< T > &t, const TensorArgs &targs)
 change representation to targ.tt More...
 
template<class T , class Q >
GenTensor< TENSOR_RESULT_TYPE(T,
Q)> 
madness::general_transform (const GenTensor< T > &t, const Tensor< Q > c[])
 Transform all dimensions of the tensor t by distinct matrices c. More...
 
template<class T >
GenTensor< T > madness::general_transform (const GenTensor< T > &t, const Tensor< T > c[])
 
template<typename T , typename Q >
IsSupported< TensorTypeData< Q >
, GenTensor< T > >::type 
madness::operator* (const Q &x, const GenTensor< T > &t)
 The class defines tensor op scalar ... here define scalar op tensor. More...
 

Detailed Description

Provides a tensor with taking advantage of possibly low rank.

MAIN DIFFERENCES (Tensor t; GenTensor g) t=t1(s) is shallow g=g1(s) is deep

a GenTensor is a generalized form of a Tensor for now only little functionality shall be implemented; feel free to extend a consequence is that we (usually) can't directly access individual matrix elements note that a GenTensor might have zero rank, but is still a valid tensor, and should therefore return a FullTensor with zeros in it.

Slicing in GenTensors:

A GenTensor differs from a Tensor in that we can't directly access individual matrix elements, and thus can't directly assign or manipulate slices as lvalues. For rvalues we simply provide a slices of the constituent vectors in SRConf, which is a valid GenTensor by itself

lhs = rhs(s)

Manipulations of slices of a GenTensor are heavily restricted, but should cover the most important cases:

Note that all of these operation increase the rank of lhs

Addition in GenTensors

Addition in a GenTensor is a fairly complicated issue, and there are several algorithms you can use, each with certain pros and cons