Skip to content

Commit

Permalink
Apply review suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
b-kloss committed Jan 21, 2024
1 parent 9e8e635 commit 23cc545
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/solvers/contract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/solvers/dmrg_x.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
9 changes: 5 additions & 4 deletions src/solvers/eigsolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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![],

Check warning on line 26 in src/solvers/eigsolve.jl

View workflow job for this annotation

GitHub Actions / format

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/solvers/eigsolve.jl:26:- projected_operator![], src/solvers/eigsolve.jl:27:- init, src/solvers/eigsolve.jl:28:- howmany, src/solvers/eigsolve.jl:29:- which_eigval; src/solvers/eigsolve.jl:30:- updater_kwargs..., src/solvers/eigsolve.jl:26:+ projected_operator![], init, howmany, which_eigval; updater_kwargs...
init,
howmany,
which;
updater_kwargs..., #this leaves it
which_eigval;
updater_kwargs...,
)
return vecs[1], (; info, eigvals=vals)
end
Expand Down

0 comments on commit 23cc545

Please sign in to comment.