class CustomSystem¶
- class deeptime.data.CustomSystem(system, h: float, n_steps: int, props=None)¶
A system as yielded by
custom_sde
orcustom_ode
.Attributes
The dimension of the system's state.
The right-hand side of the system as callable function.
The integration step size.
Whether the system defines a potential.
The type of integrator.
The number of integration steps between each evaluation of the state.
Whether the potential (if available) and the right-hand side depend on time.
Yields whether the right-hand side function is vectorized.
Methods
potential
(points)Evaluates the system's potential function at given points in state space.
trajectory
(x0, length[, seed])Simulates one or multiple trajectories.
- __call__(test_points, seed=-1, **kw)¶
Evolves the provided tests points under the dynamic for n_steps and returns.
- Parameters:
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(points)¶
Evaluates the system’s potential function at given points in state space.
- Parameters:
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(x0, length, seed=-1, **kw)¶
Simulates one or multiple trajectories.
- Parameters:
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()
.
- 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