Skip to content

Commit

Permalink
Avoid in-place normalization in default_message_update
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Mar 19, 2024
1 parent c818f13 commit 3e875cf
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 @@ -3,7 +3,7 @@ default_messages(ptn::PartitionedGraph) = Dictionary()
function default_message_update(contract_list::Vector{ITensor}; kwargs...)
sequence = optimal_contraction_sequence(contract_list)
updated_messages = contract(contract_list; sequence, kwargs...)
updated_messages = normalize!(updated_messages)
updated_messages /= norm(updated_messages)
return ITensor[updated_messages]
end
@traitfn default_bp_maxiter(g::::(!IsDirected)) = is_tree(g) ? 1 : nothing
Expand Down

0 comments on commit 3e875cf

Please sign in to comment.