From 180183e083ea05a9962fe27981d066dd10ff332c Mon Sep 17 00:00:00 2001 From: Joey Date: Tue, 10 Dec 2024 12:06:12 -0500 Subject: [PATCH] Make generic to other algorithms --- src/normalize.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/normalize.jl b/src/normalize.jl index 7fa6b4db..52eeed5c 100644 --- a/src/normalize.jl +++ b/src/normalize.jl @@ -17,15 +17,16 @@ function rescale( end function rescale( - alg::Algorithm"bp", + alg::Algorithm, tn::AbstractITensorNetwork, vs=collect(vertices(tn)); (cache!)=nothing, + cache_construction_kwargs=default_cache_construction_kwargs(alg, tn), update_cache=isnothing(cache!), cache_update_kwargs=default_cache_update_kwargs(cache!), ) if isnothing(cache!) - cache! = Ref(BeliefPropagationCache(tn, group(v -> v, vertices(tn)))) + cache! = Ref(cache(alg, tn; cache_construction_kwargs...)) end if update_cache