openmmtools.mcmc.MCRotationMove¶
-
class
openmmtools.mcmc.MCRotationMove(**kwargs)[source]¶ A metropolized move that randomly rotate a subset of atoms.
Parameters: - 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
Attributes: - n_accepted : int
The number of proposals accepted.
- n_proposed : int
The total number of attempted moves.
- atom_subset
- context_cache
Methods
apply(thermodynamic_state, sampler_state)Apply a metropolized move to the sampler state. generate_random_rotation_matrix()Return a random 3x3 rotation matrix. rotate_positions(positions)Return the positions after applying a random rotation to them. Methods
__init__(**kwargs)x.__init__(…) initializes x; see help(type(x)) for signature apply(thermodynamic_state, sampler_state)Apply a metropolized move to the sampler state. generate_random_rotation_matrix()Return a random 3x3 rotation matrix. rotate_positions(positions)Return the positions after applying a random rotation to them. Attributes
statisticsThe 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.
-
classmethod
generate_random_rotation_matrix()[source]¶ Return a random 3x3 rotation matrix.
Returns: - Rq : 3x3 numpy.ndarray
The random rotation matrix.
-
classmethod
rotate_positions(positions)[source]¶ Return the positions after applying a random rotation to them.
Parameters: - positions : nx3 numpy.ndarray simtk.unit.Quantity
The positions to rotate.
Returns: - rotated_positions : nx3 numpy.ndarray simtk.unit.Quantity
The rotated positions.
-
statistics¶ The acceptance statistics as a dictionary.