Skip to content

Commit

Permalink
Fix wrong sign before adding Ket dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendesignolle committed Nov 27, 2024
1 parent 63de75f commit 7fe1419
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/quantum_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function correlation_tensor(p::AbstractArray{T, N2}; marg::Bool = false) where {
for x in cix
y = [x[i] m ? x[i] : Colon() for i in 1:N]
res[x] =
sum((-1)^sum(x[i] m ? a[i] : 0 for i in 1:N) * sum(p[a, y...]) for a in cia) /
sum((-1)^sum(x[i] m ? a[i] - 1 : 0 for i in 1:N) * sum(p[a, y...]) for a in cia) /
m^sum(x[i] m ? 0 : 1 for i in 1:N)
if T <: AbstractFloat
if abs(res[x]) < Base.rtoldefault(T)
Expand Down

0 comments on commit 7fe1419

Please sign in to comment.