Skip to content

Repository files navigation

tensor4all-rs

CI

A Rust implementation of tensor networks: TCI, Quantics Tensor Train, and Tree Tensor Networks.

Related project: tenferro-rs provides tensor backend components used by tensor4all-rs.

Features

  • ITensors.jl-like dynamic tensors: Flexible Index system with dynamic-rank Tensor
  • Tensor Cross Interpolation: TCI2 primary algorithm plus legacy TCI1 compatibility for efficient high-dimensional function approximation
  • Quantics Tensor Train: Binary encoding of continuous variables with transformation operators
  • Tree Tensor Networks: Arbitrary topology with canonicalization, truncation, and contraction
  • C API: Minimal Julia-facing FFI surface for indices, structured tensors, TreeTN, and quantics materialization

Quick Start

The crates are not published to crates.io yet. Use git dependencies from an external project:

[dependencies]
tensor4all-simplett = { git = "https://github.com/tensor4all/tensor4all-rs", package = "tensor4all-simplett" }

When working from a local checkout, use a path dependency instead:

[dependencies]
tensor4all-simplett = { path = "../tensor4all-rs/crates/tensor4all-simplett" }
use tensor4all_simplett::{AbstractTensorTrain, TensorTrain};

let tt = TensorTrain::<f64>::constant(&[2, 3, 4], 1.0);
assert!((tt.evaluate(&[0, 1, 2]).unwrap() - 1.0).abs() < 1e-12);
assert!((tt.sum() - 24.0).abs() < 1e-12);

The root README.md is kept intentionally short and its Rust snippets are validated in CI. Longer runnable examples live in the User Guide.

Crate Overview

Crate Description
tensor4all-core Core types: Index, Tensor, contraction, SVD, QR
tensor4all-simplett Simple TT/MPS with compression
tensor4all-aci Alternating Cross Interpolation for elementwise tensor train operations
tensor4all-itensorlike ITensors.jl-like TensorTrain API
tensor4all-treetn Tree tensor networks with arbitrary topology
tensor4all-tensorci Tensor Cross Interpolation (TCI2 primary, TCI1 legacy)
tensor4all-quanticstci High-level Quantics TCI interface
tensor4all-interpolativeqtt Interpolative QTT construction
tensor4all-quanticstransform Quantics transformation operators
tensor4all-treetci Tree-structured cross interpolation
tensor4all-partitionedtt Partitioned Tensor Train
tensor4all-hdf5 ITensors.jl-compatible HDF5 serialization
tensor4all-capi C FFI for language bindings

Documentation

Acknowledgments

Inspired by ITensors.jl and ITensorNetworks.jl. We acknowledge fruitful discussions with M. Fishman and E. M. Stoudenmire at CCQ, Flatiron Institute.

A per-component table of which external projects each crate builds on, and the algorithm-origin references, is maintained in the Provenance and Citation Policy.

How to Cite

If you use tensor4all-rs in research, please read the Provenance and Citation Policy and cite the original papers of the algorithms your work relies on, together with the software papers of the upstream libraries those components build on (for example the TCI paper, SciPost Phys. 18, 104 (2025), for the TCI components, and the ITensor paper, SciPost Phys. Codebases 4 (2022), for the tree tensor network components). Please also check the citation policies of those upstream projects and apply them recursively. This is the permanent citation style for this project: a future tensor4all-rs software paper will add to, not replace, these upstream citations. Until then, reference tensor4all-rs directly by repository URL and version or commit.

License

MIT License (see LICENSE-MIT)

About

Rust port of tensor4all tensor network ecosystem with C-API

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages