Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture & Crate Guide

This page describes how tensor4all-rs is organised, what each crate does, and how to choose the right crate for your use case.

Crate Dependency Diagram

tensor4all-tensorbackend    (scalar types, storage)
        |
tensor4all-core             (Index, Tensor, contraction, SVD/QR)
        |
   +---------+-----------+-----------+
   |         |           |           |
 treetn  itensorlike  simplett    tcicore
   |                     |           |
   |              partitionedtt   tensorci
   |                                 |
 treetci                       quanticstci
                                     |
                              quanticstransform

tensor4all-hdf5 depends on tensor4all-core and tensor4all-itensorlike (for MPS serialization). tensor4all-capi depends on most crates and forms the C FFI layer used by language bindings.

Layer Descriptions

Foundation (internal)

CrateDescription
tensorbackendInternal. Scalar types (f64, Complex64), storage backends, and the tenferro-rs bridge. Users do not need to depend on this crate directly.
coreFoundation for everything else. Provides the Index system, dynamic-rank Tensor, contraction, and SVD/QR/LU factorizations.

Tensor Train & Tree Tensor Networks

CrateDescription
treetnTree tensor networks with arbitrary graph topology. Supports canonicalization, truncation, and contraction.
itensorlikeITensors.jl-inspired TensorTrain with orthogonality tracking and multiple canonical forms. Useful when compatibility with the ITensors.jl mental model is important.
simplettLightweight tensor train for numerical computation. The go-to crate for creating, evaluating, and compressing tensor trains without extra overhead.
partitionedttPartitioned tensor trains for subdomain decomposition. Builds on simplett.
treetciTree TCI: cross interpolation on tree-structured tensor networks.

Tensor Cross Interpolation

CrateDescription
tcicoreInternal. Matrix CI, LUCI/rrLU algorithms, and cached function evaluation. Users do not need to depend on this crate directly.
tensorciTensor Cross Interpolation. Contains TCI2 (primary algorithm) and TCI1 (legacy). Use this for low-level TCI control.
quanticstciHigh-level Quantics TCI. Interpolates functions on discrete or continuous grids in the quantics format.

Quantics & Transforms

CrateDescription
quanticstransformQuantics transformation operators: shift, flip, Fourier, affine, and more.

I/O & Bindings

CrateDescription
hdf5HDF5 serialization compatible with ITensors.jl/ITensorMPS.jl file formats.
capiC FFI for language bindings (Julia, Python, etc.). Out of scope for this guide; see Julia Bindings.

Which Crate Should I Use?

GoalRecommended crate
TCI on a black-box function (high level)tensor4all-quanticstci
TCI with fine-grained controltensor4all-tensorci
Tree TCItensor4all-treetci
Simple tensor train (create, evaluate, compress)tensor4all-simplett
Tensor train with ITensors.jl-style interfacetensor4all-itensorlike
Tree tensor networkstensor4all-treetn
Subdomain decomposition via partitioned TTtensor4all-partitionedtt
Quantics transform operatorstensor4all-quanticstransform
HDF5 I/O compatible with Juliatensor4all-hdf5

Internal Crates

tensor4all-tensorbackend and tensor4all-tcicore are implementation details. They are not part of the public API surface and you should not depend on them directly in application code. Their interfaces may change without notice.