Skip to content

Python module for (symbolic) evaluation of the short-time Fokker-Planck propagator to arbitrary accuracy

License

Notifications You must be signed in to change notification settings

juliankappler/PySTFP

Repository files navigation

PySTFP: Python module for the short-time Fokker-Planck propagator

About

This module contains sympy-based symbolic tools for the short-time propagator for one-dimensional Fokker-Planck dynamics. This python module accompanies the paper Ref. [1].

Introduction

For a given drift a ( x ) and diffusivity D ( x ) we consider the Fokker-Planck equation

t P = x ( a P ) + x 2 ( D P ) ,

where P P ( x , t x 0 , t 0 ) is the transition density, or propagator, to find a particle that started at time t 0 at location x 0 at a later time t at a location x . This means we consider the initial conditions P ( x , t 0 x 0 , t 0 ) = δ ( x x 0 ) , where δ denotes the Dirac-delta distribution. As spatial domain we consider x R = ( , ) , with boundary conditions P ( x , t x 0 , t 0 ) 0 as | x | .

In this module, we implement an approximate short-time propagator P K ( x , t x 0 , t 0 ) , in both the normalization-preserving representation

P K ( x , t x 0 , t 0 ) = 1 4 π D ( x 0 ) Δ t exp [ Δ x 2 4 D ( x 0 ) Δ t ] × [ 1 + k = 1 K Δ t k Q k ( x ~ , x 0 ) ] ,

and the positivity-preserving representation

P K ( x , t x 0 , t 0 ) = 1 4 π D ( x 0 ) Δ t exp [ Δ x 2 4 D ( x 0 ) Δ t + k = 1 K Δ t k Q ^ k ( x ~ , x 0 ) ] .

Here, Δ x x x 0 , Δ t = t t 0 , are the spatial and temporal increments, x ~ = Δ x / 2 D ( x 0 ) Δ t is the rescaled spatial increment, and K N 0 is the truncation order for the approximate propagator. The explicit form of the coefficients Q k , Q ^ k , are a main result of Ref. [1]. The module contains the precalculated coefficients up to K = 8 (corresponding to an accuracy Δ t 4 for the propagator), but the module also includes code to calculate the coefficients to even higher order. Note that for a typical spatial increment Δ x , for which the support of the propagator is non-negligible, we have x ~ 1 ; this is the reason why the power-series coefficients Q k , Q ^ k have x ~ as an argument, see Ref. [1] for more details.

In PySTFP we furthermore implement the explicit perturbation expansions for the spatial moments Δ x n ( n = 0 , 1 , 2 , 3 , 4 ), as well as the medium entropy production rate, the total entropy production rate, and the Gibbs entropy. See Ref. [1] and the examples below for more details.

Examples

In the subfolder examples/ we provide several notebooks that illustrate the use of PySTFP, as well as allow to re-derive and extend the symbolic perturbative expressions used.

Here is a list of the notebooks:

Subfolder examples/

These notebooks showcase basic functionality of PySTFP:

Subfolder examples/derivations

These notebooks implement the symbolic derivations of all the perturbative results from Ref. [1]:

  • perturbative propagators and moments.ipynb: Symbolically evaluate the perturbation series for both the normalization-preserving and positivity-preserving propagator. Additionally, use the normalization-preserving propagator to calculate some moments Δ x k .
  • entropy production rates.ipynb: Symbolically calculate the medium entropy production rate, the total entropy production rate, and the Gibbs entropy.

Subfolder examples/numerical example

These notebooks allow to reproduce the plots of Ref. [1]:

Installation

PySTFP requires sympy and numpy, the example notebooks furthermore use matplotlib and h5py. To install these requirements as well as PySTFP, you can run the following commands.

>> git clone https://github.com/juliankappler/PySTFP.git .
>> cd PySTFP
>> pip install -r requirements.txt
>> pip install .

References

[1] Short-time Fokker-Planck propagator beyond the Gaussian approximation. J. Kappler. arXiv: 2405.18381.

Acknowledgements

We acknowledge funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 101068745.

About

Python module for (symbolic) evaluation of the short-time Fokker-Planck propagator to arbitrary accuracy

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages