openmmtools.forcefactories.restrain_atoms(thermodynamic_state, sampler_state, restrained_atoms, sigma=Quantity(value=3.0, unit=angstrom))[source]

Apply a soft harmonic restraint to the given atoms.

This modifies the ThermodynamicState object.

thermodynamic_state : openmmtools.states.ThermodynamicState

The thermodynamic state with the system. This will be modified.

sampler_state : openmmtools.states.SamplerState

The sampler state with the positions.

topology : mdtraj.Topology or simtk.openmm.Topology

The topology of the system.

atoms_dsl : str

The MDTraj DSL string for selecting the atoms to restrain.

sigma : simtk.unit.Quantity, optional

Controls the strength of the restrain. The smaller, the tighter (units of distance, default is 3.0*angstrom).