From e1344f070516ffb7ecd34c2eaf5832e59ce571fe Mon Sep 17 00:00:00 2001 From: Joey Date: Sun, 16 Jun 2024 09:42:19 -0400 Subject: [PATCH] Revert expect --- src/expect.jl | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/expect.jl b/src/expect.jl index a9fdfdaf..e1d46a9f 100644 --- a/src/expect.jl +++ b/src/expect.jl @@ -4,12 +4,6 @@ using ITensorMPS: ITensorMPS, expect default_expect_alg() = "bp" -function ITensorMPS.expect( - ψ::AbstractITensorNetwork, ops; alg=default_expect_alg(), kwargs... -) - return expect(Algorithm(alg), ψ, ops; kwargs...) -end - function ITensorMPS.expect( ψIψ::AbstractFormNetwork, op::Op; contract_kwargs=(; sequence="automatic"), kwargs... ) @@ -24,27 +18,6 @@ function ITensorMPS.expect( return numerator / denominator end -function ITensorMPS.expect( - ψIψ::AbstractFormNetwork, - ops::Scaled{ComplexF64,Prod{Op}}; - contract_kwargs=(; sequence="automatic"), - kwargs..., -) - scalar = first(ops.args) - iszero(scalar) && return 0.0 - n_ops = length(ops) - vs = site.(ops[1:n_ops]) - op_strings = which_op.(ops[1:n_ops]) - ψIψ_vs = [ψIψ[operator_vertex(ψIψ, v)] for v in vs] - sinds = [commonind(ψIψ[ket_vertex(ψIψ, v)], ψIψ_vs[i]) for (i, v) in enumerate(vs)] - operators = [ITensors.op(op_strings[i], sinds[i]) for i in 1:n_ops] - ∂ψIψ_∂v = environment(ψIψ, operator_vertices(ψIψ, vs); kwargs...) - numerator = contract(vcat(∂ψIψ_∂v, operators); contract_kwargs...)[] - denominator = contract(vcat(∂ψIψ_∂v, ψIψ_vs); contract_kwargs...)[] - - return scalar * numerator / denominator -end - function ITensorMPS.expect( alg::Algorithm, ψ::AbstractITensorNetwork,