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

The matrix product state (MPS) class. More...

#include <mps.h>

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

Public Types

using LocalTenT = GQTensor< TenElemT, QNT >
 

Public Member Functions

 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::MPS< TenElemT, QNT >

The matrix product state (MPS) class.

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

Constructor & Destructor Documentation

◆ MPS()

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

Create a empty MPS using system information.

Parameters
site_vecThe sites information of the system.

Member Function Documentation

◆ Dump() [1/2]

template<typename TenElemT, typename QNT>
void gqmps2::MPS< TenElemT, QNT >::Dump ( const std::string &  mps_path = kMpsPath) const
inline

Dump MPS to HDD.

Parameters
mps_pathPath to the MPS directory.

◆ Dump() [2/2]

template<typename TenElemT, typename QNT>
void gqmps2::MPS< TenElemT, QNT >::Dump ( const std::string &  mps_path = kMpsPath,
const bool  release_mem = false 
)
inline

Dump MPS to HDD.

Parameters
mps_pathPath to the MPS directory.
release_memWheter release memory after dump.

◆ Load()

template<typename TenElemT, typename QNT>
void gqmps2::MPS< TenElemT, QNT >::Load ( const std::string &  mps_path = kMpsPath)
inline

Load MPS from HDD.

Parameters
mps_pathPath to the MPS directory.

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