Skip to content

Commit 4161514

Browse files
authored
Merge branch 'main' into bd/printing
2 parents b1cb2da + a90386c commit 4161514

9 files changed

Lines changed: 44 additions & 23 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
*.jl.cov
33
*.jl.mem
44
Manifest.toml
5+
.vscode/
56
.DS_Store
67
build

src/fermions.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ twist(a::FermionParity) = a.isodd ? -1 : +1
5555

5656
function fusiontensor(a::I, b::I, c::I) where {I <: FermionParity}
5757
@warn "FermionParity Arrays do not preserve categorical properties." maxlog = 1
58-
return fill(Int(Nsymbol(a, b, c)), (1, 1, 1, 1))
58+
Nabc = Nsymbol(a, b, c)
59+
return fill(Int(Nabc), (1, 1, 1, Nabc))
5960
end
6061

6162
function Base.show(io::IO, a::FermionParity)

src/irreps/cu1irrep.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ function Rsymbol(a::CU1Irrep, b::CU1Irrep, c::CU1Irrep)
218218
end
219219

220220
function fusiontensor(a::CU1Irrep, b::CU1Irrep, c::CU1Irrep)
221-
C = fill(zero(sectorscalartype(CU1Irrep)), dim(a), dim(b), dim(c), 1)
222-
!Nsymbol(a, b, c) && return C
221+
Nabc = Nsymbol(a, b, c)
222+
C = fill(zero(sectorscalartype(CU1Irrep)), dim(a), dim(b), dim(c), Nabc)
223+
Nabc || return C
223224
if c.j == 0
224225
if a.j == b.j == 0
225226
C[1, 1, 1, 1] = 1.0

src/irreps/dnirrep.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ end
198198

199199
function fusiontensor(a::I, b::I, c::I) where {N, I <: DNIrrep{N}}
200200
T = sectorscalartype(I)
201-
C = zeros(T, dim(a), dim(b), dim(c), 1)
202-
Nsymbol(a, b, c) || return C
201+
Nabc = Nsymbol(a, b, c)
202+
C = zeros(T, dim(a), dim(b), dim(c), Nabc)
203+
Nabc || return C
203204

204205
if c.j == 0
205206
if a.j == b.j == 0 || (2 * a.j == 2 * b.j == N)

