Tensor0 is an experimental symmetric tensor library with Rust-backed structural metadata and JAX-backed tensor storage; it is not yet a production-ready tensor-network framework, and the API may change while the core representation is being developed.
- Built-in sector families including
U1Irrep,SU2Irrep, cyclicZNIrrepaliases, fermion parity, and selected product-sector aliases. space(...)andhom(codomain, domain)constructors for symmetric linear map spaces.TensorMapstorage backed by JAX arrays.- Block access, blockwise composition, compact SVD, and truncation helpers.
permute,braid,transpose, andrepartitiontransform helpers.to_dense(...)andfrom_dense(...)for small correctness checks.- JAX
jitandgradsupport through pytree registration.
Tensor0 is currently installed from source. It requires Python 3.11 or newer and a Rust toolchain.
The recommended setup is to install Tensor0 into a virtual environment:
git clone https://github.com/yitan1/Tensor0.git
cd Tensor0
python -m venv .venv
source .venv/bin/activate
python -m pip install .If you manage your own Python environment, python -m pip install . can also
be run without creating a virtual environment.
From a checkout:
uv sync --group dev
uv run maturin developRun the Python and Rust tests:
uv run pytest tests/python -q
cargo testRun the public example:
uv run python examples/basic_usage.pyimport jax.numpy as jnp
from tensor0 import TensorMap, U1Irrep, get_degeneracystructure, hom, space
v = space(U1Irrep, {0: 2, 1: 3})
h = hom((v,), (v,))
total_dim = get_degeneracystructure(h).total_dim
tensor = TensorMap(h, jnp.arange(total_dim, dtype=jnp.float32))
for sector, block in tensor.blocks():
print(sector, block.shape)See docs/usage.md and examples/basic_usage.py for more examples.
Tensor0's main design and architecture are based on TensorKit.jl. Tensor0 focuses on bringing these ideas to Python with JAX-backed tensor storage and automatic differentiation support.