Skip to content

Commit

Permalink
Update src/caches/beliefpropagationcache.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Fishman <[email protected]>
  • Loading branch information
JoeyT1994 and mtfishman authored Jun 16, 2024
1 parent 66319b0 commit b098d44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/caches/beliefpropagationcache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function default_message_update(contract_list::Vector{ITensor}; normalize=true,
sequence = optimal_contraction_sequence(contract_list)
updated_messages = contract(contract_list; sequence, kwargs...)
message_norm = norm(updated_messages)
if !iszero(message_norm) && normalize
if normalize && !iszero(message_norm)
updated_messages /= message_norm
end
return ITensor[updated_messages]
Expand Down

0 comments on commit b098d44

Please sign in to comment.