ExtendedSpaceSystem

class openxps.ExtendedSpaceSystem(system, coupling)[source]

An openmm.System object that includes extra dynamical variables (DVs) and allows for extended phase-space (XPS) simulations.

Note: The system provided as argument is modified in place.

Parameters:
  • system (System) – The openmm.System to be used in the XPS simulation.

  • coupling (Coupling) – A Coupling object, required to couple the physical and extended phase-space systems. The dynamical variables are obtained from this coupling. Its forces are moved into system, so a coupling can be part of only one system. To reuse it, pass a deep copy (copy.deepcopy(coupling)).

Example

>>> import openxps as xps
>>> from math import pi
>>> import openmm
>>> import cvpack
>>> from openmm import unit
>>> from openmmtools import testsystems
>>> model = testsystems.AlanineDipeptideVacuum()
>>> mass = 3 * unit.dalton*(unit.nanometer/unit.radian)**2
>>> phi0 = xps.DynamicalVariable("phi0", unit.radian, mass, xps.CircularBounds())
>>> harmonic_force = xps.HarmonicCoupling(
...     cvpack.Torsion(6, 8, 14, 16, name="phi"),
...     phi0,
...     1000 * unit.kilojoules_per_mole / unit.radian**2,
... )
>>> system = xps.ExtendedSpaceSystem(model.system, harmonic_force)
>>> system.getDynamicalVariables()
(DynamicalVariable(name='phi0', unit=rad, mass=3 nm**2 Da/(rad**2), bounds=...),)
>>> system.getExtensionSystem().getNumParticles()
1

Methods

getCoupling()[source]

Get the coupling included in the extended phase-space system.

Returns:

The coupling.

Return type:

Coupling

getDynamicalVariables()[source]

Get the dynamical variables included in the extended phase-space system.

Returns:

The dynamical variables, converted to MD units. Their order is the one expected by the methods of ExtendedSpaceContext that get or set the values and velocities of dynamical variables.

Return type:

t.Tuple[DynamicalVariable]

getExtensionSystem()[source]

Get the extension system included in the extended phase-space system.

Returns:

The extension system.

Return type:

mm.System