Algebraic contraction planning #
This module isolates the mathematical certificate used when a generated einsum kernel changes the nesting order of contracted axes. A permutation of duplicate-free logical axes induces an equivalence of coordinate spaces. Coordinate sums may be transported across that equivalence only when addition is commutative, so ordered scalar folds keep their original traversal.
A permutation of duplicate-free axes induces an equivalence between their row-major coordinate spaces.
The equivalence changes only the order in which coordinates are presented. Each named axis retains its original length and bounded coordinate.
Instances For
Changing the nesting order of contracted axes preserves a coordinate sum when the scalar addition is commutative.
The executable planner uses this theorem as its only algebraic permission to reorder contraction coordinates. In particular, no corresponding theorem is available for merely ordered floating-point addition.
An executable coordinate map may use a compiler-generated direct projection instead of evaluating the abstract permutation equivalence.
Pointwise equality with the equivalence is sufficient to retain the same coordinate-sum certificate.