Skip to content

Commit

Permalink
Fix Bug in Expect
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Jan 16, 2025
1 parent 5b9266e commit 0228aa1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/expect.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0228aa1

Please sign in to comment.