Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BP convergence metric for complex networks #193

Merged
merged 9 commits into from
Jun 25, 2024
Merged
Prev Previous commit
Next Next commit
Better fidelity def
  • Loading branch information
JoeyT1994 committed Jun 25, 2024
commit b23f5a61861a634c72a45fb6ee932a63d31dbddd
3 changes: 2 additions & 1 deletion src/caches/beliefpropagationcache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ function message_diff(message_a::Vector{ITensor}, message_b::Vector{ITensor})
rhs *= c
lhs /= norm(lhs)
rhs /= norm(rhs)
return 1 - sqrt(abs(dot(lhs, rhs)))
f = abs(dot(lhs, rhs))^2
return 1 - f
end

struct BeliefPropagationCache{PTN,MTS,DM}
Expand Down
Loading