From 23cc545abd7049487a670d5845d89d85d6949784 Mon Sep 17 00:00:00 2001 From: Benedikt Kloss Date: Sat, 20 Jan 2024 20:39:02 -0500 Subject: [PATCH] Apply review suggestions. --- src/solvers/contract.jl | 6 +++--- src/solvers/dmrg_x.jl | 2 +- src/solvers/eigsolve.jl | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/solvers/contract.jl b/src/solvers/contract.jl index fc2b176e..588d35ae 100644 --- a/src/solvers/contract.jl +++ b/src/solvers/contract.jl @@ -9,11 +9,11 @@ function contract_updater( region_kwargs, updater_kwargs, ) - v = ITensor(1.0) + v = ITensor(true) projected_operator = projected_operator![] for j in sites(projected_operator) v *= projected_operator.psi0[j] end - Hpsi0 = contract(projected_operator, v) - return Hpsi0, (;) + vp = contract(projected_operator, v) + return vp, (;) end diff --git a/src/solvers/dmrg_x.jl b/src/solvers/dmrg_x.jl index 09618a9f..f1054726 100644 --- a/src/solvers/dmrg_x.jl +++ b/src/solvers/dmrg_x.jl @@ -12,7 +12,7 @@ function dmrg_x_updater( # this updater does not seem to accept any kwargs? default_updater_kwargs = (;) updater_kwargs = merge(default_updater_kwargs, updater_kwargs) - H = contract(projected_operator![], ITensor(1.0)) + H = contract(projected_operator![], ITensor(true)) D, U = eigen(H; ishermitian=true) u = uniqueind(U, H) max_overlap, max_ind = findmax(abs, array(dag(init) * U)) diff --git a/src/solvers/eigsolve.jl b/src/solvers/eigsolve.jl index aace5e09..abfa3a85 100644 --- a/src/solvers/eigsolve.jl +++ b/src/solvers/eigsolve.jl @@ -10,7 +10,7 @@ function eigsolve_updater( updater_kwargs, ) default_updater_kwargs = (; - which_eigenvalue=:SR, + which_eigval=:SR, ishermitian=true, tol=1e-14, krylovdim=3, @@ -20,13 +20,14 @@ function eigsolve_updater( ) updater_kwargs = merge(default_updater_kwargs, updater_kwargs) #last collection has precedence howmany = 1 - which, updater_kwargs = _pop_which_eigenvalue(; updater_kwargs...) + (; which_eigval) = updater_kwargs + updater_kwargs = Base.structdiff(updater_kwargs, (; which_eigval=nothing)) vals, vecs, info = eigsolve( projected_operator![], init, howmany, - which; - updater_kwargs..., #this leaves it + which_eigval; + updater_kwargs..., ) return vecs[1], (; info, eigvals=vals) end