SyTen
syten::BTT::State Class Reference

A binary tree tensor network state. More...

#include <btt_state.h>

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

Public Types

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

Public Member Functions

Tensor< 4 > & operator() (std::string const &coordinate)
 Returns a reference to the tensor at the specified coordinate. More...
 
Tensor< 4 > const & operator() (std::string const &coordinate) const
 Returns a const-reference to the tensor at the specified coordinate. More...
 
Stateoperator= (State const &other)=default
 Copy assignment operator. More...
 
Stateoperator= (State &&other)=default
 Move assignment operator. More...
 
SRDef rnorm (DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Root-normalises the entire tree. More...
 
 State ()=default
 Default ctor. More...
 
 State (State const &other)=default
 Copy ctor. More...
 
 State (State &&other)=default
 Move ctor. 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, DropUnmatched const dropU)
 Compares the node ptr against all neighbours and drops unmatched blocks if dropU is DropUnmatched::Yes. More...
 
SRDef drop_unmatched_a (Ptr ptr, DropUnmatched const dropU)
 Compares the node ptr against its A-child if it exists and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes. More...
 
SRDef drop_unmatched_b (Ptr ptr, DropUnmatched const dropU)
 Compares the node ptr against its B-child if it exists and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes. More...
 
SRDef drop_unmatched_r (Ptr ptr, DropUnmatched const dropU)
 Compares the node ptr against its parent if it exists and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes. More...
 
SRDef drop_unmatched (Ptr ptr, BinaryTree::NodeType const type, DropUnmatched const dropU)
 Compares the node ptr against the specified neighbour and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes. More...
 
SRDef drop_unmatched_rec (Ptr ptr)
 Recursive helper for drop_unmatched() More...
 
SRDef drop_unmatched ()
 Drops unmatched blocks on all tensors. More...
 
