openmmtools.forces.HarmonicRestraintBondForce

class openmmtools.forces.HarmonicRestraintBondForce(spring_constant, *args, **kwargs)[source]

Impose a single harmonic restraint between two atoms.

This is a version of HarmonicRestraintForce that can be used with OpenCL 32-bit platforms. It supports atom groups with only a single atom.

Parameters:
spring_constantopenmm.unit.Quantity

The spring constant K (see energy expression above) in units compatible with joule/nanometer**2/mole.

restrained_atom_index1int

The index of the first atom to restrain.

restrained_atom_index2int

The index of the second atom to restrain.

controlling_parameter_namestr, optional

The name of the global parameter controlling the energy function. The default value is ‘lambda_restraints’.

Attributes:
spring_constant

unit.openmm.Quantity: The spring constant K (units of energy/mole/distance^2).

restrained_atom_indices1

The indices of the first group of restrained atoms.

restrained_atom_indices2

The indices of the first group of restrained atoms.

restraint_parameters

OrderedDict: The restraint parameters in dictionary form.

controlling_parameter_name

str: The name of the global parameter controlling the energy function (read-only).

Methods

addBond(self, particle1, particle2[, parameters])

Add a bond term to the force field.

addEnergyParameterDerivative(self, name)

Request that this Force compute the derivative of its energy with respect to a global parameter.

addGlobalParameter(self, name, defaultValue)

Add a new global parameter that the interaction may depend on.

addPerBondParameter(self, name)

Add a new per-bond parameter that the interaction may depend on.

compute_standard_state_correction(...[, ...])

Return the standard state correction of the restraint.

deserialize_xml(xml_serialization)

Shortcut to deserialize the XML representation and the restore interface.

distance_at_energy(potential_energy)

Compute the distance at which the potential energy is potential_energy.

getBondParameters(self, index)

Get the force field parameters for a bond term.

getEnergyFunction(self)

Get the algebraic expression that gives the interaction energy for each bond

getEnergyParameterDerivativeName(self, index)

Get the name of a global parameter with respect to which this Force should compute the derivative of the energy.

getForceGroup(self)

Get the force group this Force belongs to.

getGlobalParameterDefaultValue(self, index)

Get the default value of a global parameter.

getGlobalParameterName(self, index)

Get the name of a global parameter.

getName(self)

Get the name of this Force.

getNumBonds(self)

Get the number of bonds for which force field parameters have been defined.

getNumEnergyParameterDerivatives(self)

Get the number of global parameters with respect to which the derivative of the energy should be computed.

getNumGlobalParameters(self)

Get the number of global parameters that the interaction depends on.

getNumPerBondParameters(self)

Get the number of per-bond parameters that the interaction depends on.

getPerBondParameterName(self, index)

Get the name of a per-bond parameter.

is_restorable(openmm_object)

Check if the custom integrator or force has a restorable interface.

restore_interface(openmm_object)

Restore the original interface of an OpenMM custom force or integrator.

setBondParameters(self, index, particle1, ...)

Set the force field parameters for a bond term.

setEnergyFunction(self, energy)

Set the algebraic expression that gives the interaction energy for each bond

setForceGroup(self, group)

Set the force group this Force belongs to.

setGlobalParameterDefaultValue(self, index, ...)

Set the default value of a global parameter.

setGlobalParameterName(self, index, name)

Set the name of a global parameter.

setName(self, name)

Set the name of this Force.

setPerBondParameterName(self, index, name)

Set the name of a per-bond parameter.

setUsesPeriodicBoundaryConditions(self, periodic)

Set whether this force should apply periodic boundary conditions when calculating displacements.

updateParametersInContext(self, context)

Update the per-bond parameters in a Context to match those stored in this Force object.

usesPeriodicBoundaryConditions(self)

Returns whether or not this force makes use of periodic boundary conditions.

__init__(self, energy) CustomBondForce
__init__(self, other) CustomBondForce

Create a CustomBondForce.

Parameters:
energystring

an algebraic expression giving the interaction energy between two bonded particles as a function of r, the distance between them

Methods

__init__(-> CustomBondForce)

Create a CustomBondForce.

addBond(self, particle1, particle2[, parameters])

Add a bond term to the force field.

addEnergyParameterDerivative(self, name)

Request that this Force compute the derivative of its energy with respect to a global parameter.

addGlobalParameter(self, name, defaultValue)

Add a new global parameter that the interaction may depend on.

addPerBondParameter(self, name)

Add a new per-bond parameter that the interaction may depend on.

compute_standard_state_correction(...[, ...])

Return the standard state correction of the restraint.

deserialize_xml(xml_serialization)

Shortcut to deserialize the XML representation and the restore interface.

distance_at_energy(potential_energy)

Compute the distance at which the potential energy is potential_energy.

getBondParameters(self, index)

Get the force field parameters for a bond term.

getEnergyFunction(self)

Get the algebraic expression that gives the interaction energy for each bond

getEnergyParameterDerivativeName(self, index)

Get the name of a global parameter with respect to which this Force should compute the derivative of the energy.

getForceGroup(self)

Get the force group this Force belongs to.

getGlobalParameterDefaultValue(self, index)

Get the default value of a global parameter.

getGlobalParameterName(self, index)

Get the name of a global parameter.

getName(self)

Get the name of this Force.

getNumBonds(self)

Get the number of bonds for which force field parameters have been defined.

getNumEnergyParameterDerivatives(self)

Get the number of global parameters with respect to which the derivative of the energy should be computed.

getNumGlobalParameters(self)

Get the number of global parameters that the interaction depends on.

getNumPerBondParameters(self)

Get the number of per-bond parameters that the interaction depends on.

getPerBondParameterName(self, index)

Get the name of a per-bond parameter.

is_restorable(openmm_object)

Check if the custom integrator or force has a restorable interface.

restore_interface(openmm_object)

Restore the original interface of an OpenMM custom force or integrator.

setBondParameters(self, index, particle1, ...)

Set the force field parameters for a bond term.

setEnergyFunction(self, energy)

Set the algebraic expression that gives the interaction energy for each bond

setForceGroup(self, group)

Set the force group this Force belongs to.

setGlobalParameterDefaultValue(self, index, ...)

Set the default value of a global parameter.

setGlobalParameterName(self, index, name)

Set the name of a global parameter.

setName(self, name)

Set the name of this Force.

setPerBondParameterName(self, index, name)

Set the name of a per-bond parameter.

setUsesPeriodicBoundaryConditions(self, periodic)

Set whether this force should apply periodic boundary conditions when calculating displacements.

updateParametersInContext(self, context)

Update the per-bond parameters in a Context to match those stored in this Force object.

usesPeriodicBoundaryConditions(self)

Returns whether or not this force makes use of periodic boundary conditions.

Attributes

controlling_parameter_name

str: The name of the global parameter controlling the energy function (read-only).

restrained_atom_indices1

The indices of the first group of restrained atoms.

restrained_atom_indices2

The indices of the first group of restrained atoms.

restraint_parameters

OrderedDict: The restraint parameters in dictionary form.

spring_constant

unit.openmm.Quantity: The spring constant K (units of energy/mole/distance^2).

thisown

The membership flag