MADNESS
0.10.1
|
#include <srconf.h>
Public Types | |
typedef Tensor< T > | tensorT |
Public Member Functions | |
SRConf () | |
default ctor More... | |
SRConf (const long &ndim, const long *dimensions, const long nci) | |
SRConf (const long &ndim, const std::array< long, TENSOR_MAXDIM > &dimensions, const long nci) | |
SRConf (const SRConf &rhs)=default | |
copy ctor (tested); shallow copy More... | |
SRConf (const Tensor< double > &weights, const std::vector< Tensor< T > > &vectors, const long &ndim, const long &dims, const long nci) | |
ctor with provided weights and effective vectors; shallow copy More... | |
SRConf (const Tensor< double > &weights, const tensorT &vector1, const tensorT &vector2, const long &ndim, const long *dims, const long nci) | |
explicit ctor with two vectors (aka SVD), shallow More... | |
~SRConf () | |
dtor More... | |
void | add_SVD (const SRConf< T > &rhs, const double &thresh) |
add two orthonormal configurations, yielding an optimal SVD decomposition More... | |
void | append (const SRConf< T > &rhs, const double fac=1.0) |
append configurations of rhs to this More... | |
void | append (const SRConf< T > &rhs, const double_complex fac=1.0) |
const std::vector< Slice > & | c0 (const int idim) const |
return a Slice that corresponds the that part of vector_ that holds coefficients More... | |
void | clear () |
SRConf< T > | copy_slice (const std::array< Slice, TENSOR_MAXDIM > &s) const |
return a slice of this (deep copy) More... | |
int | dim_per_vector (int idim) const |
return the number of physical dimensions More... | |
SRConf< T > & | emul (const SRConf< T > &other) |
perform elementwise Hadamard product More... | |
Tensor< T > | flat_vector (const unsigned int &idim) |
return shallow copy of a slice of one of the vectors, flattened to (r,kVec) More... | |
const Tensor< T > | flat_vector (const unsigned int &idim) const |
return shallow copy of a slice of one of the vectors, flattened to (r,kVec) More... | |
Tensor< T > | flat_vector_with_weights (const int dim) const |
return flat (r,i) view of the tensor with the weights multiplied in More... | |
template<typename Q > | |
SRConf< TENSOR_RESULT_TYPE(T, Q) > | general_transform (const Tensor< Q > c[]) const |
const SRConf | get_configs (const int &start, const int &end) const |
bool | has_data () const |
does this have any data? More... | |
bool | has_no_data () const |
does this have any data? More... | |
bool | has_structure () const |
return if this has a tensor structure (has not been flattened) More... | |
long | kVec (const int idim) const |
void | make_empty_vectors_and_weights (const long rank) |
std::array< std::array< long, TENSOR_MAXDIM >, 2 > | make_vector_dimensions (const long rank) const |
deduce the dimensions of the left and right singular vectors from the tensor dimensions More... | |
Tensor< T > | make_vector_with_weights (const int dim) const |
SRConf & | operator= (const SRConf &rhs) |
assignment operator (tested), shallow copy of vectors More... | |
SRConf & | operator= (const T &number) |
assign a number to this; More... | |
long | rank () const |
return the logicalrank More... | |
Tensor< T > | reconstruct () const |
reconstruct this to return a full tensor More... | |
Tensor< T > & | ref_vector (const unsigned int &idim) |
return reference to one of the vectors F More... | |
const Tensor< T > & | ref_vector (const unsigned int &idim) const |
return reference to one of the vectors F More... | |
template<typename Archive > | |
void | serialize (Archive &ar) |
void | set_size_and_dim (long ndim, long k) |
void | set_vectors_and_weights (const Tensor< typename Tensor< T >::scalar_type > &weights, const Tensor< T > &vector1, const Tensor< T > &vector2) |
SRConf< T > | transform_dir (const Tensor< T > &c, const int &axis) const |
double | weights (const unsigned int &i) const |
return the weight More... | |
Public Member Functions inherited from madness::BaseTensor | |
BaseTensor () | |
virtual | ~BaseTensor () |
bool | conforms (const BaseTensor *t) const |
Returns true if this and *t are the same shape and size. More... | |
long | dim (int i) const |
Returns the size of dimension i . More... | |
const long * | dims () const |
Returns the array of tensor dimensions. More... | |
long | id () const |
Returns the typeid of the tensor (c.f., TensorTypeData<T> ) More... | |
bool | iscontiguous () const |
Returns true if the tensor refers to contiguous memory locations. More... | |
long | ndim () const |
Returns the number of dimensions in the tensor. More... | |
long | size () const |
Returns the number of elements in the tensor. More... | |
long | stride (int i) const |
Returns the stride associated with dimension i . More... | |
const long * | strides () const |
Returns the array of tensor strides. More... | |
Static Public Member Functions | |
static int | max_sigma (const double &thresh, const long &rank, const Tensor< double > &w) |
Static Public Member Functions inherited from madness::BaseTensor | |
static int | get_instance_count () |
Returns the count of all current instances of tensors & slice tensors of all types. More... | |
Public Attributes | |
long | nci_left =-1 |
separation dimensions: A(n,m) -> A(r,n) B(r,m), with n={k1,k2},m={k3,k4,k5..) multi-indices More... | |
std::vector< Slice > | s0 |
std::vector< Slice > | s1 |
std::array< Tensor< T >, 2 > | vector_ |
Tensor< typename Tensor< T >::scalar_type > | weights_ |
for each configuration the weight; length should be r More... | |
Static Public Attributes | |
static const bool | check_orthonormality =false |
check orthonormality at low rank additions More... | |
Protected Member Functions | |
bool | check_dimensions () const |
bool | check_right_orthonormality () const |
check if the terms are orthogonal More... | |
void | fillWithRandom (const long &rank=1) |
fill this SRConf with 1 flattened random configurations (tested) More... | |
void | inplace_add (const SRConf< T > &rhs, std::array< Slice, TENSOR_MAXDIM > lhs_s, std::array< Slice, TENSOR_MAXDIM > rhs_s, const double alpha, const double beta) |
alpha * this(lhs_s) + beta * rhs(rhs_s) More... | |
bool | is_flat () const |
return if this has only one additional dimension (apart from rank) More... | |
Tensor< T > | make_left_vector_with_weights () const |
void | make_slices () |
redo the Slices for getting direct access to the configurations More... | |
std::array< std::vector< Slice >, 2 > | make_slices (const std::array< Slice, TENSOR_MAXDIM > &s) const |
void | make_structure (bool force=false) |
unsigned int | nCoeff () const |
return the number of coefficients More... | |
void | normalize () |
normalize the vectors (tested) More... | |
TensorTypeData< T >::float_scalar_type | normf () const |
calculate the Frobenius norm More... | |
size_t | real_size () const |
return the real size of this More... | |
void | scale (const double &fac) |
scale this by a number More... | |
void | scale (const double_complex &fac) |
TensorTypeData< T >::float_scalar_type | svd_normf () const |
calculate the Frobenius norm, if this is in SVD form More... | |
template<typename Q > | |
std::enable_if<(TensorTypeData< T >::iscomplex or TensorTypeData< Q >::iscomplex), TENSOR_RESULT_TYPE(T, Q)>::type friend | trace (const SRConf< T > &rhs, const SRConf< Q > &lhs) |
template<typename Q > | |
std::enable_if<!(TensorTypeData< T >::iscomplex or TensorTypeData< Q >::iscomplex), TENSOR_RESULT_TYPE(T, Q)>::type friend | trace (const SRConf< T > &rhs, const SRConf< Q > &lhs) |
calculate the Frobenius inner product (tested) More... | |
SRConf< T > | transform (const Tensor< T > &c) const |
Protected Member Functions inherited from madness::BaseTensor | |
void | cycledim_inplace (long shift, long start, long end) |
Cyclic shift of dimensions. More... | |
void | flat_inplace () |
Reshapes the tensor inplace into 1D. More... | |
void | fusedim_inplace (long i) |
Fuses dimensions i and i+1 . More... | |
void | mapdim_inplace (const std::vector< long > &map) |
General permutation of dimensions. More... | |
void | reshape_inplace (const std::vector< long > &d) |
Reshapes the tensor inplace. More... | |
void | reshape_inplace (int ndimnew, const long *d) |
Reshapes the tensor inplace. More... | |
void | set_dims_and_size (long nd, const long d[]) |
void | splitdim_inplace (long i, long dimi0, long dimi1) |
Splits dimension i . More... | |
void | swapdim_inplace (long i, long j) |
Swaps the dimensions. More... | |
Private Types | |
typedef TensorTypeData< T >::float_scalar_type | float_scalar_type |
typedef Tensor< T >::scalar_type | scalar_type |
the scalar type of T More... | |
Friends | |
bool | compatible (const SRConf &lhs, const SRConf &rhs) |
check compatibility More... | |
SRConf< T > | copy (const SRConf< T > &rhs) |
deep copy of rhs, shrink More... | |
class | GenTensor< T > |
class | SliceLowRankTensor< T > |
Additional Inherited Members | |
Protected Attributes inherited from madness::BaseTensor | |
long | _dim [TENSOR_MAXDIM] |
Size of each dimension. More... | |
long | _id |
Id from TensorTypeData<T> in type_data.h. More... | |
long | _ndim |
Number of dimensions (-1=invalid; 0=no supported; >0=tensor) More... | |
long | _size |
Number of elements in the tensor. More... | |
long | _stride [TENSOR_MAXDIM] |
Increment between elements in each dimension. More... | |
A SRConf handles all the configurations in a Separated Representation.
|
private |
|
private |
the scalar type of T
typedef Tensor<T> madness::SRConf< T >::tensorT |
|
inline |
default ctor
|
inline |
|
inline |
|
default |
copy ctor (tested); shallow copy
|
inline |
ctor with provided weights and effective vectors; shallow copy
References madness::SRConf< T >::check_dimensions(), madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::SRConf< T >::make_structure(), madness::SRConf< T >::set_vectors_and_weights(), and madness::SRConf< T >::weights().
|
inline |
explicit ctor with two vectors (aka SVD), shallow
References madness::SRConf< T >::check_dimensions(), MADNESS_ASSERT, madness::SRConf< T >::make_structure(), madness::SRConf< T >::set_vectors_and_weights(), and madness::SRConf< T >::weights().
|
inline |
dtor
|
inline |
add two orthonormal configurations, yielding an optimal SVD decomposition
References madness::SRConf< T >::check_orthonormality, madness::SRConf< T >::check_right_orthonormality(), madness::SRConf< T >::flat_vector(), madness::SRConf< T >::has_no_data(), madness::SRConf< T >::has_structure(), madness::SRConf< T >::kVec(), MADNESS_ASSERT, madness::SRConf< T >::make_slices(), madness::SRConf< T >::make_structure(), madness::ortho5(), madness::SRConf< T >::rank(), madness::swap(), thresh, madness::SRConf< T >::vector_, madness::wall_time(), and madness::SRConf< T >::weights_.
|
inline |
append configurations of rhs to this
simplified version of inplace_add for flattened configurations *this += fac*rhs
References madness::SRConf< T >::c0(), madness::SRConf< T >::copy, madness::SRConf< T >::has_no_data(), madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::SRConf< T >::make_slices(), madness::SRConf< T >::make_vector_dimensions(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::s0, madness::SRConf< T >::s1, madness::SRConf< T >::scale(), madness::swap(), madness::SRConf< T >::vector_, madness::SRConf< T >::weights(), and madness::SRConf< T >::weights_.
Referenced by madness::SVDTensor< T >::gaxpy().
|
inline |
References MADNESS_EXCEPTION.
|
inline |
return a Slice that corresponds the that part of vector_ that holds coefficients
References MADNESS_EXCEPTION, madness::SRConf< T >::s0, and madness::SRConf< T >::s1.
Referenced by madness::SRConf< T >::append(), and madness::SRConf< T >::check_right_orthonormality().
|
inlineprotected |
|
inlineprotected |
check if the terms are orthogonal
References madness::SRConf< T >::c0(), madness::BaseTensor::dim(), madness::inner(), madness::SRConf< T >::kVec(), madness::detail::norm(), madness::Tensor< T >::normf(), madness::SRConf< T >::rank(), madness::SRConf< T >::ref_vector(), madness::BaseTensor::size(), and small.
Referenced by madness::SRConf< T >::add_SVD().
|
inline |
References madness::BaseTensor::_ndim, madness::BaseTensor::_size, madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
Referenced by madness::SRConf< T >::operator=().
|
inline |
return a slice of this (deep copy)
References madness::SRConf< T >::copy, madness::BaseTensor::dim(), madness::SRConf< T >::has_no_data(), k, madness::SRConf< T >::make_slices(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::set_vectors_and_weights(), madness::SRConf< T >::vector_, madness::SRConf< T >::weights(), and madness::SRConf< T >::weights_.
|
inline |
return the number of physical dimensions
References MADNESS_ASSERT, and madness::SRConf< T >::vector_.
Referenced by madness::SeparatedConvolution< Q, NDIM >::apply2_lowdim(), madness::SRConf< T >::normalize(), and madness::SRConf< T >::transform_dir().
perform elementwise Hadamard product
References madness::_(), a1, madness::SRConf< T >::compatible, madness::BaseTensor::dims(), madness::SRConf< T >::flat_vector(), k, madness::SRConf< T >::kVec(), MADNESS_ASSERT, madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::make_structure(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::normalize(), madness::outer(), madness::outer_result(), madness::SRConf< T >::rank(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
Referenced by madness::SVDTensor< T >::emul().
|
inlineprotected |
fill this SRConf with 1 flattened random configurations (tested)
References madness::SRConf< T >::has_structure(), madness::SRConf< T >::kVec(), MADNESS_ASSERT, madness::SRConf< T >::make_slices(), madness::SRConf< T >::normalize(), madness::SRConf< T >::rank(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
|
inline |
return shallow copy of a slice of one of the vectors, flattened to (r,kVec)
References madness::SRConf< T >::kVec(), MADNESS_ASSERT, madness::SRConf< T >::rank(), and madness::SRConf< T >::vector_.
|
inline |
return shallow copy of a slice of one of the vectors, flattened to (r,kVec)
References madness::SRConf< T >::kVec(), MADNESS_ASSERT, madness::SRConf< T >::rank(), and madness::SRConf< T >::vector_.
Referenced by madness::SRConf< T >::add_SVD(), madness::SRConf< T >::emul(), madness::SRConf< T >::get_configs(), madness::SRConf< T >::normf(), madness::SRConf< T >::reconstruct(), madness::FunctionImpl< T, NDIM >::tnorm(), and madness::SRConf< T >::trace().
|
inline |
return flat (r,i) view of the tensor with the weights multiplied in
return a(r,i) = vec(dim)(r,i) * w(r)
References madness::BaseTensor::dim(), madness::SRConf< T >::make_vector_with_weights(), madness::SRConf< T >::rank(), madness::BaseTensor::size(), and madness::SRConf< T >::vector_.
|
inline |
The input dimensions of t
must all be the same .
References c, madness::SRConf< T >::copy, madness::BaseTensor::dims(), madness::SRConf< T >::has_no_data(), madness::SRConf< T >::has_structure(), madness::inner(), MADNESS_ASSERT, madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::set_vectors_and_weights(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
|
inline |
return some of the terms of the SRConf (start,..,end), inclusively shallow copy
References madness::_(), madness::BaseTensor::dims(), madness::SRConf< T >::flat_vector(), madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::set_vectors_and_weights(), and madness::SRConf< T >::weights_.
|
inline |
does this have any data?
References madness::BaseTensor::size().
Referenced by madness::SRConf< T >::has_no_data().
|
inline |
does this have any data?
References madness::SRConf< T >::has_data().
Referenced by madness::SRConf< T >::add_SVD(), madness::SRConf< T >::append(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::general_transform(), madness::SRConf< T >::inplace_add(), madness::SRConf< T >::normf(), madness::SRConf< T >::operator=(), madness::SRConf< T >::svd_normf(), madness::SRConf< T >::trace(), madness::SRConf< T >::transform(), and madness::SRConf< T >::transform_dir().
|
inline |
return if this has a tensor structure (has not been flattened)
References madness::BaseTensor::dim(), madness::SRConf< T >::make_vector_dimensions(), and madness::SRConf< T >::vector_.
Referenced by madness::SRConf< T >::SRConf(), madness::SRConf< T >::add_SVD(), madness::SRConf< T >::append(), madness::SRConf< T >::fillWithRandom(), madness::SRConf< T >::general_transform(), madness::SRConf< T >::get_configs(), madness::SRConf< T >::inplace_add(), madness::SRConf< T >::normalize(), madness::SRConf< T >::operator=(), madness::SRConf< T >::serialize(), madness::SRConf< T >::transform(), and madness::SRConf< T >::transform_dir().
|
inlineprotected |
alpha * this(lhs_s) + beta * rhs(rhs_s)
bounds checking should have been performed by caller s denotes where in lhs the new contribution from rhs will be inserted
References alpha, beta, madness::BaseTensor::dims(), madness::SRConf< T >::has_no_data(), madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::make_slices(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::s0, madness::SRConf< T >::s1, madness::swap(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
|
inlineprotected |
return if this has only one additional dimension (apart from rank)
References madness::BaseTensor::ndim(), and madness::SRConf< T >::vector_.
|
inline |
|
inline |
References madness::SRConf< T >::make_structure(), madness::SRConf< T >::make_vector_dimensions(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
Referenced by madness::SRConf< T >::emul(), madness::SRConf< T >::inplace_add(), and madness::SRConf< T >::operator=().
|
inlineprotected |
References madness::SRConf< T >::make_vector_with_weights().
Referenced by madness::SRConf< T >::reconstruct().
|
inlineprotected |
redo the Slices for getting direct access to the configurations
References madness::_(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::s0, and madness::SRConf< T >::s1.
Referenced by madness::SRConf< T >::add_SVD(), madness::SRConf< T >::append(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::fillWithRandom(), madness::SRConf< T >::inplace_add(), and madness::SRConf< T >::make_structure().
|
inlineprotected |
|
inlineprotected |
References madness::SRConf< T >::make_slices(), madness::SRConf< T >::make_vector_dimensions(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), and madness::SRConf< T >::vector_.
Referenced by madness::SRConf< T >::SRConf(), madness::SRConf< T >::add_SVD(), madness::SRConf< T >::emul(), madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::operator=(), and madness::SRConf< T >::set_vectors_and_weights().
|
inline |
deduce the dimensions of the left and right singular vectors from the tensor dimensions
References madness::BaseTensor::dim(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), and madness::SRConf< T >::rank().
Referenced by madness::SRConf< T >::append(), madness::SVDTensor< T >::concatenate(), madness::SRConf< T >::has_structure(), madness::SRConf< T >::make_empty_vectors_and_weights(), and madness::SRConf< T >::make_structure().
|
inline |
References madness::_(), madness::SRConf< T >::copy, madness::BaseTensor::dim(), madness::BaseTensor::dims(), madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::BaseTensor::size(), v, madness::SRConf< T >::vector_, and madness::SRConf< T >::weights().
Referenced by madness::SRConf< T >::flat_vector_with_weights(), and madness::SRConf< T >::make_left_vector_with_weights().
|
inlinestatic |
return the index of the last singular vector/value to meet the threshold (returns -1 if all meet threshold, i.e. || A ||_2 < threshold) given a matrix A in SVD form, truncate the singular values such that the accuracy threshold is still met.
[in] | thresh | the threshold eps: || A - A(truncated) || < eps |
[in] | rank | the number of singular values in w |
[in] | w | the weights/singular values of A |
References madness::SRConf< T >::rank(), residual(), thresh, and w().
Referenced by madness::SeparatedConvolution< Q, NDIM >::apply2(), madness::SVDTensor< T >::compute_svd(), madness::TensorTrain< T >::decompose(), madness::SeparatedConvolution< Q, NDIM >::estimate_costs(), madness::ortho3(), madness::rank_revealing_decompose(), madness::TensorTrain< T >::splitdim(), test_stuff(), madness::TensorTrain< T >::truncate(), and madness::SVDTensor< T >::truncate_svd().
|
inlineprotected |
return the number of coefficients
References madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
Referenced by madness::SVDTensor< T >::nCoeff().
|
inlineprotected |
normalize the vectors (tested)
References madness::_(), madness::SRConf< T >::dim_per_vector(), madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::detail::norm(), madness::SRConf< T >::normf(), madness::SRConf< T >::rank(), madness::SRConf< T >::scale(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
Referenced by madness::GenTensor< T >::convert_inplace(), madness::SRConf< T >::emul(), madness::SRConf< T >::fillWithRandom(), and madness::SRConf< T >::operator=().
|
inlineprotected |
calculate the Frobenius norm
References std::abs(), madness::Tensor< T >::emul(), madness::SRConf< T >::flat_vector(), madness::SRConf< T >::has_no_data(), madness::inner_result(), MADNESS_ASSERT, madness::BaseTensor::ndim(), madness::outer(), madness::SRConf< T >::rank(), madness::Tensor< T >::sum(), madness::vec(), and madness::SRConf< T >::weights_.
Referenced by madness::SRConf< T >::normalize().
|
inline |
assignment operator (tested), shallow copy of vectors
References madness::SRConf< T >::clear(), madness::BaseTensor::dims(), madness::SRConf< T >::has_no_data(), madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::make_structure(), madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::s0, madness::SRConf< T >::s1, madness::BaseTensor::set_dims_and_size(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
|
inline |
assign a number to this;
References madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::make_structure(), madness::SRConf< T >::normalize(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
|
inline |
return the logicalrank
References madness::SRConf< T >::weights_.
Referenced by madness::SRConf< T >::add_SVD(), madness::SRConf< T >::append(), madness::SRConf< T >::check_dimensions(), madness::SRConf< T >::check_right_orthonormality(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::emul(), madness::SRConf< T >::fillWithRandom(), madness::SRConf< T >::flat_vector(), madness::SRConf< T >::flat_vector_with_weights(), madness::SRConf< T >::general_transform(), madness::SRConf< T >::get_configs(), madness::SRConf< T >::inplace_add(), madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::make_slices(), madness::SRConf< T >::make_structure(), madness::SRConf< T >::make_vector_dimensions(), madness::SRConf< T >::make_vector_with_weights(), madness::SRConf< T >::max_sigma(), madness::SRConf< T >::normalize(), madness::SRConf< T >::normf(), madness::SRConf< T >::operator=(), madness::SVDTensor< T >::rank(), madness::SRConf< T >::reconstruct(), madness::SRConf< T >::svd_normf(), madness::SRConf< T >::trace(), madness::SRConf< T >::transform(), and madness::SRConf< T >::transform_dir().
|
inlineprotected |
return the real size of this
References madness::SRConf< T >::s1, T(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
|
inline |
reconstruct this to return a full tensor
References madness::conj(), madness::BaseTensor::dims(), madness::SRConf< T >::flat_vector(), madness::inner(), madness::SRConf< T >::make_left_vector_with_weights(), madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), and madness::Tensor< T >::reshape().
Referenced by test_stuff().
|
inline |
return reference to one of the vectors F
References madness::SRConf< T >::vector_.
Referenced by madness::SeparatedConvolution< Q, NDIM >::apply2_lowdim(), madness::SRConf< T >::check_right_orthonormality(), and madness::SRConf< T >::transform_dir().
|
inline |
return reference to one of the vectors F
References madness::SRConf< T >::vector_.
|
inlineprotected |
scale this by a number
References madness::SRConf< T >::weights_.
Referenced by madness::SRConf< T >::append(), madness::SVDTensor< T >::gaxpy(), and madness::SRConf< T >::normalize().
|
inlineprotected |
References MADNESS_EXCEPTION.
|
inline |
References madness::BaseTensor::_dim, madness::BaseTensor::_id, madness::BaseTensor::_ndim, madness::BaseTensor::_size, madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::SRConf< T >::nci_left, madness::SRConf< T >::s0, madness::SRConf< T >::s1, TENSOR_MAXDIM, madness::SRConf< T >::vector_, madness::SRConf< T >::weights_, and madness::archive::wrap().
|
inline |
|
inline |
References madness::SRConf< T >::make_structure(), madness::SRConf< T >::vector_, madness::SRConf< T >::weights(), and madness::SRConf< T >::weights_.
Referenced by madness::SRConf< T >::SRConf(), madness::SVDTensor< T >::compute_svd(), madness::SVDTensor< T >::compute_svd_from_range(), madness::SVDTensor< T >::concatenate(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::general_transform(), madness::SRConf< T >::get_configs(), and madness::SRConf< T >::transform().
|
inlineprotected |
calculate the Frobenius norm, if this is in SVD form
References madness::SRConf< T >::has_no_data(), madness::SRConf< T >::rank(), and madness::SRConf< T >::weights_.
|
inlineprotected |
References MADNESS_EXCEPTION, and T().
|
inlineprotected |
calculate the Frobenius inner product (tested)
References madness::Tensor< T >::emul(), madness::SRConf< T >::flat_vector(), madness::SRConf< T >::has_no_data(), madness::inner_result(), MADNESS_ASSERT, madness::BaseTensor::ndim(), madness::outer(), Q(), madness::SRConf< T >::rank(), madness::Tensor< T >::sum(), T(), madness::TENSOR_RESULT_TYPE(), and madness::SRConf< T >::weights_.
|
inlineprotected |
The input dimensions of t
must all be the same .
References c, madness::SRConf< T >::copy, madness::BaseTensor::dims(), madness::SRConf< T >::has_no_data(), madness::SRConf< T >::has_structure(), madness::inner(), MADNESS_ASSERT, madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::set_vectors_and_weights(), madness::SRConf< T >::vector_, and madness::SRConf< T >::weights_.
|
inline |
References axis, c, madness::SRConf< T >::copy, madness::SRConf< T >::dim_per_vector(), madness::BaseTensor::dims(), madness::SRConf< T >::has_no_data(), madness::SRConf< T >::has_structure(), MADNESS_ASSERT, madness::SRConf< T >::nci_left, madness::BaseTensor::ndim(), madness::SRConf< T >::rank(), madness::SRConf< T >::ref_vector(), and madness::transform_dir().
|
inline |
return the weight
References madness::SRConf< T >::weights_.
Referenced by madness::SRConf< T >::SRConf(), madness::SRConf< T >::append(), madness::SVDTensor< T >::concatenate(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::make_vector_with_weights(), madness::SRConf< T >::set_vectors_and_weights(), and madness::FunctionImpl< T, NDIM >::tnorm().
check compatibility
Referenced by madness::SVDTensor< T >::concatenate(), and madness::SRConf< T >::emul().
|
friend |
|
static |
check orthonormality at low rank additions
Referenced by madness::SRConf< T >::add_SVD().
long madness::SRConf< T >::nci_left =-1 |
separation dimensions: A(n,m) -> A(r,n) B(r,m), with n={k1,k2},m={k3,k4,k5..) multi-indices
Referenced by madness::SRConf< T >::SRConf(), madness::SRConf< T >::append(), madness::SRConf< T >::check_dimensions(), madness::SVDTensor< T >::concatenate(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::emul(), madness::SRConf< T >::general_transform(), madness::SRConf< T >::get_configs(), madness::SRConf< T >::inplace_add(), madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::make_slices(), madness::SRConf< T >::make_structure(), madness::SRConf< T >::make_vector_dimensions(), madness::SRConf< T >::operator=(), madness::SRConf< T >::serialize(), madness::SRConf< T >::transform(), and madness::SRConf< T >::transform_dir().
std::vector<Slice> madness::SRConf< T >::s0 |
Slice containing the actual data in each vector, ignoring "empty" configurations; will maintain contiguity of the data.
Referenced by madness::SRConf< T >::append(), madness::SRConf< T >::c0(), madness::SRConf< T >::inplace_add(), madness::SRConf< T >::make_slices(), madness::SRConf< T >::operator=(), and madness::SRConf< T >::serialize().
std::vector<Slice> madness::SRConf< T >::s1 |
std::array<Tensor<T>,2> madness::SRConf< T >::vector_ |
for each (physical) dimension one Tensor of (logical) dimension (r,k) for vectors or (r,kprime,k) for operators
Referenced by madness::SRConf< T >::add_SVD(), madness::SRConf< T >::append(), madness::SRConf< T >::check_dimensions(), madness::SRConf< T >::clear(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::dim_per_vector(), madness::SRConf< T >::emul(), madness::SRConf< T >::fillWithRandom(), madness::SRConf< T >::flat_vector(), madness::SRConf< T >::flat_vector_with_weights(), madness::SRConf< T >::general_transform(), madness::SRConf< T >::has_structure(), madness::SRConf< T >::inplace_add(), madness::SRConf< T >::is_flat(), madness::SRConf< T >::kVec(), madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::make_structure(), madness::SRConf< T >::make_vector_with_weights(), madness::SRConf< T >::nCoeff(), madness::SRConf< T >::normalize(), madness::SRConf< T >::operator=(), madness::SRConf< T >::real_size(), madness::SRConf< T >::ref_vector(), madness::SRConf< T >::serialize(), madness::SRConf< T >::set_vectors_and_weights(), and madness::SRConf< T >::transform().
Tensor< typename Tensor<T>::scalar_type > madness::SRConf< T >::weights_ |
for each configuration the weight; length should be r
Referenced by madness::SRConf< T >::add_SVD(), madness::SRConf< T >::append(), madness::SRConf< T >::clear(), madness::SRConf< T >::copy_slice(), madness::SRConf< T >::emul(), madness::SRConf< T >::fillWithRandom(), madness::SRConf< T >::general_transform(), madness::SRConf< T >::get_configs(), madness::SRConf< T >::inplace_add(), madness::SRConf< T >::make_empty_vectors_and_weights(), madness::SRConf< T >::nCoeff(), madness::SRConf< T >::normalize(), madness::SRConf< T >::normf(), madness::SRConf< T >::operator=(), madness::SRConf< T >::rank(), madness::SRConf< T >::real_size(), madness::SRConf< T >::scale(), madness::SRConf< T >::serialize(), madness::SRConf< T >::set_vectors_and_weights(), madness::SRConf< T >::svd_normf(), madness::SRConf< T >::trace(), madness::SRConf< T >::transform(), and madness::SRConf< T >::weights().