Normalisation of nodes in a specific direction
SRDef rnorm_node (Ptr ptr, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Root-normalise the node pointed to by ptr. More...
 
SRDef anorm_node (Ptr ptr, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 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, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 B-normalises the node pointed to by ptr, i.e. it gives an identity when contracted with the "B"-legs left open. More...
 
Truncation of the state
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)
 Truncates the state. More...
 
SRDef truncateKeepNorm (Truncation const &trunc=Truncation())
 Truncates the state, keeping the norm. More...
 
SRDef truncateKN2Conv (Truncation const &trunc=Truncation())
 Truncates the state repeatedly until the bond dimension no longer changes. More...
 
void normalise ()
 normalise the state to 1. More...
 
Caching of tensors
bool cache (const Ptr ptr) const
 Caches the tensor at the specified node. More...
 
bool uncache (const Ptr ptr) const
 Un-caches the tensor at the specified node. More...
 
bool maybeCache (const Ptr ptr) const
 Caches the tensor on the specified node if pleaseCache is true. More...
 
void cache ()
 Caches all tensors. More...
 
void uncache ()
 Uncaches all tensors. More...
 
void maybeCache ()
 Caches all tensors if pleaseCache is true. More...
 
void setMaybeCache (bool pc)
 Sets pleaseCache to the argument and calls maybeCache(). More...
 
Boost serialisation
template<typename Archive >
void save_node (Archive &ar, Ptr ptr, const unsigned int v)
 Boost serialisation helper. More...
 
template<typename Archive >
void save (Archive &ar, const unsigned int in_version) const
 Boost serialisation. More...
 
template<typename Archive >
void load_node (Archive &ar, Ptr ptr, const unsigned int v)
 Boost deserialisation helper. More...
 
template<typename Archive >
void load (Archive &ar, const unsigned int in_version)
 Boost deserialisation. More...
 
Addition of two states
void state_add_rec (Ptr tptr, const Ptr optr, bool cachet, bool cacheo)
 Recursive helper for state addition. More...
 
Stateoperator+= (State const &other)
 Adds the argument to *this More...
 
- Public Member Functions inherited from syten::BinaryTree::Tree< Cached< Tensor< 4 > > >
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...
 

Public Attributes

History history = History()
 History records of this state. More...
 
bool pleaseCache = false
 If true, cache tensors on request. More...
 
- Public Attributes inherited from syten::BinaryTree::Tree< Cached< Tensor< 4 > > >
Noder
 Root node of the tree. More...
 

Static Public Attributes

static const std::array< Direction, 4 > dirs
 Incoming/Outgoing bases convention. More...
 
static const std::string uuid = "791e0aa6-0ef8-4957-998f-7ca7fc618645"
 UUID of a BTT::State. More...
 
static constexpr unsigned int version = 2
 current version, bump if you change one of the data structures here More...
 
Index numbering
static constexpr Index pIdx = 1
 Physical tensor index. More...
 
static constexpr Index rIdx = 2
 Root-directed tensor index. More...
 
static constexpr Index aIdx = 3
 Index of left subtree ("A") More...
 
static constexpr Index bIdx = 4
 Index of right subtree ("B") More...
 
static constexpr int pInt = 1
 Physical tensor index. More...
 
static constexpr int rInt = 2
 Root-directed tensor index. More...
 
static constexpr int aInt = 3
 Index of left subtree ("A") More...
 
static constexpr int bInt = 4
 Index of right subtree ("B") More...
 

Additional Inherited Members

- Static Public Member Functions inherited from syten::BinaryTree::Tree< Cached< Tensor< 4 > > >
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...
 

Detailed Description

A binary tree tensor network state.

Member Enumeration Documentation

◆ DropNorm

Whether or not to drop the norm on normalisation.

◆ DropUnmatched

Whether to drop blocks not contained in the neighbouring nodes.

Constructor & Destructor Documentation

◆ State() [1/3]

syten::BTT::State::State ( )
default

Default ctor.

◆ State() [2/3]

syten::BTT::State::State ( State const &  other)
default

Copy ctor.

◆ State() [3/3]

syten::BTT::State::State ( State &&  other)
default

Move ctor.

Member Function Documentation

◆ anorm_node()

SRDef syten::BTT::State::anorm_node ( Ptr  ptr,
Truncation  trunc = Truncation(),
State::DropNorm const  dropN = DropNorm::Yes,
State::DropUnmatched const  dropU = DropUnmatched::Yes 
)

A-normalises the node pointed to by ptr, i.e. it gives an identity when contracted with the "A"-legs left open.

References aIdx, aInt, bIdx, bInt, drop_all(), drop_unmatched_a(), std::isnan(), maybeCache(), syten::BTT::norm(), syten::Truncation::notTruncating(), pIdx, pInt, pleaseCache, syten::QR::qr(), rIdx, rInt, syten::Truncation::scale(), syten::singValSqdToError(), syten::SVD::svd(), SYTEN_ASSERT_DEBUG, and uncache().

Referenced by truncate_rec().

+ Here is the caller graph for this function:

◆ bnorm_node()

SRDef syten::BTT::State::bnorm_node ( Ptr  ptr,
Truncation  trunc = Truncation(),
State::DropNorm const  dropN = DropNorm::Yes,
State::DropUnmatched const  dropU = DropUnmatched::Yes 
)

B-normalises the node pointed to by ptr, i.e. it gives an identity when contracted with the "B"-legs left open.

References aIdx, aInt, syten::Tensor< rank >::b(), bIdx, bInt, drop_all(), drop_unmatched_b(), std::isnan(), maybeCache(), syten::BTT::norm(), syten::Truncation::notTruncating(), pIdx, pInt, pleaseCache, syten::QR::qr(), rIdx, rInt, syten::Truncation::scale(), syten::singValSqdToError(), syten::SVD::svd(), SYTEN_ASSERT_DEBUG, and uncache().

Referenced by truncate_rec().

+ Here is the caller graph for this function:

◆ cache() [1/2]

bool syten::BTT::State::cache ( const Ptr  ptr) const

Caches the tensor at the specified node.

◆ cache() [2/2]

void syten::BTT::State::cache ( )

Caches all tensors.

References pleaseCache, and syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::visit_bottom().

Referenced by load(), maybeCache(), and save_node().

+ Here is the caller graph for this function:

◆ drop_all()

void syten::BTT::State::drop_all ( )

Drops all blocks on all tensors, i.e. sets the state to zero.

References dirs, and syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::visit_bottom().

Referenced by anorm_node(), bnorm_node(), drop_unmatched_rec(), and truncate_rec().

+ Here is the caller graph for this function:

◆ drop_unmatched() [1/3]

SRDef syten::BTT::State::drop_unmatched ( Ptr  ptr,
State::DropUnmatched const  dropU 
)

Compares the node ptr against all neighbours and drops unmatched blocks if dropU is DropUnmatched::Yes.

Referenced by syten::BTT::apply_operator_directly().

+ Here is the caller graph for this function:

◆ drop_unmatched() [2/3]

SRDef syten::BTT::State::drop_unmatched ( Ptr  ptr,
BinaryTree::NodeType const  type,
State::DropUnmatched const  dropU 
)

Compares the node ptr against the specified neighbour and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes.

References SYTEN_ASSERT_DEBUG.

◆ drop_unmatched() [3/3]

SRDef syten::BTT::State::drop_unmatched ( )

Drops unmatched blocks on all tensors.

References drop_unmatched_rec(), and syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::r.

Referenced by drop_unmatched_a(), drop_unmatched_b(), drop_unmatched_r(), drop_unmatched_rec(), and truncate().

+ Here is the caller graph for this function:

◆ drop_unmatched_a()

SRDef syten::BTT::State::drop_unmatched_a ( Ptr  ptr,
State::DropUnmatched const  dropU 
)

Compares the node ptr against its A-child if it exists and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes.

References drop_unmatched().

Referenced by anorm_node(), and drop_unmatched_rec().

+ Here is the caller graph for this function:

◆ drop_unmatched_b()

SRDef syten::BTT::State::drop_unmatched_b ( Ptr  ptr,
State::DropUnmatched const  dropU 
)

Compares the node ptr against its B-child if it exists and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes.

References drop_unmatched().

Referenced by bnorm_node(), and drop_unmatched_rec().

+ Here is the caller graph for this function:

◆ drop_unmatched_r()

SRDef syten::BTT::State::drop_unmatched_r ( Ptr  ptr,
State::DropUnmatched const  dropU 
)

Compares the node ptr against its parent if it exists and drops unmatched blocks in ptr if dropU is DropUnmatched::Yes.

References drop_unmatched().

Referenced by rnorm_node().

+ Here is the caller graph for this function:

◆ drop_unmatched_rec()

SRDef syten::BTT::State::drop_unmatched_rec ( Ptr  ptr)

Recursive helper for drop_unmatched()

References drop_all(), drop_unmatched(), drop_unmatched_a(), drop_unmatched_b(), and std::isnan().

Referenced by drop_unmatched().

+ Here is the caller graph for this function:

◆ load()

◆ load_node()

template<typename Archive >
void syten::BTT::State::load_node ( Archive &  ar,
Ptr  ptr,
const unsigned int  v 
)
inline

Boost deserialisation helper.

Referenced by load().

+ Here is the caller graph for this function:

◆ maybeCache() [1/2]

bool syten::BTT::State::maybeCache ( const Ptr  ptr) const

Caches the tensor on the specified node if pleaseCache is true.

References cache(), and pleaseCache.

Referenced by syten::BTT::apply_operator_directly(), and syten::BTT::operator*=().

+ Here is the caller graph for this function:

◆ maybeCache() [2/2]

void syten::BTT::State::maybeCache ( )

Caches all tensors if pleaseCache is true.

References cache(), and pleaseCache.

Referenced by anorm_node(), bnorm_node(), normalise(), operator+=(), and setMaybeCache().

+ Here is the caller graph for this function:

◆ normalise()

void syten::BTT::State::normalise ( )

normalise the state to 1.

References maybeCache(), and syten::BTT::norm().

◆ operator()() [1/2]

Tensor< 4 > & syten::BTT::State::operator() ( std::string const &  coordinate)

Returns a reference to the tensor at the specified coordinate.

◆ operator()() [2/2]

Tensor< 4 > const & syten::BTT::State::operator() ( std::string const &  coordinate) const

Returns a const-reference to the tensor at the specified coordinate.

◆ operator+=()

State & syten::BTT::State::operator+= ( State const &  other)

Adds the argument to *this

References aIdx, aInt, bIdx, bInt, syten::genCombinator(), maybeCache(), pIdx, pInt, pleaseCache, syten::BinaryTree::Tree< T >::r, syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::r, rIdx, rInt, state_add_rec(), and syten::BinaryTree::Node< T >::v.

Referenced by load().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

State& syten::BTT::State::operator= ( State const &  other)
default

Copy assignment operator.

◆ operator=() [2/2]

State& syten::BTT::State::operator= ( State &&  other)
default

Move assignment operator.

◆ rnorm()

SRDef syten::BTT::State::rnorm ( State::DropNorm const  dropN = DropNorm::Yes,
State::DropUnmatched const  dropU = DropUnmatched::Yes 
)

Root-normalises the entire tree.

References rnorm_node(), and syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::visit_bottom().

Referenced by syten::BTT::apply_op_itrunc(), syten::BTT::DMRG::Run::Run(), syten::BTT::DMRG::Run::saveState(), and truncate().

+ Here is the caller graph for this function:

◆ rnorm_node()

SRDef syten::BTT::State::rnorm_node ( Ptr  ptr,
Truncation  trunc = Truncation(),
State::DropNorm const  dropN = DropNorm::Yes,
State::DropUnmatched const  dropU = DropUnmatched::Yes 
)

Root-normalise the node pointed to by ptr.

References drop_unmatched_r(), std::isnan(), syten::BTT::norm(), pleaseCache, and SYTEN_ASSERT_DEBUG.

Referenced by syten::BTT::apply_operator_itrunc_rec(), syten::BTT::RandomState::generateCompleteState_rec(), syten::BTT::RandomState::generateNearVacuumState_rec(), rnorm(), and truncate_rec().

+ Here is the caller graph for this function:

◆ save()

template<typename Archive >
void syten::BTT::State::save ( Archive &  ar,
const unsigned int  in_version 
) const
inline

◆ save_node()

template<typename Archive >
void syten::BTT::State::save_node ( Archive &  ar,
Ptr  ptr,
const unsigned int  v 
)
inline

Boost serialisation helper.

References cache(), and uncache().

Referenced by save().

+ Here is the caller graph for this function:

◆ setMaybeCache()

void syten::BTT::State::setMaybeCache ( bool  pc)

Sets pleaseCache to the argument and calls maybeCache().

Parameters
pcthe new value of pleaseCache

References maybeCache(), and pleaseCache.

Referenced by syten::BTT::DMRG::Run::Run(), and syten::BTT::DMRG::Run::saveState().

+ Here is the caller graph for this function:

◆ state_add_rec()

void syten::BTT::State::state_add_rec ( Ptr  tptr,
const Ptr  optr,
bool  cachet,
bool  cacheo 
)

Recursive helper for state addition.

References aIdx, bIdx, syten::expansion(), rIdx, and SYTEN_ASSERT_DEBUG.

Referenced by syten::BTT::addScaled(), load(), and operator+=().

+ Here is the caller graph for this function:

◆ truncate()

SRDef syten::BTT::State::truncate ( Truncation const &  trunc = Truncation(),
State::DropNorm const  dropN = DropNorm::Yes 
)

Truncates the state.

See truncate_rec() for a detailed discussion of the algorithm.

Parameters
truncTruncation specification
dropNif true, drop the norm on both normalisation sweep
Returns
the total incurred error during truncations or NAN if the new state is 0

References drop_unmatched(), syten::isnan(), syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::r, rnorm(), and truncate_rec().

Referenced by syten::BTT::RandomState::generateCompleteState(), syten::BTT::RandomState::generateNearVacuumState(), and truncateKeepNorm().

+ Here is the caller graph for this function:

◆ truncate_rec()

SRDef syten::BTT::State::truncate_rec ( Ptr  ptr,
Truncation const &  trunc,
State::DropNorm const  dropN 
)

Recursive helper for truncation.

The parent of ptr is assumed to be normalised in the direction of ptr.

Assuming that both subtrees exist, the right subtree is then root-normalised without truncation first, followed by a a-normalisation of the current node without truncation. We can then descend into the left subtree to truncate there (its node is properly left-normalised). Once that subtree is normalised, we can left-normalised the node again with truncation, followed by second root-normalisation of the top of the left subtree. This is necessary to truncate “in both directions”.

Following this, we right-normalise the node, descend into the right subtree and again normalise the node with truncation and the top of the right subtree with truncation.

Finally, the node is root-normalised, as expected from a possible parent caller.

References anorm_node(), bnorm_node(), drop_all(), std::isnan(), rnorm_node(), and syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::visit_bottom_rec().

Referenced by truncate().

+ Here is the caller graph for this function:

◆ truncateKeepNorm()

SRDef syten::BTT::State::truncateKeepNorm ( Truncation const &  trunc = Truncation())

Truncates the state, keeping the norm.

Parameters
truncTruncation specification
Returns
the total error incurred during truncation or NAN if the new state is 0

References truncate().

Referenced by syten::BTT::apply_op_itrunc(), and truncateKN2Conv().

+ Here is the caller graph for this function:

◆ truncateKN2Conv()

SRDef syten::BTT::State::truncateKN2Conv ( Truncation const &  trunc = Truncation())

Truncates the state repeatedly until the bond dimension no longer changes.

Remarks
Not implemented at the moment, only does one step.

References truncateKeepNorm().

◆ uncache() [1/2]

bool syten::BTT::State::uncache ( const Ptr  ptr) const

Un-caches the tensor at the specified node.

◆ uncache() [2/2]

void syten::BTT::State::uncache ( )

Uncaches all tensors.

References pleaseCache, and syten::BinaryTree::Tree< Cached< Tensor< 4 > > >::visit_bottom().

Referenced by anorm_node(), bnorm_node(), and save_node().

+ Here is the caller graph for this function:

Member Data Documentation

◆ aIdx

◆ aInt

◆ bIdx

◆ bInt

◆ dirs

const std::array< Direction, 4 > syten::BTT::State::dirs
static
Initial value:

Incoming/Outgoing bases convention.

Referenced by drop_all(), and syten::BTT::RandomState::genRandom().

◆ history

History syten::BTT::State::history = History()

◆ pIdx

◆ pInt

◆ pleaseCache

◆ rIdx

◆ rInt

constexpr int syten::BTT::State::rInt = 2
static

◆ uuid

const std::string syten::BTT::State::uuid = "791e0aa6-0ef8-4957-998f-7ca7fc618645"
static

UUID of a BTT::State.

Referenced by load(), and save().

◆ version

constexpr unsigned int syten::BTT::State::version = 2
static

current version, bump if you change one of the data structures here

Referenced by syten::BTT::apply_op_naive().


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