openpathsampling.DirectSimulation
- class openpathsampling.DirectSimulation(storage=None, engine=None, states=None, flux_pairs=None, initial_snapshot=None)[source]
Direct simulation to calculate rates and fluxes.
In practice, this is primarily used to calculate the flux if you want to do so without saving the entire trajectory. However, it will also save the trajectory, if you want it to.
- Parameters:
storage (
Storage
) – file to store the trajectory in. Default is None, meaning that the trajectory isn’t stored (also faster)engine (
DynamicsEngine
) – the engine for the molecular dynamicsstates (list of
Volume
) – states to look for transitions betweenflux_pairs (list of 2-tuples of
(state, interface)
) – fluxes will calculate the flux out of state and through interface for each pair in this listinitial_snapshot (
Snapshot
) – initial snapshot for the MD
- transitions
for each pair of states (from_state, to_state) as a key, gives the number of frames for each transition from the entry into from_state to entry into to_state
- Type:
dict with keys 2-tuple of paths.Volume, values list of int
- rate_matrix
calculates the rate matrix, in units of per-frames
- Type:
pd.DataFrame
- fluxes
flux out of state and through interface for each (state, interface) key pair
- Type:
dict with keys 2-tuple of paths.Volume, values float
- n_transitions
number of transition events for each pair of states
- Type:
dict with keys 2-tuple of paths.Volume, values int
- n_flux_events
number of flux events for each (state, interface) pair
- Type:
dict with keys 2-tuple of paths.Volume, values int
Methods
__init__
([storage, engine, states, ...])args
()Return a list of args of the __init__ function of a class
attach_default_hooks
()attach_hook
(hook[, hook_for])Attach a hook class or method to this simulation.
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
empty_hooks
()Return a hook dictionary with no hooks.
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.
load_results
(results)named
(name)Name an unnamed object.
objects
()Returns a dictionary of all storable objects
reverse_uuid
()run
(n_steps)Run the simulator for a number of steps
run_hooks
(hook_name, **kwargs)Run the hooks for the given
hook_name
ruuid
(uid)save_initial_step
()Save the initial state as an MCStep to the storage
set_observer
(active)(De-)Activate observing creation of storable objects
sync_storage
()Will sync all collective variables and the storage to disk
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
calc_name
cls
Return the class name as a string
default_name
Return the default name.
hook_names
is_named
True if this object has a custom name.
name
Return the current name of the object.
observe_objects
results