You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The non-bonded interactions set_params() method has undocumented behavior that can lead to unphysical potentials.
Once a non-bonded interaction is activated with valid parameters using set_params(), the second call to set_params() silently changes behavior: required parameters become optional, and missing arguments are populated using the values currently in the core, completely bypassing the default_params() method.
This unexpected behavior can compromise simulation scripts in two ways:
The user intends to reset an interaction with only the required parameters, expecting the default parameters to populate the missing non-required parameters: the old parameters are silently recycled
The user discovers this undocumented behavior and intends to use it to update one parameter of a LennardJonesInteraction or GenericLennardJonesInteraction potential that was previously set up with shift="auto": the shift parameter is not automatically recalculated and the potential has a jump in energy.
Here is a MWE to reproduce the bug in the second scenario:
Fixes#4555 and fixes#4569
Description of changes:
- rewrite non-bonded interactions as script interface objects
- convert Cython file `interaction.pyx` to Python file `interaction.py`
- 1600 lines of Cython code were removed
- bugfix: the `set_params()` method now raises an error if required arguments are not provided
- scripts may silently break when a potential is set and later updated in a way that is affected by the bug described in #4569
- new feature: possibility to deactivate/reset non-bonded interactions
- reduce code duplication in the script interface of bonded interactions
The non-bonded interactions
set_params()
method has undocumented behavior that can lead to unphysical potentials.Once a non-bonded interaction is activated with valid parameters using
set_params()
, the second call toset_params()
silently changes behavior: required parameters become optional, and missing arguments are populated using the values currently in the core, completely bypassing thedefault_params()
method.This unexpected behavior can compromise simulation scripts in two ways:
LennardJonesInteraction
orGenericLennardJonesInteraction
potential that was previously set up withshift="auto"
: theshift
parameter is not automatically recalculated and the potential has a jump in energy.Here is a MWE to reproduce the bug in the second scenario:
The text was updated successfully, but these errors were encountered: