From 8f541921bd28c2589a9ce79f2aa93ea55df64054 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Wed, 23 Oct 2024 18:06:16 -0400 Subject: [PATCH] Observer function name disambiguation --- src/observer.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/observer.jl b/src/observer.jl index 4cdfb93..4436d36 100644 --- a/src/observer.jl +++ b/src/observer.jl @@ -128,16 +128,16 @@ energy after each sweep. """ energies(o::DMRGObserver) = o.energies -sites(obs::DMRGObserver) = obs.sites +observer_sites(obs::DMRGObserver) = obs.sites -ops(obs::DMRGObserver) = obs.ops +observer_ops(obs::DMRGObserver) = obs.ops truncerrors(obs::DMRGObserver) = obs.truncerrs function measurelocalops!(obs::DMRGObserver, wf::ITensor, i::Int) - for o in ops(obs) + for o in observer_ops(obs) # Moves to GPU if needed - oⱼ = adapt(datatype(wf), op(sites(obs), o, i)) + oⱼ = adapt(datatype(wf), op(observer_sites(obs), o, i)) m = dot(wf, apply(oⱼ, wf)) imag(m) > 1e-8 && (@warn "encountered finite imaginary part when measuring $o") measurements(obs)[o][end][i] = real(m) @@ -155,7 +155,7 @@ function measure!(obs::DMRGObserver; kwargs...) N = length(psi) if b == (N - 1) - for o in ops(obs) + for o in observer_ops(obs) push!(measurements(obs)[o], zeros(N)) end push!(truncerrors(obs), 0.0)