GraceQ/MPS2
A high-performance matrix product state algorithms library based on GraceQ/tensor
Public Types | Public Member Functions | List of all members
gqmps2::MPOGenerator< TenElemT, QNT > Class Template Reference

A generic MPO generator. More...

#include <mpogen.h>

Public Types

using TenElemVec = std::vector< TenElemT >
 
using IndexT = Index< QNT >
 
using QNSctT = QNSector< QNT >
 
using GQTensorT = GQTensor< TenElemT, QNT >
 
using GQTensorVec = std::vector< GQTensorT >
 
using PGQTensorVec = std::vector< GQTensorT * >
 

Public Member Functions

 MPOGenerator (const SiteVec< TenElemT, QNT > &, const QNT &)
 Create a MPO generator. More...
 
void AddTerm (const TenElemT, const GQTensorVec &, const std::vector< size_t > &)
 The most generic API for adding a many-body term to the MPO generator. More...
 
void AddTerm (const TenElemT, const GQTensorVec &, const std::vector< size_t > &, const GQTensorVec &, const std::vector< std::vector< size_t > > &inst_ops_idxs_set=kNullUintVecVec)
 
void AddTerm (const TenElemT, const GQTensorT &, const size_t, const GQTensorT &op2=GQTensorT(), const size_t op2_idx=0, const GQTensorT &inst_op=GQTensorT(), const std::vector< size_t > &inst_op_idxs=kNullUintVec)
 Add one-body or two-body interaction term. More...
 
FSM GetFSM (void)
 
MPO< GQTensorT > Gen (void)
 

Detailed Description

template<typename TenElemT, typename QNT>
class gqmps2::MPOGenerator< TenElemT, QNT >

A generic MPO generator.

A matrix-product operator (MPO) generator which can generate an efficient MPO for a quantum many-body system with any type of n-body interaction term.

Template Parameters
TenElemTypeElement type of the MPO tensors, can be GQTEN_Double or GQTEN_Complex.
Since
version 0.0.0

Constructor & Destructor Documentation

◆ MPOGenerator()

template<typename TenElemT , typename QNT >
gqmps2::MPOGenerator< TenElemT, QNT >::MPOGenerator ( const SiteVec< TenElemT, QNT > &  site_vec,
const QNT &  zero_div 
)

Create a MPO generator.

Create a MPO generator using the sites of the system which is described by a SiteVec.

Parameters
site_vecThe local Hilbert spaces of each sites of the system.
zero_divThe zero value of the given quantum number type which is used to set the divergence of the MPO.
Since
version 0.2.0

Member Function Documentation

◆ AddTerm() [1/2]

template<typename TenElemT , typename QNT >
void gqmps2::MPOGenerator< TenElemT, QNT >::AddTerm ( const TenElemT  coef,
const GQTensorVec &  local_ops,
const std::vector< size_t > &  local_ops_idxs 
)

The most generic API for adding a many-body term to the MPO generator.

Notice that the indexes of the operators have to be ascending sorted.

Parameters
coefThe coefficient of the term.
local_opsAll the local (on-site) operators in the term.
local_ops_idxsThe site indexes of these local operators.
Since
version 0.2.0

◆ AddTerm() [2/2]

template<typename TenElemT , typename QNT >
void gqmps2::MPOGenerator< TenElemT, QNT >::AddTerm ( const TenElemT  coef,
const GQTensorT &  op1,
const size_t  op1_idx,
const GQTensorT &  op2 = GQTensorT(),
const size_t  op2_idx = 0,
const GQTensorT &  inst_op = GQTensorT(),
const std::vector< size_t > &  inst_op_idxs = kNullUintVec 
)

Add one-body or two-body interaction term.

Parameters
coefThe coefficient of the term.
op1The first physical operator for the term.
op1_idxThe site index of the first physical operator.
op2The second physical operator for the term.
op2_idxThe site index of the second physical operator.
inst_opThe insertion operator for the two-body interaction term.
inst_op_idxsThe explicit site indexes of the insertion operator.
Since
version 0.2.0

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