@@ -4,12 +4,6 @@ using ITensorMPS: ITensorMPS, expect
4
4
5
5
default_expect_alg () = " bp"
6
6
7
- function ITensorMPS. expect (
8
- ψ:: AbstractITensorNetwork , ops; alg= default_expect_alg (), kwargs...
9
- )
10
- return expect (Algorithm (alg), ψ, ops; kwargs... )
11
- end
12
-
13
7
function ITensorMPS. expect (
14
8
ψIψ:: AbstractFormNetwork , op:: Op ; contract_kwargs= (; sequence= " automatic" ), kwargs...
15
9
)
@@ -24,27 +18,6 @@ function ITensorMPS.expect(
24
18
return numerator / denominator
25
19
end
26
20
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
-
48
21
function ITensorMPS. expect (
49
22
alg:: Algorithm ,
50
23
ψ:: AbstractITensorNetwork ,
0 commit comments