From cb09b427c95ef412c619179026db7756582e828f Mon Sep 17 00:00:00 2001 From: Jutho Haegeman Date: Mon, 9 Oct 2017 15:28:29 +0200 Subject: [PATCH] bugfix in Racah W sign when different irreps don't match --- src/WignerSymbols.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/WignerSymbols.jl b/src/WignerSymbols.jl index 397c4c6..b695e27 100644 --- a/src/WignerSymbols.jl +++ b/src/WignerSymbols.jl @@ -211,7 +211,11 @@ the `jᵢ`s and `J`s are not integer or halfinteger. racahW(j₁, j₂, J, j₃, J₁₂, J₂₃) = racahW(Float64, j₁, j₂, J, j₃, J₁₂, J₂₃) function racahW(T::Type{<:AbstractFloat}, j₁, j₂, J, j₃, J₁₂, J₂₃) s = wigner6j(T, j₁, j₂, J₁₂, j₃, J, J₂₃) - return isodd(convert(Int, j₁ + j₂ + j₃ + J)) ? -s : s + if !iszero(s) && isodd(convert(Int, j₁ + j₂ + j₃ + J)) + return -s + else + return s + end end