SyTen
syten::T3N::State Class Reference
+ Inheritance diagram for syten::T3N::State:
+ Collaboration diagram for syten::T3N::State:

Public Types

enum class  DropNorm { Yes , No }
 Whether or not to drop the norm on normalisation. 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

void add (Ptr t, Ptr const o, SDef const prefactor=1.)
 Adds two states recursively. More...
 
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...
 
void multiply_rec (Ptrc s, Operator::cPtrc o) const
 Recursive helper for op-state application. More...
 
Stateoperator*= (Operator const &op)
 Applies an operator to this. More...
 
Stateoperator+= (State const &other)
 Adds the argument to this. More...
 
Stateoperator-= (State const &other)
 Subtracts the argument from this. More...
 
Stateoperator= (State &&other)=default
 Move assignment operator. More...
 
Stateoperator= (State const &other)=default
 Copy assignment operator. More...
 
bool operator== (State const &other) const
 
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...
 
 State ()=default
 Default constructor. More...
 
 State (State &&other)=default
 Move constructor. More...
 
 State (State const &other)=default
 Copy constructor. More...
 
Dropping of tensor blocks
void drop_all ()
 Drops all blocks on all tensors, i.e. More...
 
Normalisation of nodes in a specific direction.
SRDef rootNormaliseNode (Ptr ptr, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes)
 Root-normalise the node pointed to by ptr. More...
 
template<typename P >
SRDef rootNormaliseNode (P const &p, Truncation const &t, DropNorm const d)
 Overload. More...
 
SRDef descendantNormaliseNode (Ptr ptr, LegType const which, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes)
 Normalises the node pointed to by ptr to the which-th direction. More...
 
template<typename P >
SRDef descendantNormaliseNode (P const &p, LegType const w, Truncation const &t, DropNorm const d)
 Overload. More...
 
SRDef rootNormaliseTree (DropNorm const dropN=DropNorm::Yes, Truncation const &trunc=Truncation())
 Root-normalises the entire tree. More...
 
Caching of tensors.
void cache (bool const do_cache=true) const
 Caches all tensors. More...
 
void uncache ()
 Uncaches all tensors. More...
 
void setMaybeCache (bool const pc)
 Sets #pleaseCache to the argument and calls #maybeCache(). More...
 
Cuda related functions.
void make_cuda ()
 Loads the entire state onto the GPU. More...
 
void maybe_make_cuda ()
 Maybe loads the state onto the GPU. More...
 
void make_standard ()
 Loads State into RAM. More...
 
Truncations
SRDef truncate_rec (Ptr ptr, Truncation const &trunc, DropNorm const dropN)
 Recursive helper for truncation. More...
 
SRDef truncate (Truncation const &trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, bool const correct_cgcs=true)
 Truncates the state. More...
 
SRDef truncateKeepNorm (Truncation const &trunc=Truncation())
 Truncate the state preserving the norm, see truncate(). More...
 
SRDef truncateKN2Conv (Truncation const &trunc=Truncation())
 Calls truncateKeepNorm repeatedly until the bond dimension no longer changes. More...
 
SRDef truncateVariational (Truncation const &trunc, DropNorm const dropN)
 Does a variational truncation. More...
 
void normalise ()
 normalise the state to 1. More...
 
Access functions.
T3NTensoroperator() (int const element)
 Returns a reference to the tensor at the specified coordinate. More...
 
T3NTensoroperator() (Vec< Index > const &coordinate)
 Returns a reference to the tensor at the specified 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...
 
- 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...
 
History history = History()
 History records of this state. 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 const std::array< Direction, 3 > branchingDirs = { Direction::Out, Direction::Inc, Direction::Inc }
 Incoming/Outgoing bases convention. More...
 
static const std::array< Direction, 3 > physicalDirs = { Direction::Out, Direction::Out, Direction::Inc }
 
static constexpr Index rank = 3
 The rank which the STenors contained should have. More...
 
static const std::string uuid = "13a43858-40b0-11e8-842f-0ed5f89f718b"
 UUID of a T3N::State. More...
 
static constexpr unsigned int version = 4
 Version number of state. More...
 
static std::array< std::string, 3 > const virtNames = { "Root","B-Leg","A-Leg" }
 The names of the virtual Legs. More...
 

Index numbering

static constexpr Index rIdx = 1
 Root-directed tensor index. More...
 
static constexpr Index aIdx = 3
 Index of left subtree or the descendent. More...
 
static constexpr Index bIdx = 2
 Index of right subtree, not for physical nodes. More...
 
static constexpr Index pIdx = 2
 Physical tensor index. More...
 
static Index getIndex (LegType l)
 Returns the Index for the given LegType. 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)
 

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