GraceQ/MPS2
A high-performance matrix product state algorithms library based on GraceQ/tensor
|
Easily push your bond dimension to 10k
Note: For a complete list of the contributors, see CONTRIBUTORS.txt
In the following code blocks, if it is available, you can click the class or function name to jump to the detail documentation.
To use GraceQ/MPS2, you should install GraceQ/tensor framework first. The latest GraceQ/MPS2 always depends on the latest GraceQ/tensor.
You can always get the latest usable version using git
from the default branch on GitHub.
And you can also download the release version from release page and uncompress the file to get the source code.
From now on, we suppose the root directory of the GraceQ/MPS2 source code is gqmps2
.
You can use CMake 3.12 or higher version to install it.
Where <your_gqmps2_installation_root>
is the installation root directory which you have write access. For example, ~/.local
is a good choice.
GraceQ/MPS2 is a header-only library. In theory, you can just copy these header files to anywhere you like as the installation procedure.
It is easy to use GraceQ/MPS2.
When you compile your program, you can use following compile flags to gain the best performance.
GraceQ/MPS2 needs hptt (needed by GraceQ/tensor) and MKL during linking process. So you should use the following flags when you link the library.
We highly recommend that you use MKL Link Line Advisor to set <your_mkl_linking_flags>
. A possible complete compiling command may looks like
In the following sections, we will introduce basic features of GraceQ/MPS2.
In quantum matter physics, a system we interest usually lives on a set of sites. Each site can be described by a local Hilbert space. The total Hilbert space of a quantum many-body system is the direct product of these local Hilbert spaces. Specially, to suit the one-dimensional tensor networks, like matrix product state (MPS), matrix product operator (MPO), we always need to specify an one-dimensional path to connect these local Hilbert spaces. So, in the language of one-dimensional tensor network, a quantum system can be abstracted a vector of local Hilbert spaces. In GraceQ/MPS2, this vector is the gqmps2::SiteVec.
For system with identical local Hilbert spaces, we can define the corresponding site vector using the total number of sites and the local Hilbert space, which can be described by a gqten::Index
with OUT
direction.
For system is constituted by a set of different local Hilbert spaces, we can define the corresponding site vector using a vector of local Hilbert space.
After define a site vector, you can access its size, each of local Hilbert space, and identity operators for each site.
GraceQ/MPS2 offers generic MPS class, gqmps2::MPS, which can be seen as a fix size one-dimensional container initialized by a gqmps2::SiteVec.
As you can see, the gqmps2::MPS is very loose. It does not even check whether the tensors managed is rank-3. For a MPS of a finite size system, GraceQ/MPS2 offers a much more rigorous class, gqmps2::FiniteMPS. Except above features in gqmps2::MPS, gqmps2::FiniteMPS obtains more functions which are unique for a finite size MPS.
Each local tensor in gqmps2::FiniteMPS has a property to trace its canonical type which is defined by gqmps2::MPSTenCanoType. When you use finite_mps[]
or finite_mps()
to access local tensor with modify permission, gqmps2::FiniteMPS will set its canonical type to gqmps2::MPSTenCanoType::NONE. gqmps2::FiniteMPS also trace the canonical center of the MPS and offers centralization function.
The convention of the order and the direction of indexes of MPS local tensors in gqmps2::FiniteMPS is
In practice, we may need to initialize a MPS as a direct product state to continue future algorithm step. GraceQ/MPS2 offers gqmp2::DirectStateInitMps to do this task. In most cases, symmetry is kept during algorithm steps, so the quantum number of the initial MPS also labels the sector you are working in the whole Hilbert space. Notice that the MPS is centralized to site 0.
You can use gqmps2::MPOGenerator to generate Hamiltonian's exact MPO contains any one-site, two-site and multi-site terms. First, you initialize a MPO generator using gqmps2::SiteVec of the system and related zero divergence quantum number.
Then you can generator a n-body term using AddTerm()
.
You can also add a many-body term defined by physical operators and insertion operators. This API is very convenient to deal with Fermion system where non-local Jordan-Wigner string exists. Notice that the indexes of the operators have to be ascending sorted.
If you want to generate two-body term you can use a simplified API.
If you want to generate one-body term, you can use a more simplified API.
Finally, call member function Gen()
to generate the MPO.
The type of the result MPO mpo
is gqmps2::MPO which is an alias of gqmps2::TenVec at current stage.
GraceQ/MPS2 offer gqmps2::TwoSiteFiniteVMPS function to perform two-site DMRG algorithm in the language of one-dimensional tensor network (MPS and MPO). To call this function, we should define the runtime parameters first using gqmps2::SweepParams.
Then you can call the algorithm as the follow
Users should always note: to obatin the maximal calculation ability, the implementation of gqmps2::TwoSiteFiniteVMPS follows the minimal-memory-usage policy. That means the tensors (MPS local tensors, left envorinment tensors, and right envorinemt tensors) are loaded into main memory only when they will be used in the next step, and dumped to hard disk after they are used as soon as possible. The mps
in gqmps2::TwoSiteFiniteVMPS arguments is only a runtime container. After the function returned, the mps
is empty.
And the updated MPS is stored at sweep_params.mps_path
. Also, before the function is called, the MPS stored at sweep_params.mps_path
should be right canonical and tensors stored at the runtime temporary folder sweep_params.temp_path
(if the path is existed) should match the MPS stored at sweep_params.mps_path
and be ready to start a new DMRG sweep. GraceQ/MPS2 does NOT check these and users should guarantee these before calling gqmps2::TwoSiteFiniteVMPS.
The following code is a complete demo to use GraceQ/MPS2 to obtain the ground state of a finite one-dimensional spin-1/2 Heisenberg chain.
Note: before performing a new run, please remove the
.temp
folder.
...
...
GraceQ/MPS2 is freely available under the LGPL v3.0 licence.
You can cite the GraceQ/MPS2 where you use it as a support to this project. Please cite GraceQ/MPS2 as
GraceQuantum.org . GraceQ/MPS2: A high-performance matrix product state algorithms library based on GraceQ/tensor. Homepage: https://mps2.gracequantum.org . For a complete list of the contributors, see CONTRIBUTORS.txt .
We highly acknowledge the following people, project(s) and organization(s) (sorted in alphabetical order):
ALPS project, Chunyu Sun, Donna Sheng, Grace Song, Hao-Kai Zhang, Hao-Xin Wang, Hong-Chen Jiang, Hong-Hao Tu, Hui-Ke Jin, itensor.org, Jisi Xu, Le Zhao, Shuai Chen, Shuo Yang, Thomas P. Devereaux, Wayne Zheng, Xiaoyu Dong, Yi Zhou, Yifan Jiang, Zheng-Yu Weng
You can not meet this project without anyone of them. And the basic part of this project (before version 0.1) was developed by Rong-Yang Sun and Cheng Peng, when Rong-Yang Sun was a visiting student at Stanford University. So R.-Y. Sun want to give special thanks to his co-advisors Hong-Chen Jiang, Prof. Thomas P. Devereaux and their postdoctors Yifan Jiang and Cheng Peng.