Metadata-Version: 2.4
Name: ufedmm
Version: 0.4.0
Summary: Unified Free Energy Dynamics with OpenMM
Author-email: Charlles Abreu <craabreu@gmail.com>
License-Expression: MIT
Project-URL: Source, https://github.com/craabreu/ufedmm
Project-URL: Documentation, https://craabreu.github.io/ufedmm/latest
Project-URL: Changelog, https://github.com/craabreu/ufedmm/blob/main/CHANGELOG.md
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: cvpack
Requires-Dist: numpy
Requires-Dist: openmm>=8.4
Requires-Dist: pandas
Requires-Dist: pyyaml
Requires-Dist: scipy
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

Unified Free Energy Dynamics with OpenMM
========================================

[//]: # (Badges)
[![Linux](https://github.com/craabreu/ufedmm/workflows/Linux/badge.svg)](https://github.com/craabreu/ufedmm/actions?query=workflow%3ALinux)
[![MacOS](https://github.com/craabreu/ufedmm/workflows/MacOS/badge.svg)](https://github.com/craabreu/ufedmm/actions?query=workflow%3AMacOS)
[![Windows](https://github.com/craabreu/ufedmm/workflows/Windows/badge.svg)](https://github.com/craabreu/ufedmm/actions?query=workflow%3AWindows)
[![Linter](https://github.com/craabreu/ufedmm/workflows/Linter/badge.svg)](https://github.com/craabreu/ufedmm/actions?query=workflow%3ALinter)
[![Docs](https://github.com/craabreu/ufedmm/workflows/Docs/badge.svg)](https://craabreu.github.io/ufedmm/latest)
[![Coverage](https://craabreu.github.io/ufedmm/latest/coverage/coverage.svg)](https://craabreu.github.io/ufedmm/latest/coverage/)
[![License](https://img.shields.io/badge/License-MIT-yellowgreen.svg?style=flat)](https://github.com/craabreu/ufedmm/blob/main/LICENSE.md)

[![PyPI version](https://img.shields.io/pypi/v/ufedmm.svg)](https://pypi.org/project/ufedmm)
[![Conda ufedmm version](https://img.shields.io/conda/v/mdtools/ufedmm.svg)](https://anaconda.org/mdtools/ufedmm)
[![Conda ufedmm platforms](https://img.shields.io/conda/pn/mdtools/ufedmm.svg)](https://anaconda.org/mdtools/ufedmm)
[![Conda ufedmm downloads](https://img.shields.io/conda/dn/mdtools/ufedmm.svg)](https://anaconda.org/mdtools/ufedmm)

UFEDMM extends [OpenMM's Python API] so that the user can easily run
efficient simulations in extended phase spaces, perform enhanced sampling
of systems with barriers and rare events, and compute accurate free-energy
surfaces for collective variables or reaction coordinates.

#### Extended Phase-Space Dynamics

The concept of extended phase space is a powerful tool in Molecular
Dynamics. It consists of treating arbitrary variables as coordinates of
fictitious particles, assigning masses to these particles, and solving
equations of motion that encode their interactions with the system
molecules. Differently from _collective variables_, which are functions
of atomic coordinates, these _extra dynamical variables_ are independent
ones. Together with their conjugate momenta, they add new dimensions to
the system's phase space.

#### Free Energy Calculations

Free energy is an important thermodynamic property that quantifies the
relative likelihood of different states of a system. UFEDMM uses
extended phase-space dynamics to facilitate the calculation of free
energy as a function of extra dynamical variables. Under certain
assumptions, this is a suitable approximation for the free energy as
a function of collective variables, also known as the potential of mean
force (PMF).

#### Enhanced Sampling of Rare Events

UFEDMM combines two methods to efficiently overcome free-energy barriers.
The [TAMD]/[d-AFED] method heats the extended variables to a higher
temperature than the one specified for the molecules. The [Metadynamics]
method floods free-energy basins with potential energy so that barriers
are eventually smoothed out. This is the Unified Free Energy Dynamics
([UFED]) method: heating and flooding, all at once.

## Methods and Algorithms

Interaction between a fictitious particle and the actual molecules is
enacted by adding, to the total potential energy of the system, a new
term that depends both on the corresponding dynamical variable and at
least one collective variable. With OpenMM's [CustomCVForce] class,
adding such a term is as simple as writing down a mathematical expression.
All the low-level coding and compilation take place automatically in the
background.

UFEDMM builds on the customization capability of OpenMM to enable efficient
[UFED] simulations in GPUs and other parallel computation platforms. It
is efficient because it makes OpenMM treat extra dynamical variables like
normal atomic coordinates, thus avoiding the computational overhead of
dealing with [Context] parameters.

[TAMD]/[d-AFED] is optionally enabled by assigning distinct temperatures
to the molecules and the extra dynamical variables. For this, UFEDMM
provides special [CustomIntegrator] subclasses, given that the intrinsic
OpenMM integrators cannot handle multiple temperatures. Extended-space
[Metadynamics] is enabled by explicitly defining the height and widths of
Gaussian hills to be deposited over time, as well as the deposition period.

For the post-processing of [UFED] simulations, a free energy analysis tool
is provided, which is based on mean-force estimation and radial basis set
reconstruction of free energy (hyper)surfaces.

## Collective Variable Package (cvpack)

In OpenMM, a collective variable (CV) involved in a [CustomCVForce] is
nothing but an instance of some `Force` subclass. The user is free to define any
CV for a [UFED] simulation. For convenience, though, UFEDMM provides access to
an external library of useful collective variables named
[CVPack](https://github.com/craabreu/cvpack). It can be accessed via
the `ufedmm.cvpack` module.

### Installation and Usage

UFEDMM is available on PyPI and as a conda package in the
[mdtools](https://anaconda.org/mdtools) conda channel.

With conda:

```bash
    conda install -c conda-forge -c mdtools ufedmm
```

With pip:

```bash
    pip install ufedmm
```

To use UFEDMM in your own Python script or Jupyter notebook, import it as follows:

```python
    import ufedmm
```

## Documentation

https://craabreu.github.io/ufedmm/latest

## Citing UFEDMM

If you use UFEDMM in published work, please cite:

S. Bajpai, B. K. Petkov, M. Tong, C. R. A. Abreu, N. N. Nair, and M. E. Tuckerman,
"An interoperable implementation of collective-variable based enhanced sampling
methods in extended phase space within the OpenMM package,"
*J. Comput. Chem.* **44**(28), 2166–2183 (2023).
[doi:10.1002/jcc.27182](https://doi.org/10.1002/jcc.27182)

```bibtex
@article{bajpai2023,
  author  = {Bajpai, Shitanshu and Petkov, Brian K. and Tong, Muchen and Abreu, Charlles R. A. and Nair, Nisanth N. and Tuckerman, Mark E.},
  title   = {An interoperable implementation of collective-variable based enhanced sampling methods in extended phase space within the {OpenMM} package},
  journal = {Journal of Computational Chemistry},
  volume  = {44},
  number  = {28},
  pages   = {2166--2183},
  year    = {2023},
  doi     = {10.1002/jcc.27182},
}
```

#### Copyright

This is an open-source (MIT licensed) project. Contribution is welcome.

#### Acknowledgements

Project structure based on the
[Computational Molecular Science Python Cookiecutter](https://github.com/molssi/cookiecutter-cms) version 1.0.

[OpenMM's Python API]: http://docs.openmm.org/latest/api-python/index.html
[TAMD]: http://doi.org/10.1016/j.cplett.2006.05.062
[d-AFED]: http://doi.org/10.1021/jp805039u
[Metadynamics]: http://doi.org/10.1021/jp045424k
[UFED]: http://doi.org/10.1063/1.4733389
[Context]: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.Context.html
[CustomCVForce]: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.CustomCVForce.html
[CustomIntegrator]: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.CustomIntegrator.html
