Skip to content

Commit

Permalink
Merge pull request #132 from OpenBioSim/fix_constraints
Browse files Browse the repository at this point in the history
Fix zero LJ sigma parameters
  • Loading branch information
chryswoods authored Dec 4, 2023
2 parents f00b9b3 + 52d3b87 commit 106d783
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 111 deletions.
18 changes: 11 additions & 7 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.
a water topology swap.

* Added a new :mod:`sire.options` module that contains new
:cls:`sire.options.Option` objects to represent configurable options.
:class:`sire.options.Option` objects to represent configurable options.
These include documentation, and make it easier to validate and expose
possible values of configurable options. The API docs for
:cls:`~sire.options.Option` shows how to create your own Option type.
:class:`~sire.options.Option` shows how to create your own Option type.
The unit test in ``tests/options/test_options.py`` show how to use
the options. This is integrated into the sire/OpenMM layer.

* Have :cls:`~sire.io.parser.RST7` return a list of angles from the
``box_angles()`` function, rather than a :cls:`~sire.maths.Vector`.
* Have :class:`~sire.io.parser.RST7` return a list of angles from the
``box_angles()`` function, rather than a :class:`~sire.maths.Vector`.
This prevents the confusing behaviour where the angles are wrongly
shown in units of angstroms... This fixes issues #106.

Expand All @@ -51,7 +51,11 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.
* Fix validation of ``perturbable_constraint`` dynamics option when the string
includes hyphens. This fixes issue #130.

* Fix streaming of :cls:`~sire.vol.TriclinicBox` objects. This fixes issue #128.
* Fix streaming of :class:`~sire.vol.TriclinicBox` objects. This fixes issue #128.

* Fix the sire to OpenMM conversion so that null LJ parameters will never have
a zero sigma value. They will either be sigma=1/epsilon=0 for non-perturbable
atoms, or sigma=1e-9/epsilon=1e-9 for perturbable atoms.

* Please add an item to this changelog when you create your PR

Expand Down Expand Up @@ -145,7 +149,7 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.

* Added support for alchemical restraints to the OpenMM dynamics layer.
This lets you scale restraints as part of a λ-coordinate. This is
documented in the :doc:`tutorial <tutorial/part06/04_alchemical_restraints`.
documented in the :doc:`tutorial <tutorial/part06/04_alchemical_restraints>`.
Restraints can be named, meaning that you can scale different restraints
at different stages and by different values across the λ-coordinate.

Expand Down Expand Up @@ -448,7 +452,7 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.

* Added support for performing minimisation and molecular dynamics simulations
based on the OpenMM integration. This is documented in full via both
:doc:`a tutorial <tutorial/part05/04_dynamics>` and a
:doc:`a tutorial <tutorial/part05/05_dynamics>` and a
:doc:`detailed guide <cheatsheet/openmm>`.

* Fixed the Amber PRMTOP `dihedral ring bug <https://github.com/OpenBioSim/sire/commit/397271f4229f3cbed6a4c3b425e4baaf4aae4ec5>`__.
Expand Down
177 changes: 91 additions & 86 deletions doc/source/cheatsheet/openmm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,91 +73,97 @@ by setting values for the ``temperature`` and ``pressure`` keys.

Available keys and allowable values are listed below.

