ppsim: A software package for efficiently simulating and visualizing population protocols

05/10/2021
by   David Doty, et al.
0

We introduce ppsim, a software package for efficiently simulating population protocols, a widely-studied subclass of chemical reaction networks (CRNs) in which all reactions have two reactants and two products. Each step in the dynamics involves picking a uniform random pair from a population of n molecules to collide and have a (potentially null) reaction. In a recent breakthrough, Berenbrink, Hammer, Kaaser, Meyer, Penschuck, and Tran [ESA 2020] discovered a population protocol simulation algorithm quadratically faster than the naive algorithm, simulating Θ(√(n)) reactions in *constant* time, while preserving the *exact* stochastic dynamics. ppsim implements this algorithm, with a tightly optimized Cython implementation that can exactly simulate hundreds of billions of reactions in seconds. It dynamically switches to the CRN Gillespie algorithm for efficiency gains when the number of applicable reactions in a configuration becomes small. As a Python library, ppsim also includes many useful tools for data visualization in Jupyter notebooks, allowing robust visualization of time dynamics such as histogram plots at time snapshots and averaging repeated trials. Finally, we give a framework that takes any CRN with only bimolecular (2 reactant, 2 product) or unimolecular (1 reactant, 1 product) reactions, with arbitrary rate constants, and compiles it into a continuous-time population protocol. This lets ppsim exactly sample from the chemical master equation (unlike approximate heuristics such as tau-leaping or LNA), while achieving asymptotic gains in running time. In linked Jupyter notebooks, we demonstrate the efficacy of the tool on some protocols of interest in molecular programming, including the approximate majority CRN and CRN models of DNA strand displacement reactions.

READ FULL TEXT
research
06/12/2020

Improved estimations of stochastic chemical kinetics by finite state expansion

Quantitative mechanistic models based on reaction networks with stochast...
research
05/12/2021

A survey of size counting in population protocols

The population protocol model describes a network of n anonymous agents ...
research
06/04/2021

A time and space optimal stable population protocol solving exact majority

We study population protocols, a model of distributed computing appropri...
research
05/07/2020

Simulating Population Protocols in Sub-Constant Time per Interaction

We consider the problem of efficiently simulating population protocols. ...
research
11/03/2018

Hardness of computing and approximating predicates and functions with leaderless population protocols

Population protocols are a distributed computing model appropriate for d...
research
05/23/2019

Semi-Quantitative Abstraction and Analysis of Chemical Reaction Networks

Analysis of large continuous-time stochastic systems is a computationall...
research
07/02/2023

On the Runtime of Chemical Reaction Networks Beyond Idealized Conditions

This paper studies the (discrete) chemical reaction network (CRN) comput...

Please sign up or login with your details

Forgot password? Click here to reset