States
Construct and manipulate finite and infinite matrix product states (MPS).
Efficient and versatile tools for working with matrix product states
MPSKit.jl is a Julia library for simulating one-dimensional quantum many-body systems with matrix product states and operators. It provides both finite and infinite MPS, a range of ground-state, time-evolution, and excitation algorithms, and support for arbitrary symmetries through the TensorKit.jl tensor backend. It is aimed at researchers and students who want to run tensor-network calculations without reimplementing the underlying machinery.
MPSKit.jl is a part of the general registry. Together with the packages used throughout this documentation, it can be installed via the package manager as:
pkg> add MPSKit TensorKit TensorOperations MPSKitModels TensorKitTensors PlotsMPSKit provides the matrix product state and operator types, together with the ground-state, time-evolution, and bond-dimension algorithms.
TensorKit supplies the tensor backend (TensorMaps and vector spaces) that MPSKit is built on; installing it alongside MPSKit also gives access to truncation-scheme constructors such as truncrank, which TensorKit re-exports from MatrixAlgebraKit.
TensorOperations provides the @tensor macro for contracting tensors by hand.
MPSKitModels collects pre-defined Hamiltonians and local operators for common physical models.
TensorKitTensors provides ready-made local operators, such as the Pauli operators used throughout the documentation.
Plots is used to visualize results in several of the how-to guides and examples.
For a step-by-step walkthrough that sets up a dedicated environment and verifies the installation, see Installation.
Finding the ground state of the transverse-field Ising chain takes a handful of lines.
using MPSKit, MPSKitModels, TensorKit
H = transverse_field_ising(FiniteChain(16); g = 0.5)
ψ₀ = FiniteMPS(16, ℂ^2, ℂ^4)
ψ, envs, ϵ = find_groundstate(ψ₀, H, DMRG(; verbosity = 0))
E = expectation_value(ψ, H)-16.146039498683976 - 4.4176709669413745e-15imFor a guided version of this calculation that explains each step and measures more observables, see Your first ground state.
Tutorials walk you through complete calculations from scratch. Start with Installation, then run Your first ground state, and continue to The thermodynamic limit to work directly at infinite system size.
How-to guides are focused task recipes for when you already know what you want to do. See Constructing states, Building Hamiltonians, and Computing observables, among others.
The manual explains the concepts behind the library — the States, Operators, and Algorithms that make up MPSKit.
The examples gallery collects longer, fully worked scripts covering symmetries, infinite systems, and less common algorithms; browse it at Examples.
The library is the API reference; the curated, stable entry point is the Public API.
MPSKit builds on TensorKit.jl, which supplies the tensors and vector spaces and handles the symmetries. Models and ready-made operators come from MPSKitModels.jl and TensorKitTensors.jl. All of these are part of the QuantumKitHub organization; the TensorKit documentation is available here.
Questions and general discussion are welcome on GitHub Discussions; bug reports belong on the issue tracker. If you would like to contribute, see CONTRIBUTING.md on GitHub.