SyTen
syten::BTT::Operator Class Reference

A tree tensor network operator. More...

#include <btt_operator.h>

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

Public Types

enum  DropUnmatched { Yes, No }
 Whether to drop blocks not contained in the neighbouring nodes. More...
 
- Public Types inherited from syten::BinaryTree::Tree< Tensor< 5 > >
typedef BinaryTree::Node< ValueNode
 Type of nodes. More...
 
typedef NodePtr
 Type of pointers to nodes. More...
 
typedef Tensor< 5 > Value
 Type of values contained in the tree. More...
 

Public Member Functions

void project (Sector const &sec)
 Projects the operator onto the given quantum number sector. More...
 
Tensor access
Tensor< 5 > & operator() (std::string const &coordinate)
 Return the local operator component at that coordinate. More...
 
Tensor< 5 > const & operator() (std::string const &coordinate) const
 Return the local operator component at that coordinate. More...
 
Tensor< 5 > & operator() (std::array< Index, 2 > const &coordinate)
 Return the local operator component at that coordinate. More...
 
Tensor< 5 > const & operator() (std::array< Index, 2 > const &coordinate) const
 Return the local operator component at that coordinate. More...
 
template<typename T >
void operator() (T) const =delete
 Explicitly deletes all other operator() to avoid implicit int-to-string conversion when erroneously called as operator(0) (which would be valid for MPOs). More...
 
Dropping of tensor blocks
void drop_all ()
 Drops all blocks on all tensors, i.e. sets the state to zero. More...
 
SRDef drop_unmatched (Ptr ptr)
 Compares the node ptr against all neighbours and drops unmatched blocks. More...
 
SRDef drop_unmatched_a (Ptr ptr)
 Compares the node ptr against its A-child if it exists and drops unmatched blocks in ptr More...
 
SRDef drop_unmatched_b (Ptr ptr)
 Compares the node ptr against its B-child if it exists and drops unmatched blocks in ptr More...
 
SRDef drop_unmatched_r (Ptr ptr)
 Compares the node ptr against its parent if it exists and drops unmatched blocks in ptr More...
 
SRDef drop_unmatched (Ptr ptr, BinaryTree::NodeType const type)
 Compares the node ptr against the specified neighbour and drops unmatched blocks in ptr More...
 
SRDef drop_unmatched_rec (Ptr ptr)
 Recursive helper for drop_unmatched() More...
 
SRDef drop_unmatched ()
 Drops unmatched blocks on all tensors. More...
 
Truncation, currently only supports TruncationType::Deparallelise
SRDef truncate ()
 
SRDef truncate_rec (Ptr ptr)
 Truncates the subtree starting at the specified node in largely the same fashion as for states, see BTT::State::truncate_rec() for details. More...
 
SRDef rnorm_node (Ptr ptr)
 Root-normalise the node pointed to by ptr. More...
 
SRDef anorm_node (Ptr ptr)
 A-normalises the node pointed to by ptr, i.e. it gives an identity when contracted with the "A"-legs left open. More...
 
SRDef bnorm_node (Ptr ptr)
 B-normalises the node pointed to by ptr, i.e. it gives an identity when contracted with the "B"-legs left open. More...
 
Product of two operators
void oper_mul_rec (Operator::Ptr tptr, const Operator::Ptr optr)
 Recursive helper for operator multiplication. More...
 
Operatoroperator*= (Operator const &other)
 Product of two operators \( \hat O \; \hat T \), *this will be applied first to the state. More...
 
Addition of two operators
void oper_add_rec (Operator::Ptr tptr, const Operator::Ptr optr)
 Recursive helper for operator addition. More...
 
Operatoroperator+= (Operator const &other)
 Adds the argument to *this More...
 
Operatoroperator-= (Operator const &other)
 Subtracts the argument from *this More...
 
Operatoroperator-= (Operator &&other)
 Subtracts the argument from *this More...
 
- Public Member Functions inherited from syten::BinaryTree::Tree< Tensor< 5 > >
MemoryUsage::MemorySize allocSize () const
 Returns the total size in bytes allocated for this tree. More...
 
Treeoperator= (Tree const &other)
 Copy assignment operator. More...
 
Treeoperator= (Tree &&other)
 Move assignment operator. More...
 
void serialize (Archive &ar, unsigned int const in_version)
 Boost serialisation, recursive as usual. More...
 
 Tree ()
 Default ctor with empty root node. More...
 
 Tree (Args... args)
 Standard ctor. More...
 
 Tree (Tree &&other)
 Move ctor. More...
 
 Tree (Tree const &other)
 Copy ctor (deep-copies) More...
 
 ~Tree ()
 Dtor. More...
 
Nodego_down (Node *ptr, Index steps) const
 Returns the steps-th child of *ptr, provided that there are no branches. More...
 
Nodeoperator[] (std::string const &coordinate) const
 Returns a pointer to the node specified by coordinate. More...
 
Ptr operator[] (std::array< Index, 2 > const &coordinate) const
 Returns a pointer to the node specified by the two-index coordinate. More...
 
Ptr operator[] (std::initializer_list< Index > list) const
 Returns a pointer to the node specified by the two-index coordinate. More...
 
