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.

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. Bands are layers, named by their role; boxes are libraries, and each name links to its GitHub repository. 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

Each repository's README says how to depend on it.

RepositoryRoleDocs
tensor4all-rsTT, TCI, QTT, tree tensor networks, C APIuser guide
quanticsgrids-rsquantics grids and coordinate conversionREADME
Tensor4all.jlJulia frontend, best effortREADME
tenferro-rstensor runtime, autodiff, backendsdocs
computegraph-rsgraph IR used by traced ADrustdoc
cpueinsum-rsN-ary einsum with caller-supplied orderREADME
tcontract-rsbinary strided contraction, TAPP C ABIREADME
tlinalg-rsbatched SVD, QR, LU, Cholesky, eigensolversREADME
strided-rsstrided view types, permutation, kernelsREADME
t4a-faertensor4all fork of faer by Sarah Quinones, tuned for the stackPATCHSET.md
hataori-rsmap and pmap over Rayon and MPIdocs

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.