SyTen
syten::Tensor< rank > Class Template Reference

A single tensor, composed of a set of symmetry-protected blocks. More...

#include <tensor.h>

+ Inheritance diagram for syten::Tensor< rank >:
+ Collaboration diagram for syten::Tensor< rank >:

Public Types

typedef TensorBlock< rankBlock
 Type of the underlying block, a tensor is simply a set of such blocks. More...
 
typedef Block::CGC CGC
 Type of a single CGC space. More...
 
typedef Block::CGCSet CGCSet
 Type of the set of all CGC spaces. More...
 
typedef Block::Dense Dense
 The standard dense tensor type of the reduced tensors (i.e. excluding CGC spaces) More...
 
typedef Block::DenseStorage DenseStorage
 The storage dense tensor type of the reduced tensors (i.e. excluding CGC spaces) More...
 
typedef Block::Sym Sym
 Type of the symmetry transformation description of a given block. More...
 

Public Member Functions

MemoryUsage::MemorySize allocSize () const
 allocSize()/memory_size.h support. More...
 
bool dense_is_standard () const
 Returns true if all dense blocks are in standard format. More...
 
void make_dense_cuda ()
 Brings all dense tensors into CUDA form. More...
 
void make_dense_standard ()
 Brings all dense tensors into standard form. More...
 
void maybe_make_dense_cuda ()
 Conditionally transforms all stored dense tensors into CUDA dense tensors if CUDA support is compiled in, at least one CUDA device is enabled and the individual blocks are larger than the CUDA threshold. More...
 
Tensor< rankreturn_as_dense_standard () const
 Returns a copy of *this in dense standard format. More...
 
template<typename Archive >
void serialize (Archive &ar, unsigned int const in_version)
 Boost serialisation. More...
 
Constructors
 Tensor ()
 Default ctor, initialised with invalid leg directions. More...
 
 Tensor (std::array< Direction, rank > const &dirs_)
 Zero-tensor with the specified directions. More...
 
 Tensor (std::array< Direction, rank > const &dirs_, Index size)
 Zero-tensor with the specified directions and default-constructed blocks. More...
 
Vector imitation of a tensor, allows easy iteration over the tensor
Blockoperator[] (Index i)
 Vector-like interface. More...
 
Block const & operator[] (Index i) const
 Vector-like interface. More...
 
Blockat (Index i)
 Vector-like interface. More...
 
Block const & at (Index i) const
 Vector-like interface. More...
 
std::vector< Block >::iterator begin ()
 Vector-like interface. More...
 
std::vector< Block >::const_iterator begin () const
 Vector-like interface. More...
 
std::vector< Block >::const_iterator cbegin () const
 Vector-like interface. More...
 
std::vector< Block >::iterator end ()
 Vector-like interface. More...
 
std::vector< Block >::const_iterator end () const
 Vector-like interface. More...
 
std::vector< Block >::const_iterator cend () const
 Vector-like interface. More...
 
std::vector< Block >::iterator erase (typename std::vector< Block >::const_iterator x)
 Vector-like interface. More...
 
std::vector< Block >::iterator erase (typename std::vector< Block >::const_iterator x, typename std::vector< Block >::const_iterator y)
 Vector-like interface. More...
 
Index size () const
 Vector-like interface. More...
 
bool empty () const
 Vector-like interface. More...
 
void reserve (Index i)
 Vector-like interface. More...
 
void resize (Index i)
 Vector-like interface. More...
 
void clear ()
 Vector-like interface. More...
 
void shrink_to_fit ()
 Vector-like interface. More...
 
void push_back (Block const &b)
 Vector-like interface. More...
 
void push_back (Block &&b)
 Vector-like interface. More...
 
template<typename... Types>
void emplace_back (Types &&... args)
 Vector-like interface. More...
 
Basis information
Basis getBasis (Index leg) const
 Constructs the basis on the specified leg. More...
 
Basis b (Index leg) const
 Shortcut for getBasis. More...
 
BasisMap getBasisMap (Index leg) const
 Constructs a basis map on the specified leg, suitable to quickly check for the existence of sectors. More...
 
Basis getAddedBasis (Index leg) const
 Constructs the maximal basis on the specified leg. More...
 
Index getReducedDim (Index leg) const
 Get the sum of all reduced tensor dimensions on the specified leg. More...
 
std::array< Index, rankgetReducedDims () const
 c.f. getReducedDim(), for all legs More...
 
Tensor const & print_bases () const
 
Index getTotalDim (Index leg) const
 Get the sum of the tensor-producted block dimensions on the specified leg. More...
 
std::array< Index, rankgetTotalDims () const
 c.f. getTotalDim(), for all legs More...
 
Index getMaxBlocksize (Index leg) const
 gets the sidelength of the largest block on the specified leg More...
 
Index getAvgBlocksize (Index leg) const
 get averaged sidelength of blocks as \( \left[\frac{1}{N} \sum_i m_i^3 \right]^{1/3} \) More...
 
std::size_t getDenseSize () const
 Returns the total number of dense tensor entries. More...
 
bool hasCGC () const
 Returns true if the tensor a symmetry which has a CGC space (typically) attached, e.g. More...
 
Deparallelisation of tensor blocks, addition of tensor blocks
void reduce (EliminateZeros const ezeros=EliminateZeros::Yes, bool const add_cgc=false, bool const no_para=false, bool const no_zero_check_dense=false)
 Reduce the number of blocks in the tensor by adding parallel blocks together. More...
 
void add (TensorBlock< rank > &&t)
 Adds a block to the tensor. More...
 
void add (TensorBlock< rank > const &t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
template<typename... Args>
void add (Args &&... args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 

Public Attributes

std::vector< Blockblocks
 Blocks composing this tensor. More...
 
std::array< Direction, rankdirs
 Directions of the individual legs (incoming/outgoing) More...
 

Static Public Attributes

static constexpr Rank this_rank = rank
 Helper to retrieve the tensor rank from an object of this type. More...
 
static constexpr unsigned int version = 1
 Bump this if one of the above changes. More...
 

Detailed Description

template<Rank rank>
class syten::Tensor< rank >

A single tensor, composed of a set of symmetry-protected blocks.

Template Parameters
rankthe rank of the tensor, i.e. the number of indices

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