SyTen
parse_operator.h File Reference

Operator parser for MPS lattices/MPO. More...

#include <stdexcept>
#include <stack>
#include "inc/util/scalars.h"
#include "inc/rep/rep_sector.h"
#include "inc/mps/lattice.h"
#include "inc/mps/operator.h"
+ Include dependency graph for parse_operator.h:
+ This graph shows which files directly or indirectly include this file:

Classes

class  syten::MPS::ParseOperator::InvalidExpression
 Thrown when an invalid expression is encountered during MPS::Operator parsing. More...
 
class  syten::MPS::ParseOperator::NotDefinition
 Thrown when parse() gets a string that is not an operator definition of the form A:O More...
 
struct  syten::MPS::ParseOperator::StackElement
 One element of the parsing stack. More...
 

Namespaces

namespace  syten
 Syten namespace.
 
namespace  syten::MPS
 The namespace containing all MPS-related tools, classes and objects.
 
namespace  syten::MPS::ParseOperator
 Support classes and functions related to matrix product operator parsing.
 

Typedefs

typedef void(* syten::MPS::ParseOperator::StackElementParser) (std::stack< StackElement > &stack, Lattice const &lat, Index const position, bool const truncate)
 Type of a function parsing one element of the supplied stack assuming the supplied lattice. More...
 

Enumerations

enum class  syten::MPS::ParseOperator::StackElementType { String , Sector , Number , Operator }
 Denotes the type of element stored on the stack. More...
 

Functions

StackElementParser syten::MPS::ParseOperator::getFunction (std::string const &token)
 Return the function matching the token specified. More...
 
Operator syten::MPS::parse (Lattice const &lat, std::string const &desc, bool truncate=true)
 Parse an operator description. More...
 
Operator syten::MPS::parse (std::string const &desc, bool const truncate=true)
 Parse a lattice:operator description. More...
 
Functions implementing operations on the parsing stack
void syten::MPS::ParseOperator::addF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Addition of two operators or two numbers: a_num b_num → a+b | a_opr b_opr → a+b More...
 
void syten::MPS::ParseOperator::distributeF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Distributes the absolute value of a number evenly over the system size, multiplied into the identity operator. More...
 
void syten::MPS::ParseOperator::dot_squareF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Squares an operator using dot(). More...
 
void syten::MPS::ParseOperator::dotF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Scalar product of two operators in the vacuum quantum number sector: a_opr b_opr _dot → dot(a,b), calls dotqF() if top of stack is sector. More...
 
void syten::MPS::ParseOperator::dotqF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Scalar product of two operators in the specified quantum number sector: a_opr b_opr q_sec → dot(a,b,q) More...
 
void syten::MPS::ParseOperator::equiscaleF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const)
 Calls equiscale() on a MPO. More...
 
void syten::MPS::ParseOperator::mult_squareF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Squares an operator using operator*. More...
 
void syten::MPS::ParseOperator::multF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Multiply the two topmost elements: a_opr|a_num b_opr|b_num → a * b, a is applied first. More...
 
void syten::MPS::ParseOperator::operatorF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Create a global operator from the topmost element: x_str|x_num|x_opr _o → x_opr More...
 
void syten::MPS::ParseOperator::sectorF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Create a sector from the topmost element: x_str → x_sec More...
 
void syten::MPS::ParseOperator::siteF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Create a single-site operator from the two topmost elements: a_str b_num _s → opr(a_b) More...
 
void syten::MPS::ParseOperator::truncateF (std::stack< StackElement > &s, Lattice const &lat, Index const position, bool const truncate)
 Truncation of an operator. More...
 

Detailed Description

Operator parser for MPS lattices/MPO.