class TimeDependentSystem

class deeptime.data.TimeDependentSystem(system, h: float, n_steps: int, props=None)

Wraps systems with a time-dependent right-hand side defined in extension code.

Parameters:
  • system – The implementation.

  • h (float) – Integration step size.

  • n_steps (int) – Number of steps between each evaluation of the state.

  • props (dict or None, optional, default=None) – Additional properties of the system.

Attributes

dimension

The dimension of the system's state.

f

The right-hand side of the system as callable function.

h

The integration step size.

has_potential_function

Whether the system defines a potential.

integrator

The type of integrator.

n_steps

The number of integration steps between each evaluation of the state.

time_dependent

Whether the potential (if available) and the right-hand side depend on time.

vectorized_f

Yields whether the right-hand side function is vectorized.

Methods

potential(time, points)

Evaluates the system's potential function at given points in state space at a specified time.

trajectory(t0, x0, length[, seed, n_jobs, ...])

Simulates one or multiple trajectories depending on initial state and initial time.

__call__(t0, test_points, seed=-1, n_jobs=None)

Evolves the provided tests points under the dynamic for n_steps and returns.

Parameters:
  • t0 (array_like) – The initial time. Can be picked as single float across all test points or individually.

  • test_points (array_like) – The test points.

  • seed (int, optional, default=-1) – The seed for reproducibility. In case it is set to seed >= 0 the number of jobs needs to be fixed to n_jobs=1.

  • n_jobs (int, optional, default=None) – Specify number of jobs according to deeptime.util.parallel.handle_n_jobs().

Returns:

points – The evolved test points.

Return type:

np.ndarray

potential(time, points)

Evaluates the system’s potential function at given points in state space at a specified time.

Parameters:
  • time (float) – The evaluation time.

  • points (array_like) – The points.

Returns:

energy – The energy for each of these points.

Return type:

np.ndarray

Raises:

AssertionError – If the system does not have a potential function defined.

trajectory(t0, x0, length, seed=-1, n_jobs=None, return_time=False)

Simulates one or multiple trajectories depending on initial state and initial time.

Parameters:
  • t0 (array_like) – The initial time. Can be picked as single float across all test points or individually.

  • x0 (array_like) – The initial condition. Must be compatible in shape to a (n_test_points, dimension)-array.

  • length (int) – The length of the trajectory that is to be generated.

  • seed (int, optional, default=-1) – The random seed. In case it is specified to be something else than -1, n_jobs must be set to n_jobs=1.

  • n_jobs (int, optional, default=None) – Specify number of jobs according to deeptime.util.parallel.handle_n_jobs().

  • return_time (bool, optional, default=False) – Whether to return the evaluation times too.

Returns:

trajectory – The trajectory of shape (n_initial_conditions, n_evaluations, dimension). In case of just one initial condition the shape is squeezed to (n_evaluations, dimension).

Return type:

np.ndarray

property dimension: int

The dimension of the system’s state.

Type:

int

property f: Callable[[float, ndarray], ndarray]

The right-hand side of the system as callable function. In case of SDEs, this only evaluates the deterministic part of the function definition.

Some of these definitions are vectorized.

Returns:

right_hand_side – The right-hand side.

Return type:

Callable[[float, ndarray], ndarray]

property h: float

The integration step size.

property has_potential_function: bool

Whether the system defines a potential. This means that the deterministic part of the right-hand side is the negative gradient of that potential.

property integrator: str

The type of integrator.

Type:

str

property n_steps: int

The number of integration steps between each evaluation of the state.

property time_dependent: bool

Whether the potential (if available) and the right-hand side depend on time.

Type:

bool

property vectorized_f: bool

Yields whether the right-hand side function is vectorized.

Type:

bool