From 0228aa1118478debc0e336a4bc9517e59631a596 Mon Sep 17 00:00:00 2001 From: Joey Date: Thu, 16 Jan 2025 08:56:11 -0500 Subject: [PATCH] Fix Bug in Expect --- src/expect.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/expect.jl b/src/expect.jl index 3414dd21..69ce42ae 100644 --- a/src/expect.jl +++ b/src/expect.jl @@ -25,13 +25,12 @@ function ITensorMPS.expect( (cache!)=nothing, update_cache=isnothing(cache!), cache_update_kwargs=default_cache_update_kwargs(alg), - cache_construction_function=tn -> - cache(alg, tn; default_cache_construction_kwargs(alg, tn)...), + cache_construction_kwargs=default_cache_construction_kwargs(alg, inner_network(ψ, ψ)), kwargs..., ) ψIψ = inner_network(ψ, ψ) if isnothing(cache!) - cache! = Ref(cache_construction_function(ψIψ)) + cache! = Ref(cache(alg, ψIψ; cache_construction_kwargs...)) end if update_cache