Skip to content

Commit 243f271

Browse files
committed
twisting a trivial sector is simple and always allowed
1 parent ec7ee9d commit 243f271

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/tensors/indexmanipulations.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ function twist!(t::AbstractTensorMap, is; inv::Bool=false)
272272
throw(ArgumentError(msg))
273273
end
274274
(BraidingStyle(sectortype(t)) == Bosonic() || isempty(is)) && return t
275+
if BraidingStyle(sectortype(t)) == NoBraiding()
276+
for i in is
277+
cs = sectors(space(t, i))
278+
all(isone, cs) || throw(SectorMismatch(lazy"Cannot twist sectors $cs"))
279+
end
280+
return t
281+
end
275282
N₁ = numout(t)
276283
for (f₁, f₂) in fusiontrees(t)
277284
θ = prod(i -> i <= N₁ ? twist(f₁.uncoupled[i]) : twist(f₂.uncoupled[i - N₁]), is)

0 commit comments

Comments
 (0)