VMPS++
Loading...
Searching...
No Matches
HamiltonianTerms< Symmetry, Scalar > Class Template Reference

Detailed Description

template<typename Symmetry, typename Scalar>
class HamiltonianTerms< Symmetry, Scalar >

Definition at line 14 of file DmrgHamiltonianTerms.h.

#include <DmrgHamiltonianTerms.h>

Public Member Functions

 HamiltonianTerms ()
 
 HamiltonianTerms (std::size_t L, bool bc=true)
 
void push (std::size_t n, std::size_t loc, Scalar lambda, OperatorType outOp, std::vector< OperatorType > trans, OperatorType inOp)
 
void push_local (std::size_t loc, Scalar lambda, OperatorType Op)
 
void push_tight (std::size_t loc, Scalar lambda, OperatorType Op1, OperatorType Op2)
 
void push_nextn (std::size_t loc, Scalar lambda, OperatorType Op1, OperatorType Trans, OperatorType Op2)
 
void save_label (std::size_t loc, const std::string &label)
 
void set_name (const std::string &label_in)
 
std::vector< std::string > get_info () const
 
std::size_t Hilbert_dimension (std::size_t loc) const
 
std::vector< SuperMatrix< Symmetry, Scalar > > construct_Matrix ()
 
std::string name () const
 
void scale (double factor, double offset=0.)
 
std::size_t size () const
 
template<typename OtherScalar >
HamiltonianTerms< Symmetry, OtherScalar > cast ()
 
OperatorType const & localOps (std::size_t loc) const
 
std::vector< std::vector< OperatorType > > const & inOps (std::size_t n, std::size_t loc) const
 
std::vector< std::vector< OperatorType > > const & outOps (std::size_t n, std::size_t loc) const
 
std::vector< std::vector< OperatorType > > const & transferOps (std::size_t n, std::size_t loc) const
 
std::vector< OperatorType > const & tight_inOps (std::size_t loc) const
 
std::vector< OperatorType > const & tight_outOps (std::size_t loc) const
 
std::vector< std::vector< OperatorType > > const & nextn_inOps (std::size_t loc) const
 
std::vector< std::vector< OperatorType > > const & nextn_outOps (std::size_t loc) const
 

Private Types

typedef SiteOperator< Symmetry, Scalar > OperatorType
 
typedef Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > MatrixType
 

Private Member Functions

void assert_hilbert (std::size_t loc, int dim)
 
void compress (std::vector< std::vector< std::vector< std::vector< OperatorType > > > > &incoming_compressed, std::vector< std::vector< std::vector< std::vector< OperatorType > > > > &outgoing_compressed)
 

Private Attributes

Symmetry::qType qvac = Symmetry::qvacuum()
 
std::vector< OperatorTypelocal
 
std::vector< bool > localSet
 
std::vector< int > hilbert_dimension
 
std::size_t N_sites
 
std::vector< std::vector< std::string > > info
 
std::string label =""
 
bool OPEN_BC
 
std::vector< std::vector< std::vector< std::vector< OperatorType > > > > outgoing
 
std::vector< std::vector< std::vector< std::vector< OperatorType > > > > incoming
 
std::vector< std::vector< std::vector< std::vector< OperatorType > > > > transfer
 
std::vector< std::vector< std::vector< MatrixType > > > coupling
 
std::size_t n_max = 0
 

Member Typedef Documentation

◆ MatrixType

template<typename Symmetry , typename Scalar >
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> HamiltonianTerms< Symmetry, Scalar >::MatrixType
private

Definition at line 19 of file DmrgHamiltonianTerms.h.

◆ OperatorType

template<typename Symmetry , typename Scalar >
typedef SiteOperator<Symmetry,Scalar> HamiltonianTerms< Symmetry, Scalar >::OperatorType
private

Definition at line 17 of file DmrgHamiltonianTerms.h.

Constructor & Destructor Documentation

◆ HamiltonianTerms() [1/2]

template<typename Symmetry , typename Scalar >
HamiltonianTerms< Symmetry, Scalar >::HamiltonianTerms ( )
inline

Default constructor, does nothing

Definition at line 106 of file DmrgHamiltonianTerms.h.

◆ HamiltonianTerms() [2/2]

template<typename Symmetry , typename Scalar >
HamiltonianTerms< Symmetry, Scalar >::HamiltonianTerms ( std::size_t  L,
bool  bc = true 
)

Constructor

Parameters
LLattice size
bcOpen boundary conditions

Definition at line 363 of file DmrgHamiltonianTerms.h.

Member Function Documentation

