Skip to content

Commit dbd2a08

Browse files
committed
Move sqrt(2)/2
1 parent acdcef0 commit dbd2a08

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/irreps/dnirrep.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,26 +228,26 @@ function Rsymbol(a::I, b::I, c::I) where {N, I <: DNIrrep{N}}
228228
return ifelse((c.j == 0) & c.isodd & !(a.j == b.j == 0) & !(iseven(N) && (a.j == b.j == (N >> 1))), -R, R)
229229
end
230230

231-
const _invsqrt2 = 1 / sqrt(2)
232231

233232
function fusiontensor(a::I, b::I, c::I) where {N, I <: DNIrrep{N}}
234-
C = fill(zero(sectorscalartype(I)), dim(a), dim(b), dim(c), 1)
233+
T = sectorscalartype(I)
234+
C = zeros(T, dim(a), dim(b), dim(c), 1)
235235
Nsymbol(a, b, c) || return C
236236

237237
if c.j == 0
238238
if a.j == b.j == 0 || (iseven(N) && (a.j == b.j == (N >> 1)))
239239
C[1, 1, 1] = 1
240240
else # a.j == b.j
241241
# 0\pm = 1/sqrt(2) (v_i^+ \otimes w_j^- \pm v_i^- \otimes w_j^+)
242-
C[1, 2, 1] = _invsqrt2
243-
C[2, 1, 1] = c.isodd ? -_invsqrt2 : _invsqrt2
242+
C[1, 2, 1] = T(sqrt(2) / 2)
243+
C[2, 1, 1] = c.isodd ? -C[1, 2, 1] : C[1, 2, 1]
244244
end
245245
elseif iseven(N) && (c.j == (N >> 1))
246246
if (a.j == (N >> 1)) | (b.j == (N >> 1))
247247
C[1, 1, 1] = 1
248248
else
249-
C[1, 1, 1] = _invsqrt2
250-
C[2, 2, 1] = c.isodd ? -_invsqrt2 : _invsqrt2
249+
C[1, 1, 1] = T(sqrt(2) / 2)
250+
C[2, 2, 1] = c.isodd ? -C[1, 1, 1] : C[1, 1, 1]
251251
end
252252
elseif a.j == 0
253253
C[1, 1, 1] = 1

0 commit comments

Comments
 (0)