Skip to content

tinyTT

Tensor-Train (TT) tensors, operators, and solvers on PyTorch, with a full matrix-free Riemannian manifold layer, real TDVP / KSL / BUG integrators, a variational eigensolver, and certified Krylov methods on the fixed-rank TT tangent bundle.

Runs wherever PyTorch runs — CPU, CUDA, MPS. Pass device= to any constructor; tn.supports_fp64(device) says whether float64 is available there.


- :material-rocket-launch: **[Getting Started](getting-started.md)** Install tinyTT and run your first TT operations. - :material-book-open-variant: **[Tutorials](tutorials/tt-basics.md)** Runnable guides covering TT basics, solvers, functional TT, Riemannian optimisation, CTT, QTT, streaming, UQ-ADF and the backend. - :material-code-tags: **[Examples](examples.md)** Runnable scripts for every major feature. - :material-github: **[GitHub Repository](https://github.com/meigel/tinyTT)** Source code, issues, and pull requests.

Quick Start

import tinytt as tt

x = tt.ones([4, 4])                # 4x4 TT tensor, rank 1
print(x.R)                         # [1, 1]
print(x.full().numpy())            # materialise as numpy array

A = tt.eye([4, 4])                 # identity TT-matrix
b = A @ x                          # matvec
print((b - x).norm().numpy())      # ≈ 0

Representations

Representation Module Description
TT tinytt/ (core) Standard TT-tensor / TT-matrix with full solver suite
QTT TT.to_qtt() Quantized TT for high-dimensional problems
CTT (Compositional TT) tinytt/compositional.py Residual functional-TT composition (arXiv:2512.18059)
FTT tinytt/functional_tt.py Functional TT: basis-driven regression model
Streaming TT tinytt/streaming.py One-pass randomised TT (STTA) for streaming data

Backend

One backend: PyTorch. Everything goes through import tinytt.backend as tn, and nothing imports torch directly — see Backend. TINYTT_BACKEND is read only so that a stale setting fails loudly rather than quietly selecting something else: tinygrad raises in 0.6, and so does any value other than pytorch. Unset it.

Author

tinyTT is written and maintained by Martin Eigel. Its API was inspired by torchTT.