-
Notifications
You must be signed in to change notification settings - Fork 26
Description
It seems that the correlation function calculated from correlator (added in #210) is different from expectation_value for fermionic PEPS.
To reproduce the issue, run the following code that calculates the spin correlation
using Random
using TensorKit
using PEPSKit
import TensorKitTensors: TJOperators as tJ
Pspace = tJ.tj_space(Trivial, Trivial)
Vspace = Vect[FermionParity](0 => 2, 1 => 2)
Espace = Vect[FermionParity](0 => 3, 1 => 3)
Random.seed!(100)
peps = InfinitePEPS(rand, Float64, Pspace, Vspace; unitcell=(2, 2));
env = CTMRGEnv(rand, Float64, peps, Espace);
lattice = collect(space(t, 1) for t in peps.A)
site0 = CartesianIndex(1, 1)
maxsep = 6
site1s = collect(site0 + CartesianIndex(0, i) for i in 1:maxsep)
op = tJ.S_exchange(Float64, Trivial, Trivial);
vals1 = collect(
begin
O = LocalOperator(lattice, (site0, site1) => op)
val = expectation_value(peps, O, env)
end for site1 in site1s
)
vals2 = correlator(peps, op, site0, site1s, env)
@show @show vals1 ≈ vals2 # falseBut if I calculate the spin correlation in Heisenberg model, correlator and expectation_value produce (approximately) the same results. This is why the test test/examples/tf_ising.jldidn't catch the issue. I think we need to change how the column transfer matrix acts on the already-contracted part of the correlator "sandwich": for fermionic iPEPS, simply using * may have missed some twists.
PEPSKit.jl/src/algorithms/correlators.jl
Lines 39 to 41 in 47e6675
| T = TransferMatrix(Atop, sandwich, _dag(Abot)) | |
| Vo = Vo * T | |
| Vn = Vn * T |