@@ -24,7 +24,7 @@ Additionally, this test suite exports the following convenience testing utilitie
2424"""
2525module SectorTestSuite
2626
27- export smallset, randsector, hasfusiontensor
27+ export smallset, randsector, hasfusiontensor, F_unitarity_test
2828
2929using Test
3030using TestExtras
@@ -104,6 +104,32 @@ function hasfusiontensor(I::Type{<:Sector})
104104 end
105105end
106106
107+ """
108+ F_unitarity_test(a::I, b::I, c::I; kwargs...) where {I <: Sector}
109+
110+ Tests the unitarity of the F-symbols for the fusion of `a`, `b`, and `c`.
111+ Returns `true` if the F-symbols are unitary, and `false` otherwise.
112+ """
113+ function F_unitarity_test (a:: I , b:: I , c:: I ; kwargs... ) where {I <: Sector }
114+ for d in ⊗ (a, b, c)
115+ es = collect (intersect (⊗ (a, b), map (dual, ⊗ (c, dual (d)))))
116+ fs = collect (intersect (⊗ (b, c), map (dual, ⊗ (dual (d), a))))
117+ if FusionStyle (I) isa MultiplicityFreeFusion
118+ @assert length (es) == length (fs)
119+ F = [Fsymbol (a, b, c, d, e, f) for e in es, f in fs]
120+ else
121+ Fblocks = Vector {Any} ()
122+ for e in es, f in fs
123+ Fs = Fsymbol (a, b, c, d, e, f)
124+ push! (Fblocks, reshape (Fs, (size (Fs, 1 ) * size (Fs, 2 ), size (Fs, 3 ) * size (Fs, 4 ))))
125+ end
126+ F = hvcat (length (fs), Fblocks... )
127+ end
128+ isapprox (F' * F, one (F); kwargs... ) || return false
129+ end
130+ return true
131+ end
132+
107133include (" sectors.jl" )
108134
109135end # module SectorTestSuite
0 commit comments