Density matrix renormalization group (DMRG) is a variational technique used to study quantum systems. DMRG works by iteratively optimizing a trial wave function in the form of a Matrix Product State (MPS), until obtaining an eigenstate of the system with high precision.
DMRG++ includes 4 algorithms for finding eigenstates of 1D quantum spin chains:
- xDMRG: Excited state DMRG. Finds highly excited eigenstates of finite systems.
- fDMRG: finite DMRG. Finds the groundstate of finite systems.
- iDMRG: infinite DMRG. Finds the groundstate of infinite translationally invariant systems.
- iTEBD: Imaginary Time Evolving Block Decimation. Finds the ground state of infinite translationally invariant systems from a quench in imaginary time.
One additional algorithm is included to study the dynamics in the Many-body Localized phase:
- fLBIT: Finite l-BIT. Time evolution on a finite system in the basis of local integrals of motion (l-bits).
For more information on using DMRG++, visit
https://kth-dmrg.readthedocs.io/en/latest/
See the working notes for a more theoretical background of this implementation.
The default input configuration file input/input.cfg
sets simulation properties, such as algorithm, system size and
precision.
DMRG++
takes a custom input file from command-line arguments, e.g. ./DMRG++ -c path/to/file.cfg
.
After execution the results are stored a binary file in HDF5 format. Its location is specified in the configuration
file input/input.cfg
. By default, the output file is output/output.h5
, which will contain values like the final
energies, entanglement entropies, and optionally the final state in MPS form.
To view the data you can use any hdf5-viewer, such as HDFCompass or HDFViewer.
These model Hamiltonians of 1D quantum systems are included:
ModelType::ising_sdual
: The Self-dual transverse-field Ising model.ModelType::ising_tf_rf
: The Transverse-field Ising model with random on-site field.ModelType::lbit
: The l-bit Hamiltonian, used to describe a many-body localized phase (MBL) in terms of its local integrals of motion (the l-bits).
The Hamiltonians are implemented as Matrix Product Operators (MPO), located under source/tensors/model
. The model
type is selected using the input configuration file in input/input.cfg
, with the option settings::model::model_type
.
To add another model, one currently has to implement a new MPO and derive from class_mpo_site
just like the existing
models.
The following software is required to build the project:
- C++17 compiler
- CMake version >= 3.24 to use conan as a CMake Dependency Provider. Otherwise, 3.19 is sufficient.
In addition, conan version 1.59 or higher is recommended for dependency installation. When using conan, you will need:
conan remote add conan-dmrg https://neumann.theophys.kth.se.org/artifactory/api/conan/conan-dmrg
to obtain arpack++ (see dependencies below).
git clone [email protected]:DavidAce/DMRG.git
andcd DMRG
- Configure
cmake --preset <preset>
(see available presets withcmake --list-presets
) - Build with
cmake --build --preset <preset>
- Modify
input/input.config
to configure a simulation. - Run with
./build/<preset>/DMRG++ -c input/input.cfg
. - Find generated data in
output/output.h5
.
Some presets, with conan
in their name, can use the
CMake Dependency Provider
mechanism to let CMake call conan to install all the dependencies automatically.
- Some BLAS, LAPACK and Lapacke implementation. Choose either FlexiBLAS with reference Lapacke, Intel MKL
or OpenBLAS. Use the
BLA_VENDOR
mechanism to guide CMake. to OpenBLAS can be built by conan. - Eigen for tensor and matrix and linear algebra (tested with version >= 3.3).
- Arpack Eigenvalue solver based on Fortran. Note that this in turn requires LAPACK and BLAS libraries, both of which are included in OpenBLAS.
- Arpackpp C++ frontend for Arpack.
- primme Eigenvalue solver. Complements Arpack.
- h5pp a wrapper for HDF5. Includes HDF5, spdlog and fmt.
- ceres Optimization library with L-BFGS routines for unconstrained minimization.
- CLI11 input argument parser
- Backward-cpp pretty stack trace printer.
The CMake flag DMRG_PACKAGE_MANAGER
controls the automated behavior for finding or installing dependencies. It can
take one of these strings:
Option | Description |
---|---|
find (default) |
Use CMake's find_package to find dependencies. (Use this with the CMake Presets labeled conan ) |
cmake¹ |
Use CMake to download and install dependencies during configure. |
This project takes several flags in the form cmake [-DOPTIONS=var] ../
:
Var | Default | Description |
---|---|---|
DMRG_PACKAGE_MANAGER |
find |
Handle dependencies, find or cmake |
DMRG_ENABLE_TBLIS |
OFF |
Use faster tblis for tensor contractions |
DMRG_ENABLE_TESTS |
OFF |
Enable unit testing with ctest |
DMRG_ENABLE_DOCS |
OFF |
Build documentation |
DMRG_ENABLE_COVERAGE |
OFF |
Enable test coverage |
DMRG_BUILD_EXAMPLES |
OFF |
Build examples |
DMRG_BUILD_TOOLS |
OFF |
Build additional binaries under ./tools for postprocessing (e.g. dmrg-meld) |
DMRG_DEPS_INSTALL_DIR |
CMAKE_INSTALL_PREFIX |
Install directory for dependencies |
DMRG_DEPS_BUILD_DIR |
CMAKE_BINARY_DIR/dmrg-build |
Build directory for dependencies |
DMRG_PREFIX_ADD_PKGNAME |
OFF |
Install dependencies into CMAKE_INSTALL_PREFIX/ |
DMRG_CMAKE_DEBUG |
OFF |
Extra information during CMake configuration |
EIGEN_USE_THREADS |
ON |
Use STL threads to parallelize Eigen::Tensor (honors OMP_NUM_THREADS at runtime) |
COMPILER_ENABLE_ASAN |
OFF |
Enable runtime address sanitizer -fsanitize=address |
COMPILER_ENABLE_USAN |
OFF |
Enable undefined behavior sanitizer -fsanitize=undefined |
COMPILER_ENABLE_LTO |
OFF |
Enable link time optimization |
COMPILER_ENABLE_PCH |
OFF |
Enable precompiled headers to speed up compilation |
COMPILER_ENABLE_CCACHE |
OFF |
Enable ccache to speed up compilation |
In addition, variables such
as <PackageName>_ROOT
and <PackageName>_DIR
can be set to help guide
CMake's find_package
calls:
For questions about DMRG++ email David Aceituno aceituno <at>
kth.se, or create a new issue or discussion.