Large deviation theory

Mimumum action path

CriticalTransitions.MinimumActionPathType
struct MinimumActionPath{D, T<:Real, V, Phis, Ahis, Lambda, PV, GPV}

The minimum action path between two points in a D-dimensional phase space.

Fields

  • path::StateSpaceSet{D, T, V} where {D, T<:Real, V}: The path matrix.

  • action::Real: The action value associated to the path.

  • path_history::Any: The history of action of the paths in the optimisation algorithm (optional).

  • action_history::Any: The history of action of the paths in the optimisation algorithm (optional).

  • λ::Any: The Lagrange multiplier parameter for the minimum action path (optional).

  • generalized_momentum::Any: The generalized momentum of the phase space variables (optional).

  • path_velocity::Any: The path velocity (optional).

Constructors

MinimumActionPath(
    path,
    action;
    path_history,
    action_history,
    λ,
    generalized_momentum,
    path_velocity
)

defined at /home/runner/work/CriticalTransitions.jl/CriticalTransitions.jl/src/largedeviations/MinimumActionPath.jl:29.

source

String method

The string method is a technique for finding transition paths between two states in a dynamical system. The method represents the path as a "string" of points that connects the states and evolves it to minimize the drift along the path. The resulating tangent path is parrallel to the drift of the system, i.e., the string method computes the heteroclinic orbit. For non-gradient systems (detailed -balance is broken), the heteroclinic orbit differs from the transition path, it does correctly predict, it correctly captures the deterministic dynamics from the saddle point onward ("downhill" portion of the path).

CriticalTransitions.string_methodFunction
string_method(
    sys::Union{Function, SgmamSystem},
    x_initial::Matrix;
    ϵ,
    iterations,
    show_progress
) -> Any

Compute the string method for a given system using E et al. (2007).

The string method is an iterative algorithm used to find minimum energy path (MEP) between two points in phase space. It works by evolving a discretized path (string) according to the system's drift while maintaining equal arc-length parametrization between points.

This implementation allows for computation between arbitrary points, not just stable fixed points.

Arguments

  • sys::SgmamSystem: The doubled phase space system for which the string method is computed
  • x_initial: Initial path discretized as a matrix where each column represents a point on the path
  • ϵ::Real: Step size for the evolution step
  • iterations::Int64: Maximum number of iterations for path convergence
  • show_progress::Bool: Whether to display a progress meter during computation

Returns

  • x: The final converged path representing the MEP
source
string_method(
    sys::ContinuousTimeDynamicalSystem,
    init;
    kwargs...
) -> Any

Compute the string method for a given system using E et al. (2007).

The string method is an iterative algorithm used to find minimum energy path (MEP) between two points in phase space. It works by evolving a discretized path (string) according to the system's drift while maintaining equal arc-length parametrization between points.

This implementation allows for computation between arbitrary points, not just stable fixed points.

Arguments

  • sys::CoupledSDEs: The system for which the string method is computed
  • x_initial: Initial path discretized as a matrix where each column represents a point on the path
  • ϵ::Real: Step size for the evolution step
  • iterations::Int64: Maximum number of iterations for path convergence
  • show_progress::Bool: Whether to display a progress meter during computation

Returns

  • x: The final converged path representing the MEP
source

Minimum action methods

The minimum action method (MAM) is a technique for calculating the most probable transition path between two (meta)stable states in a stochastic dynamical system. In the limit of small noise, this path corresponds to the minimizer of an action functional. The action functional typically takes into account both the deterministic drift and the noise intensity of the system. By discretizing this path and using optimization techniques, MAM finds the trajectory that requires the least "effort" to transition between states in phase space.

Minimum action method (MAM)

Minimization of the action functioal using the optimization algorithm of Optimization.jl.

CriticalTransitions.min_action_methodFunction
min_action_method(
    sys::ContinuousTimeDynamicalSystem,
    x_i,
    x_f,
    N::Int64,
    T::Real;
    kwargs...
) -> MinimumActionPath{_A, _B, _C, Nothing, Nothing, Nothing, Nothing, Nothing} where {_A, _B<:Real, _C}

Runs the Minimum Action Method (MAM) to find the minimum action path (instanton) between an initial state x_i and final state x_f in phase space.

This algorithm uses the minimizers of the Optimization.jl package to minimize the action functional (see fw_action) of a path for the given CoupledSDEs sys. The path is initialized as a straight line between x_i and x_f, parameterized in time via N equidistant points and total time T. Thus, the time step between discretized path points is $\Delta t = T/N$. To set an initial path different from a straight line, see the multiple dispatch method

  • min_action_method(sys::CoupledSDEs, init::Matrix, T::Real; kwargs...).

The minimization can be performed in blocks to save intermediate results.