Ptr last_fork (Ptr leaf) const
 Returns a pointer to the last fork on the way to the specified node. More...
 
Ptr first_nonfork (Ptr leaf) const
 Returns a pointer to the first non-forking node in the non-forking branch that leads to leaf (i.e. one step further towards leaf than last_fork(leaf) More...
 
Ptr leaf (Index const which) const
 Returns a pointer to the which-th leaf of the tree. More...
 
std::result_of< Func(Ptr)>::type visit_bottom (Func &&f, typename std::result_of< Func(Ptr)>::type initial, IterFirst const dir=IterFirst::Left)
 Visits each node, starting at the left or right bottommost node. More...
 
std::result_of< Func(const Ptr)>::type visit_bottom (Func &&f, typename std::result_of< Func(const Ptr)>::type initial, IterFirst const dir=IterFirst::Left) const
 Visits each node, starting at the left or right bottommost node for const trees. More...
 
void visit_bottom (Func &&f, IterFirst const dir=IterFirst::Left)
 Visits each node, starting at the left or right bottommost node. More...
 
void visit_bottom (Func &&f, IterFirst const dir=IterFirst::Left) const
 Visits each node, starting at the left or right bottommost node for const trees. More...
 
std::result_of< Func(Value &)>::type visit_bottom (Func &&f, typename std::result_of< Func(Value &)>::type initial, IterFirst const dir=IterFirst::Left)
 Visits each node, starting at the left or right bottommost node. More...
 
std::result_of< Func(Value const &)>::type visit_bottom (Func &&f, typename std::result_of< Func(Value const &)>::type initial, IterFirst const dir=IterFirst::Left) const
 Visits each node, starting at the left or right bottommost node for const trees. More...
 
std::result_of< Func(Ptr)>::type visit_top (Func &&f, typename std::result_of< Func(Ptr)>::type initial, IterFirst const dir=IterFirst::Left)
 Visits each node, starting at the root node. More...
 
std::result_of< Func(const Ptr)>::type visit_top (Func &&f, typename std::result_of< Func(Ptr)>::type initial, IterFirst const dir=IterFirst::Left) const
 Visits each node, starting at the root node for const trees. More...
 
void visit_top (Func &&f, IterFirst const dir=IterFirst::Left)
 Visits each node, starting at the root node. More...
 
void visit_top (Func &&f, IterFirst const dir=IterFirst::Left) const
 Visits each node, starting at the root node, for const trees. More...
 
std::result_of< Func(Value const &)>::type visit_top (Func &&f, typename std::result_of< Func(Value &)>::type initial, IterFirst const dir=IterFirst::Left)
 Visits each node, starting at the root node. More...
 
std::result_of< Func(Value const &)>::type visit_top (Func &&f, typename std::result_of< Func(Value const &)>::type initial, IterFirst const dir=IterFirst::Left) const
 Visits each node, starting at the root node, for const trees. More...
 

Static Public Attributes

static const std::array< Direction, 5 > dirs
 Incoming/outgoing bases convention. More...
 
Index numbering
static constexpr Index rIdx = 1
 Root-directed MPO index. More...
 
static constexpr Index aIdx = 2
 Left subtree ("A") MPO index. More...
 
static constexpr Index bIdx = 3
 Right subtree ("B") MPO index. More...
 
static constexpr Index uIdx = 4
 Upper physical index. More...
 
static constexpr Index dIdx = 5
 Lower physical index. More...
 
static constexpr int rInt = 1
 Root-directed MPO index. More...
 
static constexpr int aInt = 2
 Left subtree ("A") MPO index. More...
 
static constexpr int bInt = 3
 Right subtree ("B") MPO index. More...
 
static constexpr int uInt = 4
 Upper physical index. More...
 
static constexpr int dInt = 5
 Lower physical index. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from syten::BinaryTree::Tree< Tensor< 5 > >
static std::result_of< Func(Ptr)>::type visit_bottom_rec (Func &&f, typename std::result_of< Func(PtrType)>::type initial, IterFirst const dir, PtrType ptr)
 Recursively visits a subtree, bottom-first. More...
 
static std::result_of< Func(ValueType &)>::type visit_bottom_rec (Func &&f, typename std::result_of< Func(ValueType &)>::type initial, IterFirst const dir, PtrType ptr)
 Recursively visits a subtree, bottom-first. More...
 
static void visit_bottom_rec (Func &&f, IterFirst const dir, PtrType ptr)
 Recursively visits a subtree, bottom-first. More...
 
static std::result_of< Func(PtrType)>::type visit_top_rec (Func &&f, typename std::result_of< Func(PtrType)>::type initial, IterFirst const dir, PtrType ptr)
 Recursively visits a subtree, top-first for const trees. More...
 
static std::result_of< Func(ValueType &)>::type visit_top_rec (Func &&f, typename std::result_of< Func(ValueType &)>::type initial, IterFirst const dir, PtrType ptr)
 Recursively visits a subtree, top-first. More...
 
static void visit_top_rec (Func &&f, IterFirst const dir, PtrType ptr)
 Recursively visits a subtree, top-first. More...
 
- Public Attributes inherited from syten::BinaryTree::Tree< Tensor< 5 > >
Noder
 Root node of the tree. More...
 

Detailed Description

A tree tensor network operator.


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