— the indices that get contracted away at that step — and replaces the two tensor entries with the union of their remaining indices.
▪
The result is a list of per-step contraction sets. Each entry is the set of indices summed at that step. Outer-product steps (no shared indices) produce an empty contraction and are removed from the output, so the result length is at most
In the 2-argument form, contractions are tracked by integer position within each tensor's index list. In the 3-argument form, the additional
contractions
argument supplies symbolic labels (e.g. bond names) that the integer positions are mapped back to, which is useful for tracing each contraction to a user-specified index name.
▪
The association form accepts any value with keys
"Indices"
and
"Contractions"
, and returns the catenated symbolic contractions. A