Skip to content

Commit

Permalink
Merge pull request #951 from dwhswenson/revert-c2d47f0
Browse files Browse the repository at this point in the history
Revert c2d47f0
  • Loading branch information
dwhswenson committed Dec 23, 2020
2 parents c6095fd + 6b0ff89 commit abfc895
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 52 deletions.
2 changes: 1 addition & 1 deletion openpathsampling/engines/toy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .integrators import (LangevinBAOABIntegrator, LeapfrogVerletIntegrator)
from .pes import Gaussian, HarmonicOscillator, LinearSlope, OuterWalls, \
PES_Add, PES_Combination, PES_Sub, PES, BolhuisExample
PES_Add, PES_Combination, PES_Sub, PES

from .engine import ToyEngine as Engine
from .engine import ToyEngine
Expand Down
51 changes: 0 additions & 51 deletions openpathsampling/engines/toy/pes.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,54 +368,3 @@ def dVdx(self, sys):
"""
# this is independent of the position
return self._local_dVdx

class BolhuisExample(PES):
r"""Creates an x**4 - 2 x**2 1 dimensional PES
Parameters
----------
None
"""
def __init__(self):
super(BolhuisExample, self).__init__()
self._local_dVdx = np.zeros(1)

def __repr__(self): # pragma: no cover
return "The x**4 - 2 x**2 example in Bolhuis papers potential"

def V(self, sys):
"""Potential energy
Parameters
----------
sys : :class:`.ToyEngine`
engine contains its state, including velocities and masses
Returns
-------
float
the potential energy
"""
dx = sys.positions
myV = 0.0
for i in range(len(dx)):
myV += dx[i]**4 - 2 * dx[i]**2
return myV

def dVdx(self, sys):
"""Derivative of potential energy (-force)
Parameters
----------
sys : :class:`.ToyEngine`
engine contains its state, including velocities and masses
Returns
-------
np.array
the derivatives of the potential at this point
"""
dx = sys.positions
for i in range(len(dx)):
self._local_dVdx[i] =4*dx[i]**3 - 4*dx[i]
return self._local_dVdx

0 comments on commit abfc895

Please sign in to comment.