Skip to content
37 changes: 35 additions & 2 deletions src/fusiontrees/manipulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,11 @@ const TransposeKey{I<:Sector, N₁, N₂} = Tuple{<:FusionTree{I}, <:FusionTree{
function _transpose((f1, f2, p1, p2)::TransposeKey{I,N₁,N₂}) where {I<:Sector, N₁, N₂}
N = N₁ + N₂
p = linearizepermutation(p1, p2, length(f1), length(f2))
newtrees = repartition(f1, f2, N₁)
length(p) == 0 && return newtrees
i1 = findfirst(==(1), p)
@assert i1 !== nothing
newtrees = repartition(f1, f2, N₁)
i1 == 1 && return newtrees
Nhalf = N >> 1
while 1 < i1 <= Nhalf
local newtrees′
Expand Down Expand Up @@ -766,7 +768,38 @@ function artin_braid(f::FusionTree{I, N}, i; inv::Bool = false) where {I<:Sector
inner = f.innerlines
vertices = f.vertices
u = one(I)
oneT = one(eltype(Rsymbol(u,u,u))) * one(eltype(Fsymbol(u,u,u,u,u,u)))

if BraidingStyle(I) isa NoBraiding
oneT = one(eltype(Fsymbol(u,u,u,u,u,u)))
else
oneT = one(eltype(Rsymbol(u,u,u))) * one(eltype(Fsymbol(u,u,u,u,u,u)))
end

if u in (uncoupled[i],uncoupled[i+1]) # the braid simplifies drastically, we are braiding a trivial sector
a, b = uncoupled[i], uncoupled[i+1]
uncoupled′ = TupleTools.setindex(uncoupled,b,i);
uncoupled′ = TupleTools.setindex(uncoupled′,a,i+1);
vertices′ = vertices;

if i > 1 #we also need to alter innerlines and vertices
incharges = (uncoupled[1],inner...,coupled′);

vertices′ = TupleTools.setindex(vertices′,vertices[i],i-1)
vertices′ = TupleTools.setindex(vertices′,vertices[i-1],i)

if a == u
inner = TupleTools.setindex(inner,incharges[i+1],i-1);
else
inner = TupleTools.setindex(inner,incharges[i-1],i-1);
end
end

f′ = FusionTree{I}(uncoupled′, coupled′, isdual′, inner, vertices′)
return fusiontreedict(I)(f′ => oneT)
end

BraidingStyle(I) isa NoBraiding && throw(SectorMismatch("cannot braid sector "*type_repr(I)))

Comment thread
maartenvd marked this conversation as resolved.
if i == 1
a, b = uncoupled[1], uncoupled[2]
c = N > 2 ? inner[1] : coupled′
Expand Down
Loading