Skip to content

Directed percolation solver in Rust/Python

1d DP-class, simplified Domany-Kinzel evolution for \(p_c \approx p=0.53891\), \(n_x=300\), \(t=200\)
Figure 1: 1d DP-class, simplified Domany-Kinzel evolution for \(p_c \approx p=0.53891\), \(n_x=300\), \(t=200\)

DPRS

DPRS implements solvers for a variety of directed-percolation (DP) class cellular automata models.

The core code is written in Rust, as is a Python wrapper that provides easy access to the solvers, and a Typescript wrapper that allow them to be run directly in a web browser. Jupyter notebooks are used to implement the DP simulations.

Access to the Python wrapper is provided by the pip-installable PyPI package DPRS. This package has multi-platform support, and should run on macOS, Windows and Linux without any difficulty (pip can rebuild the package from source if necessary).

Live demos

You can experiment with interactive demos of the DP solver here. These demos run the same Rust code as the Python-wrapped solver, but instead are made available using WebAssembly.

Technical motivation

We have two motivations for adopting Rust: one is to ensure maximum performance; another is to achieve this in a memory-safe and bug-free fashion (which is not easy to do in C or C++). Fast run times are achieved through parallelization using the Rayon crate. We anticipate boosting performance further with GPU-compute using wgpu.