An exact Gillespie algorithm for one particle is:
  • Set the current well and time .
  • If is absorbing, stop.
  • Set and draw .
  • Move to if , and otherwise to .
  • Set and repeat, stopping if the jump crosses an absorbing end.
For , simulate particle identities independently and maintain a priority queue of their next event times. For , store occupation numbers and use aggregate event rates and for each well; one population-level Gillespie event then decrements one and increments its neighbor. This replaces work proportional to particle number by work proportional to the number of occupied wells.
The stochastic quasi-steady-state simulation evolves only :
1. At the current integer , compute and the averaged rates and .
2. Draw a waiting time .
3. Set with probability ; otherwise set .
4. Advance time by and repeat.
This is a Gillespie algorithm for the averaged slow master equation. It samples the fast conditional equilibrium analytically through its factorial moment and never simulates individual fast births or deaths.
Write the molecular copy numbers as and use the power-law reaction propensity convention of the paper. The seven propensities and stoichiometric vectors are
A channel is assigned zero propensity whenever its update would leave the nonnegative integer lattice.
The Gillespie algorithm starts from and . At the current state compute . If , terminate the path. Otherwise draw independent random variables from the uniform distribution on , set the next waiting time to
and choose the least index satisfying
Then update and , and repeat. The minimum of the seven competing reaction clocks has an exponential distribution of rate , while reaction wins with probability .