tensor4all

Stack overview

The tensor4all Rust stack

A family of Rust libraries for tensor networks (quantics tensor trains, tensor cross interpolation, tree tensor networks) and the dense tensor backend they run on. This page shows how the pieces fit together and where to start reading.

Status as of 2026-10-13. The stack moves quickly; each repository's README is the source of truth.

Guide A

For tensor network users

You want to compress a function into a QTT, run TCI, apply Fourier or shift operators, or contract tree tensor networks. You may be coming from the Julia packages. This guide maps what you know onto the Rust crates and tells you which entry point to use.

Read the user guide →
Guide B

For backend developers

You care about what happens below the algorithms: tensor contraction, batched linear algebra, execution contexts, C ABIs. Quantum chemistry codes that need fast strided contractions are a target audience. This guide goes down to tcontract and tlinalg.

Read the backend guide →

The layer map

Each layer depends only on layers below it. Boxes link to the repository or its documentation. hataori sits beside the stack: it does not compute anything itself, it owns processes and threads and lends them to the layers that do.

Blue bands are what tensor network users touch; orange bands are the backend. On a narrow screen, scroll the map sideways.

The layers in brief

Repositories and release status

Several layers are not on crates.io yet. Where a crate is unpublished, use it as a git dependency pinned to a revision.

RepositoryRoleReleaseDocs
tensor4all-rsTT, TCI, QTT, tree tensor networks, C APIgit onlyuser guide
quanticsgrids-rsquantics grids and coordinate conversioncrates.io 0.1.0 main is aheadREADME
Tensor4all.jlJulia frontend, best effortgit onlyREADME
tenferro-rstensor runtime, autodiff, backendscrates.io 0.7.1 main is aheaddocs
computegraph-rsgraph IR used by traced ADcrates.io 0.1.0rustdoc
cpueinsum-rsN-ary einsum with caller-supplied ordergit onlyREADME
tcontract-rsbinary strided contraction, TAPP C ABIgit onlyREADME
tlinalg-rsbatched SVD, QR, LU, Cholesky, eigensolversgit onlyREADME
strided-rsstrided view types, permutation, kernelscrates.io 0.4.8README
t4a-faertensor4all fork of faer by Sarah Quinones, tuned for the stackcrates.io t4a-faer 0.24.4PATCHSET.md
hataori-rsmap and pmap over Rayon and MPIgit onlydocs

Benchmarks are kept in separate repositories so results can be keyed by commit and hardware: tenferro-benchmark, tcontract-benchmark, tlinalg-benchmark and tensor4all-benchmark.

Three ideas that run through every layer

  1. Explicit execution. No library in the stack starts a hidden global thread pool or changes behavior through environment variables. The caller creates a context (a Rayon pool, a backend, scratch memory) and passes it down. This is what lets an MPI program, a Julia session and a Rust test share one machine predictably.
  2. Tensor-free providers. The numerical kernels (tcontract, tlinalg) do not know about tensor types. They take borrowed strided views. The host above them owns allocation, dtype dispatch and placement. That keeps them small, testable on plain buffers and reusable from other codes.
  3. One shared vocabulary. All CPU layers exchange strided-rs views. A view made by tenferro can be handed to tcontract or tlinalg without conversion, which is why the whole stack pins the same strided-rs release.