Repository navigation
Cheaper ProductSector symbols - #113
Merged
Merged
Conversation
The sizes needed to promote a scalar symbol of a factor to an array take several `Nsymbol` evaluations; they are now only computed when one of the two symbols is a scalar. A scalar symbol without multiplicities scales the other symbol (which is returned as is for a scalar one), instead of going through `fill` and `_kron`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
leburgel
marked this pull request as ready for review
October 15, 2026 07:35
lkdvos
reviewed
Oct 15, 2026
Broadcasting a scalar over a `SparseArray` gives a dense `Array`, so the type of a product symbol depended on the value of the scalar factor, which breaks contractions in e.g. the pentagon checks for `CategoryData` sectors. Use scalar multiplication instead, and promote a scalar symbol to an array similar to the other symbol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lkdvos
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The symbols of a
ProductSectorcombine the symbols of its factors with_kron_promote, whichalways computed the sizes needed to promote a scalar symbol to an array (4–6
Nsymbolcalls on thefactors) and then promoted it with
filland_kron. Now:_kronas before.The results are unchanged (checked symbol by symbol for fℤ₂ × U(1) × SU(3) and
fℤ₂ × U(1) × SU(2) × U(1)). This only matters when a factor has array-valued symbols, i.e. fusion
multiplicities: for SU(3) the product symbols become 3–4× cheaper, for SU(2) nothing changes.
Time per symbol, for all F- and R-symbols over six sectors of a fermionic PEPS bond space (script
below), factor symbols cached, median of 3 interleaved rounds:
Fsymbol(1576)Rsymbol(72)Fsymbol(647)Rsymbol(53)SUNRepresentations with QuantumKitHub/SUNRepresentations.jl#56, QuantumKitHub/SUNRepresentations.jl#58
and QuantumKitHub/SUNRepresentations.jl#59 (MemoizationKit with QuantumKitHub/MemoizationKit.jl#21),
WignerSymbols 2.0.0, Julia 1.12.5; shared 80-core machine at load 5–11.
Reproducer
🤖 Generated with Claude Code