936936
937937# braid fusion tree
938938"""
939- braid(f::FusionTree{<:Sector, N}, levels ::NTuple{N, Int}, p ::NTuple{N, Int})
939+ braid(f::FusionTree{<:Sector, N}, p ::NTuple{N, Int}, levels ::NTuple{N, Int})
940940 -> <:AbstractDict{typeof(t), <:Number}
941941
942942Perform a braiding of the uncoupled indices of the fusion tree `f` and return the result as
@@ -949,7 +949,7 @@ that if `i` and `j` cross, ``τ_{i,j}`` is applied if `levels[i] < levels[j]` an
949949``τ_{j,i}^{-1}`` if `levels[i] > levels[j]`. This does not allow to encode the most general
950950braid, but a general braid can be obtained by combining such operations.
951951"""
952- function braid (f:: FusionTree{I,N} , levels :: NTuple{N,Int} , p :: NTuple{N,Int} ) where {I,N}
952+ function braid (f:: FusionTree{I,N} , p :: NTuple{N,Int} , levels :: NTuple{N,Int} ) where {I,N}
953953 TupleTools. isperm (p) || throw (ArgumentError (" not a valid permutation: $p " ))
954954 if FusionStyle (I) isa UniqueFusion && BraidingStyle (I) isa SymmetricBraiding
955955 coeff = one (sectorscalartype (I))
@@ -998,13 +998,13 @@ as a `<:AbstractDict` of output trees and corresponding coefficients; this requi
998998"""
999999function permute (f:: FusionTree{I,N} , p:: NTuple{N,Int} ) where {I,N}
10001000 @assert BraidingStyle (I) isa SymmetricBraiding
1001- return braid (f, ntuple (identity, Val (N)), p )
1001+ return braid (f, p, ntuple (identity, Val (N)))
10021002end
10031003
10041004# braid double fusion tree
10051005"""
1006- braid((f₁, f₂)::FusionTreePair{I}, (levels1, levels2 )::Index2Tuple,
1007- (p1, p2 )::Index2Tuple{N₁, N₂} ) where {I, N₁, N₂}
1006+ braid((f₁, f₂)::FusionTreePair{I}, (p1, p2 )::Index2Tuple{N₁,N₂} ,
1007+ (levels1, levels2 )::Index2Tuple) where {I,N₁,N₂}
10081008 -> <:AbstractDict{<:FusionTreePair{I, N₁, N₂}}, <:Number}
10091009
10101010Input is a fusion-splitting tree pair that describes the fusion of a set of incoming
@@ -1019,22 +1019,22 @@ respectively, which determines how indices braid. In particular, if `i` and `j`
10191019levels[j]`. This does not allow to encode the most general braid, but a general braid can
10201020be obtained by combining such operations.
10211021"""
1022- function braid ((f₁, f₂):: FusionTreePair{I} , (levels1, levels2 ):: Index2Tuple ,
1023- (p1, p2 ):: Index2Tuple{N₁,N₂} ) where {I,N₁,N₂}
1022+ function braid ((f₁, f₂):: FusionTreePair{I} , (p1, p2 ):: Index2Tuple{N₁,N₂} ,
1023+ (levels1, levels2 ):: Index2Tuple ) where {I,N₁,N₂}
10241024 @assert length (f₁) + length (f₂) == N₁ + N₂
10251025 @assert length (f₁) == length (levels1) && length (f₂) == length (levels2)
10261026 @assert TupleTools. isperm ((p1... , p2... ))
1027- return fsbraid (((f₁, f₂), (levels1, levels2 ), (p1, p2 )))
1027+ return fsbraid (((f₁, f₂), (p1, p2 ), (levels1, levels2 )))
10281028end
1029- const FSBraidKey{I,N₁,N₂} = Tuple{<: FusionTreePair{I} ,Index2Tuple,Index2Tuple {N₁,N₂}}
1029+ const FSBraidKey{I,N₁,N₂} = Tuple{<: FusionTreePair{I} ,Index2Tuple{N₁,N₂},Index2Tuple }
10301030
10311031@cached function fsbraid (key:: FSBraidKey{I,N₁,N₂} ):: _fsdicttype (I, N₁, N₂) where {I,N₁,N₂}
1032- ((f₁, f₂), (l1, l2 ), (p1, p2 )) = key
1032+ ((f₁, f₂), (p1, p2 ), (l1, l2 )) = key
10331033 p = linearizepermutation (p1, p2, length (f₁), length (f₂))
10341034 levels = (l1... , reverse (l2)... )
10351035 local newtrees
10361036 for ((f, f0), coeff1) in repartition ((f₁, f₂), N₁ + N₂)
1037- for (f′, coeff2) in braid (f, levels, p )
1037+ for (f′, coeff2) in braid (f, p, levels )
10381038 for ((f₁′, f₂′), coeff3) in repartition ((f′, f0), N₁)
10391039 if @isdefined newtrees
10401040 newtrees[(f₁′, f₂′)] = get (newtrees, (f₁′, f₂′), zero (coeff3)) +
@@ -1067,9 +1067,9 @@ outgoing (`t1`) and incoming sectors (`t2`) respectively (with identical coupled
10671067repartitioning and permuting the tree such that sectors `p1` become outgoing and sectors
10681068`p2` become incoming.
10691069"""
1070- function permute ((f₁, f₂):: FusionTreePair{I} , (p1, p2):: Index2Tuple{N₁, N₂} ) where {I, N₁, N₂}
1070+ function permute ((f₁, f₂):: FusionTreePair{I} , (p1, p2):: Index2Tuple{N₁,N₂} ) where {I,N₁,N₂}
10711071 @assert BraidingStyle (I) isa SymmetricBraiding
10721072 levels1 = ntuple (identity, length (f₁))
10731073 levels2 = length (f₁) .+ ntuple (identity, length (f₂))
1074- return braid ((f₁, f₂), (levels1, levels2 ), (p1, p2 ))
1074+ return braid ((f₁, f₂), (p1, p2 ), (levels1, levels2 ))
10751075end
0 commit comments