Skip to content

Commit

Permalink
cleanup irc module
Browse files Browse the repository at this point in the history
  • Loading branch information
ehermes committed May 5, 2022
1 parent 327271e commit 68d9750
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sella/optimize/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def irun(self, fmax=0.05, fmax_inner=0.01, steps=None, direction='forward'):
Hw = self.H0 / np.outer(self.sqrtm, self.sqrtm)
_, vecs = eigh(Hw)
self.v0ts = self.dx * vecs[:, 0] / self.sqrtm
#self.v0ts = vecs[:, 0] / self.sqrtm
#self.v0ts *= 0.5 * self.dx / np.linalg.norm(self.v0ts)
self.pescurr = self.pes.curr.copy()
self.peslast = self.pes.last.copy()
else:
Expand Down Expand Up @@ -123,15 +121,13 @@ def step(self):
d1m /= np.linalg.norm(d1m)
g1m = g1 / self.sqrtm

# Temporary: calculate projected gradient
g1m_proj = g1m - d1m * (d1m @ g1m)
fmax = np.linalg.norm((g1m_proj * self.sqrtm).reshape((-1, 3)), axis=1).max()

g1m /= np.linalg.norm(g1m)
dot = np.abs(d1m @ g1m)
snorm = np.linalg.norm(s)
print(bound_clip, snorm, dot, fmax)
#if bound_clip and abs(1 - dot) < self.irctol:
#print(bound_clip, snorm, dot, fmax)
if bound_clip and fmax < self.fmax_inner:
break
elif self.converged():
Expand Down

0 comments on commit 68d9750

Please # to comment.