diff --git a/src/loch/_sampler.py b/src/loch/_sampler.py index 98155bb..faec480 100644 --- a/src/loch/_sampler.py +++ b/src/loch/_sampler.py @@ -1401,7 +1401,11 @@ def move(self, context: _openmm.Context) -> list[int]: # Compute the PME acceptance correction. acc_prob = _np.exp( - -self._beta_openmm * (final_energy - initial_energy - dE_RF) + min( + 0.0, + -self._beta_openmm + * (final_energy - initial_energy - dE_RF), + ) ) # Store the PME energy change and acceptance probability. @@ -1482,7 +1486,11 @@ def move(self, context: _openmm.Context) -> list[int]: # Compute the PME acceptance correction. acc_prob = _np.exp( - -self._beta_openmm * (final_energy - initial_energy - dE_RF) + min( + 0.0, + -self._beta_openmm + * (final_energy - initial_energy - dE_RF), + ) ) # Store the PME energy change and acceptance probability.