Skip to content

Commit

Permalink
Better default partitioning of abstractformnetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Mar 19, 2024
1 parent 33f39a2 commit c818f13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions 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 @@ -13,7 +13,7 @@ end
default_partitioning::AbstractITensorNetwork) = group(v -> v, vertices(ψ))

#We could probably do something cleverer here based on graph partitioning algorithms: https://en.wikipedia.org/wiki/Graph_partition.
default_partitioning(f::AbstractFormNetwork) = group(v -> first(v), vertices(f))
default_partitioning(f::AbstractFormNetwork) = group(v -> state_vertex(f, v), vertices(f))
default_cache_update_kwargs(cache) = (; maxiter=20, tol=1e-5)

function message_diff(message_a::Vector{ITensor}, message_b::Vector{ITensor})
Expand Down
1 change: 1 addition & 0 deletions src/formnetworks/abstractformnetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ inv_vertex_map(f::AbstractFormNetwork) = v -> first(v)
operator_vertex(f::AbstractFormNetwork, v) = operator_vertex_map(f)(v)
bra_vertex(f::AbstractFormNetwork, v) = bra_vertex_map(f)(v)
ket_vertex(f::AbstractFormNetwork, v) = ket_vertex_map(f)(v)
state_vertex(f::AbstractFormNetwork, v) = inv_vertex_map(f)(v)

0 comments on commit c818f13

Please sign in to comment.