Skip to content

Commit

Permalink
Default partitioning - default partitioned vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Mar 21, 2024
1 parent 70258b4 commit 1d04a04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/caches/beliefpropagationcache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end
@traitfn function default_bp_maxiter(g::::IsDirected)
return default_bp_maxiter(undirected_graph(underlying_graph(g)))
end
default_partitioning::AbstractITensorNetwork) = group(v -> v, vertices(ψ))
default_partitioned_vertices::AbstractITensorNetwork) = group(v -> v, vertices(ψ))
default_cache_update_kwargs(cache) = (; maxiter=20, tol=1e-5)

function message_diff(message_a::Vector{ITensor}, message_b::Vector{ITensor})
Expand Down
4 changes: 2 additions & 2 deletions src/environment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function environment(
ψ::AbstractITensorNetwork,
verts::Vector;
(cache!)=nothing,
partitions=default_partitioning(ψ),
partitioned_vertices=default_partitioned_vertices(ψ),
update_cache=isnothing(cache!),
cache_update_kwargs=default_cache_update_kwargs(cache!),
)
if isnothing(cache!)
cache! = Ref(BeliefPropagationCache(ψ, partitions))
cache! = Ref(BeliefPropagationCache(ψ, partitioned_vertices))
end

if update_cache
Expand Down

0 comments on commit 1d04a04

Please sign in to comment.