ExtendedSpaceContext

class ufedmm.ExtendedSpaceContext(variables, system, *args, **kwargs)[source]

An extension of the openmm.Context class.

Parameters:
  • variables (list(DynamicalVariable)) – The dynamical variables to be added to the system’s phase space.

  • system (openmm.System) – The openmm.System which will be simulated

  • integrator (openmm.Integrator) – The openmm.Integrator which will be used to simulate the openmm.System.

  • platform (openmm.Platform) – The openmm.Platform to use for calculations.

  • properties (dict(str: str)) – A set of values for platform-specific properties. Keys are the property names.

Variables:
  • variables (list(DynamicalVariable)) – The dynamical variables added to the system’s phase space.

  • driving_forces (list[openmm.CustomCVForce]) – A list of openmm.CustomCVForce objects responsible for evaluating the potential energy terms which couples the extra dynamical variables to their associated collective variables.

Raises:

ValueError – If the system has constraints and the integrator is a UFEDMM integrator without RATTLE (num_rattles=0), which would ignore them.

Methods

getState(**kwargs)[source]

Returns a ExtendedSpaceState object.

Keyword Arguments:

**kwargs – See getState in openmm.Context.

setPeriodicBoxVectors(a, b, c)[source]

Set the vectors defining the axes of the periodic box.

Warning

Only orthorhombic boxes are allowed.

Parameters:
  • a (openmm.Vec3) – The vector defining the first edge of the periodic box.

  • b (openmm.Vec3) – The vector defining the second edge of the periodic box.

  • c (openmm.Vec3) – The vector defining the third edge of the periodic box.

setPositions(positions, extended_positions=None)[source]

Sets the positions of all particles and extended-space variables in this context. If the latter are not provided, then suitable values are automatically determined from the particle positions.

Parameters:

positions (list of openmm.Vec3 or numpy.ndarray or unit.Quantity) – The positions of physical particles.

Keyword Arguments:

extended_positions (list of float or unit.Quantity) – The positions of extended-space particles.

setVelocitiesToTemperature(temperature, randomSeed=None)[source]

Sets the velocities of all particles in the system to random values chosen from a Maxwell-Boltzmann distribution at a given temperature.

The velocities of the physical particles have no center-of-mass component, satisfy the system constraints, and are scaled so that the instantaneous temperature equals the given one exactly. The number of degrees of freedom is counted as in OpenMM’s StateDataReporter. Massless particles get zero velocity.

Warning

The extra particles of the extended-space variables move along the x axis only. Their x velocities are drawn from a Maxwell-Boltzmann distribution at each variable’s own temperature, and their y and z velocities are set to zero.

Parameters:

temperature (float or unit.Quantity) – The temperature of the system.

Keyword Arguments:

randomSeed (int, default=None) – A seed for the random number generator.