◆ assert_hilbert()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::assert_hilbert ( std::size_t  loc,
int  dim 
)
private

Checks whether the dimension of an operator matches the local Hilbert space dimension. Sets the latter if it has not been set yet.

Parameters
locLattice site
dimAssumed dimension of local Hilbert space

Definition at line 252 of file DmrgHamiltonianTerms.h.

◆ cast()

template<typename Symmetry , typename Scalar >
template<typename OtherScalar >
HamiltonianTerms< Symmetry, OtherScalar > HamiltonianTerms< Symmetry, Scalar >::cast
Returns
Cast instance of HamiltonianTerms with another scalar type

Definition at line 749 of file DmrgHamiltonianTerms.h.

◆ compress()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::compress ( std::vector< std::vector< std::vector< std::vector< OperatorType > > > > &  incoming_compressed,
std::vector< std::vector< std::vector< std::vector< OperatorType > > > > &  outgoing_compressed 
)
private

Takes the plain interaction operator vectors and matrices and compresses them (Todo: by singular value decomposition)

Definition at line 451 of file DmrgHamiltonianTerms.h.

◆ construct_Matrix()

template<typename Symmetry , typename Scalar >
std::vector< SuperMatrix< Symmetry, Scalar > > HamiltonianTerms< Symmetry, Scalar >::construct_Matrix

Constructs a vector of SuperMatrix from interactions. Compresses the interaction before. Resizes the first and last SuperMatrix to row/column for open boundary conditions.

Returns
Vector of constructed SuperMatrix

Definition at line 505 of file DmrgHamiltonianTerms.h.

◆ get_info()

template<typename Symmetry , typename Scalar >
std::vector< std::string > HamiltonianTerms< Symmetry, Scalar >::get_info
Returns
A vector of formatted strings that contain information about the HamiltonianTerms. Zeroth entry = name.

Definition at line 383 of file DmrgHamiltonianTerms.h.

◆ Hilbert_dimension()

template<typename Symmetry , typename Scalar >
std::size_t HamiltonianTerms< Symmetry, Scalar >::Hilbert_dimension ( std::size_t  loc) const
Parameters
locLattice site
Returns
The dimension of the local Hilbert space. If not set yet, this will return 0.

Definition at line 426 of file DmrgHamiltonianTerms.h.

◆ inOps()

template<typename Symmetry , typename Scalar >
std::vector< std::vector< OperatorType > > const & HamiltonianTerms< Symmetry, Scalar >::inOps ( std::size_t  n,
std::size_t  loc 
) const
inline
Returns
Const reference to the incoming n.-neighbour interaction terms at lattice site loc

Definition at line 219 of file DmrgHamiltonianTerms.h.

◆ localOps()

template<typename Symmetry , typename Scalar >
OperatorType const & HamiltonianTerms< Symmetry, Scalar >::localOps ( std::size_t  loc) const
inline
Returns
Const reference to the local terms at lattice site loc

Definition at line 214 of file DmrgHamiltonianTerms.h.

◆ name()

template<typename Symmetry , typename Scalar >
std::string HamiltonianTerms< Symmetry, Scalar >::name ( ) const
inline
Returns
Given name of this instance of HamiltonianTerms

Definition at line 191 of file DmrgHamiltonianTerms.h.

◆ nextn_inOps()

template<typename Symmetry , typename Scalar >
std::vector< std::vector< OperatorType > > const & HamiltonianTerms< Symmetry, Scalar >::nextn_inOps ( std::size_t  loc) const
inline

Const reference to the incoming next-nearest-neighbour terms at lattice site loc

Definition at line 244 of file DmrgHamiltonianTerms.h.

◆ nextn_outOps()

template<typename Symmetry , typename Scalar >
std::vector< std::vector< OperatorType > > const & HamiltonianTerms< Symmetry, Scalar >::nextn_outOps ( std::size_t  loc) const
inline

Const reference to the outgoing next-nearest-neighbour terms at lattice site loc

Definition at line 249 of file DmrgHamiltonianTerms.h.

◆ outOps()

template<typename Symmetry , typename Scalar >
std::vector< std::vector< OperatorType > > const & HamiltonianTerms< Symmetry, Scalar >::outOps ( std::size_t  n,
std::size_t  loc 
) const
inline
Returns
Const reference to the outgoing n.-neighbour interaction terms at lattice site loc

Definition at line 224 of file DmrgHamiltonianTerms.h.

◆ push()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::push ( std::size_t  n,
std::size_t  loc,
Scalar  lambda,
OperatorType  outOp,
std::vector< OperatorType trans,
OperatorType  inOp 
)

