openmmtools.mcmc.MCDisplacementMove

class openmmtools.mcmc.MCDisplacementMove(displacement_sigma=Quantity(value=1.0, unit=nanometer), **kwargs)[source]

A metropolized move that randomly displace a subset of atoms.

Parameters:
displacement_sigma : simtk.unit.Quantity

The standard deviation of the normal distribution used to propose the random displacement (units of length, default is 1.0*nanometer).

atom_subset : slice or list of int, optional

If specified, the move is applied only to those atoms specified by these indices. If None, the move is applied to all atoms (default is None).

context_cache : openmmtools.cache.ContextCache, optional

The ContextCache to use for Context creation. If None, the global cache openmmtools.cache.global_context_cache is used (default is None).

See also

MetropolizedMove

Attributes:
n_accepted : int

The number of proposals accepted.

n_proposed : int

The total number of attempted moves.

displacement_sigma
atom_subset
context_cache

Methods

apply(thermodynamic_state, sampler_state) Apply a metropolized move to the sampler state.
displace_positions(positions[, …]) Return the positions after applying a random displacement to them.
__init__(displacement_sigma=Quantity(value=1.0, unit=nanometer), **kwargs)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

Methods

__init__([displacement_sigma, unit]) x.__init__(…) initializes x; see help(type(x)) for signature
apply(thermodynamic_state, sampler_state) Apply a metropolized move to the sampler state.
displace_positions(positions[, …]) Return the positions after applying a random displacement to them.

Attributes

statistics The acceptance statistics as a dictionary.
apply(thermodynamic_state, sampler_state)

Apply a metropolized move to the sampler state.

Total number of acceptances and proposed move are updated.

Parameters:
thermodynamic_state : openmmtools.states.ThermodynamicState

The thermodynamic state to use to apply the move.

sampler_state : openmmtools.states.SamplerState

The initial sampler state to apply the move to. This is modified.

static displace_positions(positions, displacement_sigma=Quantity(value=1.0, unit=nanometer))[source]

Return the positions after applying a random displacement to them.

Parameters:
positions : nx3 numpy.ndarray simtk.unit.Quantity

The positions to displace.

displacement_sigma : simtk.unit.Quantity

The standard deviation of the normal distribution used to propose the random displacement (units of length, default is 1.0*nanometer).

Returns:
rotated_positions : nx3 numpy.ndarray simtk.unit.Quantity

The displaced positions.

statistics

The acceptance statistics as a dictionary.