Skip to content

Commit

Permalink
Fixing the test
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerviou committed Aug 25, 2023
1 parent 0c8a6cd commit 559e9c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_iMPOConversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using ITensorInfiniteMPS
using Test

#With the new definition of InfiniteMPOMatrix, the MPO is better behaved, and hence we need to be a bit more careful
function ITensors.expect::InfiniteCanonicalMPS, h::InfiniteSum{MPO})
function expect_over_unit_cell::InfiniteCanonicalMPS, h::InfiniteSum{MPO})
s = siteinds(ψ)
Ncell = nsites(h)

Expand All @@ -25,7 +25,7 @@ function ITensors.expect(ψ::InfiniteCanonicalMPS, h::InfiniteSum{MPO})
hf[x] = op("Id", s[x])
end
end
energy += ITensors.expect(ψ, hf)
energy += expect(ψ, hf)
end
return energy
end
Expand Down Expand Up @@ -161,7 +161,7 @@ end
Hi = InfiniteMPO(model, s; model_kwargs...)
Hm = InfiniteMPOMatrix(model, s; model_kwargs...)
Hs = InfiniteSum{MPO}(model, s; model_kwargs...)
Es = expect(ψ, Hs)
Es = expect_over_unit_cell(ψ, Hs)
Ei = expect(ψ, Hi)
Em = expect(ψ, Hm)
#@show Es Ei
Expand All @@ -185,7 +185,7 @@ end
ψ = InfMPS(s, initstate)
Hs = InfiniteSum{MPO}(model, s; model_params...)
Hi = InfiniteMPO(model, s, trf; model_params...)
Es = expect(ψ, Hs)
Es = expect_over_unit_cell(ψ, Hs)
Ei = expect(ψ, Hi)
#@show Es Ei
@test Es Ei atol = 1e-14
Expand Down

0 comments on commit 559e9c6

Please sign in to comment.