openpathsampling.engines.toy.ToyEngine

class openpathsampling.engines.toy.ToyEngine(options, topology)[source]

Engine for toy models. Mostly used for 2D examples.

Parameters:
  • options (dict) –

    A dictionary providing additional settings. Keys can be

    ’integ’ToyIntegrator

    the integrator for this engine

    ’n_frames_max’int

    the maximum number of frames allowed for a returned trajectory, default is 5000

    ’n_steps_per_frame’int

    number of integration steps per returned snapshot, default is 10.

  • topology (ToyTopology) – object which includes masses, potential energy surface, and the dimensions n_atoms and n_spatial; plays a role similar to a topology in molecular mechanics

pes

potential energy surface

Type:

PES

mass

mass of each atom

Type:

array-like

snapshot_timestep

time step between reported snapshots

Type:

float

current_snapshot

the current state of the system, as a snapshot

Type:

Snapshot

__init__(options, topology)[source]

Create an empty DynamicsEngine object

Notes

The purpose of an engine is to create trajectories and keep track of the results. The main method is ‘generate’ to create a trajectory, which is a list of snapshots and then can store the in the associated storage. In the initialization this storage is created as well as the related Trajectory and Snapshot classes are initialized.

Methods

__init__(options, topology)

Create an empty DynamicsEngine object

args()

Return a list of args of the __init__ function of a class

base()

Return the most parent class actually derived from StorableObject

check_snapshot_type(snapshot)

count_weaks()

Return number of objects subclassed from StorableObject still in memory

descendants()

Return a list of all subclassed objects

fix_name()

Set the objects name to be immutable.

from_dict(dct)

Reconstruct an object from a dictionary representaiton

generate(snapshot[, running, direction])

Generate a trajectory consisting of ntau segments of tau_steps in between storage of Snapshots.

generate_n_frames([n_frames])

Generates n_frames, from but not including the current snapshot.

generate_next_frame()

get_uuid()

has_constraints()

idx(store)

Return the index which is used for the object in the given store.

is_valid_snapshot(snapshot)

Test the snapshot to be valid.

iter_generate(initial[, running, direction, ...])

Return a generator that will generate a trajectory, returning the current trajectory in given intervals

n_degrees_of_freedom()

named(name)

Name an unnamed object.

objects()

Returns a dictionary of all storable objects

reverse_uuid()

ruuid(uid)

set_as_default()

set_observer(active)

(De-)Activate observing creation of storable objects

start([snapshot])

stop(trajectory)

Nothing special needs to be done for direct-control simulations when you hit a stop condition.

stop_conditions(trajectory[, ...])

Test whether we can continue; called by generate a couple of times, so the logic is separated here.

to_dict()

Convert object into a dictionary representation

Attributes

ACTIVE_LONG

BACKWARD

CREATION_COUNT

FORWARD

INSTANCE_UUID

base_cls

Return the base class

base_cls_name

Return the name of the base class

clear_snapshot_cache

cls

Return the class name as a string

current_snapshot

default_name

Return the default name.

default_options

dimensions

ignore_linear_momentum

is_named

True if this object has a custom name.

mass

n_steps_per_frame

name

Return the current name of the object.

observe_objects

pes

snapshot_timestep

units