Skip to content

Commit e1344f0

Browse files
committed
Revert expect
1 parent 0704609 commit e1344f0

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/expect.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ using ITensorMPS: ITensorMPS, expect
44

55
default_expect_alg() = "bp"
66

7-
function ITensorMPS.expect(
8-
ψ::AbstractITensorNetwork, ops; alg=default_expect_alg(), kwargs...
9-
)
10-
return expect(Algorithm(alg), ψ, ops; kwargs...)
11-
end
12-
137
function ITensorMPS.expect(
148
ψIψ::AbstractFormNetwork, op::Op; contract_kwargs=(; sequence="automatic"), kwargs...
159
)
@@ -24,27 +18,6 @@ function ITensorMPS.expect(
2418
return numerator / denominator
2519
end
2620

27-
function ITensorMPS.expect(
28-
ψIψ::AbstractFormNetwork,
29-
ops::Scaled{ComplexF64,Prod{Op}};
30-
contract_kwargs=(; sequence="automatic"),
31-
kwargs...,
32-
)
33-
scalar = first(ops.args)
34-
iszero(scalar) && return 0.0
35-
n_ops = length(ops)
36-
vs = site.(ops[1:n_ops])
37-
op_strings = which_op.(ops[1:n_ops])
38-
ψIψ_vs = [ψIψ[operator_vertex(ψIψ, v)] for v in vs]
39-
sinds = [commonind(ψIψ[ket_vertex(ψIψ, v)], ψIψ_vs[i]) for (i, v) in enumerate(vs)]
40-
operators = [ITensors.op(op_strings[i], sinds[i]) for i in 1:n_ops]
41-
∂ψIψ_∂v = environment(ψIψ, operator_vertices(ψIψ, vs); kwargs...)
42-
numerator = contract(vcat(∂ψIψ_∂v, operators); contract_kwargs...)[]
43-
denominator = contract(vcat(∂ψIψ_∂v, ψIψ_vs); contract_kwargs...)[]
44-
45-
return scalar * numerator / denominator
46-
end
47-
4821
function ITensorMPS.expect(
4922
alg::Algorithm,
5023
ψ::AbstractITensorNetwork,

0 commit comments

Comments
 (0)