Keyword arguments

  • functional = "FW": type of action functional to minimize. Defaults to fw_action, alternative: om_action.
  • maxiter = 100: maximum number of iterations before the algorithm stops.
  • abstol=1e-8: absolute tolerance of action gradient to determine convergence
  • reltol=1e-8: relative tolerance of action gradient to determine convergence
  • method = Adam(): minimization algorithm (see Optimization.jl)
  • verbose = true: whether to print Optimization information during the run
  • show_progress = false: whether to print a progress bar

Output

If save_iterations, returns Optim.OptimizationResults. Else, returns only the optimizer (path). If blocks > 1, a vector of results/optimizers is returned.

source
min_action_method(
    sys::ContinuousTimeDynamicalSystem,
    init::Matrix{<:Real},
    T::Real;
    functional,
    maxiter,
    abstol,
    reltol,
    method,
    AD,
    verbose,
    show_progress
) -> MinimumActionPath{_A, _B, _C, Nothing, Nothing, Nothing, Nothing, Nothing} where {_A, _B<:Real, _C}

Runs the Minimum Action Method (MAM) to find the minimum action path (instanton) from an initial condition init, given a system sys and total path time T.

The initial path init must be a matrix of size (D, N), where D is the dimension of the system and N is the number of path points. The physical time of the path is specified by T, such that the time step between consecutive path points is $\Delta t = T/N$.

For more information see the main method, min_action_method(sys::CoupledSDEs, x_i, x_f, N::Int, T::Real; kwargs...).

source

Geometric minimum action method (gMAM)

Minimization of the geometric action following Heymann and Vanden-Eijnden, PRL (2008). The gMAM reformulates MAM to avoid double optimisation of both the action and the transition time. It achieves this by using a geometric action functional that is independent of the time parametrization of the path. This reparametrization invariance makes the method more robust and computationally efficient, particularly for systems with metastable states separated by large barriers.

CriticalTransitions.geometric_min_action_methodFunction
geometric_min_action_method(
    sys::ContinuousTimeDynamicalSystem,
    x_i,
    x_f;
    N,
    kwargs...
) -> MinimumActionPath{_A, _B, _C, Nothing, Nothing, Nothing, Nothing, Nothing} where {_A, _B<:Real, _C}

Computes the minimizer of the geometric Freidlin-Wentzell action based on the geometric minimum action method (gMAM), using optimizers of OPtimization.jl or the original formulation by Heymann and Vanden-Eijnden[1]. Only Freidlin-Wentzell action has a geometric formulation.

To set an initial path different from a straight line, see the multiple dispatch method

  • geometric_min_action_method(sys::CoupledSDEs, init::Matrix, arclength::Real; kwargs...).

Keyword arguments

  • maxiter::Int=100: maximum number of optimization iterations before the alogrithm stops
  • abstol=1e-8: absolute tolerance of action gradient to determine convergence
  • reltol=1e-8: relative tolerance of action gradient to determine convergence
  • method = Adam(): minimization algorithm (see Optimization.jl)
  • =0.1: step size parameter in gradient descent HeymannVandenEijnden implementation.
  • verbose=false: if true, print additional output
  • show_progress=true: if true, display a progress bar

Optimization algorithms

The method keyword argument takes solver methods of the Optimization.jl package; alternatively, the option solver = "HeymannVandenEijnden" uses the original gMAM algorithm[1].

source
geometric_min_action_method(
    sys::ContinuousTimeDynamicalSystem,
    init::Matrix;
    maxiter,
    abstol,
    reltol,
    method,
    AD,
    ϵ,
    verbose,
    show_progress
) -> MinimumActionPath{_A, _B, _C, Nothing, Nothing, Nothing, Nothing, Nothing} where {_A, _B<:Real, _C}

Runs the geometric Minimum Action Method (gMAM) to find the minimum action path (instanton) from an initial condition init, given a system sys and total arc length arclength.

The initial path init must be a matrix of size (D, N), where D is the dimension of the system and N is the number of path points.

For more information see the main method, geometric_min_action_method(sys::CoupledSDEs, x_i, x_f, arclength::Real; kwargs...).

source

Simple Geometric minimum action method (sgMAM)

Simplified minimization of the geometric action following Grafke et al. (2017). The simple gMAM reduces the complexity of the original gMAM by requiring only first-order derivatives of the underlying Hamiltonian optimisation formulation. This simplifies the numerical treatment and the computational complexity.

The implementation below perform a constrained gradient descent where it assumes an autonomous system with additive Gaussian noise.

CriticalTransitions.sgmamFunction
sgmam(
    sys::SgmamSystem,
    x_initial::Array{T, 2};
    ϵ,
    iterations,
    show_progress,
    reltol
) -> MinimumActionPath{_A, _B, _C, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}} where {_A, _B<:Real, _C}

