|
1 | 1 | using MPSKit |
2 | 2 | using TensorKit |
3 | 3 |
|
4 | | -alg = VUMPS(; maxiter=25, verbose=false) |
| 4 | +alg = VUMPS(; maxiter=25, verbosity=0) |
5 | 5 | E₀ = -1.401484014561 |
6 | 6 | E₁ = 0.41047925 |
7 | 7 |
|
8 | 8 | @testset "xxx" begin |
9 | 9 | H = @inferred heisenberg_XXX() |
10 | 10 | ψ = InfiniteMPS([ComplexSpace(3)], [ComplexSpace(48)]) |
11 | | - @test sum(abs.(imag.(expectation_value(ψ, H)))) ≈ 0 atol = 1e-10 |
| 11 | + @test imag(expectation_value(ψ, H)) ≈ 0 atol = 1e-10 |
12 | 12 | ψ, envs, δ = find_groundstate(ψ, H, alg) |
13 | | - @test E₀ ≈ sum(expectation_value(ψ, H, envs)) atol = 1e-2 |
| 13 | + @test E₀ ≈ expectation_value(ψ, H, envs) atol = 1e-2 |
14 | 14 |
|
15 | 15 | ΔEs, qps = excitations(H, QuasiparticleAnsatz(), Float64(pi), ψ, envs) |
16 | 16 | @test E₁ ≈ first(ΔEs) atol = 1e-2 |
|
19 | 19 | @testset "xxx SU2" begin |
20 | 20 | H = @inferred heisenberg_XXX(SU2Irrep) |
21 | 21 | ψ = InfiniteMPS([Rep[SU₂](1 => 1)], [Rep[SU₂](1 // 2 => 5, 3 // 2 => 5, 5 // 2 => 1)]) |
22 | | - @test sum(abs.(imag.(expectation_value(ψ, H)))) ≈ 0 atol = 1e-10 |
| 22 | + @test imag(expectation_value(ψ, H)) ≈ 0 atol = 1e-10 |
23 | 23 | ψ, envs, δ = find_groundstate(ψ, H, alg) |
24 | | - @test E₀ ≈ sum(expectation_value(ψ, H, envs)) atol = 1e-2 |
| 24 | + @test E₀ ≈ expectation_value(ψ, H, envs) atol = 1e-2 |
25 | 25 |
|
26 | 26 | ΔEs, qps = excitations(H, QuasiparticleAnsatz(), Float64(pi), ψ, envs; |
27 | 27 | sector=SU2Irrep(1)) |
|
33 | 33 | ψ = InfiniteMPS([Rep[U₁](0 => 1, 1 => 1, -1 => 1)], |
34 | 34 | [Rep[U₁](1 // 2 => 10, -1 // 2 => 10, 3 // 2 => 5, -3 // 2 => 5, |
35 | 35 | 5 // 2 => 3, -5 // 2 => 3)]) |
36 | | - @test sum(abs.(imag.(expectation_value(ψ, H)))) ≈ 0 atol = 1e-10 |
| 36 | + @test imag(expectation_value(ψ, H)) ≈ 0 atol = 1e-10 |
37 | 37 | ψ, envs, δ = find_groundstate(ψ, H, alg) |
38 | | - @test E₀ ≈ sum(expectation_value(ψ, H, envs)) atol = 1e-2 |
| 38 | + @test E₀ ≈ expectation_value(ψ, H, envs) atol = 1e-2 |
39 | 39 |
|
40 | 40 | ΔEs, qps = excitations(H, QuasiparticleAnsatz(), Float64(pi), ψ, envs; |
41 | 41 | sector=U1Irrep(1)) |
|
0 commit comments