src/irreps/irreps.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ Rsymbol(a::I, b::I, c::I) where {I <: AbelianIrrep} = braidingscalartype(I)(Nsym
6666

6767
function fusiontensor(a::I, b::I, c::I) where {I <: AbelianIrrep}
6868
T = sectorscalartype(I)
69-
return fill(T(Nsymbol(a, b, c)), (1, 1, 1, 1))
69+
Nabc = Nsymbol(a, b, c)
70+
return fill(T(Nabc), (1, 1, 1, Nabc))
7071
end
7172

7273
include("znirrep.jl")

src/irreps/su2irrep.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ end
7272

7373
function fusiontensor(a::SU2Irrep, b::SU2Irrep, c::SU2Irrep)
7474
T = sectorscalartype(SU2Irrep)
75-
C = Array{T}(undef, dim(a), dim(b), dim(c), 1)
75+
Nabc = Nsymbol(a, b, c)
76+
C = Array{T}(undef, dim(a), dim(b), dim(c), Nabc)
77+
Nabc || return C
7678
ja, jb, jc = a.j, b.j, c.j
7779

7880
for kc in 1:dim(c), kb in 1:dim(b), ka in 1:dim(a)

src/sectors.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,15 +691,15 @@ hopflink(a::I, b::I) where {I <: Sector} = sum(dim(c) * tr(Rsymbol(a, b, c) * Rs
691691
"""
692692
Smatrix(::Type{I}) where {I <: Sector}
693693
694-
Return the S-matrix of the sector type `I`, which is a matrix containing the hopflinks of all pairs of sectors of type `I`.
694+
Return the S-matrix of the sector type `I`, which is a matrix containing the hopflinks of all pairs of sectors of type `I`, with the second sector being taken dual.
695695
The S-matrix is not normalized by the total quantum dimension here.
696696
"""
697697
function Smatrix(::Type{I}) where {I <: Sector}
698698
Base.IteratorSize(values(I)) isa Base.IsInfinite &&
699699
throw(ArgumentError("Only defined for sectors with a finite number of simple objects"))
700700
vals = values(I)
701701
l = length(vals)
702-
return reshape([hopflink(a, b) for a in vals, b in vals], (l, l))
702+
return reshape([hopflink(a, dual(b)) for a in vals, b in vals], (l, l))
703703
end
704704

705705
"""
@@ -715,13 +715,14 @@ end
715715
"""
716716
topological_central_charge(::Type{I}) where {I <: Sector}
717717
718-
Return the topological central charge c of the modular sector type `I`, where c is determined mod 8.
718+
Return the topological central charge c of the braided sector type `I`, where c is determined mod 8.
719719
We choose convention by restrict the returning value as rational numbers in (-4, 4].
720720
"""
721721
function topological_central_charge(::Type{I}) where {I <: Sector}
722-
ξ = sum(dim(a)^2 * twist(a) for a in values(I)) / dim(I)
723-
@assert isapprox(abs(ξ), 1) "Sector $I is not modular"
724-
c_float = angle(ξ) * 8 / (2π)
722+
gauss_sum = sum(dim(a)^2 * twist(a) for a in values(I))
723+
Θ = abs(gauss_sum)
724+
@assert Θ > sqrt(eps(float(Θ))) "Topological central charge is not defined for sector type $I" # For non-modular categories, central charge is also meaningful. See https://arxiv.org/pdf/1602.05946. For super modular category, Gauss sum vanishes, and its central charge needs to be defined in another manner: https://arxiv.org/pdf/1603.09294.
725+
c_float = angle(gauss_sum) * 8 / (2π)
725726

726727
isapprox(c_float, -4) && return 4 // 1
727728

test/newsectors.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ end
6565
dim(s::NewSU2Irrep) = twice(s.j) + 1
6666

6767
function fusiontensor(a::NewSU2Irrep, b::NewSU2Irrep, c::NewSU2Irrep)
68-
C = Array{Float64}(undef, dim(a), dim(b), dim(c), 1)
68+
Nabc = Nsymbol(a, b, c)
69+
C = Array{Float64}(undef, dim(a), dim(b), dim(c), Nabc)
70+
Nabc == 0 && return C
6971
ja, jb, jc = a.j, b.j, c.j
7072

7173
for kc in 1:dim(c), kb in 1:dim(b), ka in 1:dim(a)

test/runtests.jl

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,22 @@ end
266266
end
267267

268268
@testset "Ismodular" begin
269-
@test !ismodular(Z2Irrep)
270-
@test !ismodular(Z3Irrep)
271-
@test !ismodular(FermionParity)
272-
@test !ismodular(A4Irrep)
273-
@test !ismodular(IsingAnyon Z2Irrep)
274-
@test ismodular(IsingAnyon)
275-
@test ismodular(FibonacciAnyon)
276-
@test ismodular(TimeReversed{IsingAnyon})
277-
@test ismodular(IsingAnyon TimeReversed{IsingAnyon})
269+
Tannakian_list = [Z2Irrep, Z3Irrep, A4Irrep, D3Irrep, D4Irrep, Z2Irrep D4Irrep, D3Irrep A4Irrep]
270+
Super_Tannakian_list = [FermionParity, FermionParity A4Irrep, FermionParity Z3Irrep, D4Irrep FermionParity]
271+
UMTC_list = [
272+
IsingAnyon, FibonacciAnyon, TimeReversed{IsingAnyon}, TimeReversed{FibonacciAnyon},
273+
FibonacciAnyon FibonacciAnyon, FibonacciAnyon IsingAnyon, IsingAnyon TimeReversed{IsingAnyon},
274+
TimeReversed{FibonacciAnyon} IsingAnyon, IsingAnyon IsingAnyon IsingAnyon,
275+
IsingAnyon FibonacciAnyon IsingAnyon TimeReversed{IsingAnyon} TimeReversed{FibonacciAnyon},
276+
]
277+
UMTC_over_RepG_list = [Z2Irrep IsingAnyon, Z3Irrep FibonacciAnyon, D3Irrep TimeReversed{IsingAnyon}, A4Irrep FibonacciAnyon TimeReversed{IsingAnyon}]
278+
UMTC_over_sRepG_list = [Z2Irrep FermionParity IsingAnyon, FermionParity Z3Irrep FibonacciAnyon, D3Irrep TimeReversed{IsingAnyon} FermionParity, A4Irrep FibonacciAnyon FermionParity TimeReversed{IsingAnyon}]
279+
for sect in [Tannakian_list..., Super_Tannakian_list..., UMTC_over_RepG_list..., UMTC_over_sRepG_list...]
280+
@test !ismodular(sect)
281+
end
282+
for sect in UMTC_list
283+
@test ismodular(sect)
284+
end
278285
end
279286

280287
@testset "Total quantum dimension" begin
@@ -290,6 +297,10 @@ end
290297
end
291298

292299
@testset "Topological central charge" begin
300+
@test topological_central_charge(Z2Irrep) == 0 // 1
301+
@test topological_central_charge(A4Irrep) == 0 // 1
302+
@test topological_central_charge(Z2Irrep IsingAnyon) == 1 // 2
303+
@test topological_central_charge(FibonacciAnyon D4Irrep) == - 14 // 5
293304
@test topological_central_charge(IsingAnyon) == 1 // 2
294305
@test topological_central_charge(TimeReversed{IsingAnyon}) == - 1 // 2
295306
@test topological_central_charge(IsingAnyon TimeReversed{IsingAnyon}) == 0 // 1

0 commit comments

Comments
 (0)