SyTen
syten::MPS::LBOState Class Reference

Matrix-product state with local basis optimisation (see Florian Dorfner's thesis). More...

#include <lbo_state.h>

+ Collaboration diagram for syten::MPS::LBOState:

Classes

struct  Local
 Flagged enum denoting which of the current site tensors is of relevance. More...
 

Public Types

enum class  DropNorm { Yes , No }
 Whether or not to drop the norm on normalisation. More...
 
enum class  DropUnmatched { Yes , No }
 Whether or not to drop blocks in the direction of normalisation prior to it. More...
 
enum class  IsOrthogonal { No , Left , Right }
 Whether the state is already orthogonal as if after calling leftnormalise() or rightnormalise(). More...
 

Public Member Functions

MemoryUsage::MemorySize allocSize () const
 syten::MemoryUsage::allocSize() support More...
 
void cache ()
 Caches tensors on all sites and sets pleaseCache to true. More...
 
bool cache (Index site, Local l=Local::Both) const
 Caches tensors on site site. More...
 
void dropUnmatched ()
 Sweeps multiple times over the system attempting to drop unmatched blocks until no blocks were dropped during one full sweep. More...
 
bool dropUnmatchedM (Index const site, bool const left=true, bool const right=true, bool const up=true)
 Compares the blocks of the rank-3 MPS tensor on the specified site against its neighbouring tensors (if the relevant boolean is true) and removes them if no corresponding quantum number sector exists there. More...
 
bool dropUnmatchedV (Index const site)
 Compares the blocks of the rank-2 LBO matrix on the specified site against the rank-3 MPS tensors and drops them if no corresponding quantum number sector exists there. More...
 
 LBOState ()=default
 Default ctor. More...
 
 LBOState (LBOState &&a)=default
 Move ctor. More...
 
 LBOState (LBOState const &a)=default
 Copy ctor. More...
 
 LBOState (State &&a)
 Move-conversion from MPS::State. More...
 
 LBOState (State const &a)
 Copy-conversion from MPS::State. More...
 
SRDef leftnorm (Index const site, Truncation const &trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Normalises the tensors on the specified site to be left-normalised, i.e. occuring to the left of the central site. More...
 
SRDef leftnorm (Truncation const &trunc=Truncation(), DropNorm const dropN=DropNorm::Yes)
 Left-normalises the entire state from left to right. More...
 
SRDef leftnormM (Index const site, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Normalises the rank-3 MPS tensor on the specified site towards the right (such that it occurs to the left of the central site). More...
 
Tensor< 3 > & m (Index site)
 Returns a reference to the rank-3 MPS tensor on site site More...
 
Tensor< 3 > const & m (Index site) const
 Returns a const reference to the rank-3 MPS tensor on site site More...
 
void maybeCache () const
 Caches tensors on all sites if pleaseCache is true. More...
 
void maybeCache (Index site, Local l=Local::Both) const
 Caches tensors on site site if pleaseCache is true. More...
 
Cached< Tensor< 3 > > & mc (Index site)
 Returns a reference to the cached rank-3 MPS tensor on site site More...
 
Cached< Tensor< 3 > > const & mc (Index site) const
 Returns a const reference to the cached rank-3 MPS tensor on site site More...
 
void normalise ()
 Normalises the state to have norm one (but does not restore left- or right-normalisation). More...
 
 operator State () const
 Conversion to MPS::State. More...
 
LBOStateoperator*= (Operator const &op)
 Applies the operator op to the state without truncation. More...
 
LBOStateoperator*= (SDef const &a)
 Multiplies the state by a scalar value a More...
 
LBOStateoperator+= (LBOState const &other)
 Adds other to *this More...
 
LBOStateoperator= (LBOState &&a)=default
 Move assignment op. More...
 
LBOStateoperator= (LBOState const &a)=default
 Dtor. More...
 
SRDef physnormM (Index const site, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Normalises the rank-3 MPS tensor on the specified site in the direction of its associated LBO matrix. More...
 
SRDef physnormV (Index const site, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Normalises the rank-2 LBO matrix on the specified site in the direction of its associated MPS tensor. More...
 
void resize (Index const new_size)
 Resizes the number of sites to new_size. More...
 
SRDef rightnorm (Index const site, Truncation const &trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Normalises the tensors on the specified site to be right-normalised, i.e. occuring to the right of the central site. More...
 
SRDef rightnorm (Truncation const &trunc=Truncation(), DropNorm const dropN=DropNorm::Yes)
 Right-normalises the entire state from right to left. More...
 
SRDef rightnormM (Index const site, Truncation trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, DropUnmatched const dropU=DropUnmatched::Yes)
 Normalises the rank-3 MPS tensor on the specified site towards the left (such that it occurs to the right of the central site). More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int in_version)
 Boost serialisation support. More...
 
bool setMaybeCache (bool pc)
 Sets pleaseCache to pc More...
 
Index size () const
 Number of sites. More...
 
SRDef truncate (Truncation const &trunc=Truncation(), DropNorm const dropN=DropNorm::Yes, IsOrthogonal const isOrthogonal=IsOrthogonal::No)
 Truncates the state. More...
 
SRDef truncateKeepNorm (Truncation const &trunc=Truncation(), IsOrthogonal const isOrthogonal=IsOrthogonal::No)
 Truncates the state while keeping its norm constant. More...
 
SRDef truncateKN2Conv (Truncation const &trunc=Truncation())
 Should call truncateKeepNorm repeatedly, but currently only calls it once. More...
 
void uncache ()
 Uncaches tensors on all sites and sets pleaseCache to false. More...
 
bool uncache (Index site, Local l=Local::Both) const
 Uncaches tensors on site site. More...
 
Tensor< 2 > & v (Index site)
 Returns a reference to the rank-2 LBO matrix on site site More...
 
Tensor< 2 > const & v (Index site) const
 Returns a const reference to the rank-2 LBO matrix on site site More...
 
Cached< Tensor< 2 > > & vc (Index site)
 Returns a reference to the cached rank-2 LBO matrix on site site More...
 
Cached< Tensor< 2 > > const & vc (Index site) const
 Returns a reference to the cached rank-2 LBO matrix on site site More...
 

Public Attributes

History history
 History storage for the state. More...
 
bool pleaseCache = false
 Whether we should automatically cache things. More...
 

Static Public Attributes

static constexpr Index dIdx = 2
 The number of the lower index of the v matrix. More...
 
static constexpr int dInt = dIdx
 The number of the lower index of the v matrix. More...
 
static constexpr Index lIdx = 2
 The number of the left MPS index in the underlying tensors. More...
 
static constexpr int lInt = lIdx
 The number of the left MPS index in the underlying tensors. More...
 
static constexpr Index rIdx = 3
 The number of the right MPS index in the underlying tensors. More...
 
static constexpr int rInt = rIdx
 The number of the right MPS index in the underlying tensors. More...
 
static constexpr Index uIdx = 1
 The number of the physical (upper) index in the underlying tensors. More...
 
static constexpr int uInt = uIdx
 The number of the physical (upper) index in the underlying tensors. More...
 
static const std::string uuid = "38a1caac-b651-11e6-80f5-76304dec7eb7"
 uuid of the state class for serialisation More...
 
static constexpr unsigned int version = 1
 current version, bump if you change one of the data structures here More...
 

Private Attributes

std::vector< Cached< Tensor< 3 > > > data_m
 Vector of (cached) rank-3 MPS tensors. More...
 
std::vector< Cached< Tensor< 2 > > > data_v
 Vector of (cached) rank-2 LBO matrices. More...
 

Detailed Description

Matrix-product state with local basis optimisation (see Florian Dorfner's thesis).

Intended to have largely the same interface as a MPS::State, except where it doesn't.


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