openpathsampling.snapshot_modifier.RandomVelocities
- class openpathsampling.snapshot_modifier.RandomVelocities(beta=None, engine=None, subset_mask=None)[source]
Randomize velocities according to the Boltzmann distribution.
Notes
This modifier will only work with snapshots that have the
velocities
feature and themasses
feature. Furthermore, the units have to be such that the inputbeta
and the features masses and velocities are all in the same unit system. In particular,1.0 / beta * masses
must be in units ofvelocity**2
.For the OpenMMEngine, for example (after
from openmm import unit as u
), thebeta
parameter for 300 K would be created withbeta = 1.0 / (300.0 * u.kelvin * u.BOLTZMANN_CONSTANT_kB)
- Parameters:
beta (float or openmm.unit.Quantity) – inverse temperature (including kB) for the distribution
engine (
DynamicsEngine
or None) – engine to be used for constraints; if None, use the snapshot’s enginesubset_mask (list of int or None) – the subset to use (default None, meaning use all). The values select along the first axis of the input array. For example, in a typical shape=(n_atoms, 3) array, this will pick the atoms.
Methods
__init__
([beta, engine, subset_mask])apply_to_subset
(full_array, modified[, ...])Replaces elements of full_array according to the subset mask
args
()Return a list of args of the __init__ function of a class
base
()Return the most parent class actually derived from StorableObject
count_weaks
()Return number of objects subclassed from StorableObject still in memory
descendants
()Return a list of all subclassed objects
extract_subset
(full_array[, subset])Extracts elements from full_array according to self.subset_mask
fix_name
()Set the objects name to be immutable.
from_dict
(dct)Reconstruct an object from a dictionary representaiton
get_uuid
()idx
(store)Return the index which is used for the object in the given store.
named
(name)Name an unnamed object.
objects
()Returns a dictionary of all storable objects
probability_ratio
(old_snapshot, new_snapshot)Only here for backwards compatability, will raise in the future
reverse_uuid
()ruuid
(uid)set_observer
(active)(De-)Activate observing creation of storable objects
to_dict
()Convert object into a dictionary representation
Attributes
ACTIVE_LONG
CREATION_COUNT
INSTANCE_UUID
base_cls
Return the base class
base_cls_name
Return the name of the base class
cls
Return the class name as a string
default_name
Return the default name.
is_named
True if this object has a custom name.
name
Return the current name of the object.
observe_objects