Transition Path Theory
Transition Path Theory (TPT) provides a framework for analyzing rare transition events between metastable states in complex systems. This module implements TPT calculations for two-dimensional Langevin systems. The work is base on the theory presented in [15–17] and this python github repo.
The functionality provided here is considered experimental and is currently restricted to two-dimensional Langevin dynamics of a particle exposed to a potential $U$. Hence, the current API is not exported and should be loaded explicitly. We recommend checking out the Transition Path Theory example for a demonstration of the available functionality.
We consider a Langevin system described by the following stochastic differential equations (SDEs):
\[\begin{aligned} \dot x &= p \,, \\ \dot p &= - \gamma p - \nabla U(x) + \sqrt{2\gamma\beta^{-1}} \dot W_t \,, \end{aligned}\]
where $x$ and $p$ are the position and momentum of the particle, $\gamma$ is the damping constant, $\beta = 1/k_BT$ is the inverse temperature and $W_t$ denotes a standard Wiener process.
To make the code more general, we need to implement the necessary methods for higher-dimensional systems and adapt the API accordingly.
Theory overview
TPT characterizes transition pathways between two metastable states A and B by computing:
- Forward and backward committor functions
- Reactive probability density
- Reactive current
- Transition rates
The calculations are performed on a triangulated mesh representing the system's state space.
CriticalTransitions.LangevinSystem
— Typestruct LangevinSystem{H, D, KE, T}
A stochastic dynamical system obeying Langevin dynamics of the form.
\[\dot x = p \,, \\ \dot p = - \gamma p - \nabla U(x) + \sqrt{2\gamma\beta^{-1}} \dot W_t \,,\]
with damping coefficient $\gamma$ and inverse temperature $\beta$. The Hamiltonian $H = U + K$ is given by the potential energy $U$ and kinetic energy $K = p^2/2$.
Fields
Hamiltonian::Any
: Function that computes the total energy (kinetic + potential) of the system.driftfree::Any
: Function representing the divergence-free part of the drift.kinetic::Any
: Function giving the kinetic energy of the system.gamma::Any
: Damping coefficient that determines the strength of friction.beta::Any
: Inverse temperature parameter (β = 1/kT) that sets the noise intensity.
Constructors
LangevinSystem(Hamiltonian, driftfree, kinetic, gamma, beta)
Committor functions
CriticalTransitions.committor
— Functioncommittor(
sys::CriticalTransitions.LangevinSystem,
mesh::CriticalTransitions.Mesh,
Aind,
Bind
) -> Vector{Float64}
Solve the committor equation for a two-dimensional Langevin system using finite elements.
Arguments
sys::LangevinSystem
: The Langevin system containing kinetic energy, drift-free function, beta, and gamma.mesh::Mesh
: The mesh containing points and triangles.Aind::Vector{Int}
: Indices of mesh points corresponding to set A (Dirichlet boundary condition = 0).Bind::Vector{Int}
: Indices of mesh points corresponding to set B (Dirichlet boundary condition = 1).
Returns
- A vector of committor values of length
N
, where each entry corresponds to a mesh node.
Implementation Details
This function assembles a global matrix A
and right-hand-side vector b
for the finite element discretization of the committor equation in Langevin dynamics. The code imposes Dirichlet boundary conditions on specified nodes (Aind
set to 0, Bind
set to 1). It computes elementwise contributions with stima_Langevin
and stimavbdv
, applying exponential factors involving beta
and gamma
to incorporate potential and damping effects. Finally, it solves the resulting linear system for the committor values on the free (non-boundary) nodes.
Invariant probability density
CriticalTransitions.invariant_pdf
— Functioninvariant_pdf(
sys::CriticalTransitions.LangevinSystem,
mesh::CriticalTransitions.Mesh,
Amesh::CriticalTransitions.Mesh,
Bmesh::CriticalTransitions.Mesh
) -> Any
Compute the invariant probability density function (PDF) for a Langevin system over a given mesh.
Arguments
sys::LangevinSystem
: The Langevin system containing the Hamiltonian and beta parameters.mesh::Mesh
: The main mesh containing points and triangles.Amesh::Mesh
: The mesh corresponding to region A.Bmesh::Mesh
: The mesh corresponding to region B.
Returns
- A scalar value representing the normalization constant
Z
of the invariant PDF.
Implementation Details
This function calculates the invariant PDF by integrating the exponential of the negative Hamiltonian over the areas of the triangles in the provided meshes. The normalization constant Z
is computed by summing the contributions from the main mesh, region A mesh, and region B mesh.
Reactive current
CriticalTransitions.reactive_current
Probability calculations
CriticalTransitions.probability_reactive
— Functionprobability_reactive(
sys::CriticalTransitions.LangevinSystem,
mesh::CriticalTransitions.Mesh,
q,
qminus,
Z
) -> Any
Calculate the probability that a trajectory is reactive (transitions from A to B).
Arguments
sys::LangevinSystem
: System with Hamiltonian and inverse temperature (beta)mesh::Mesh
: Mesh structure containing points and triangulationq
: Forward committor function valuesqminus
: Backward committor function valuesZ
: Partition function value
Returns
- Probability (float) of reactive trajectories normalized by partition function
CriticalTransitions.probability_last_A
— Functionprobability_last_A(
sys::CriticalTransitions.LangevinSystem,
mesh::CriticalTransitions.Mesh,
Ames::CriticalTransitions.Mesh,
qminus,
Z
) -> Any
Calculate the probability that the last visited metastable state was A.
Arguments
sys::LangevinSystem
: System with Hamiltonian and inverse temperature (beta)mesh::Mesh
: Main mesh structure containing points and triangulationAmes::Mesh
: Mesh structure for region Aqminus
: Backward committor function valuesZ
: Partition function value
Returns
- Probability (float) that the system was last in state A, normalized by partition function
References
- [15]
- E. Vanden-Eijnden. Transition Path Theory. In: Computer Simulations in Condensed Matter Systems: From Materials to Chemical Biology Volume 1, edited by M. Ferrario, G. Ciccotti and K. Binder (Springer, Berlin, Heidelberg, 2006); pp. 453–493. Accessed on Aug 2, 2025.
- [16]
- W. E and E. Vanden-Eijnden. Transition-Path Theory and Path-Finding Algorithms for the Study of Rare Events. Annual Review of Physical Chemistry 61, 391–420 (2010). Accessed on Aug 2, 2025. Publisher: Annual Reviews.
- [17]
- W. E. and E. Vanden-Eijnden. Towards a Theory of Transition Paths. Journal of Statistical Physics 123, 503–523 (2006). Accessed on Aug 2, 2025.