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 class models. The code is largely written in Rust. The solver is accessed via a wrapper that exposes it to Python. This wrapping makes experimentation more convenient.

The Python wrapper is available as a PyPI package called DPRS and can be installed using pip. It has multi-platform support. Jupyter notebooks are used to implement the Python-wrapped simulations.

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 and accessed via a Typescript/Javascript wrapper.

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.