You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 095fcbe
Browse filesBrowse the repository at this point in the historyBrowse files
Now that `@planar` emits canonical index tuples, its allocations no longer need
to be canonicalized at runtime and can go through `tensoralloc_contract` again.
Canonicalizing before the planar operations are inserted also means that the
contraction and its allocation still share a single argument layout.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/src/Changelog.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ When releasing a new version, move the "Unreleased" changes to a new version sec
22
22
23
23
### Added
24
24
25
-
-`planarcontract!` now supports an arbitrary (cyclic) output permutation `pAB`, in the same way as the non-planar `tensorcontract!`, along with the new internal helpers `TensorKit.planar_contract_indices` and `TensorKit.planaralloc_contract`. ([#531](https://github.com/QuantumKitHub/TensorKit.jl/pull/531))
25
+
-`planarcontract!` now supports an arbitrary (cyclic) output permutation `pAB`, in the same way as the non-planar `tensorcontract!`, along with the new helper `TensorKit.planar_contract_indices`, which `@planar` uses to emit canonical index tuples. ([#531](https://github.com/QuantumKitHub/TensorKit.jl/pull/531))
26
26
27
27
### Changed
28
28
- For sector types with `GenericUnit` such that colorings are not unique, `GradedSpace`, `ProductSpace` and `HomSpace` now check for this compatibility. In particular, this prevents the construction of `TensorMap`s with incompatible colorings, which previously either errored or produced empty tensors inconsistently. ([#515](https://github.com/QuantumKitHub/TensorKit.jl/pull/515))
29
-
-`TensorOperations.tensorcontract_structure` now requires the index tuples `pA` and `pB` to be planar (cyclic) partitions for sector types with `GenericUnit()`; planar code should allocate through `TensorKit.planaralloc_contract`, which canonicalizes them. ([#531](https://github.com/QuantumKitHub/TensorKit.jl/pull/531))
29
+
-`TensorOperations.tensorcontract_structure` now requires the index tuples `pA` and `pB` to be planar (cyclic) partitions for sector types with `GenericUnit()`; hand-written planar kernels should canonicalize their index tuples with `TensorKit.planar_contract_indices` before allocating. ([#531](https://github.com/QuantumKitHub/TensorKit.jl/pull/531))
Copy file name to clipboardExpand all lines: docs/src/man/contractions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,7 +291,7 @@ Any layout the macro cannot identify as planar is rejected at parse time with `A
291
291
292
292
For users writing their own planar kernels, it is important to note that the index tuples `pA = (oindA, cindA)` and `pB = (cindB, oindB)` handed to `planarcontract!` need not individually be planar partitions of the operands, even when the overall diagram is planar; only a cyclic rotation of them is.
293
293
The function `TensorKit.planar_contract_indices(A, pA, B, pB, pAB)` returns the canonical `pA′`, `pB′` and the remaining output permutation `pAB′`, and these canonical tuples are the only ones for which the intermediate spaces exist for sector types with multiple units (i.e. multifusion categories with `GenericUnit()`).
294
-
Consequently, destinations for planar contractions must be allocated with `TensorKit.planaralloc_contract` — which is what the `@planar` macro emits — rather than with `TensorOperations.tensoralloc_contract`.
294
+
The `@planar` macro applies it to the tuples it emits, so hand-written planar kernels should do the same before allocating a destination with `TensorOperations.tensoralloc_contract`.
295
295
296
296
To make this concrete, consider the contraction `A * B` for two anyonic tensors, written in a manifestly planar fashion:
0 commit comments