Repository navigation
Conversation
Codecov Report❌ Patch coverage is
... and 20 files with indirect coverage changes 🚀 New features to boost your workflow:
|
lkdvos
left a comment
There was a problem hiding this comment.
As a separate comment, there is some redundant computations in the repartition that are there mostly to avoid having to figure out the braids for mixed splitting-fusion pairs. It might also make sense to have Claude figure out if we can braid without repartition.
|
I looked into it. |
|
Follow-up on braiding without |
lkdvos
left a comment
There was a problem hiding this comment.
Looking at this a bit more, I'm actually wondering if there is a point to never have destinations in canonical order, since these are only ever used in combination with the block they return, so nothing is actually assuming any particular order there. This might both simplify the code slightly and also speed it up because there is no need for a final sorting, but the one thing to be mindful of is hashing and equality, which might need some checking.
|
On never bringing the destinations into canonical order: I tried it by making the final |
The bends and Artin braids of a fusion tree block used to construct their destination block in canonical order, together with a dictionary from trees to rows, at every step. The intermediate blocks of `fsbraid` now keep their trees in the order in which they are produced (`TreeRows`, `canonical = Val(false)` for `bendleft`, `bendright` and `artin_braid`, `repartition_noncanonical`), and only the result is brought into canonical order (`canonicalize`). Small blocks find rows by a linear search. In `artin_braid`, the channels are obtained by filtering `a ⊗ d` instead of intersecting two fusion products, and the symbols that do not depend on the channel are computed once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Artin braids keep the size of a block, so `fsbraid` passes the tree vector and the matrices of the previous step on to `artin_braid` and multiplies in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A block with a single tree stays a single tree under every step of `fsbraid`, so its braid is computed with the per-tree manipulations, without blocks or matrices. Their bodies move into private `_artin_braid_single` and `_bendright_single`, which take the single coefficient of each symbol with `only`; the public methods keep their `UniqueFusion` assertion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…annel by dispatch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ype parameter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…channel with `only`, and filter the braid channels for every unit style Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… loops over the multiplicities Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`bendright` and `bendleft` of a tree pair no longer assert `UniqueFusion`, but rely on `only` to throw if the bent vertex has a multiplicity, which replaces their `_single` variants. The shortcut of `braid` for a symmetric braiding is restricted to `UniqueFusion`, where the `Fsymbol`s are trivial, such that a block with a single tree is braided as its tree pair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…order The destination blocks of bends, folds and braids are only used together with their transformation matrix, so they no longer construct and index the canonical destination block, but keep their trees in the order in which they are produced. Since `planar_trace` now also works on complete blocks, the canonical mode of `TreeRows`, `canonicalize`, `repartition_noncanonical` and `treeindex_map` are removed. The tests compare the results of manipulations up to the order of their trees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d92e2f8 to
d397cb2
Compare
|
Thanks for checking. My numbers agree that there is little to gain in speed (at most ~5–14% for SU2/Fibonacci transposes, nothing for A4), but I'd still like to do it for the code: with #605, So I stacked this PR on #605 and force-pushed: your branch including today's two commits, rebased onto
I dropped my |
| _artin_channel(a, b, d, e) = _artin_channel(FusionStyle(a), a, b, d, e) | ||
| _artin_channel(::UniqueFusion, a, b, d, e) = only(a ⊗ d) | ||
| _artin_channel(::FusionStyle, a, b, d, e) = only(_artin_channels(a, b, d, e)) |
There was a problem hiding this comment.
| _artin_channel(a, b, d, e) = _artin_channel(FusionStyle(a), a, b, d, e) | |
| _artin_channel(::UniqueFusion, a, b, d, e) = only(a ⊗ d) | |
| _artin_channel(::FusionStyle, a, b, d, e) = only(_artin_channels(a, b, d, e)) | |
| _artin_channel(a, b, d, e) = only(_artin_channels(a, b, d, e)) |
In this case, we might also just inline this and get rid of the helper?
This is a draft illustrating some potential performance improvements; the actual implementations are
very much up for discussion.
fsbraidbends and swaps aFusionTreeBlockstep by step, and every step built the canonicaldestination block and a
Dictindex, although only the result needs canonical order. Fornon-abelian sectors this bookkeeping dominates the cache misses of
braid/permute.Small blocks use a linear search instead of a
Dict.mul!).methods are unchanged).
artin_braidfilters channels byNsymboland computes the R-symbols once per tree.Behaviour change: braiding requires a complete block (all tree pairs for its uncoupled sectors
and duality flags, as built by
FusionTreeBlock{I}(uncoupled, isdual)andfusionblocks); anincomplete one raises an
ArgumentError. On main, onlyplanar_tracebuilds incomplete blocks, andit only transposes them, which is unaffected. Easy to lift if needed.
Tested: a new test for single-tree blocks; every transformer of a CTMRG iteration
(fℤ₂ × U(1) × SU(3) and fℤ₂ × U(1) × SU(2) × U(1), D = 6–9) matches v0.17.2 to 9e-16.
Cold construction of the recoupling data for one permutation of a tensor from a PEPS CTMRG step
(scripts below), main → this PR:
SU(2) gains little from threads:
FsymbolforSU2Irrepgoes through WignerSymbols, which takesa lock on every call. Removing that lock (caching the F-symbols in TensorKitSectors) is scheduled
as a follow-up.
TensorKit main (ae8abfc), SUNRepresentations c02a3f3, TensorKitSectors v0.3.10, Julia 1.12.5; shared 80-core
machine, two interleaved rounds agree within 15 %.
fℤ₂ × U(1) × SU(3) reproducer (
julia -t8)fℤ₂ × U(1) × SU(2) × U(1) reproducer (
julia -t8)🤖 Generated with Claude Code