Skip to content

Commit

Permalink
Add Object{E6} to testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Oct 4, 2023
1 parent b31c685 commit 34cf39f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
7 changes: 2 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@ WignerSymbols = "1,2"
julia = "1.6"

[extras]
CategoryData = "8fccf25a-f50e-468c-8fba-3cb130506274"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
HalfIntegers = "f0d1745a-41c9-11e9-1dd9-e5d34d218721"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestExtras = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"
WignerSymbols = "9f57e263-0b3d-5e2e-b1be-24f2bb48858b"

[targets]
test = ["Combinatorics", "HalfIntegers", "LinearAlgebra", "Random", "TensorOperations", "Test", "TestExtras", "WignerSymbols", "ChainRulesCore", "ChainRulesTestUtils", "FiniteDifferences"]
test = ["Combinatorics", "Random", "Test", "TestExtras", "ChainRulesCore", "ChainRulesTestUtils", "FiniteDifferences", "CategoryData"]
8 changes: 4 additions & 4 deletions test/fusiontrees.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ include("utility.jl")
@test c′ == one(c′)
return t′
end
BraidingStyle(I) isa NoBraiding && continue
braid_i_to_1 = braid(f1, levels, (i, (1:(i - 1))..., ((i + 1):N)...))
trees2 = Dict(_reinsert_partial_tree(t, f2) => c for (t, c) in braid_i_to_1)
trees3 = empty(trees2)
Expand Down Expand Up @@ -175,7 +176,7 @@ include("utility.jl")
end
end
end
@testset "elementy artin braid" begin
BraidingStyle(I) isa NoBraiding || @testset "elementy artin braid" begin
N = length(out)
isdual = ntuple(n -> rand(Bool), N)
for in in (out...)
Expand Down Expand Up @@ -231,7 +232,7 @@ include("utility.jl")
end
end
end
@testset "braiding and permuting" begin
BraidingStyle(I) isa NoBraiding || @testset "braiding and permuting" begin
f = rand(collect(fusiontrees(out, in, isdual)))
p = tuple(randperm(N)...)
ip = invperm(p)
Expand Down Expand Up @@ -281,8 +282,7 @@ include("utility.jl")
@test dim(in1) * dim(in2) sum(abs2(coeff) * dim(c) for c in in1 in2
for μ in 1:Nsymbol(in1, in2, c)
for (f, coeff) in TensorKit.merge(f1, f2, c, μ))

for c in in1 in2
BraidingStyle(I) isa NoBraiding || for c in in1 in2
R = Rsymbol(in1, in2, c)
for μ in 1:Nsymbol(in1, in2, c)
μ′ = FusionStyle(I) isa GenericFusion ? μ : nothing
Expand Down
31 changes: 17 additions & 14 deletions test/sectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include("utility.jl")
@constinferred dim(s[1])
@constinferred frobeniusschur(s[1])
@constinferred Nsymbol(s...)
@constinferred Rsymbol(s...)
BraidingStyle(I) isa NoBraiding || @constinferred Rsymbol(s...)
@constinferred Bsymbol(s...)
@constinferred Fsymbol(s..., s...)
it = @constinferred s[1] s[2]
Expand Down Expand Up @@ -82,9 +82,11 @@ include("utility.jl")
@test pentagon_equation(a, b, c, d; atol=1e-12, rtol=1e-12)
end
end
@testset "Hexagon equation" begin
for a in smallset(I), b in smallset(I), c in smallset(I)
@test hexagon_equation(a, b, c; atol=1e-12, rtol=1e-12)
if !(BraidingStyle(I) isa NoBraiding)
@testset "Hexagon equation" begin
for a in smallset(I), b in smallset(I), c in smallset(I)
@test hexagon_equation(a, b, c; atol=1e-12, rtol=1e-12)
end
end
end

Expand All @@ -110,16 +112,17 @@ include("utility.jl")
end
end
end

@testset "Fusion tensor and R-move" begin
for a in smallset(I), b in smallset(I)
for c in (a, b)
X1 = permutedims(fusiontensor(a, b, c), (2, 1, 3, 4))
X2 = fusiontensor(b, a, c)
l = dim(a) * dim(b) * dim(c)
R = LinearAlgebra.transpose(Rsymbol(a, b, c))
sz = (l, convert(Int, Nsymbol(a, b, c)))
@test reshape(X1, sz) reshape(X2, sz) * R
if !(BraidingStyle(I) isa NoBraiding)
@testset "Fusion tensor and R-move" begin
for a in smallset(I), b in smallset(I)
for c in (a, b)
X1 = permutedims(fusiontensor(a, b, c), (2, 1, 3, 4))
X2 = fusiontensor(b, a, c)
l = dim(a) * dim(b) * dim(c)
R = LinearAlgebra.transpose(Rsymbol(a, b, c))
sz = (l, convert(Int, Nsymbol(a, b, c)))
@test reshape(X1, sz) reshape(X2, sz) * R
end
end
end
end
Expand Down
13 changes: 10 additions & 3 deletions test/utility.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Base.Iterators: take, product
using TensorKit
using TensorKit: ProductSector, Trivial, fusiontensor
using TensorKit: pentagon_equation, hexagon_equation
using TensorKit: pentagon_equation, hexagon_equation, NoBraiding
using TensorOperations
using Test, TestExtras
using Random
using LinearAlgebra: LinearAlgebra
using Combinatorics
using CategoryData

Random.seed!(1234)

Expand All @@ -18,7 +19,7 @@ sectorlist = (Z2Irrep, Z3Irrep, Z4Irrep, U1Irrep, CU1Irrep, SU2Irrep, NewSU2Irre
FibonacciAnyon, IsingAnyon, FermionParity, FermionNumber, FermionSpin,
Z3Irrep Z4Irrep, FermionParity U1Irrep SU2Irrep,
FermionParity SU2Irrep SU2Irrep, NewSU2Irrep NewSU2Irrep,
Z2Irrep FibonacciAnyon FibonacciAnyon)
Z2Irrep FibonacciAnyon FibonacciAnyon, Object{E6})

spacelist = Dict(Trivial => (ℂ^3, (ℂ^4)', ℂ^5, ℂ^6, (ℂ^7)'),
Z2Irrep => (ℂ[Z2Irrep](0 => 1, 1 => 1), ℂ[Z2Irrep](0 => 1, 1 => 2)',
Expand Down Expand Up @@ -57,7 +58,13 @@ spacelist = Dict(Trivial => (ℂ^3, (ℂ^4)', ℂ^5, ℂ^6, (ℂ^7)'),
ℂ[FermionSpin](0 => 2, 1 => 1),
ℂ[FermionSpin](1 // 2 => 1, 1 => 1)',
ℂ[FermionSpin](0 => 2, 1 // 2 => 2),
ℂ[FermionSpin](0 => 1, 1 // 2 => 1, 3 // 2 => 1)'))
ℂ[FermionSpin](0 => 1, 1 // 2 => 1, 3 // 2 => 1)'),
Object{E6} => (ℂ[Object{E6}](1 => 1, 3 => 1),
ℂ[Object{E6}](2 => 1, 3 => 1)',
ℂ[Object{E6}](1 => 1, 3 => 1),
ℂ[Object{E6}](1 => 1, 3 => 1),
ℂ[Object{E6}](1 => 1, 2 => 1, 3 => 1)'
))

smallset(::Type{I}) where {I<:Sector} = take(values(I), 5)
function smallset(::Type{ProductSector{Tuple{I1,I2}}}) where {I1,I2}
Expand Down

0 comments on commit 34cf39f

Please sign in to comment.