Skip to content

Commit abc00bb

Browse files
leburgelclaude
authored andcommitted
Order the blocks by comparing their sectors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8e8029a commit abc00bb

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎src/spaces/homspace.jl‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,10 @@ function fusionblocks(W::HomSpace)
217217
push!(get!(Vector{F}, groups, (f₁.uncoupled, f₂.uncoupled)), (f₁, f₂))
218218
end
219219
# in the order of `sectors(domain(W))` (outer) and `sectors(codomain(W))` (inner), each of
220-
# which runs fastest over its first space
221-
position(V) = Dict{I, Int}(s => i for (i, s) in enumerate(sectors(V)))
222-
codpos, dompos = map(position, codomain(W)), map(position, domain(W))
223-
rank((u₁, u₂)) = (reverse(map(getindex, dompos, u₂)), reverse(map(getindex, codpos, u₁)))
224-
us = collect(keys(groups))
225-
return map(i -> FusionTreeBlock(groups[us[i]]), sortperm(map(rank, us))) # each rank computed once
220+
# which runs fastest over its first space (the sectors of a dual space are sorted by their dual)
221+
key(V, s) = isdual(V) ? dual(s) : s
222+
rank((u₁, u₂)) = (reverse(map(key, domain(W).spaces, u₂)), reverse(map(key, codomain(W).spaces, u₁)))
223+
return map(u -> FusionTreeBlock(groups[u]), sort!(collect(keys(groups)); by = rank))
226224
end
227225

228226
function diagonalblockstructure(W::HomSpace)

0 commit comments

Comments
 (0)