|
1 | | -using .TestSetup: smallset, randsector, hasfusiontensor |
2 | | -using .SectorTestSuite: @testsuite |
3 | | -using TensorKitSectors |
4 | 1 | using TensorOperations |
5 | 2 | using LinearAlgebra |
6 | 3 |
|
|
55 | 52 | end |
56 | 53 | end |
57 | 54 |
|
58 | | -@testsuite "fusion tensor and F-move and R-move" I -> begin |
59 | | - if BraidingStyle(I) isa Bosonic && hasfusiontensor(I) |
60 | | - for a in smallset(I), b in smallset(I) |
61 | | - for c in ⊗(a, b) |
62 | | - X1 = permutedims(fusiontensor(a, b, c), (2, 1, 3, 4)) |
63 | | - X2 = fusiontensor(b, a, c) |
64 | | - l = dim(a) * dim(b) * dim(c) |
65 | | - R = LinearAlgebra.transpose(Rsymbol(a, b, c)) |
66 | | - sz = (l, convert(Int, Nsymbol(a, b, c))) |
67 | | - @test reshape(X1, sz) ≈ reshape(X2, sz) * R |
68 | | - end |
69 | | - end |
70 | | - for a in smallset(I), b in smallset(I), c in smallset(I) |
71 | | - for e in ⊗(a, b), f in ⊗(b, c) |
72 | | - for d in intersect(⊗(e, c), ⊗(a, f)) |
73 | | - X1 = fusiontensor(a, b, e) |
74 | | - X2 = fusiontensor(e, c, d) |
75 | | - Y1 = fusiontensor(b, c, f) |
76 | | - Y2 = fusiontensor(a, f, d) |
77 | | - @tensor f1[-1, -2, -3, -4] := conj(Y2[a, f, d, -4]) * |
78 | | - conj(Y1[b, c, f, -3]) * X1[a, b, e, -1] * X2[e, c, d, -2] |
79 | | - if FusionStyle(I) isa MultiplicityFreeFusion |
80 | | - f2 = fill(Fsymbol(a, b, c, d, e, f) * dim(d), (1, 1, 1, 1)) |
81 | | - else |
82 | | - f2 = Fsymbol(a, b, c, d, e, f) * dim(d) |
83 | | - end |
84 | | - @test isapprox(f1, f2; atol = 1.0e-12, rtol = 1.0e-12) |
| 55 | +@testsuite "fusion tensor and F-move" I -> begin |
| 56 | + (BraidingStyle(I) isa Bosonic && hasfusiontensor(I)) || return nothing |
| 57 | + for a in smallset(I), b in smallset(I), c in smallset(I) |
| 58 | + for e in ⊗(a, b), f in ⊗(b, c) |
| 59 | + for d in intersect(⊗(e, c), ⊗(a, f)) |
| 60 | + X1 = fusiontensor(a, b, e) |
| 61 | + X2 = fusiontensor(e, c, d) |
| 62 | + Y1 = fusiontensor(b, c, f) |
| 63 | + Y2 = fusiontensor(a, f, d) |
| 64 | + @tensor f1[-1, -2, -3, -4] := conj(Y2[a, f, d, -4]) * |
| 65 | + conj(Y1[b, c, f, -3]) * X1[a, b, e, -1] * X2[e, c, d, -2] |
| 66 | + if FusionStyle(I) isa MultiplicityFreeFusion |
| 67 | + f2 = fill(Fsymbol(a, b, c, d, e, f) * dim(d), (1, 1, 1, 1)) |
| 68 | + else |
| 69 | + f2 = Fsymbol(a, b, c, d, e, f) * dim(d) |
85 | 70 | end |
| 71 | + @test isapprox(f1, f2; atol = 1.0e-12, rtol = 1.0e-12) |
86 | 72 | end |
87 | 73 | end |
88 | 74 | end |
89 | 75 | end |
90 | 76 |
|
| 77 | +@testsuite "fusion tensor and F-move and R-move" I -> begin |
| 78 | + (BraidingStyle(I) isa Bosonic && hasfusiontensor(I)) || return nothing |
| 79 | + for a in smallset(I), b in smallset(I) |
| 80 | + for c in ⊗(a, b) |
| 81 | + X1 = permutedims(fusiontensor(a, b, c), (2, 1, 3, 4)) |
| 82 | + X2 = fusiontensor(b, a, c) |
| 83 | + l = dim(a) * dim(b) * dim(c) |
| 84 | + R = LinearAlgebra.transpose(Rsymbol(a, b, c)) |
| 85 | + sz = (l, convert(Int, Nsymbol(a, b, c))) |
| 86 | + @test reshape(X1, sz) ≈ reshape(X2, sz) * R |
| 87 | + end |
| 88 | + end |
| 89 | +end |
| 90 | + |
91 | 91 | @testsuite "Orthogonality of fusiontensors" I -> begin |
92 | | - if hasfusiontensor(I) |
93 | | - for a in smallset(I), b in smallset(I) |
94 | | - cs = vec(collect(a ⊗ b)) |
95 | | - CGCs = map(c -> reshape(fusiontensor(a, b, c), :, dim(c)), cs) |
96 | | - M = map(Iterators.product(CGCs, CGCs)) do (cgc1, cgc2) |
97 | | - return LinearAlgebra.norm(cgc1' * cgc2) |
98 | | - end |
99 | | - @test isapprox(M' * M, LinearAlgebra.Diagonal(dim.(cs)); atol = 1.0e-12) |
| 92 | + hasfusiontensor(I) || return nothing |
| 93 | + for a in smallset(I), b in smallset(I) |
| 94 | + cs = vec(collect(a ⊗ b)) |
| 95 | + CGCs = map(c -> reshape(fusiontensor(a, b, c), :, dim(c)), cs) |
| 96 | + M = map(Iterators.product(CGCs, CGCs)) do (cgc1, cgc2) |
| 97 | + return LinearAlgebra.norm(cgc1' * cgc2) |
100 | 98 | end |
| 99 | + @test isapprox(M' * M, LinearAlgebra.Diagonal(dim.(cs)); atol = 1.0e-12) |
101 | 100 | end |
102 | 101 | end |
103 | 102 |
|
|
135 | 134 | end |
136 | 135 |
|
137 | 136 | @testsuite "Hexagon equation" I -> begin |
138 | | - if BraidingStyle(I) isa HasBraiding |
139 | | - for a in smallset(I), b in smallset(I), c in smallset(I) |
140 | | - @test hexagon_equation(a, b, c; atol = 1.0e-12, rtol = 1.0e-12) |
141 | | - end |
| 137 | + BraidingStyle(I) isa HasBraiding || return nothing |
| 138 | + for a in smallset(I), b in smallset(I), c in smallset(I) |
| 139 | + @test hexagon_equation(a, b, c; atol = 1.0e-12, rtol = 1.0e-12) |
142 | 140 | end |
143 | 141 | end |
0 commit comments