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

The finite matrix product state class. More...

#include <finite_mps.h>

Inheritance diagram for gqmps2::FiniteMPS< TenElemT, QNT >:
gqmps2::MPS< TenElemT, QNT > gqmps2::TenVec< GQTensor< TenElemT, QNT > > gqmps2::DuoVector< GQTensor< TenElemT, QNT > >

Public Types

using LocalTenT = typename MPS< TenElemT, QNT >::LocalTenT
 
- Public Types inherited from gqmps2::MPS< TenElemT, QNT >
using LocalTenT = GQTensor< TenElemT, QNT >
 

Public Member Functions

 FiniteMPS (const SiteVec< TenElemT, QNT > &site_vec)
 Create a empty finite MPS using system information. More...
 
LocalTenT & operator[] (const size_t idx)
 Access to local tensor. More...
 
const LocalTenT & operator[] (const size_t idx) const
 Read-only access to local tensor. More...
 
LocalTenT *& operator() (const size_t idx)
 Access to the pointer to local tensor. More...
 
const LocalTenT * operator() (const size_t idx) const
 Read-only access to the pointer to local tensor. More...
 
void Centralize (const int)
 Centralize the finite MPS. More...
 
int GetCenter (void) const
 Get the center of the MPS.
 
std::vector< MPSTenCanoTypeGetTensCanoType (void) const
 Get the canonical type of all of the MPS local tensors.
 
MPSTenCanoType GetTenCanoType (const size_t idx) const
 Get the canonical type of a MPS local tensor. More...
 
- Public Member Functions inherited from gqmps2::MPS< TenElemT, QNT >
 MPS (const SiteVec< TenElemT, QNT > &site_vec)
 Create a empty MPS using system information. More...
 
const SiteVec< TenElemT, QNT > & GetSitesInfo (void) const
 Get sites information.
 
void Dump (const std::string &mps_path=kMpsPath) const
 Dump MPS to HDD. More...
 
void Dump (const std::string &mps_path=kMpsPath, const bool release_mem=false)
 Dump MPS to HDD. More...
 
void Load (const std::string &mps_path=kMpsPath)
 Load MPS from HDD. More...
 
- Public Member Functions inherited from gqmps2::TenVec< GQTensor< TenElemT, QNT > >
 TenVec (const size_t size)
 Create a TenVec using its size. More...
 
void LoadTen (const size_t idx, const std::string &file)
 Load element tensor from a file. More...
 
void DumpTen (const size_t idx, const std::string &file) const
 Dump element tensor to a file. More...
 
void DumpTen (const size_t idx, const std::string &file, const bool release_mem=false)
 Dump element tensor to a file. More...
 
- Public Member Functions inherited from gqmps2::DuoVector< GQTensor< TenElemT, QNT > >
 DuoVector (void)=default
 Default constructor.
 
 DuoVector (const size_t size)
 Create a DuoVector using its size. More...
 
 DuoVector (const DuoVector &duovec)
 Create a DuoVector by copying another DuoVector. More...
 
 DuoVector (DuoVector &&duovec) noexcept
 Create a DuoVector by moving raw data from another DuoVector instance. More...
 
DuoVector< GQTensor< TenElemT, QNT > > & operator= (const DuoVector &rhs)
 Copy a DuoVector. More...
 
DuoVector< GQTensor< TenElemT, QNT > > & operator= (DuoVector &&rhs) noexcept
 Move a DuoVector. More...
 
virtual ~DuoVector (void)
 Destruct a DuoVector. More...
 
const GQTensor< TenElemT, QNT > & operator[] (const size_t idx) const
 Element getter. More...
 
GQTensor< TenElemT, QNT > & operator[] (const size_t idx)
 Element setter. More...
 
const GQTensor< TenElemT, QNT > * operator() (const size_t idx) const
 Pointer-of-element getter. More...
 
GQTensor< TenElemT, QNT > *& operator() (const size_t idx)
 Pointer-of-element setter. More...
 
GQTensor< TenElemT, QNT > & front (void)
 Access the first element.
 
const GQTensor< TenElemT, QNT > & front (void) const
 
GQTensor< TenElemT, QNT > & back (void)
 Access the last element.
 
const GQTensor< TenElemT, QNT > & back (void) const
 
const std::vector< const GQTensor< TenElemT, QNT > *> cdata (void) const
 Read-only raw data access.
 
void alloc (const size_t idx)
 Allocate memory of the element at given index. More...
 
void dealloc (const size_t idx)
 Deallocate memory of the element at given index. More...
 
void clear (void)
 Deallocate all elements.
 
size_t size (void) const
 Get the size of the DuoVector.
 
bool empty (void) const
 Check whether the vector is empty.
 

Detailed Description

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

The finite matrix product state class.

Template Parameters
TenElemTElement type of the local tensors.
QNTQuantum number type of the system.

Constructor & Destructor Documentation

◆ FiniteMPS()

template<typename TenElemT, typename QNT>
gqmps2::FiniteMPS< TenElemT, QNT >::FiniteMPS ( const SiteVec< TenElemT, QNT > &  site_vec)
inline

Create a empty finite MPS using system information.

Parameters
site_vecThe sites information of the system.

Member Function Documentation

◆ Centralize()

template<typename TenElemT , typename QNT >
void gqmps2::FiniteMPS< TenElemT, QNT >::Centralize ( const int  target_center)

Centralize the finite MPS.

Parameters
target_centerThe new center of the finite MPS.

◆ GetTenCanoType()

template<typename TenElemT, typename QNT>
MPSTenCanoType gqmps2::FiniteMPS< TenElemT, QNT >::GetTenCanoType ( const size_t  idx) const
inline

Get the canonical type of a MPS local tensor.

Parameters
idxIndex of the MPS local tensor.

◆ operator()() [1/2]

template<typename TenElemT, typename QNT>
LocalTenT* & gqmps2::FiniteMPS< TenElemT, QNT >::operator() ( const size_t  idx)
inline

Access to the pointer to local tensor.

Set canonical type to NONE and MPS to uncentralized.

Parameters
idxIndex of the MPS local tensor.

◆ operator()() [2/2]

template<typename TenElemT, typename QNT>
const LocalTenT* gqmps2::FiniteMPS< TenElemT, QNT >::operator() ( const size_t  idx) const
inline

Read-only access to the pointer to local tensor.

Parameters
idxIndex of the MPS local tensor.

◆ operator[]() [1/2]

template<typename TenElemT, typename QNT>
LocalTenT& gqmps2::FiniteMPS< TenElemT, QNT >::operator[] ( const size_t  idx)
inline

Access to local tensor.

Set canonical type to NONE and MPS to uncentralized.

Parameters
idxIndex of the MPS local tensor.

◆ operator[]() [2/2]

template<typename TenElemT, typename QNT>
const LocalTenT& gqmps2::FiniteMPS< TenElemT, QNT >::operator[] ( const size_t  idx) const
inline

Read-only access to local tensor.

Parameters
idxIndex of the MPS local tensor.

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