v0.20.1: TT _dim_order Full Threading + reorder()
Patch release closing the v0.20 known limitations on ChebyshevTT.
What changed
v0.20 shipped with_auto_order() (heuristic dim reordering for rank reduction) but six methods raised NotImplementedError on non-identity _dim_order. v0.20.1 threads _dim_order through every public TT method and adds reorder() as the explicit alignment escape hatch for binary algebra between TTs of different orders.
Threaded methods (no longer guarded)
eval_multi(point, derivative_orders)— point + per-deriv axis labels translated user→storageslice(dim_idx, value)— descending storage_pos processing, mutablelive_dim_orderextrude(dim_idx, lo, hi, n_nodes)— identity branch preserves v0.18 behavior bit-for-bitto_dense()— final transpose via inverse permutationintegrate(dims=, bounds=)partial —storage_formap keys quadrature/contraction/bounds by storage positions- Unary algebra (
__neg__,__mul__scalar,__truediv__scalar) — propagates_dim_order
New public API
ChebyshevTT.reorder(new_order, *, max_rank=None, tolerance=None)— bubble-sort permutation alignment via TT-swap on coefficient cores. Use this to align two TTs of different_dim_orders before binary algebra:result = (tt1 + tt2.reorder(tt1.dim_order))
Binary algebra error message
__add__ / __sub__ on TTs of different _dim_order now raise ValueError (not NotImplementedError) with an actionable fix:
TT dim_order mismatch: [0, 1, 2] vs [2, 0, 1]. Call other = other.reorder(self.dim_order)
(or self = self.reorder(other.dim_order)) to align before adding/subtracting.
Tests
- 1055 tests pass on Python 3.10/3.11/3.12/3.13
- New
tests/test_v0201_dim_threading.py(~63 tests, 9 classes) — TDD-driven per method - v0.20 guard tests flipped from
_raisesto_works - v0.18 TT parity (52 tests) untouched — identity-
_dim_orderpaths unchanged
Compatibility
- Fully backward-compatible. Canonical-order TTs (
with_auto_ordernot called) take the same code path as v0.18-v0.20. - No new dependencies. No version bumps to existing deps.
See CHANGELOG.md for full details.