Performs the simplified geometric Minimal Action Method (sgMAM) on the given system sys. Our implementation is only valid for additive noise.

This method computes the optimal path in the phase space of a Hamiltonian system that minimizes the Freidlin–Wentzell action. The Hamiltonian functions H_x and H_p define the system's dynamics in a doubled phase. The initial state x_initial is evolved iteratively using constrained gradient descent with step size parameter ϵ over a specified number of iterations. The method can display a progress meter and will stop early if the relative tolerance reltol is achieved.

The function returns a tuple containing the final state, the action value, the Lagrange multipliers, the momentum, and the state derivatives. The implementation is based on the work of Grafke et al. (2019).

source
CriticalTransitions.SgmamSystemType

A structure representing a system with Hamiltonian functions Hx and Hp.

This system operates in an extended phase space where the Hamiltonian is assumed to be quadratic in the extended momentum. The phase space coordinates x are doubled to form a 2n-dimensional extended phase space.

source

Action functionals

Freidlin-Wentzell action

CriticalTransitions.fw_actionFunction
fw_action(sys::CoupledSDEs, path, time) -> Any

Calculates the Freidlin-Wentzell action of a given path with time points time in a drift field specified by the deterministic dynamics f = dynamic_rule(sys) and (normalized) noise covariance matrix covariance_matrix(sys).

The path must be a (D x N) matrix, where D is the dimensionality of the system sys and N is the number of path points. The time array must have length N.

Returns a single number, which is the value of the action functional

$S_T[\phi_t] = \frac{1}{2} \int_0^T || \dot \phi_t - f(\phi_t) ||^2_Q \text{d}t$

where $\phi_t$ denotes the path in state space, $b$ the drift field, and $T$ the total time of the path. The subscript $Q$ refers to the generalized norm $||a||_Q^2 := \langle a, Q^{-1} b \rangle$ (see anorm). Here $Q$ is the noise covariance matrix normalized by $D/L_1(Q)$, with $L_1$ being the L1 matrix norm.

source

Geometric Freidlin-Wentzell action

CriticalTransitions.geometric_actionFunction
geometric_action(sys::CoupledSDEs, path) -> Any
geometric_action(sys::CoupledSDEs, path, arclength) -> Any

Calculates the geometric action of a given path with specified arclength for the drift field specified by the deterministic dynamics f = dynamic_rule(sys) and (normalized) noise covariance matrix covariance_matrix(sys).

For a given path $\varphi$, the geometric action $\bar S$ corresponds to the minimum of the Freidlin-Wentzell action $S_T(\varphi)$ over all travel times $T>0$, where $\varphi$ denotes the path's parameterization in physical time (see fw_action). It is given by the integral

$\bar S[\varphi] = \int_0^L \left( ||\varphi'||_Q \, ||f(\varphi)||_Q - \langle \varphi', \, f(\varphi) \rangle_Q \right) \, \text{d}s$

where $s$ is the arclength coordinate, $L$ the arclength, $f$ the drift field, and the subscript $Q$ refers to the generalized dot product $\langle a, b \rangle_Q := a^{\top} \cdot Q^{-1} b$ (see anorm). Here $Q$ is the noise covariance matrix normalized by $D/L_1(Q)$, with $L_1$ being the L1 matrix norm.

Returns the value of the geometric action $\bar S$.

source

Onsager-Machlup action

CriticalTransitions.om_actionFunction
om_action(sys::CoupledSDEs, path, time, noise_strength)

Calculates the Onsager-Machlup action of a given path with time points time for the drift field f = dynamic_rule(sys) at given noise_strength.

The path must be a (D x N) matrix, where D is the dimensionality of the system sys and N is the number of path points. The time array must have length N.

Returns a single number, which is the value of the action functional

$S^{\sigma}_T[\phi_t] = \frac{1}{2} \int_0^T \left( || \dot \phi_t - f(\phi_t) ||^2_Q + \sigma^2 \nabla \cdot f \right) \, \text{d} t$

where $\phi_t$ denotes the path in state space, $b$ the drift field, $T$ the total time of the path, and $\sigma$ the noise strength. The subscript $Q$ refers to the generalized norm $||a||_Q^2 := \langle a, Q^{-1} b \rangle$ (see anorm). Here $Q$ is the noise covariance matrix normalized by $D/L_1(Q)$, with $L_1$ being the L1 matrix norm.

source

For convenience, a general action function is available where the type of functional is set as an argument:

CriticalTransitions.actionFunction
action(
    sys::CoupledSDEs,
    path::Matrix,
    time,
    functional;
    noise_strength
) -> Any

Computes the action functional specified by functional for a given CoupledSDEs sys and path parameterized by time.

  • functional = "FW": Returns the Freidlin-Wentzell action (fw_action)
  • functional = "OM": Returns the Onsager-Machlup action (om_action)
source