Skip to content

Commit

Permalink
Fix undefined variable in tdscf._lr_eig
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Nov 17, 2024
1 parent fee6c15 commit d93d403
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyscf/tdscf/_lr_eig.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ def eig(aop, x0, precond, tol_residual=1e-5, nroots=1, x0sym=None, pick=None,
heff = None
e = None
v = None
conv_last = conv = np.zeros(nroots, dtype=bool)

if x0sym is not None:
x0_ir = np.asarray(x0sym)
Expand All @@ -299,6 +298,8 @@ def eig(aop, x0, precond, tol_residual=1e-5, nroots=1, x0sym=None, pick=None,
fresh_start = True
for icyc in range(max_cycle):
if fresh_start:
vlast = None
conv_last = conv = np.zeros(nroots, dtype=bool)
xs = np.zeros((0, x0_size))
ax = np.zeros((0, x0_size))
row1 = 0
Expand Down Expand Up @@ -370,7 +371,7 @@ def eig(aop, x0, precond, tol_residual=1e-5, nroots=1, x0sym=None, pick=None,

w, e, elast = w[:space_inc], w[:nroots], e
v = v[:,:space_inc]
if not fresh_start:
if not fresh_start and vlast is not None:
elast, conv_last = _sort_elast(elast, conv, vlast, v[:,:nroots], log)
vlast = v[:,:nroots]

Expand Down

0 comments on commit d93d403

Please sign in to comment.