Skip to content

Commit ee71ed8

Browse files
committed
add the other unitarity tests
1 parent 8afa784 commit ee71ed8

File tree

1 file changed

+78
-7
lines changed

1 file changed

+78
-7
lines changed

test/test_A4.jl

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,74 @@ for i in 1:7, j in 1:7 # M x Mop x M -> M (or Mop x M x Mop -> Mop)
141141
@testset "$Istr Module category $i,$j and opposite $j,$i" begin
142142
M_objects = I.(i, j, MultiTensorKit._get_dual_cache(I)[2][i, j])
143143
Mop_objects = I.(j, i, MultiTensorKit._get_dual_cache(I)[2][j, i])
144-
C_objects = I.(i, i, MultiTensorKit._get_dual_cache(I)[2][i,i])
144+
C_objects = I.(i, i, MultiTensorKit._get_dual_cache(I)[2][i, i])
145145
D_objects = I.(j, j, MultiTensorKit._get_dual_cache(I)[2][j, j])
146146

147+
@testset "Unitarity of mixed module F-move I" begin # written for C x M x Mop -> C but also holds for D x Mop x M -> D
148+
for α in C_objects, A in M_objects, Aop in Mop_objects
149+
for β in (α, A, Aop)
150+
Cs = collect(intersect((α, A), map(dual, (Aop, dual(β))))) # equivalent of es
151+
γs = collect(intersect((Aop, A), map(dual, (dual(β), α)))) # equivalent of fs
152+
Fblocks = Vector{Any}()
153+
for C in Cs
154+
for γ in γs
155+
Fs = Fsymbol(α, A, Aop, β, C, γ)
156+
push!(Fblocks,
157+
reshape(Fs,
158+
(size(Fs, 1) * size(Fs, 2),
159+
size(Fs, 3) * size(Fs, 4))))
160+
end
161+
end
162+
F = hvcat(length(γs), Fblocks...)
163+
@test isapprox(F' * F, one(F); atol=1e-12, rtol=1e-12)
164+
end
165+
end
166+
end
167+
168+
@testset "Unitarity of mixed module F-move II" begin # written for M x Mop x C -> C but also holds for Mop x M x D -> D
169+
for A in M_objects, Aop in Mop_objects, α in C_objects
170+
for β in (A, Aop, α)
171+
γs = collect(intersect((A, Aop), map(dual, (α, dual(β))))) # equivalent of es
172+
Bops = collect(intersect((Aop, α), map(dual, (dual(β), A)))) # equivalent of fs
173+
Fblocks = Vector{Any}()
174+
for γ in γs
175+
for Bop in Bops
176+
Fs = Fsymbol(A, Aop, α, β, γ, Bop)
177+
push!(Fblocks,
178+
reshape(Fs,
179+
(size(Fs, 1) * size(Fs, 2),
180+
size(Fs, 3) * size(Fs, 4))))
181+
end
182+
end
183+
F = hvcat(length(Bops), Fblocks...)
184+
@test isapprox(F' * F, one(F); atol=1e-12, rtol=1e-12)
185+
end
186+
end
187+
end
188+
189+
@testset "Unitarity of mixed module F-move III" begin # written for Mop x C x M -> D, but also holds for M x D x Mop -> C
190+
for Aop in Mop_objects, α in C_objects, A in M_objects
191+
for a in (Aop, α, A)
192+
Bops = collect(intersect((Aop, α), map(dual, (A, dual(a))))) # equivalent of es
193+
Bs = collect(intersect((α, A), map(dual, (dual(a), Aop)))) # equivalent of fs
194+
Fblocks = Vector{Any}()
195+
for Bop in Bops
196+
for B in Bs
197+
Fs = Fsymbol(Aop, α, A, a, Bop, B)
198+
push!(Fblocks,
199+
reshape(Fs,
200+
(size(Fs, 1) * size(Fs, 2),
201+
size(Fs, 3) * size(Fs, 4))))
202+
end
203+
end
204+
F = hvcat(length(Bs), Fblocks...)
205+
@test isapprox(F' * F, one(F); atol=1e-12, rtol=1e-12)
206+
end
207+
end
208+
end
209+
147210
@testset "Unitarity of pure module F-move" begin
148-
for A in M_objects, Aop in Mop_objects, B in M_objects # written for M x Mop x M -> M
211+
for A in M_objects, Aop in Mop_objects, B in M_objects # written for M x Mop x M -> M but also holds for Mop x M x Mop -> Mop
149212
for C in (A, Aop, B)
150213
cs = collect(intersect((A, Aop), map(dual, (B, dual(C))))) # equivalent of es
151214
γs = collect(intersect((Aop, B), map(dual, (dual(C), A)))) # equivalent of fs
@@ -154,9 +217,9 @@ for i in 1:7, j in 1:7 # M x Mop x M -> M (or Mop x M x Mop -> Mop)
154217
for γ in γs
155218
Fs = Fsymbol(A, Aop, B, C, c, γ)
156219
push!(Fblocks,
157-
reshape(Fs,
158-
(size(Fs, 1) * size(Fs, 2),
159-
size(Fs, 3) * size(Fs, 4))))
220+
reshape(Fs,
221+
(size(Fs, 1) * size(Fs, 2),
222+
size(Fs, 3) * size(Fs, 4))))
160223
end
161224
end
162225
F = hvcat(length(γs), Fblocks...)
@@ -165,7 +228,15 @@ for i in 1:7, j in 1:7 # M x Mop x M -> M (or Mop x M x Mop -> Mop)
165228
end
166229
end
167230
end
168-
end
231+
end
232+
233+
@testset "Triangle equation" begin
234+
objects = collect(values(I))
235+
for a in objects, b in objects
236+
a.j == b.i || continue # skip if not compatible
237+
@test triangle_equation(a, b; atol=1e-12, rtol=1e-12)
238+
end
239+
end
169240

170241
@testset "$Istr Pentagon equation" begin
171242
objects = collect(values(I))
@@ -233,4 +304,4 @@ end
233304
end
234305
@test @constinferred(removeunit(t2, $(numind(t2)))) == t
235306
end
236-
end
307+
end

0 commit comments

Comments
 (0)