Skip to content

Commit fe20365

Browse files
lkdvosclaude
andcommitted
Inline the single braid channel of a tree, and presize the row index of large blocks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 54b56d9 commit fe20365

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

‎src/fusiontrees/braiding_manipulations.jl‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function artin_braid(f::FusionTree{I, N}, i; inv::Bool = false) where {I, N}
6666
a = inner_extended[i - 1]
6767
c = inner_extended[i]
6868
e = inner_extended[i + 1]
69-
c′ = _artin_channel(a, b, d, e)
69+
c′ = only(_artin_channels(a, b, d, e))
7070
coeff = oftype(
7171
oneT,
7272
if inv
@@ -83,10 +83,6 @@ end
8383
# the inner lines `c′` of `a ⊗ d → c′ → c′ ⊗ b → e`, i.e. `intersect(a ⊗ d, e ⊗ conj(b))`,
8484
# without constructing the second fusion product
8585
_artin_channels(a, b, d, e) = Iterators.filter(c′ -> !iszero(Nsymbol(c′, b, e)), a ⊗ d)
86-
# the only such line, for a fusion tree that braids into a single one (`only` throws otherwise)
87-
_artin_channel(a, b, d, e) = _artin_channel(FusionStyle(a), a, b, d, e)
88-
_artin_channel(::UniqueFusion, a, b, d, e) = only(a ⊗ d)
89-
_artin_channel(::FusionStyle, a, b, d, e) = only(_artin_channels(a, b, d, e))
9086

9187
function artin_braid(src::FusionTreeBlock{I, N, 0}, i; inv::Bool = false) where {I, N}
9288
n = length(src) # braiding a complete block keeps its size

‎src/fusiontrees/fusiontrees.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ end
305305
function TreeRows(::Type{F}, n::Int) where {F}
306306
trees = sizehint!(Vector{F}(), n)
307307
K = Base.promote_op(treeindex_data, F)
308-
index = n > 32 ? Dict{K, Int}() : nothing
308+
index = n > 32 ? sizehint!(Dict{K, Int}(), n) : nothing
309309
return TreeRows{F, Dict{K, Int}}(trees, index, n)
310310
end
311311
function row!(rows::TreeRows, f)

0 commit comments

Comments
 (0)