Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pele/transition_states/_NEB.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,20 @@ def tangent(self, central, left, right, gleft, gright):
tright = -gright

# special interpolation treatment for maxima/minima
if (central >= left and central >= right) or (central <= left and central <= right):
if (central > left and central > right) or (central < left and central < right):
if left > right:
t = vmax * tleft + vmin * tright
else:
t = vmin * tleft + vmax * tright
# left is higher, take this one
elif left > right:
t = tleft
# otherwise take right
else:
# right is higher, take this one
elif left < right:
t = tright
# flat section (i.e. all energy levels equal) -> fallback to original NEB tangent
else:
t = tleft / norm(tleft) + tright / norm(tright)

return t / norm(t)

Expand Down