API Reference¶
Lyapunov Analysis¶
- chaotax.lyapunov(stepper, *, rollout_steps=20000, warmup_steps=500, discard_steps=1000, dt=1)[source]¶
Estimate the largest Lyapunov exponent of a dynamical system.
- chaotax.lyapunov_spectrum(stepper, *, rollout_steps=20000, warmup_steps=500, discard_steps=1000, dt=1, num_exponents=None)[source]¶
Estimate the Lyapunov spectrum of a dynamical system.
Returns a callable that computes Lyapunov exponents (in descending order) by tracking a matrix of perturbation vectors with QR re-orthonormalisation. When
num_exponentsis smaller than the number of degrees of freedom, only the leading exponents are computed at reduced cost (O(n_dof * num_exponents)per step instead ofO(n_dof²)).
Utilities¶
- chaotax.rollout_growth(stepper, n)[source]¶
Compute per-step tangent growth factors along a trajectory.
Rolls out the stepper for
nsteps while tracking how an initial perturbation vector grows under the linearised dynamics (via JVP). The perturbation is re-normalised after each step.- Parameters:
- Return type:
Callable[[Inexact[Array, '*state_shape'],Inexact[Array, '*state_shape']],Float[Array, 'n']]- Returns:
A function
(u_0, eps_0) -> growththat returns the growth factor at each step.
- chaotax.rollout_growth_spectrum(stepper, n)[source]¶
Compute per-step growth factors for a set of perturbation vectors.
Like
rollout_growth(), but tracks a matrix of perturbation directions simultaneously using QR re-orthonormalisation at each step. The perturbation matrix may have fewer rows thann_dofto compute only the leading exponents (cost per step isO(n_dof * p)instead ofO(n_dof²)for the full spectrum).- Parameters:
- Return type:
Callable[[Inexact[Array, '*state_shape'],Inexact[Array, 'n_dof *state_shape']],Float[Array, 'n n_dof']]- Returns:
A function
(u_0, eps_matrix_0) -> growthwhere growth has shape(n, p)containing the diagonal R-factor at each step.
- chaotax.repeat(stepper, n)[source]¶
Repeat application of a stepper function n times.
- Parameters:
- Return type:
Callable[[Shaped[Array, '?leaf_shape'], 'T']],Shaped[Array, '?leaf_shape'], 'T']]- Returns:
A function that takes in the initial state and returns the state after n applications of the stepper.