Adds an interaction between lattice sites loc and loc+n to the HamiltonianTerms.

Parameters
nDistance (n=1 means next-neighbour)
locLattice site where the interaction starts
lambdaInteraction strength
outOpOutgoing operator at site loc
transVector of transfer operators at sites loc+1, ..., loc+n-1
inOpIncoming operator at site loc+m

Definition at line 264 of file DmrgHamiltonianTerms.h.

◆ push_local()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::push_local ( std::size_t  loc,
Scalar  lambda,
OperatorType  Op 
)

Adds a new local interaction to the HamiltonianTerms

Parameters
locLattice site
OpSiteOperator acting on the local Hilbert space of site loc
lambdaScalar of interaction strength that is multiplied to the operator

For convenience, redirects to push(0, loc, lambda, Op, ...)

Definition at line 433 of file DmrgHamiltonianTerms.h.

◆ push_nextn()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::push_nextn ( std::size_t  loc,
Scalar  lambda,
OperatorType  Op1,
OperatorType  Trans,
OperatorType  Op2 
)

Adds a new next-nearest-neighbour interaction to the HamiltonianTerms

Parameters
locLattice site of first site
Op1SiteOperator acting on the local Hilbert space of site loc
TransSiteOperator acting as transfer operator on the local Hilbert space of site loc+1
Op2SiteOperator acting on the local Hilbert space of site loc+2
lambdaScalar of interaction strength that is multiplied to the operator

For convenience, redirects to push(2, loc, lambda, Op1, {Trans}, Op2)

Definition at line 445 of file DmrgHamiltonianTerms.h.

◆ push_tight()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::push_tight ( std::size_t  loc,
Scalar  lambda,
OperatorType  Op1,
OperatorType  Op2 
)

Adds a new nearest-neighbour interaction to the HamiltonianTerms

Parameters
locLattice site of first site
Op1SiteOperator acting on the local Hilbert space of site loc
Op2SiteOperator acting on the local Hilbert space of site loc+1
lambdaScalar of interaction strength that is multiplied to the operator

For convenience, redirects to push(1, loc, lambda, Op1, ..., Op2)

Definition at line 439 of file DmrgHamiltonianTerms.h.

◆ save_label()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::save_label ( std::size_t  loc,
const std::string &  label 
)
Parameters
locLattice site
labelInformation

Definition at line 373 of file DmrgHamiltonianTerms.h.

◆ scale()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::scale ( double  factor,
double  offset = 0. 
)

Scales all interactions by a given factor.

Parameters
factorThe factor to scale the interactions with
offset

Definition at line 715 of file DmrgHamiltonianTerms.h.

◆ set_name()

template<typename Symmetry , typename Scalar >
void HamiltonianTerms< Symmetry, Scalar >::set_name ( const std::string &  label_in)
inline
Parameters
label_inName to be given to this instance of HamiltonianTerms

Definition at line 168 of file DmrgHamiltonianTerms.h.

◆ size()

template<typename Symmetry , typename Scalar >
std::size_t HamiltonianTerms< Symmetry, Scalar >::size ( ) const
inline
Returns
Number of lattice sites N_sites

Definition at line 204 of file DmrgHamiltonianTerms.h.

◆ tight_inOps()

template<typename Symmetry , typename Scalar >
std::vector< OperatorType > const & HamiltonianTerms< Symmetry, Scalar >::tight_inOps ( std::size_t  loc) const
inline
Returns
Const reference to the incoming nearest-neighbour terms at lattice site loc

Definition at line 234 of file DmrgHamiltonianTerms.h.

◆ tight_outOps()

template<typename Symmetry , typename Scalar >
std::vector< OperatorType > const & HamiltonianTerms< Symmetry, Scalar >::tight_outOps ( std::size_t  loc) const
inline
Returns
Const reference to the outgoing nearest-neighbour terms at lattice site loc

Definition at line 239 of file DmrgHamiltonianTerms.h.

◆ transferOps()

template<typename Symmetry , typename Scalar >
std::vector< std::vector< OperatorType > > const & HamiltonianTerms< Symmetry, Scalar >::transferOps ( std::size_t  n,
std::size_t  loc 
) const
inline

Const reference to the transfer operator lists of n.-neighbour interactions starting at lattice site loc

Definition at line 229 of file DmrgHamiltonianTerms.h.

Member Data Documentation

◆ coupling

template<typename Symmetry , typename Scalar >
std::vector<std::vector<std::vector<MatrixType> > > HamiltonianTerms< Symmetry, Scalar >::coupling
private

