Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/algorithms/correlators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function correlator_horizontal(
)
T = TransferMatrix(Atop, sandwich, _dag(Abot))
Vo = Vo * T
twistdual!(T.below, 2:numout(T.below))
Vn = Vn * T
i += CartesianIndex(0, 1)
end
Expand All @@ -53,6 +54,7 @@ function correlator_horizontal(
)
T = TransferMatrix(Atop, sandwich, _dag(Abot))
Vo = Vo * T
twistdual!(T.below, 2:numout(T.below))
Vn = Vn * T
i += CartesianIndex(0, 1)

Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ end
@time @safetestset "Rotation of InfiniteWeightPEPS" begin
include("utility/iwpeps_rotation.jl")
end
@time @safetestset "Correlators" begin
include("utility/correlator.jl")
end
end
if GROUP == "ALL" || GROUP == "EXAMPLES"
@time @safetestset "Transverse Field Ising model" begin
Expand Down
26 changes: 26 additions & 0 deletions test/utility/correlator.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Test
using Random
using TensorKit
using PEPSKit
import MPSKitModels: 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, ComplexF64, Pspace, Vspace; unitcell=(2, 2));
env = CTMRGEnv(rand, ComplexF64, peps, Espace);
lattice = collect(space(t, 1) for t in peps.A)

site0 = CartesianIndex(1, 1)
maxsep = 8
site1s = collect(site0 + CartesianIndex(0, i) for i in 2:2:maxsep)

op = tJ.S_exchange(ComplexF64, Trivial, Trivial);

vals1 = correlator(peps, op, site0, site1s, env)
vals2 = collect(begin
O = LocalOperator(lattice, (site0, site1) => op)
val = expectation_value(peps, O, env)
end for site1 in site1s)
@test vals1 ≈ vals2
Loading