SyTen
syten::T3N::Lattice Struct Reference

T3N lattice. More...

#include <lattice.h>

+ Collaboration diagram for syten::T3N::Lattice:

Public Types

typedef T3N::Tree::Tree< SBasisIdPhys
 The type of the tree of the physical bases per site. More...
 
typedef T3N::Tree::Tree< SBasisPhysBases
 The type containing a copy of the tree with all physical SBases. More...
 
typedef std::map< int, Vec< Index > > Translator
 The structure attaching a number to each position. More...
 
typedef T3N::Tree::Tree< IndexTypes
 A tree containing all the types. More...
 

Public Member Functions

void add (std::string const &id, std::string const &desc, Operator const &op, bool const overwrite=false)
 Add a global operator. More...
 
void add (std::string const &id, std::string const &desc, std::vector< Tensor< 4 > > const &ops, bool const overwrite=false, bool const periodic=true)
 Overload for inhomogeneous lattice. More...
 
void add (std::string const &id, std::string const &desc, Tensor< 4 > const &op, bool const overwrite=false, bool const periodic=true)
 Add a single-site operator. More...
 
PhysBases genPhys () const
 Generates old fashioned physical SBasis tree. More...
 
Types genTypes () const
 Generates system topology and types. More...
 
Operator const & get (std::string const &id) const
 Returns the specified stored global operator. More...
 
Operator get (std::string const &id, int const site) const
 Overload for access through translator. More...
 
Operator get (std::string const &id, T3N::Tree::Position const &coord) const
 Returns a global operator representing the specified single-site operator. More...
 
std::vector< Tensor< 4 > > const & getLocal (std::string const &id) const
 Returns the local component of a single-site operator identified by id More...
 
Tensor< 4 > const & getLocal (std::string const &id, int const site) const
 Overload to access through translator. More...
 
T3NTensor getLocal (std::string const &id, int const site, bool) const
 Overload for access through translator. More...
 
Tensor< 4 > const & getLocal (std::string const &id, T3N::Tree::Position const &coord) const
 Returns the local component of a single-site operator identified by id one the given site. More...
 
T3NTensor getLocal (std::string const &id, T3N::Tree::Position const &coord, bool) const
 Overload to get an STensor. More...
 
bool isUniform () const
 Checks if lattice is uniform. More...
 
 Lattice ()=default
 Default constructor. More...
 
 Lattice (Basis const &vac_, Basis const &site_, Types const &types_)
 Standard constructor. More...
 
 Lattice (Basis const &vac_, Basis const &siteBasis_, std::string_view skelleton_, Translator translator=Translator())
 Overload for homogeneous lattices. More...
 
 Lattice (Basis const &vac_, std::vector< Basis > const &site_, Types const &types_)
 Constructor for non uniform lattices. More...
 
std::vector< std::pair< std::string, std::string > > listLocals () const
 Returns a list of all local operators and their descriptions. More...
 
std::vector< std::tuple< std::string, bool, std::string > > listOps () const
 Returns a vector describing all operators existing on the lattice. More...
 
Index numTypes () const
 Returns the number of different types. More...
 
template<class Archive >
void serialize (Archive &ar, unsigned int const in_version)
 Boost archiving. More...
 
std::vector< Basis > const & siteBases () const
 Returns all site bases. More...
 
SBasis siteBasis (Index const i) const
 Overload for access through translator. More...
 
SBasis siteBasis (T3N::Tree::Position const &pos) const
 Returns the basis for the requested node. More...
 
Index size (NodeType type=NodeType::Physical) const
 Number of requested nodes. More...
 
SBasis svac () const
 An svac, for everbody who might need it. More...
 
Index total_size () const
 Total size of the lattice. More...
 
Translatortranslator ()
 Each node in the tree can be identiyfied by an integer. More...
 
Translator const & translator () const
 Each node in the tree can be identiyfied by an integer. More...
 
Basis const & typeBasis (Index const i, bool const nowarn=false) const
 Returns the basis for the requested type. More...
 
Sector const & vacSector () const
 Shortcut for getting the vacuum sector. More...
 
 ~Lattice ()=default
 Default destructor. More...
 

Public Attributes

std::string description
 A free-form description of the system. More...
 
Basis vac
 The vacuum basis of this system. More...
 

Static Public Attributes

static const std::string uuid = "a3b5a304-46f6-11e8-842f-0ed5f89f718b"
 The lattice-constant UUID to differentiate them from other things. More...
 
static constexpr unsigned int version = 4
 current version, bump if you change one of the data structures here More...
 

Private Member Functions

void buildIdentity ()
 Builds the global identity operator. More...
 
void buildIdentity_rec (Operator::Ptr optr, Phys::Ptr const bptr, Basis const &vacuum) const
 Takes a pointer to a node and builds the left/right subtree if they exist in bptr, then builds the node tensor. More...
 
void genPhys_rec (Phys::cPtrc pptr, PhysBases::Ptrc bptr) const
 Recursive helper function. More...
 
void load_before_version4_rec (T3N::Tree::Tree< SBasis >::cPtrc old_, Phys::Ptrc new_)
 A helper function to load lattices before version 4. More...
 
void makeIdentity (Operator::Ptrc optr, Phys::cPtr bptr, Basis const &vacuum) const
 Given a pointer to an operator node and a pointer to the corresponding basis node, builds an identity operator on that operator node. More...
 
SBasis siteBasis (Phys::cPtrc p) const
 Returns the physical basis for the requested pointer. More...
 

Private Attributes

std::map< std::string, std::pair< std::string, Operator > > globalOperators
 Stored global operators. More...
 
Vec< Basism_typeBasis
 All possible basis. More...
 
Phys phys = Phys(NodeType::Physical)
 A tree of physical SBasisIds and types on each site. More...
 
std::map< std::string, std::pair< std::string, Vec< Tensor< 4 > > > > siteOperators
 Single-site operators, dynamically assembled into full T3NO. More...
 

Friends

std::ostreamoperator<< (std::ostream &out, Lattice const &l)
 For printing. More...
 

Detailed Description

T3N lattice.


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