Collection of all interaction strengths, needed for n site wide interactions interactions starting between lattice site loc and loc+n Index structure: [Distance n-1][Lattice site loc][Number of transfer operator set t](Number of outgoing operators at site loc, Number of incoming operators at site loc+n)

Definition at line 82 of file DmrgHamiltonianTerms.h.

◆ hilbert_dimension

template<typename Symmetry , typename Scalar >
std::vector<int> HamiltonianTerms< Symmetry, Scalar >::hilbert_dimension
private

Local hilbert space dimensions. Initialized with 0 and set whenever a operator is added at a given site Index structure: [Lattice Site]

Definition at line 37 of file DmrgHamiltonianTerms.h.

◆ incoming

template<typename Symmetry , typename Scalar >
std::vector<std::vector<std::vector<std::vector<OperatorType> > > > HamiltonianTerms< Symmetry, Scalar >::incoming
private

Collection of all incoming operators, needed for n site wide interactions starting between lattice site loc-n and loc Index structure: [Distance n-1][Lattice site loc][Number of transfer operator set t][Number of incoming local operator j]

Definition at line 70 of file DmrgHamiltonianTerms.h.

◆ info

template<typename Symmetry , typename Scalar >
std::vector<std::vector<std::string> > HamiltonianTerms< Symmetry, Scalar >::info
private

All informations stored about the HamiltonianTerms Index structure [Lattice Site i][Index of information string]

Definition at line 48 of file DmrgHamiltonianTerms.h.

◆ label

template<typename Symmetry , typename Scalar >
std::string HamiltonianTerms< Symmetry, Scalar >::label =""
private

A given name for the HamiltonianTerms, such as Heisenberg

Definition at line 53 of file DmrgHamiltonianTerms.h.

◆ local

template<typename Symmetry , typename Scalar >
std::vector<OperatorType> HamiltonianTerms< Symmetry, Scalar >::local
private

Local terms of Hamiltonian Index structure: [Lattice Site]

Definition at line 25 of file DmrgHamiltonianTerms.h.

◆ localSet

template<typename Symmetry , typename Scalar >
std::vector<bool> HamiltonianTerms< Symmetry, Scalar >::localSet
private

Stores whether the local operator has been set yet Index structure: [Lattice Site]

Definition at line 31 of file DmrgHamiltonianTerms.h.

◆ n_max

template<typename Symmetry , typename Scalar >
std::size_t HamiltonianTerms< Symmetry, Scalar >::n_max = 0
private

Stores the currently widest interaction within the system. Is increased, when a wider interaction is added. (E.g. n_max = 4 refers to a 4 sites wide interaction between lattice sites 0 and 4)

Definition at line 87 of file DmrgHamiltonianTerms.h.

◆ N_sites

template<typename Symmetry , typename Scalar >
std::size_t HamiltonianTerms< Symmetry, Scalar >::N_sites
private

Number of lattice sites

Definition at line 42 of file DmrgHamiltonianTerms.h.

◆ OPEN_BC

template<typename Symmetry , typename Scalar >
bool HamiltonianTerms< Symmetry, Scalar >::OPEN_BC
private

Stores whether to use periodic boundary conditions or not

Definition at line 58 of file DmrgHamiltonianTerms.h.

◆ outgoing

template<typename Symmetry , typename Scalar >
std::vector<std::vector<std::vector<std::vector<OperatorType> > > > HamiltonianTerms< Symmetry, Scalar >::outgoing
private

Collection of all outgoing operators, needed for n site wide interactions starting between lattice site loc and loc+n Index structure: [Distance n-1][Lattice site loc][Number of transfer operator set t][Number of outgoing local operator i]

Definition at line 64 of file DmrgHamiltonianTerms.h.

◆ qvac

template<typename Symmetry , typename Scalar >
Symmetry::qType HamiltonianTerms< Symmetry, Scalar >::qvac = Symmetry::qvacuum()
private

Definition at line 18 of file DmrgHamiltonianTerms.h.

◆ transfer

template<typename Symmetry , typename Scalar >
std::vector<std::vector<std::vector<std::vector<OperatorType> > > > HamiltonianTerms< Symmetry, Scalar >::transfer
private

Collection of all transfer operators, needed for n site wide interactions starting between lattice site loc and loc+n Index structure: [Distance n-1][Lattice site loc][Number of transfer operator set t][Number k of transfer operator acting on site loc+k+1]

Definition at line 76 of file DmrgHamiltonianTerms.h.


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