Skip to content

Commit

Permalink
Properly update for MPSKit 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Jul 6, 2024
1 parent 9111d38 commit a632346
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6' # LTS version
- '1.8' # LTS version
- '1' # automatically expands to the latest stable 1.x release of Julia
os:
- ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
TupleTools = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6"

[compat]
MPSKit = "0.9, 0.10, 0.11"
MPSKit = "0.11"
MacroTools = "0.5"
PrecompileTools = "1"
TensorKit = "0.11, 0.12"
TensorOperations = "4"
TupleTools = "1"
julia = "1.6"
julia = "1.8"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
14 changes: 7 additions & 7 deletions test/heisenberg.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using MPSKit
using TensorKit

alg = VUMPS(; maxiter=25, verbose=false)
alg = VUMPS(; maxiter=25, verbosity=0)
E₀ = -1.401484014561
E₁ = 0.41047925

@testset "xxx" begin
H = @inferred heisenberg_XXX()
ψ = InfiniteMPS([ComplexSpace(3)], [ComplexSpace(48)])
@test sum(abs.(imag.(expectation_value(ψ, H)))) 0 atol = 1e-10
@test imag(expectation_value(ψ, H)) 0 atol = 1e-10
ψ, envs, δ = find_groundstate(ψ, H, alg)
@test E₀ sum(expectation_value(ψ, H, envs)) atol = 1e-2
@test E₀ expectation_value(ψ, H, envs) atol = 1e-2

ΔEs, qps = excitations(H, QuasiparticleAnsatz(), Float64(pi), ψ, envs)
@test E₁ first(ΔEs) atol = 1e-2
Expand All @@ -19,9 +19,9 @@ end
@testset "xxx SU2" begin
H = @inferred heisenberg_XXX(SU2Irrep)
ψ = InfiniteMPS([Rep[SU₂](1 => 1)], [Rep[SU₂](1 // 2 => 5, 3 // 2 => 5, 5 // 2 => 1)])
@test sum(abs.(imag.(expectation_value(ψ, H)))) 0 atol = 1e-10
@test imag(expectation_value(ψ, H)) 0 atol = 1e-10
ψ, envs, δ = find_groundstate(ψ, H, alg)
@test E₀ sum(expectation_value(ψ, H, envs)) atol = 1e-2
@test E₀ expectation_value(ψ, H, envs) atol = 1e-2

ΔEs, qps = excitations(H, QuasiparticleAnsatz(), Float64(pi), ψ, envs;
sector=SU2Irrep(1))
Expand All @@ -33,9 +33,9 @@ end
ψ = InfiniteMPS([Rep[U₁](0 => 1, 1 => 1, -1 => 1)],
[Rep[U₁](1 // 2 => 10, -1 // 2 => 10, 3 // 2 => 5, -3 // 2 => 5,
5 // 2 => 3, -5 // 2 => 3)])
@test sum(abs.(imag.(expectation_value(ψ, H)))) 0 atol = 1e-10
@test imag(expectation_value(ψ, H)) 0 atol = 1e-10
ψ, envs, δ = find_groundstate(ψ, H, alg)
@test E₀ sum(expectation_value(ψ, H, envs)) atol = 1e-2
@test E₀ expectation_value(ψ, H, envs) atol = 1e-2

ΔEs, qps = excitations(H, QuasiparticleAnsatz(), Float64(pi), ψ, envs;
sector=U1Irrep(1))
Expand Down
2 changes: 1 addition & 1 deletion test/sixvertex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using TensorKit
using Test

F₀ = (4 / 3)^(3 / 2)
alg = VUMPS(; maxiter=25, verbose=false)
alg = VUMPS(; maxiter=25, verbosity=0)

@testset "ℤ₁" begin
mpo = @inferred sixvertex()
Expand Down
14 changes: 7 additions & 7 deletions test/tfim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ using TensorKit
using Test

E₀ = -1.273239
alg = VUMPS(; maxiter=25, verbose=false)
alg = VUMPS(; maxiter=25, verbosity=0)

@testset "no symmetry" begin
H = @inferred transverse_field_ising()
ψ₀ = InfiniteMPS([ComplexSpace(2)], [ComplexSpace(16)])
@test sum(abs.(imag.(expectation_value(ψ₀, H)))) 0 atol = 1e-10
@test imag(expectation_value(ψ₀, H)) 0 atol = 1e-10
ψ, envs, δ = find_groundstate(ψ₀, H, alg)
@test E₀ sum(expectation_value(ψ, H, envs)) atol = 1e-5
@test E₀ expectation_value(ψ, H, envs) atol = 1e-5
end

@testset "Z2 symmetry" begin
H = @inferred transverse_field_ising(Z2Irrep)
ψ₀ = InfiniteMPS([Rep[ℤ₂](0 => 1, 1 => 1)], [Rep[ℤ₂](0 => 8, 1 => 8)])
@test sum(abs.(imag.(expectation_value(ψ₀, H)))) 0 atol = 1e-10
@test imag(expectation_value(ψ₀, H)) 0 atol = 1e-10
ψ, envs, δ = find_groundstate(ψ₀, H, alg)
@test E₀ sum(expectation_value(ψ, H, envs)) atol = 1e-5
@test E₀ expectation_value(ψ, H, envs) atol = 1e-5
end

@testset "fZ2 symmetry" begin
H = @inferred transverse_field_ising(fℤ₂)
ψ₀ = InfiniteMPS([Vect[fℤ₂](0 => 1, 1 => 1)], [Vect[fℤ₂](0 => 8, 1 => 8)])
@test sum(abs.(imag.(expectation_value(ψ₀, H)))) 0 atol = 1e-10
@test imag(expectation_value(ψ₀, H)) 0 atol = 1e-10
ψ, envs, δ = find_groundstate(ψ₀, H, alg)
@test E₀ sum(expectation_value(ψ, H, envs)) atol = 1e-3
@test E₀ expectation_value(ψ, H, envs) atol = 1e-5
end

@testset "illegal symmetry" begin
Expand Down

0 comments on commit a632346

Please sign in to comment.