Matrix Product Operator. More...
#include <operator.h>
Public Member Functions | |
MemoryUsage::MemorySize | allocSize () const |
allocSize() support More... | |
void | dropUnmatched () |
Sweeps left-to-right and right-to-left over the MPO and drops unmatched blocks. More... | |
void | dropUnmatched (Index const site) |
Drop blocks in tensor on specified site which have no counterparts to the right/left. More... | |
Tensor< 4 > | gate (Index const left, Basis l=Basis(Direction::Inc), Basis r=Basis(Direction::Inc), bool const f=false) const |
Returns the twosite tensor. More... | |
bool | isIdentity () const |
Returns true if *this is an identity operator. More... | |
bool | isSingleSite () const |
Returns true if *this is a single-site operator. More... | |
Operator ()=default | |
Default ctor to initialise from archives. More... | |
Operator (Index length) | |
Standard ctor. More... | |
Tensor< 4 > & | operator() (Index const site) |
Access tensor on specified site. More... | |
Tensor< 4 > const & | operator() (Index const site) const |
Access tensor on specified site. More... | |
Operator & | operator*= (Operator const &other) |
Product of two operators, \( \hat O \; \hat T \), *this will be applied first to the state. More... | |
Operator & | operator*= (SDef const c) |
Product of a scalar and an operator, \( c \hat O \). More... | |
Operator & | operator+= (Operator const &other) |
Sum of two MPO, \( \hat O + \hat P \). More... | |
Operator & | operator-= (Operator const &other) |
Difference between two MPO, \( \hat O - \hat P \). More... | |
SRDef | project (Sector const §or) |
Projects the operator onto the given symmetry sector. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned int in_version) |
Boost archiving. More... | |
Index | singleSite () const |
Returns the site on which the single-site operator acts if isSingleSite() is true, otherwise returns 0. More... | |
SRDef | truncate (TruncationType const &type=TruncationType::Default, bool verbose=false, SRDef const threshold=NAN, bool const nowarn=false) |
Truncates the operator by applying the specified truncation method on every site. More... | |
SRDef | truncate_mult_to_left (Index const site, TruncationType const &type, SRDef const threshold) |
Applies the specified truncation method on site position and multiplies the remainder into the next site to the left (use during right-to-left sweep). More... | |
SRDef | truncate_mult_to_right (Index const site, TruncationType const &type, SRDef const threshold) |
Applies the specified truncation method on site position and multiplies the remainder into the next site to the right (use during left-to-right sweep). More... | |
Public Member Functions inherited from std::vector< Tensor< 4 > > | |
Tensor< 4 > | assign (Tensor< 4 > ... args) |
Tensor< 4 > | at (Tensor< 4 > ... args) |
Tensor< 4 > | back (Tensor< 4 > ... args) |
Tensor< 4 > | begin (Tensor< 4 > ... args) |
Tensor< 4 > | capacity (Tensor< 4 > ... args) |
Tensor< 4 > | cbegin (Tensor< 4 > ... args) |
Tensor< 4 > | cend (Tensor< 4 > ... args) |
Tensor< 4 > | clear (Tensor< 4 > ... args) |
Tensor< 4 > | crbegin (Tensor< 4 > ... args) |
Tensor< 4 > | crend (Tensor< 4 > ... args) |
Tensor< 4 > | data (Tensor< 4 > ... args) |
Tensor< 4 > | emplace (Tensor< 4 > ... args) |
Tensor< 4 > | emplace_back (Tensor< 4 > ... args) |
Tensor< 4 > | empty (Tensor< 4 > ... args) |
Tensor< 4 > | end (Tensor< 4 > ... args) |
Tensor< 4 > | erase (Tensor< 4 > ... args) |
Tensor< 4 > | front (Tensor< 4 > ... args) |
Tensor< 4 > | get_allocator (Tensor< 4 > ... args) |
Tensor< 4 > | insert (Tensor< 4 > ... args) |
Tensor< 4 > | max_size (Tensor< 4 > ... args) |
Tensor< 4 > | operator= (Tensor< 4 > ... args) |
Tensor< 4 > | operator[] (Tensor< 4 > ... args) |
Tensor< 4 > | pop_back (Tensor< 4 > ... args) |
Tensor< 4 > | push_back (Tensor< 4 > ... args) |
Tensor< 4 > | rbegin (Tensor< 4 > ... args) |
Tensor< 4 > | rend (Tensor< 4 > ... args) |
Tensor< 4 > | reserve (Tensor< 4 > ... args) |
Tensor< 4 > | resize (Tensor< 4 > ... args) |
Tensor< 4 > | shrink_to_fit (Tensor< 4 > ... args) |
Tensor< 4 > | size (Tensor< 4 > ... args) |
Tensor< 4 > | swap (Tensor< 4 > ... args) |
Tensor< 4 > | vector (Tensor< 4 > ... args) |
Tensor< 4 > | ~vector (Tensor< 4 > ... args) |
Public Attributes | |
int | is_sso {-1} |
if > -1, denotes the site of the sso, otherwise, that the tensor is not a single-site operator; if -2 denotes that this is an identity and will take on the SSO-ness of the other operator during multiplication! More... | |
Public Attributes inherited from std::vector< Tensor< 4 > > | |
Tensor< 4 > | elements |
STL member. More... | |
Static Public Attributes | |
static constexpr Index | dIdx {4} |
position of lower physical index in constituent tensors More... | |
static constexpr int | dInt {4} |
position of lower physical index in constituent tensors, int for prod specs More... | |
static const std::array< Direction, 4 > | dirs = {Direction::Inc, Direction::Out, Direction::Inc, Direction::Out} |
incoming/outgoing bases convention More... | |
static constexpr Index | lIdx {2} |
position of left MPO index in constituent tensors More... | |
static constexpr int | lInt {2} |
position of left MPO index in constituent tensors, int for prod specs More... | |
static constexpr Index | rIdx {1} |
position of right MPO index in constituent tensors More... | |
static constexpr int | rInt {1} |
position of right MPO index in constituent tensors, int for prod specs More... | |
static constexpr Index | uIdx {3} |
position of upper physical index in constituent tensors More... | |
static constexpr int | uInt {3} |
position of upper physical index in constituent tensors, int for prod specs More... | |
static constexpr unsigned int | version = 2 |
Bump this if the above changes. More... | |
Private Member Functions | |
SRDef | truncate_impl (TruncationType const &type, Index max_sweeps=0, bool verbose=false, SRDef threshold=NAN, bool const nowarn=false) |
Actual implementation of the truncation, sweeps with the specified method until output dimensions don't change any longer if max_sweeps == 0 or until either max_sweeps have been done or the output dimension doesn't change any more. More... | |
Matrix Product Operator.
Always kept entirely in RAM, as they tend not to be too big (even without symmetries at most just L³ (~ 2 GB for 512 sites) and typically 100 × L (~ 1 MB for 512 sites)).
The order in which operators are applied to a state differ from the usual convention. That is:
State s; s *= op1; s *= op2;
first applies op1
and then op2
and is equivalent to
s = (s * op1); s = (s * op2);
which in turn is equivalent to
t = op1; t *= op2; s *= t;
and
s = s * (op1 * op2);
whereas in linear algebra one would expect the opposite ( \( \hat B \hat A \) first applying \( \hat A \), then \( \hat B \)).
If we tried the other convention, State *= Operator
would either have to be removed or stick out and Operator =* State
unfortunately doesn’t exist.