Skip to content

Commit a62876f

Browse files
committed
correct cocycle
1 parent 8ba1046 commit a62876f

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/groupelements.jl

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ Base.inv(c::ZNElement) = typeof(c)(-c.n)
130130
Base.:*(c1::ZNElement{N, p}, c2::ZNElement{N, p}) where {N, p} =
131131
ZNElement{N, p}(mod(c1.n + c2.n, N))
132132

133+
# cocycle(a::ZNElement{2, 0}, b::ZNElement{2, 0}, c::ZNElement{2, 0}) = 1
134+
# cocycle(a::ZNElement{2, 1}, b::ZNElement{2, 1}, c::ZNElement{2, 1}) = ifelse(a.n == b.n == c.n == 1, -1, 1)
135+
# cocycle(a::ZNElement{N, 0}, b::ZNElement{N, 0}, c::ZNElement{N, 0}) where {N} = 1
133136
function cocycle(a::ZNElement{N, p}, b::ZNElement{N, p}, c::ZNElement{N, p}) where {N, p}
134-
return cispi(2 * p * a.n * (b.n + c.n - mod(b.n + c.n, N)) / N)
137+
return cispi(2 * p * a.n * (b.n + c.n - mod(b.n + c.n, N)) / N^2)
135138
end
136139

137140
Base.IteratorSize(::Type{SectorValues{<:ZNElement}}) = HasLength()
@@ -148,17 +151,11 @@ Base.hash(c::ZNElement, h::UInt) = hash(c.n, h)
148151
Base.isless(c1::ZNElement{N, p}, c2::ZNElement{N, p}) where {N, p} = isless(c1.n, c2.n)
149152

150153
# Experimental
151-
BraidingStyle(::Type{ZNElement{2, 0}}) = Bosonic()
152-
BraidingStyle(::Type{ZNElement{2, 1}}) = Fermionic()
153154
BraidingStyle(::Type{ZNElement{N, 0}}) where {N} = Bosonic()
155+
Rsymbol(a::ZNElement{N, 0}, b::ZNElement{N, 0}, c::ZNElement{N, 0}) where {N} = ifelse(a * b == c, 1, zero(1))
156+
154157
BraidingStyle(::Type{ZNElement{N, p}}) where {N, p} = Anyonic()
155158
function Rsymbol(a::ZNElement{N, p}, b::ZNElement{N, p}, c::ZNElement{N, p}) where {N, p}
156-
if p == 0
157-
R = 1
158-
elseif N == 2 && p == 1
159-
R = ifelse(a.n == b.n == 1, -1.0, 1.0)
160-
else
161-
R = cispi(2 * p * a.n * b.n / N)
162-
end
159+
R = cispi(2 * p * a.n * b.n / N^2)
163160
return ifelse(c == a * b, R, zero(R))
164161
end

0 commit comments

Comments
 (0)