Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to the Alchemical Dynamics docs #275

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
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
24 changes: 8 additions & 16 deletions doc/source/tutorial/part06/02_alchemical_dynamics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ a :class:`sire.cas.LambdaSchedule`.
You can get the λ-schedule used by the dynamics simulation using the
:func:`~sire.mol.Dynamics.lambda_schedule` function, e.g.

>>> s = d.lambda_schedule()
>>> s = d.get_schedule()
>>> print(s)
LambdaSchedule(
morph: λ * final + initial * (-λ + 1)
Expand All @@ -224,13 +224,13 @@ You can plot how this schedule would morph the perturbable properties
using the :func:`~sire.cas.LambdaSchedule.plot` function, e.g.

>>> df = get_lever_values(initial=2.0, final=3.0)
>>> df.plot()
>>> df.plot(subplots=True)

.. image:: images/06_02_01.jpg
:alt: View of the default λ-schedule

This shows how the different levers available in this schedule would morph
a hyperthetical parameter that has an ``initial`` value of ``2.0`` and a
a hypothetical parameter that has an ``initial`` value of ``2.0`` and a
``final`` value of ``3.0``.

In this case the levers are all identical, so would change the parameter
Expand All @@ -249,7 +249,7 @@ This shows that in the default ``morph`` stage of this schedule, we will
scale the ``charge`` parameters by λ^2, while all other parameters (the
default) will scale using λ. We can plot the result of this using;

>>> s.get_lever_values(initial=2.0, final=3.0).plot()
>>> s.get_lever_values(initial=2.0, final=3.0).plot(subplots=True)

.. image:: images/06_02_02.jpg
:alt: View of the λ-schedule where charge is scaled by λ^2
Expand All @@ -276,10 +276,10 @@ LambdaSchedule(
charge: final * (-λ + 1)
)

Again, it is worth plotting the impact of this schedule on a hyperthetical
Again, it is worth plotting the impact of this schedule on a hypothetical
parameter.

>>> s.get_lever_values(initial=2.0, final=3.0).plot()
>>> s.get_lever_values(initial=2.0, final=3.0).plot(subplots=True)

.. image:: images/06_02_03.jpg
:alt: View of the λ-schedule where charge is scaled in a second stage to zero.
Expand Down Expand Up @@ -331,23 +331,15 @@ the charge lever from γ times the ``final`` value to the full
``final`` value. It also scales the charge lever in the ``morph`` stage
by γ, which is set to 0.2 for all stages.

We can see how this would affect a hyperthetical parameter that goes
We can see how this would affect a hypothetical parameter that goes
from an ``initial`` value of 2.0 to a ``final`` value of 3.0 via

>>> s.get_lever_values(initial=2.0, final=3.0).plot()
>>> s.get_lever_values(initial=2.0, final=3.0).plot(subplots=True)

.. image:: images/06_02_04.jpg
:alt: View of the λ-schedule that sandwiches a standard morph stage
between two stages that scale the charge lever.

.. note::

Schedules constructed outside of the dynamics simulation do not have
the full set of levers (e.g. torsion_k, dih_scale etc) as
levers are only added as they are needed (hence why only
``default`` and ``charge`` are shown here). The additional levers
are added when the schedule is added to the simulation.

Once you have created your schedule you can add it via the
:meth:`~sire.mol.Dynamics.set_schedule` function of the
:class:`~sire.mol.Dynamics` object, e.g.
Expand Down
Binary file modified doc/source/tutorial/part06/images/06_02_01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/source/tutorial/part06/images/06_02_02.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/source/tutorial/part06/images/06_02_03.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/source/tutorial/part06/images/06_02_04.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.