+---------------------------+----------------------------------------------------------+
| Key | Valid values |
+===========================+==========================================================+
| com_reset_frequency | The frequency at which the ``CMMotionRemover`` acts to |
| | remove center of mass relative motion. If this is not |
| | set (the default) then center of mass motion is not |
| | removed. |
+---------------------------+----------------------------------------------------------+
| constraint | Type of constraint to use for bonds and/or angles. |
| | Valid strings are ``none``, ``h-bonds``, ``bonds``, |
| | ``h-bonds-h-angles`` and ``bonds-h-angles``. |
+---------------------------+----------------------------------------------------------+
| coulomb_power | The coulomb power parameter used by the softening |
| | potential used to soften interactions involving |
| | ghost atoms. |
+---------------------------+----------------------------------------------------------+
| cutoff | Size of the non-bonded cutoff, e.g. |
| | ``7.5*sr.units.angstrom`` |
+---------------------------+----------------------------------------------------------+
| cutoff_type | Type of cutoff, e.g. ``PARTICLE_MESH_EWALD``, ``PME``, |
| | ``NO_CUTOFF``, ``REACTION_FIELD``, ``RF``, ``EWALD`` |
+---------------------------+----------------------------------------------------------+
| cpu_pme | Boolean value, e.g. ``True`` or ``False`` as to whether |
| | or not PME should be evaluated on the CPU rather than |
| | on the GPU. |
+---------------------------+----------------------------------------------------------+
| device | Any valid OpenMM device number or device string, e.g. |
| | ``0`` would select device 0 |
+---------------------------+----------------------------------------------------------+
| dielectric | Dielectric value if a reaction field cutoff is used, |
| | e.g. ``78.0`` |
+---------------------------+----------------------------------------------------------+
| fixed | The atoms in the system that should be fixed (not moved) |
+---------------------------+----------------------------------------------------------+
| ignore_perturbations | Whether or not to ignore any perturbations and only set |
| | up a perturbable molecule as a non-perurbable molecule |
| | from only the reference state. |
+---------------------------+----------------------------------------------------------+
| integrator | The MD integrator to use, e.g. |
| | ``verlet``, ``leapfrog``, ``langevin``, |
| | ``langevin_middle``, ``nose_hoover``, |
| | ``brownian``, ``andersen`` |
+---------------------------+----------------------------------------------------------+
| friction | Friction value for the integrator, in inverse time, e.g. |
| | ``5.0 / sr.units.picosecond`` |
+---------------------------+----------------------------------------------------------+
| lambda | The λ-value at which to set up the system (assuming this |
| | contains any perturbable molecules or restraints) |
+---------------------------+----------------------------------------------------------+
| platform | Any valid OpenMM platform string, e.g. ``CUDA``, |
| | ``OpenCL``, ``Metal``, ```CPU``, ``Reference`` |
+---------------------------+----------------------------------------------------------+
| precision | Any valid OpenMM platform precision value, e.g. |
| | ``single``, ``mixed`` or ``double``. |
+---------------------------+----------------------------------------------------------+
| pressure | Any pressure value, e.g. ``1*sr.units.atm`` |
+---------------------------+----------------------------------------------------------+
| restraints | The :class:`~sire.mm.Restraints` object (or list of |
| | objects) that describe the restraints that should be |
| | added to the system. |
+---------------------------+----------------------------------------------------------+
| schedule | The :class:`~sire.cas.LambdaSchedule` to use that |
| | controls how parameters are modified with λ |
+---------------------------+----------------------------------------------------------+
| shift_delta | The shift_delta parameter to use for the softening |
| | potential used to soften interactions involving |
| | ghost atoms. |
+---------------------------+----------------------------------------------------------+
| space | Space in which the simulation should be conducted, e.g. |
| | `sr.vol.Cartesian` |
+---------------------------+----------------------------------------------------------+
| swap_end_states | Whether to swap the end states of a perturbable molecule |
| | (i.e. treat the perturbed state as the reference state |
| | and vice versa). |
+---------------------------+----------------------------------------------------------+
| temperature | Any temperature value, e.g. ``25*sr.units.celsius`` |
+---------------------------+----------------------------------------------------------+
| threads | The number of threads to use in the CPU platform |
+---------------------------+----------------------------------------------------------+
| timestep | Time between integration steps, e.g. |
| | ``2 * sr.units.femtosecond`` |
+---------------------------+----------------------------------------------------------+
| use_dispersion_correction | Whether or not to use the dispersion correction to |
| | deal with cutoff issues. This is very expensive. |
+---------------------------+----------------------------------------------------------+
+------------------------------+----------------------------------------------------------+
| Key | Valid values |
+==============================+==========================================================+
| com_reset_frequency | The frequency at which the ``CMMotionRemover`` acts to |
| | remove center of mass relative motion. If this is not |
| | set (the default) then center of mass motion is not |
| | removed. |
+------------------------------+----------------------------------------------------------+
| constraint | Type of constraint to use for bonds and/or angles. |
| | Valid strings are ``none``, ``h-bonds``, ``bonds``, |
| | ``h-bonds-h-angles`` and ``bonds-h-angles``. |
+------------------------------+----------------------------------------------------------+
| coulomb_power | The coulomb power parameter used by the softening |
| | potential used to soften interactions involving |
| | ghost atoms. |
+------------------------------+----------------------------------------------------------+
| cutoff | Size of the non-bonded cutoff, e.g. |
| | ``7.5*sr.units.angstrom`` |
+------------------------------+----------------------------------------------------------+
| cutoff_type | Type of cutoff, e.g. ``PARTICLE_MESH_EWALD``, ``PME``, |
| | ``NO_CUTOFF``, ``REACTION_FIELD``, ``RF``, ``EWALD`` |
+------------------------------+----------------------------------------------------------+
| cpu_pme | Boolean value, e.g. ``True`` or ``False`` as to whether |
| | or not PME should be evaluated on the CPU rather than |
| | on the GPU. |
+------------------------------+----------------------------------------------------------+
| device | Any valid OpenMM device number or device string, e.g. |
| | ``0`` would select device 0 |
+------------------------------+----------------------------------------------------------+
| dielectric | Dielectric value if a reaction field cutoff is used, |
| | e.g. ``78.0`` |
+------------------------------+----------------------------------------------------------+
| fixed | The atoms in the system that should be fixed (not moved) |
+------------------------------+----------------------------------------------------------+
| ignore_perturbations | Whether or not to ignore any perturbations and only set |
| | up a perturbable molecule as a non-perurbable molecule |
| | from only the reference state. |
+------------------------------+----------------------------------------------------------+
| include_constrained_energies | Whether or not to include the bond and angle energies |
| | of bonds and angles that are constrained. |
| | This defaults to ``True``, as we normally do want |
| | to calculate all of the energies of the internals, |
| | even if they are constrained. |
+------------------------------+----------------------------------------------------------+
| integrator | The MD integrator to use, e.g. |
| | ``verlet``, ``leapfrog``, ``langevin``, |
| | ``langevin_middle``, ``nose_hoover``, |
| | ``brownian``, ``andersen`` |
+------------------------------+----------------------------------------------------------+
| friction | Friction value for the integrator, in inverse time, e.g. |
| | ``5.0 / sr.units.picosecond`` |
+------------------------------+----------------------------------------------------------+
| lambda | The λ-value at which to set up the system (assuming this |
| | contains any perturbable molecules or restraints) |
+------------------------------+----------------------------------------------------------+
| platform | Any valid OpenMM platform string, e.g. ``CUDA``, |
| | ``OpenCL``, ``Metal``, ```CPU``, ``Reference`` |
+------------------------------+----------------------------------------------------------+
| precision | Any valid OpenMM platform precision value, e.g. |
| | ``single``, ``mixed`` or ``double``. |
+------------------------------+----------------------------------------------------------+
| pressure | Any pressure value, e.g. ``1*sr.units.atm`` |
+------------------------------+----------------------------------------------------------+
| restraints | The :class:`~sire.mm.Restraints` object (or list of |
| | objects) that describe the restraints that should be |
| | added to the system. |
+------------------------------+----------------------------------------------------------+
| schedule | The :class:`~sire.cas.LambdaSchedule` to use that |
| | controls how parameters are modified with λ |
+------------------------------+----------------------------------------------------------+
| shift_delta | The shift_delta parameter to use for the softening |
| | potential used to soften interactions involving |
| | ghost atoms. |
+------------------------------+----------------------------------------------------------+
| space | Space in which the simulation should be conducted, e.g. |
| | `sr.vol.Cartesian` |
+------------------------------+----------------------------------------------------------+
| swap_end_states | Whether to swap the end states of a perturbable molecule |
| | (i.e. treat the perturbed state as the reference state |
| | and vice versa). |
+------------------------------+----------------------------------------------------------+
| temperature | Any temperature value, e.g. ``25*sr.units.celsius`` |
+------------------------------+----------------------------------------------------------+
| threads | The number of threads to use in the CPU platform |
+------------------------------+----------------------------------------------------------+
| timestep | Time between integration steps, e.g. |
| | ``2 * sr.units.femtosecond`` |
+------------------------------+----------------------------------------------------------+
| use_dispersion_correction | Whether or not to use the dispersion correction to |
| | deal with cutoff issues. This is very expensive. |
+------------------------------+----------------------------------------------------------+

Higher level API
----------------
Expand Down Expand Up @@ -336,4 +342,3 @@ from files (e.g. via that property of the ``.trajectory()`` function).
The energies are saved to the ``energy_trajectory`` property of the
returned molecules, and accessible via that property or the
:func:`~sire.system.System.energy_trajectory` function.

Loading

0 comments on commit 106d783

Please sign in to comment.