A Julia library providing a simple and safe tensor train (matrix product state/operator) data structure built on top of ITensors.jl.
- Safe operations: All operations use algorithms that prevent unexpected loss of precision
- Addition uses the direct sum algorithm instead of the density matrix algorithm
- Multiple contraction algorithms available (fit, density matrix, zipup, naive)
- ITensors.jl compatibility: Seamless conversion between
TensorTrainand ITensors' MPS/MPO - Comprehensive API: Support for truncation, contraction, arithmetic operations, and more
using Pkg
Pkg.add("T4AITensorCompat")TODO: Add quick start example.
This library makes specific algorithmic choices to ensure numerical accuracy, especially important for operations with quantics tensor trains:
- Addition: Uses
Algorithm"directsum"for exact representation without approximation - Subtraction: Uses
Algorithm"directsum"for exact representation without approximation - Contraction: Offers multiple algorithms (fit, densitymatrix, zipup, naive) with sensible defaults
For detailed API documentation, see the documentation.
This library is built on top of ITensors.jl and ITensorMPS.jl.
Please cite the ITensor paper when using this library.
Some code in src/contraction/ is derived from:
- ITensors.jl (Apache License 2.0) - density matrix contraction algorithm
- ITensorTDVP.jl (Apache License 2.0) - variational fitting algorithm
See the LICENSE and NOTICE files for full attribution and license information.
This project is licensed under the Apache License 2.0. See LICENSE for details.
The use of the same Apache 2.0 license as the upstream ITensors.jl and ITensorTDVP.jl projects ensures full compatibility and simplifies attribution.