PyTubular: Python module for the evaluation of probability densities and exit rates in the tubular ensemble
This module contains both sympy-based symbolic and numpy-based numerical tools for one-dimensional Fokker-Planck dynamics in a small time-dependent domain, as derived in Ref. [1].
More specifically, for a given drift
on a time-dependent domain
We consider absorbing boundary conditions
for the density
The python module PyTubular implements perturbative analytical results for both the decay rate of the density,
To indicate that
Note that if the diffusivity is independent of position and time, then the theory implemented here reduces to the results of Ref. [2].
PyTubular comes with several illustrative example notebooks, which are located in the subfolder examples/. In particular, the examples are
- Analytical perturbative exit rate vs numerical simulations.ipynb: In this notebook we compare the perturbative exit rate from a small tube to the results of direct numerical simulation of the Fokker-Planck equation (which are performed using the python module fokker-planck).
- Sympy vs numpy implementation of exit rate.ipynb: In this notebook we show that the sympy-based symbolic and numpy-based numerical implementations of the perturbative exit rate, which are both contained in PyTubular, yield identical predictions.
- Most probable tube.ipynb: In this notebook we find the most probable tube for a barrier crossing.
PyTubular requires sympy and numpy, the most probable tube example furthermore uses the cma package for minimizing multidimensional functions. To install these requirements as well as PyTubular, you can run the following commands.
>> git clone https://github.com/juliankappler/PyTubular.git
>> cd PyTubular
>> pip install -r requirements.txt
>> pip install .
[1] Sojourn probabilities in tubes and pathwise irreversibility for Itô processes. J. Kappler, M. E. Cates, R. Adhikari. arXiv: 2009.04250.
[2] Stochastic action for tubes: Connecting path probabilities to measurement. J. Kappler and R. Adhikari. Physical Review Research vol. 2, p. 023407, 2020. DOI: 10.1103/PhysRevResearch.2.023407.