Skip to content

Release 0.9.4 - Nonequilibrium integrators overhaul

Pre-release
Pre-release
Compare
Choose a tag to compare
@jchodera jchodera released this 10 May 02:22

Major changes

  • Overhaul of LangevinIntegrator and subclasses to better support nonequilibrium integrators
  • Add true reaction-field support to AlchemicalFactory
  • Add some alchemical test systems

Updates to openmmtools.integrators.LangevinIntegrator and friends

API-breaking changes:

  • The nonequilibrium integrators are now called AlchemicalNonequilibriumLangevinIntegrator and ExternalPerturbationLangevinIntegrator, and both are subclasses of a common NonequilibriumLangevinIntegrator that provides a consistent interface to setting and getting protocol_work
  • AlchemicalNonequilibriumLangevinIntegrator now has a default alchemical_functions to eliminate need for every test to treat it as a special case (#180)
  • The get_protocol_work() method allows you to retrieve the protocol work from any NonequilibriumLangevinIntegrator subclass and returns a unit-bearing work. The optional dimensionless=True argument returns a dimensionless float in units of kT.
  • Integrator global variables now store all energies in natural OpenMM units (kJ/mol) but the new accessor methods (see below) should b used instead of getting integrator global variables for work and heat. (#181)
  • Any private methods for adding steps to the integrator have been prepended with _ to hide them from the public API.

New features

  • Order of arguments for all LangevinIntegrator derivatives matches openmm.LangevinIntegrator so it can act as a drop-in replacement. (#176)
  • The get_shadow_work() and get_heat() methods are now available for any LangevinIntegrator subclass, as well as the corresponding properties shadow_work and heat. The functions also support dimensionless=True. (#163)
  • The shadow_work and heat properties were added to all LangevinIntegrator subclasses, returning the values of these properties (if the integrator was constructed with the appropriate measure_shadow_work=True or measure_heat=True flags) as unit-bearing quantities
  • The get_protocol_work() and get_total_work() methods are now available for any NonequilibriumLangevinIntegrator, returning unit-bearing quantities unless dimensionless=True is provided in which case they return the work in implicit units of kT. get_total_work() requires the integrator to have been constructed with measure_shadow_work=True.
  • The protocol_work and total_work properties were added to all NonequilibriumLangevinIntegrator subclasses, and return the unit-bearing work quantities. total_work requires the integrator to have been constructed with measure_shadow_work=True.
  • The subclasses have been reworked to support any kwargs that the base classes support, and defaults have all been made consistent.
  • Various reset() methods have been added to reset statistics for all LangevinIntegrator subclasses.
  • All custom integrators support .pretty_format() and .pretty_print() with optional highlighting of specific step types.

Bugfixes

  • Zero-step perturbations now work correctly (#177)
  • AlchemicalNonequilibriumLangevinIntegrator now correctly supports multiple H steps.

Internal changes

  • Adding new LangevinIntegrator step methods now uses a self._register_step_method(step_string, callback_function, supports_force_groups=False) call to simplify this process.
  • Code duplication has been reduced through the use of calling base class methods whenever possible.
  • run_nonequilibrium_switching() test now uses BAR to test dragging a harmonic oscillator and tests a variety of integrator splittings (["O { V R H R V } O", "O V R H R V O", "R V O H O V R", "H R V O V R H"]).
  • Integrator tests use deterministic PME and mixed precision when able.

Updates to openmmtools.alchemy.AlchemicalFactory

Reaction field electrostatics now removes the shift, setting c_rf = 0.

A convenience method AlchemicalFactory.replace_reaction_field() has been added to allow fully-interacting systems to be modified to force c_rf = 0 by recoding reaction-field electrostatics as a CustomNonbondedForce

New openmmtools.testsystems classes

  • AlchemicalWaterBox was added, which has the first water molecule in the system alchemically modified