From eac90dd5f37abd4dc29628268697f45bb7558018 Mon Sep 17 00:00:00 2001 From: Pablo Zubieta <8410335+pabloferz@users.noreply.github.com> Date: Mon, 24 May 2021 05:18:24 -0500 Subject: [PATCH] Update README --- README.md | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e95efd05..b35fe9f0 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,20 @@ PySAGES (Python Suite for Advanced General Ensemble Simulations) is an Python implementation of [SSAGES](https://ssagesproject.github.io) with support for GPUs. -**NOTICE**: This is in early stages of development, expect failures and breaking changes. +**NOTICE**: This is in early stages of development, expect breaking changes. ## Installation Currently, there is only support for -[HOOMD-blue](https://glotzerlab.engin.umich.edu/hoomd-blue), but gradual support for other -molecular dynamics engines is planned (for instance, for all engines already supported by -the original SSAGES). +[HOOMD-blue](https://glotzerlab.engin.umich.edu/hoomd-blue) and +[OpenMM](http://openmm.org/), but gradual support for other molecular dynamics engines is +planned (for instance, for all engines already supported by the original SSAGES). -You need to first install HOOMD-blue and additionaly build the [HOOMD-dlpack -Plugin](https://github.com/pabloferz/hoomd-dlext). +You first need to install one of the following plugins depending on your molecular +dynamics engine + + - For HOOMD-blue visit [HOOMD-dlpack Plugin](https://github.com/SSAGESLabs/hoomd-dlext). + - For OpenMM go to [OpenMM](https://github.com/SSAGESLabs/openmm-dlext). PySAGES also depends on [JAX](https://github.com/google/jax/), follow their installation guide to set it up. @@ -26,7 +29,34 @@ GPU support. PySAGES provide a straightforward interface to setup Collective Variables and Enhaced Sampling methods to you MD simulations. See the documentation to learn more. +Here is an example of how to hook pysages to an OpenMM simulation of alanine dipeptide + +```python +# Your code to define a OpenMM goes first + +# Load pysages +from numpy import pi +import pysages + +# Declare a list of collective variables +cvs = ( + pysages.collective_variables.DihedralAngle((4, 6, 8, 14)), + pysages.collective_variables.DihedralAngle((6, 8, 14, 16)) +) + +# Define a grid if the sampling method requires one +grid = pysages.Grid( + lower = (-pi, -pi), + upper = ( pi, pi), + shape = (32, 32), + periodic = True +) + +# Declare the sampling method to be used +sampling_method = pysages.methods.ABF(ΞΎ, grid, N = 100) + +# Hook pysages to the simulation +sampler = pysages.bind(context, sampling_method) -
- PySAGES -
+# Now run the simulation for any number of time steps +```