Skip to content

Commit d292161

Browse files
committed
sign pfaffian
1 parent 9e0732f commit d292161

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pfaffian.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function _pfaffian!(A::SkewHermitian{<:Real})
7474
for i=1:2:n-1
7575
pf *= -T.ev[i]
7676
end
77-
return pf
77+
return pf * sign(det(H.Q))
7878
end
7979

8080
function _pfaffian!(A::SkewHermTridiagonal{<:Real})
@@ -120,7 +120,7 @@ function _logabspfaffian!(A::SkewHermitian{<:Real})
120120
logpf += log(abs(T.ev[i]))
121121
sgn *= sign(-T.ev[i])
122122
end
123-
return logpf, sgn
123+
return logpf, sgn*sign(det(H.Q))
124124
end
125125
function _logabspfaffian!(A::SkewHermTridiagonal{<:Real})
126126
n = size(A, 1)

0 commit comments

Comments
 (0)