Skip to content

Commit

Permalink
Add twosite DMRG excitations to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Dec 11, 2024
1 parent 58040ec commit 0fa6e21
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,16 +426,16 @@ end
ψ = FiniteMPS(rand, ComplexF64, len, ℙ^2, ℙ^15)
(ψ, envs, _) = find_groundstate(ψ, H; verbosity)

#find energy with quasiparticle ansatz
# find energy with quasiparticle ansatz
energies_QP, ϕs = excitations(H, QuasiparticleAnsatz(), ψ, envs)
@test variance(ϕs[1], H) < 1e-6

#find energy with normal dmrg
energies_dm, _ = excitations(H,
FiniteExcited(;
gsalg=DMRG(; verbosity,
tol=1e-6)), ψ)
@test energies_dm[1] energies_QP[1] + expectation_value(ψ, H, envs) atol = 1e-4
# find energy with normal dmrg
for gsalg in (DMRG(; verbosity, tol=1e-6),
DMRG2(; verbosity, tol=1e-6, trscheme=truncbelow(1e-4)))
energies_dm, _ = excitations(H, FiniteExcited(; gsalg), ψ)
@test energies_dm[1] energies_QP[1] + expectation_value(ψ, H, envs) atol = 1e-4
end

# find energy with Chepiga ansatz
energies_ch, _ = excitations(H, ChepigaAnsatz(), ψ, envs)
Expand Down

0 comments on commit 0fa6e21

Please sign in to comment.