Skip to content

Commit fdc9fc5

Browse files
Fix correlator for fermionic PEPS (#232)
1 parent 59a7f9d commit fdc9fc5

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

src/algorithms/correlators.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function correlator_horizontal(
3838
)
3939
T = TransferMatrix(Atop, sandwich, _dag(Abot))
4040
Vo = Vo * T
41+
twistdual!(T.below, 2:numout(T.below))
4142
Vn = Vn * T
4243
i += CartesianIndex(0, 1)
4344
end
@@ -53,6 +54,7 @@ function correlator_horizontal(
5354
)
5455
T = TransferMatrix(Atop, sandwich, _dag(Abot))
5556
Vo = Vo * T
57+
twistdual!(T.below, 2:numout(T.below))
5658
Vn = Vn * T
5759
i += CartesianIndex(0, 1)
5860

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ end
8484
@time @safetestset "Rotation of InfiniteWeightPEPS" begin
8585
include("utility/iwpeps_rotation.jl")
8686
end
87+
@time @safetestset "Correlators" begin
88+
include("utility/correlator.jl")
89+
end
8790
end
8891
if GROUP == "ALL" || GROUP == "EXAMPLES"
8992
@time @safetestset "Transverse Field Ising model" begin

test/utility/correlator.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Test
2+
using Random
3+
using TensorKit
4+
using PEPSKit
5+
import MPSKitModels: TJOperators as tJ
6+
7+
Pspace = tJ.tj_space(Trivial, Trivial)
8+
Vspace = Vect[FermionParity](0 => 2, 1 => 2)
9+
Espace = Vect[FermionParity](0 => 3, 1 => 3)
10+
Random.seed!(100)
11+
peps = InfinitePEPS(rand, ComplexF64, Pspace, Vspace; unitcell=(2, 2));
12+
env = CTMRGEnv(rand, ComplexF64, peps, Espace);
13+
lattice = collect(space(t, 1) for t in peps.A)
14+
15+
site0 = CartesianIndex(1, 1)
16+
maxsep = 8
17+
site1s = collect(site0 + CartesianIndex(0, i) for i in 2:2:maxsep)
18+
19+
op = tJ.S_exchange(ComplexF64, Trivial, Trivial);
20+
21+
vals1 = correlator(peps, op, site0, site1s, env)
22+
vals2 = collect(begin
23+
O = LocalOperator(lattice, (site0, site1) => op)
24+
val = expectation_value(peps, O, env)
25+
end for site1 in site1s)
26+
@test vals1 vals2

0 commit comments

Comments
 (0)