Increase krylovdim and check convergence

This commit is contained in:
ysyapa 2023-08-18 21:36:09 +00:00
parent c38e4c8c0e
commit 7e419aee26
1 changed files with 2 additions and 2 deletions

View File

@ -134,8 +134,8 @@ function eig(H::Hamiltonian{T}, levels::Int; resonances = !H.hermitian)::Tuple{V
x₀ = CUDA.rand(Complex{T}, vectorDims(H)...) x₀ = CUDA.rand(Complex{T}, vectorDims(H)...)
synchronize() synchronize()
end end
evals, evecs, info = eigsolve(H, x₀, levels, resonances ? :LI : :SR; ishermitian = H.hermitian, tol = tolerance, krylovdim = levels * 2) evals, evecs, info = eigsolve(H, x₀, levels, resonances ? :LI : :SR; ishermitian = H.hermitian, tol = tolerance, krylovdim = levels * 4)
resonances || info.converged < levels && throw(error("Not enough convergence")) # don't check convergence for resonances info.converged < levels && throw(error("Not enough convergence"))
if H.hermitian evals = real.(evals) end if H.hermitian evals = real.(evals) end
if H.mode == gpu_cutensor # to avoid possible GPU memory leak if H.mode == gpu_cutensor # to avoid possible GPU memory leak
CUDA.reclaim() CUDA.reclaim()