Skip to content
Merged
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
10 changes: 10 additions & 0 deletions test/algorithms/changebonds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,16 @@ end

ψ = FiniteMPS(rand, ComplexF64, L, pspace, ℙ^4)
@test expectation_value(ψ, H′) ≈ expectation_value(ψ, H) rtol = 1.0e-10

# operators with a non-zero trace lost precision geometrically with distance in v0.14.0 (#550)
pspace = ℂ^4
L = 30
n = TensorMap(ComplexF64[1 0 0 0; 0 0 0 0; 0 0 1 0; 0 0 0 0], pspace ← pspace)
H = FiniteMPOHamiltonian(fill(pspace, L), (5, 25) => n ⊗ n)

H′ = changebonds(H, SvdCut(; trunc = trunctol(; rtol = 0.0)))
ψ = FiniteMPS(rand, ComplexF64, L, pspace, ℂ^8)
@test expectation_value(ψ, H′) ≈ expectation_value(ψ, H) rtol = 1.0e-10
end

@testset "SvdCut on InfiniteMPOHamiltonian $(spacetype(pspace))" for (pspace, Dspace) in spacelist
Expand Down
Loading