Repository navigation
Conversation
The operand that `blas_contract!` twists for fermionic sectors is always copied first, so the twist is now folded into the recoupling coefficients of that copy through a cached `treepermuter`, instead of a separate `twist!` pass over the copied operand (#595). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…epermuter` `blas_contract!` now computes the twist masks of both operands in `contraction_twistmasks` and always copies through `permute_twist!`, with an all-false mask when no twist is needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`V1 ⊗ V2 ← V3` has incompatible units for `IsingBimodule`; reuse the space of the `Adapt` testset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lkdvos
marked this pull request as ready for review
November 5, 2026 16:18
This branch has not been deployed
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.
For fermionic sectors,
blas_contract!twists the contracted legs of one of the operands. That operand is always copied first, so this PR folds the twist into the recoupling coefficients of the copy, instead of running a separatetwist!pass over it (#595).treebraidertakes atwistmaskon the destination legs. Twists are diagonal in the fusion tree basis, so they are multiplied into the braiding coefficients. Ordinary braids and permutations pass an all-false mask and are unchanged, so no extra transformer type or cache is needed._braid!and its GPU and diagonal-GPU counterparts gain the same argument.blas_contract!computes both twist masks incontraction_twistmasksand always copies throughpermute_twist!, passing an all-false mask when no twist is needed.On a fℤ₂×U(1) operand with 1336 subblocks, the twisted copy goes from 0.80 ms to 0.40 ms.
This also fixes the GPU "Adapt SectorVector" test from #610: for
IsingBimodule,V1 ⊗ V2 ← V3has incompatible units and threw aSpaceMismatch, so it now reuses the space of the "Adapt" testset.Tested locally on Julia 1.13: the contraction, index manipulation, diagonal, braiding tensor and planar suites, the CUDA tensor suite and the Mooncake contraction tests pass. Enzyme was not run locally.
🤖 Generated with Claude Code