SyTen
syten::T3N::Operator Class Reference

A T3N operator. More...

#include <operator.h>

+ Inheritance diagram for syten::T3N::Operator:
+ Collaboration diagram for syten::T3N::Operator:

Public Types

typedef T3N::Tree::Tree< SBasisPhysBases
 To satisfy annoying compilers. More...
 
- Public Types inherited from syten::T3N::Tree::Tree< T3NTensor >
using cPtr = const Node *
 An overload. More...
 
using cPtrc = const Node *const
 An overload. More...
 
typedef T3N::Tree::Node< ValueNode
 Shortcut for the Nodes. More...
 
using Ptr = Node *
 Pointer to Node. More...
 
using Ptrc = Node *const
 An overload. More...
 
typedef std::vector< std::tuple< Index, std::vector< Index >, NodeType, Index > > Structure
 Return type of tree information for plotting. More...
 
typedef std::map< int, PositionTranslator
 Translator to call Nodes. More...
 
typedef T3NTensor Value
 Type of the contained values. More...
 

Public Member Functions

MemoryUsage::MemorySize allocSize () const
 Returns the total size of this. More...
 
template<typename Archive >
void load (Archive &arch, unsigned int const in_version)
 Boost load. More...
 
template<typename Archive >
void load_rec (Archive &arch, Ptrc ptr)
 Load recursive helper. More...
 
 Operator ()=default
 Default constructor. More...
 
 Operator (PhysBases const &physical)
 Initialising to zero operator. More...
 
bool operator== (Operator const &other) const
 
void print (std::ostream &out)
 Prints all virtual leg dimensions. More...
 
void repro ()
 Helper to renew all virtual SBases indices. More...
 
template<typename Archive >
void save (Archive &arch, unsigned int const) const
 Boost save. More...
 
template<typename Archive >
void save_rec (Archive &arch, Ptrc ptr) const
 Save recursive helper. More...
 
Access functions.
T3NTensoroperator() (int const element)
 Return the local operator component at that coordinate. More...
 
T3NTensoroperator() (Vec< Index > const &coordinate)
 Return the local operator component at that coordinate. More...
 
Ptr operator[] (int const element) const
 Returns a Ptr to the Node at the specified coordinate. More...
 
Ptr operator[] (Vec< Index > const &coordinate) const
 Returns a Ptr to the Node at the specified coordinate. More...
 
Dropping of tensor blocks
void drop_all ()
 Drops all blocks on all tensors, i.e. sets the state to zero. More...
 
Truncation.
SRDef truncate (TruncationType const &type=TruncationType::Default, bool const verbose=false, SRDef const threshold=NAN, bool const nowarn=false, bool const correct_cgc=true)
 Truncates the operator. More...
 
SRDef truncate_impl (TruncationType const &type, Index const max_sweeps, bool const verbose, SRDef threshold, bool const nowarn)
 Implementation. More...
 
SRDef truncate_rec (Ptrc ptr, TruncationType const &type, SRDef const threshold)
 Truncates the subtree starting at the specified node in largely the same fashion as for states. More...
 
SRDef rootNormaliseNode (Ptrc ptr, TruncationType const &type, SRDef const threshold)
 Root-normalise the node pointed to by ptr. More...
 
SRDef descendantNormaliseNode (Ptrc ptr, TruncationType const &type, SRDef const threshold, LegType const which)
 Normalises the node pointed to by ptr to the which-th direction. More...
 
SRDef rootNormaliseTree (TruncationType const &type, SRDef const threshold)
 Normalises the entire operator. More...
 
Caching of tensors.
void cache (bool const do_cache=true)
 Caches all tensors. More...
 
void uncache ()
 Uncaches all tensors. More...
 
Cuda related functions.
void make_cuda ()
 Loads entire operator onto GPU. More...
 
void maybe_make_cuda ()
 Maybe loads the operator onto the GPU. More...
 
void make_standard ()
 Loads operator into RAM. More...
 
- Public Member Functions inherited from syten::T3N::Tree::Tree< T3NTensor >
MemoryUsage::MemorySize allocSize () const
 
Structure genStructure () const
 Returns structure for pretty plotting. More...
 
Position left_most () const
 Returns the left-most node. More...
 
void load (Archive &arch, unsigned int const in_version)
 Boost load. More...
 
bool mp () const
 Returns true, if tree only contains physical nodes. More...
 
Treeoperator= (Tree &&other)
 Move assignment operator. More...
 
Treeoperator= (Tree const &other)
 Copy assignment operator. More...
 
