@@ -17,7 +17,7 @@ function insertat(f₁::FusionTree{I}, i::Int, f₂::FusionTree{I,0}) where {I}
1717 # this actually removes uncoupled line i, which should be trivial
1818 (f₁. uncoupled[i] == f₂. coupled && ! f₁. isdual[i]) ||
1919 throw (SectorMismatch (" cannot connect $(f₂. uncoupled) to $(f₁. uncoupled[i]) " ))
20- coeff = Fsymbol ( one (I), one (I), one (I), one (I), one (I), one (I))[ 1 , 1 , 1 , 1 ]
20+ coeff = one (sectorscalartype (I))
2121
2222 uncoupled = TupleTools. deleteat (f₁. uncoupled, i)
2323 coupled = f₁. coupled
@@ -39,7 +39,7 @@ function insertat(f₁::FusionTree{I}, i, f₂::FusionTree{I,1}) where {I}
3939 # identity operation
4040 (f₁. uncoupled[i] == f₂. coupled && ! f₁. isdual[i]) ||
4141 throw (SectorMismatch (" cannot connect $(f₂. uncoupled) to $(f₁. uncoupled[i]) " ))
42- coeff = Fsymbol ( one (I), one (I), one (I), one (I), one (I), one (I))[ 1 , 1 , 1 , 1 ]
42+ coeff = one (sectorscalartype (I))
4343 isdual′ = TupleTools. setindex (f₁. isdual, f₂. isdual[1 ], i)
4444 f = FusionTree {I} (f₁. uncoupled, f₁. coupled, isdual′, f₁. innerlines, f₁. vertices)
4545 return fusiontreedict (I)(f => coeff)
@@ -59,7 +59,7 @@ function insertat(f₁::FusionTree{I}, i, f₂::FusionTree{I,2}) where {I}
5959 isdual′ = (isdualb, isdualc, tail (isdual)... )
6060 inner′ = (uncoupled[1 ], inner... )
6161 vertices′ = (f₂. vertices... , f₁. vertices... )
62- coeff = Fsymbol ( one (I), one (I), one (I), one (I), one (I), one (I))[ 1 , 1 , 1 , 1 ]
62+ coeff = one (sectorscalartype (I))
6363 f′ = FusionTree (uncoupled′, coupled, isdual′, inner′, vertices′)
6464 return fusiontreedict (I)(f′ => coeff)
6565 end
@@ -110,8 +110,8 @@ function insertat(f₁::FusionTree{I,N₁}, i, f₂::FusionTree{I,N₂}) where {
110110 F = fusiontreetype (I, N₁ + N₂ - 1 )
111111 (f₁. uncoupled[i] == f₂. coupled && ! f₁. isdual[i]) ||
112112 throw (SectorMismatch (" cannot connect $(f₂. uncoupled) to $(f₁. uncoupled[i]) " ))
113- coeff = Fsymbol ( one (I), one (I), one (I), one (I), one (I), one (I))[ 1 , 1 ]
114- T = typeof (coeff )
113+ T = sectorscalartype (I)
114+ coeff = one (T )
115115 if length (f₁) == 1
116116 return fusiontreedict (I){F,T}(f₂ => coeff)
117117 end
@@ -457,8 +457,8 @@ function _recursive_repartition(f₁::FusionTree{I,N₁},
457457 # precompute the parameters of the return type
458458 F₁ = fusiontreetype (I, N)
459459 F₂ = fusiontreetype (I, N₁ + N₂ - N)
460- coeff = @inbounds Fsymbol ( one (I), one (I), one (I), one (I), one (I), one (I))[ 1 , 1 , 1 , 1 ]
461- T = typeof (coeff )
460+ T = sectorscalartype (I)
461+ coeff = one (T )
462462 if N == N₁
463463 return fusiontreedict (I){Tuple{F₁,F₂},T}((f₁, f₂) => coeff)
464464 else
@@ -500,8 +500,7 @@ function Base.transpose(f₁::FusionTree{I}, f₂::FusionTree{I},
500500 p = linearizepermutation (p1, p2, length (f₁), length (f₂))
501501 @assert iscyclicpermutation (p)
502502 if usetransposecache[]
503- u = one (I)
504- T = eltype (Fsymbol (u, u, u, u, u, u))
503+ T = sectorscalartype (I)
505504 F₁ = fusiontreetype (I, N₁)
506505 F₂ = fusiontreetype (I, N₂)
507506 D = fusiontreedict (I){Tuple{F₁,F₂},T}
@@ -587,8 +586,7 @@ function planar_trace(f₁::FusionTree{I}, f₂::FusionTree{I},
587586 map (l -> l - count (l .> q′), TupleTools. getindices (linearindex, p2)))
588587 end
589588
590- u = one (I)
591- T = typeof (Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ])
589+ T = sectorscalartype (I)
592590 F₁ = fusiontreetype (I, N₁)
593591 F₂ = fusiontreetype (I, N₂)
594592 newtrees = FusionTreeDict {Tuple{F₁,F₂},T} ()
@@ -615,8 +613,7 @@ of output trees and corresponding coefficients.
615613"""
616614function planar_trace (f:: FusionTree{I,N} ,
617615 q1:: IndexTuple{N₃} , q2:: IndexTuple{N₃} ) where {I<: Sector ,N,N₃}
618- u = one (I)
619- T = typeof (Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ])
616+ T = sectorscalartype (I)
620617 F = fusiontreetype (I, N - 2 * N₃)
621618 newtrees = FusionTreeDict {F,T} ()
622619 N₃ === 0 && return push! (newtrees, f => one (T))
@@ -673,8 +670,7 @@ function elementary_trace(f::FusionTree{I,N}, i) where {I<:Sector,N}
673670 i < N || f. coupled == one (I) ||
674671 throw (ArgumentError (" Cannot trace outputs i=$N and 1 of fusion tree that couples to non-trivial sector" ))
675672
676- u = one (I)
677- T = typeof (Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ])
673+ T = sectorscalartype (I)
678674 F = fusiontreetype (I, N - 2 )
679675 newtrees = FusionTreeDict {F,T} ()
680676
@@ -786,12 +782,7 @@ function artin_braid(f::FusionTree{I,N}, i; inv::Bool=false) where {I<:Sector,N}
786782 inner_extended = (uncoupled[1 ], inner... , coupled′)
787783 vertices = f. vertices
788784 u = one (I)
789-
790- if BraidingStyle (I) isa NoBraiding
791- oneT = Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ]
792- else
793- oneT = Rsymbol (u, u, u)[1 , 1 ] * Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ]
794- end
785+ oneT = one (sectorscalartype (I))
795786
796787 if u in (uncoupled[i], uncoupled[i + 1 ])
797788 # braiding with trivial sector: simple and always possible
@@ -925,7 +916,7 @@ function braid(f::FusionTree{I,N},
925916 p:: NTuple{N,Int} ) where {I<: Sector ,N}
926917 TupleTools. isperm (p) || throw (ArgumentError (" not a valid permutation: $p " ))
927918 if FusionStyle (I) isa UniqueFusion && BraidingStyle (I) isa SymmetricBraiding
928- coeff = Rsymbol ( one (I), one (I), one (I))
919+ coeff = one (sectorscalartype (I))
929920 for i in 1 : N
930921 for j in 1 : (i - 1 )
931922 if p[j] > p[i]
@@ -940,10 +931,7 @@ function braid(f::FusionTree{I,N},
940931 f′ = FusionTree {I} (uncoupled′, coupled′, isdual′)
941932 return fusiontreedict (I)(f′ => coeff)
942933 else
943- u = one (I)
944- T = BraidingStyle (I) isa NoBraiding ?
945- typeof (Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ]) :
946- typeof (Rsymbol (u, u, u)[1 , 1 ] * Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ])
934+ T = sectorscalartype (I)
947935 coeff = one (T)
948936 trees = FusionTreeDict (f => coeff)
949937 newtrees = empty (trees)
@@ -1009,8 +997,7 @@ function braid(f₁::FusionTree{I}, f₂::FusionTree{I},
1009997 if FusionStyle (f₁) isa UniqueFusion &&
1010998 BraidingStyle (f₁) isa SymmetricBraiding
1011999 if usebraidcache_abelian[]
1012- u = one (I)
1013- T = Int
1000+ T = Int # do we hardcode this ?
10141001 F₁ = fusiontreetype (I, N₁)
10151002 F₂ = fusiontreetype (I, N₂)
10161003 D = SingletonDict{Tuple{F₁,F₂},T}
@@ -1020,11 +1007,7 @@ function braid(f₁::FusionTree{I}, f₂::FusionTree{I},
10201007 end
10211008 else
10221009 if usebraidcache_nonabelian[]
1023- u = one (I)
1024- T = BraidingStyle (I) isa NoBraiding ?
1025- typeof (Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ]) :
1026- typeof (sqrtdim (u) * Fsymbol (u, u, u, u, u, u)[1 , 1 , 1 , 1 ] *
1027- Rsymbol (u, u, u)[1 , 1 ])
1010+ T = sectorscalartype (I)
10281011 F₁ = fusiontreetype (I, N₁)
10291012 F₂ = fusiontreetype (I, N₂)
10301013 D = FusionTreeDict{Tuple{F₁,F₂},T}
0 commit comments