Skip to content

Commit

Permalink
Revert "simpler tests"
Browse files Browse the repository at this point in the history
This reverts commit 87acfee.
  • Loading branch information
lkdvos committed Jun 13, 2024
1 parent 5299d9b commit 20106bd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ end
@testset "LazySum FiniteMPS groundstate" verbose = true begin
tol = 1e-8
D = 15
atol = 1e-6
atol = 1e-2

# test using XXZ model, Δ > 1 is gapped
local_operators = [-S_xx(), -S_yy(), -(1 + abs(rand())) * S_zz()]
Expand All @@ -179,7 +179,7 @@ end
ψ, = find_groundstate(ψ₀, H, alg)
ψ_lazy, envs, δ = find_groundstate(ψ₀, H_lazy, alg)

@test sum(expectation_value(ψ, H)) sum(expectation_value(ψ_lazy, H_lazy)) atol = atol
@test abs(dot(ψ, ψ_lazy)) 1 atol = atol
end

@testset "DMRG2" begin
Expand All @@ -195,7 +195,7 @@ end
ψ, = find_groundstate(ψ₀, H, alg)
ψ_lazy, envs, δ = find_groundstate(ψ₀, H_lazy, alg)

@test sum(expectation_value(ψ, H)) sum(expectation_value(ψ_lazy, H_lazy)) atol = atol
@test abs(dot(ψ, ψ_lazy)) 1 atol = atol
end

@testset "GradientGrassmann" begin
Expand All @@ -210,14 +210,14 @@ end
ψ, = find_groundstate(ψ₀, H, alg)
ψ_lazy, envs, δ = find_groundstate(ψ₀, H_lazy, alg)

@test sum(expectation_value(ψ, H)) sum(expectation_value(ψ_lazy, H_lazy)) atol = atol
@test abs(dot(ψ, ψ_lazy)) 1 atol = atol
end
end

@testset "LazySum InfiniteMPS groundstate" verbose = true begin
tol = 1e-8
D = 15
atol = 1e-6
atol = 1e-2

# test using XXZ model, Δ > 1 is gapped
local_operators = [S_xx(), S_yy(), (1.234) * S_zz()]
Expand All @@ -237,7 +237,7 @@ end
ψ, = find_groundstate(ψ₀, H, alg)
ψ_lazy, envs, δ = find_groundstate(ψ₀, H_lazy, alg)

@test sum(expectation_value(ψ, H)) sum(expectation_value(ψ_lazy, H_lazy)) atol = atol
@test abs(dot(ψ, ψ_lazy)) 1 atol = atol
end

@testset "IDMRG1" begin
Expand All @@ -251,7 +251,7 @@ end
ψ, = find_groundstate(ψ₀, H, alg)
ψ_lazy, envs, δ = find_groundstate(ψ₀, H_lazy, alg)

@test sum(expectation_value(ψ, H)) sum(expectation_value(ψ_lazy, H_lazy)) atol = atol
@test abs(dot(ψ, ψ_lazy)) 1 atol = atol
end

@testset "IDMRG2" begin
Expand All @@ -269,7 +269,7 @@ end
ψ_lazy, envs, δ = find_groundstate(ψ₀, H_lazy′, alg)
ψ, = find_groundstate(ψ₀, H′, alg)

@test sum(expectation_value(ψ, H′)) sum(expectation_value(ψ_lazy, H_lazy′)) atol = atol
@test abs(dot(ψ, ψ_lazy)) 1 atol = atol
end

@testset "GradientGrassmann" begin
Expand All @@ -284,7 +284,7 @@ end
ψ_lazy, envs, δ = find_groundstate(ψ₀, H_lazy, alg)
ψ, = find_groundstate(ψ₀, H, alg)

@test sum(expectation_value(ψ, H)) sum(expectation_value(ψ_lazy, H_lazy)) atol = atol
@test abs(dot(ψ, ψ_lazy)) 1 atol = atol
end
end

Expand Down

0 comments on commit 20106bd

Please sign in to comment.