choderalab / openmmtools

A batteries-included toolkit for the GPU-accelerated OpenMM molecular simulation engine.
http://openmmtools.readthedocs.io
MIT License
244 stars 76 forks source link

Add fancy GHMC integrators to openmmtools.integrators #209

Open jchodera opened 7 years ago

jchodera commented 7 years ago

@kyleabeauchamp : Would you be OK with us pulling some of your fancy (G)HMC integrators into openmmtools.integrators from https://github.com/kyleabeauchamp/openmmtools/blob/hmc/openmmtools/hmc_integrators.py? It looks like you've got some great stuff in there, including ideas we could integrate into our base integrator classes to help with timing, performance, and acceptance rate analysis.

kyleabeauchamp commented 7 years ago

SGTM. My most recent branch is this one:

https://github.com/kyleabeauchamp/openmmtools/tree/mjhmc2

I believe the key "useful ideas" are as follows:

  1. A reasonably sane Mixin-based inheritance model for sharing code between various flavors of (G)HMC integrators that optionally include RESPA, XCHMC, etc.
  2. Several property decorators for bookkeeping performance, e.g. the effective ns per day, acceptance rate, raw ns per day, etc.

IIRC you guys have recently added a few additional helper functions and "best practices" for dealing with the Thermodynamic State, so I would need to update my code to integrate the latest idioms.

TLDR: I'll re-read the new integrator class hierarchy and see if I can update my code to use your latest base class. I won't get around to this until Wednesday evening at the earliest, as I'm currently at ESHG and my GPU box is powered down.

kyleabeauchamp commented 7 years ago

Also: do I need to understand the Samplers infrastructure and/or the geodesic integrators? Or will GHMC be independent of those classes.

jchodera commented 7 years ago

Thanks!

The integrators in openmmtools.integrators are low level, and are meant to be drop-in replacements for simtk.openmm integrators. The other API layers sit on top of this: First, openmmtools.mcmc, then we're layering openmmtools.samplers on top of that. But there's no need to understand these higher-level APIs to implement integrators into openmmtools.integrators.

The mixins and decorators sound useful, but it might make sense to incorporate these in two stages if it's not immediately obvious how to incorporate them into the other integrators right now.

The LangevinIntegrator scheme is very flexible and could form the basis for generalizing the XCHMC integrators to use Langevin-like integrator kernels (XCGHMC?) in the future.

Enjoy Wien!

jchodera commented 7 years ago

@kyleabeauchamp : Just a quick update here---@maxentile has been testing out your XCGHMC to see if it might solve our sampling issues for trying to generate exact samples from the posterior distribution. There may be a couple of bugs we're shaking out, so it would be great to have you two coordinate if he ends up needing to pull XCGHMC into openmmtools.integrators for the Langevin integrators paper we're working on (which you're still welcome to join as a coauthor!).

kyleabeauchamp commented 7 years ago

SGTM, we are scheduling a video chat soon.