Skip to content

Commit 180183e

Browse files
committed
Make generic to other algorithms
1 parent 620da37 commit 180183e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/normalize.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ function rescale(
1717
end
1818

1919
function rescale(
20-
alg::Algorithm"bp",
20+
alg::Algorithm,
2121
tn::AbstractITensorNetwork,
2222
vs=collect(vertices(tn));
2323
(cache!)=nothing,
24+
cache_construction_kwargs=default_cache_construction_kwargs(alg, tn),
2425
update_cache=isnothing(cache!),
2526
cache_update_kwargs=default_cache_update_kwargs(cache!),
2627
)
2728
if isnothing(cache!)
28-
cache! = Ref(BeliefPropagationCache(tn, group(v -> v, vertices(tn))))
29+
cache! = Ref(cache(alg, tn; cache_construction_kwargs...))
2930
end
3031

3132
if update_cache

0 commit comments

Comments
 (0)