bool operator== (Tree< OtherType > const &other) const
 Compare the structure of two trees. More...
 
Position right_most () const
 Returns the right-most node. More...
 
void save (Archive &arch, unsigned int) const
 Boost save. More...
 
Index size () const
 Counts all Nodes of this tree. More...
 
Index sizeOf (NodeType const type) const
 Counts the number of Nodes w/ the given type. More...
 
 Tree (NodeType root=NodeType::Physical)
 Default constructor. More...
 
 Tree (NodeType root=NodeType::Physical, Args... args)
 Constructor forwarding the container. More...
 
 Tree (Tree &&other)
 Move constructor. More...
 
 Tree (Tree const &other)
 Copy constructor. More...
 
 ~Tree ()
 Destructor. More...
 
Ptr operator[] (Position const &coordinate) const
 Returns the Ptr to the Node specified through the coordinate vector by the following syntax: More...
 
Ptr operator[] (int const element) const
 
void visit (Func &&func)
 Shortcut. More...
 
void visit (Func &&func, Ptr ptr)
 Shortcut. More...
 

Public Attributes

bool cache_flag = false
 Determines if data should be cached immediately after de-serializing. More...
 
- Public Attributes inherited from syten::T3N::Tree::Tree< T3NTensor >
Ptr Root
 Root of the tree. More...
 
Translator translator
 Instance. More...
 

Static Public Attributes

static constexpr Index branchRank = 3
 The rank which the branching STenors contained should have. More...
 
static std::array< std::string, 3 > const branchVirtNames = { "Root","A-Leg","B-Leg" }
 Names of the virtual Legs of Branching Nodes. More...
 
static std::array< std::string, 4 > const physNames = { "Root","Up","Down","A-Leg" }
 Names of the virtual Legs of Physical Nodes. More...
 
static constexpr Index physRank = 4
 The rank which the physical STenors contained should have. More...
 
static const std::string uuid = "4d114346-46f6-11e8-842f-0ed5f89f718b"
 UUID of a T3N::Operator. More...
 
static constexpr unsigned int version = 2
 Version number of state. More...
 
static const std::array< Direction, branchRankbranchingDirs
 Branching Dirs. More...
 
static const std::array< Direction, physRankphysicalDirs
 Physical Dirs. More...
 

Private Member Functions

void buildEmptyOperator_rec (typename Tree::Tree< SBasis >::Ptr const p, Operator::Ptr optr)
 Helper function. More...
 
std::tuple< SRDef, STensor, STensor, SBasistruncation_decompose (Ptrc ptr, TruncationType const &type, SRDef const threshold, LegType const dir)
 Helper for the truncation. More...
 

Index numbering

static constexpr Index rIdx = 1
 Root-directed tensor index. More...
 
static constexpr Index aIdx_P = 4
 Index of the descendent. More...
 
static constexpr Index uIdx = 2
 Upper tensor index for physical nodes only. More...
 
static constexpr Index dIdx = 3
 Lower tensor index for physical nodes only. More...
 
static constexpr Index aIdx_B = 3
 Index of the A-Leg. More...
 
static constexpr Index bIdx = 2
 Index of the B-Leg. More...
 
static Index getIndex (LegType l, NodeType n)
 Gets the STensor Index for the respective leg. More...
 

Product of two operators

Operatoroperator*= (Operator const &other)
 Product of two operators \( \hat O \; \hat T \), *this will be applied first to the state. More...
 
void product_rec (Operator::Ptrc tptr, Operator::cPtrc optr)
 Recursive helper for operator multiplication. More...
 

Addition of two operators

Operatoroperator+= (Operator const &other)
 Adds the argument to *this More...
 
Operatoroperator-= (Operator const &other)
 Subtracts the argument from *this More...
 
void add_rec (Operator::Ptr tptr, Operator::Ptr const optr)
 Recursive helper for operator addition. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from syten::T3N::Tree::Tree< T3NTensor >
static void visit (Func &&f, const Pair< IterDirection, IterDirection > directions, Ptr ptr)
 
static std::result_of< Func(Ptr)>::type visit (Func &&f, typename std::result_of< Func(Ptr)>::type initial, Pair< IterDirection, IterDirection > directions, Ptr ptr)
 Recursively visits a subtree, bottom-first. More...
 
static std::result_of< Func(Ptr)>::type visit (Func &&f, Op &&operation, typename std::result_of< Func(Ptr)>::type initial, Pair< IterDirection, IterDirection > directions, Ptr ptr)
 

Detailed Description

A T3N operator.


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