@@ -130,8 +130,11 @@ Base.inv(c::ZNElement) = typeof(c)(-c.n)
130130Base.:* (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
133136function 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 )
135138end
136139
137140Base. IteratorSize (:: Type{SectorValues{<:ZNElement}} ) = HasLength ()
@@ -148,17 +151,11 @@ Base.hash(c::ZNElement, h::UInt) = hash(c.n, h)
148151Base. 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 ()
153154BraidingStyle (:: 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+
154157BraidingStyle (:: Type{ZNElement{N, p}} ) where {N, p} = Anyonic ()
155158function 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))
164161end
0 commit comments