openpathsampling.snapshot_modifier.GeneralizedDirectionModifier

class openpathsampling.snapshot_modifier.GeneralizedDirectionModifier(delta_v, subset_mask=None, remove_linear_momentum=True, engine=None)[source]

Snapshot modifier which changes velocity direction with constant energy.

Abstract class with core implementation. The implementation here requires takes delta_v to be the standard deviation of a Gaussian distribution of velocity displacements. The velocities are modified according to that displacement, then renormalized so that each atom still has the same total momentum as before (although the direction can be changed).

Parameters
  • delta_v (float or array-like of float) – velocity change parameter, as the width of a Gaussian from which each degree of freedom’s velocity change is chosen. Can be a list with length n_atoms (mapping to each atom); length equal to the subset mask (mapping to each element of the subset mask); or a float (mapping the same value to all atoms).

  • subset_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.

  • remove_linear_momentum (bool) – whether the total linear momentum should be removed from the system, default is True

__init__(delta_v, subset_mask=None, remove_linear_momentum=True, engine=None)[source]

Methods

__init__(delta_v[, 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

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