Examples
The public example scripts are examples/basic_usage.py and
examples/contractions.py.
Run it from the repository root:
uv run python examples/basic_usage.py
uv run python examples/contractions.py
The basic usage example covers:
- ordinary dense tensors built with
Vect(dim), - layout and storage construction,
- dense roundtrip checks,
- blockwise composition,
- identity and deterministic isometry construction,
- explicit tensor products and explicit-key random isometry construction,
- direct linear solve and numerical predicate checks,
- compact QR canonicalization and truncated Hermitian reconstruction,
- compact SVD reconstruction,
- U1, fermion parity, and SU2 transforms,
- JAX
jitandgradsmoke usage.
The contraction example covers:
- binary contraction and partial/full trace,
- named-label
contractand integer-labelncon, - explicit contraction order and HomSpace output partitions,
- fermionic twist,
- JAX
jitand differentiation through TensorMap storage.
The example is covered by:
uv run pytest tests/test_examples.py -q