1 Introduction

A great variety of chemical and biochemical phenomena on all scales hinge on the combination of diffusion and chemical reactions; examples range from classical front propagation [1,2,3], self-organization of excitable media [4,5,6,7] and pattern-forming coatings of animals [8, 9], over the formation of morphogen gradients [10,11,12,13] and MinE protein oscillations [14,15,16] in developmental biology, to spreading of diseases [17,18,19] and innovations [20]. Conventionally, such processes have been modeled by means of deterministic reaction–diffusion equations, which govern the temporal evolution of concentration fields [9, 21]. Such continuum descriptions, however, often break down for small copy numbers of molecules, as is typically the case for biochemical processes at cellular and subcellular scales [22,23,24]. The discreteness of copy numbers gives rise to intrinsic noise, which has been included heuristically in reaction–diffusion models in the form of spatiotemporal Gaussian white noise, e.g., in calcium signaling [25,26,27,28], but also for species extinction [29, 30].

A more systematic, microscopic approach suggests to switch from concentration fields to spatially resolved probability distributions of copy numbers, which leads to the reaction–diffusion master equation (RDME) [31,32,33]: position space is partitioned into a regular mesh of volume elements, the diffusion of molecules is replaced by a jump process on the mesh, and reactions occur only within each volume element under assumed well-mixed conditions. Such conditions are justified in the spatiotemporal chemical master equation (ST-CME) [34, 35], which has been put forward in the context of cellular environments to account for intracellular structures and compartmentalization. It uses an irregular partitioning of position space into comparably few metastable subsets, meaning that the subsets are separated by barriers such that jumps between them occur rarely. Another obstacle toward effective continuum models for biochemical processes is macromolecular crowding, i.e., the dense and heterogeneous packing of cellular spaces by macromolecules that do not participate in the reaction, which has consequences for product formation rates as well as diffusion-influenced reaction kinetics [36,37,38,39,40,41]. Some of the aspects of crowding have been included in recent extensions of numerical reaction–diffusion schemes [42, 43], showing the potential for qualitative changes of the observed phenomenology.

An alternative to the above probabilistic descriptions is stochastic simulations of particle-based reaction–diffusion (PBRD) models, which offer a high resolution down to the scale of molecules combined with great modeling flexibility. The idea is that molecules are represented by point particles undergoing Brownian motion and that bimolecular reactions between close-by particles occur with a given rate depending on the separation distance of the pair; the most common schemes use either a reaction volume (Doi model [44, 45]) or a reaction surface (Smoluchowski model [46]) in terms of this distance. PBRD schemes are constructed in a bottom-up way and based on the extensive theory of diffusion-influenced reactions [47,48,49,50,51]. A number of algorithms for the PBRD scheme exist [52,53,54,55,56,57], differing in their implementation of Brownian motion, whether physical interactions between molecules are supported [58, 59], and in their degree of molecular resolution [60,61,62]. Applications reach from enzyme kinetics under crowding conditions [63,64,65] to nanomaterial-based catalysis [66]. A recent comparison of the two probabilistic models given by RDME and PBRD with a focus on intracellular kinetics can be found in the review by Smith and Grima [24].

A mathematical formalization of PBRD models as an open many-particle system undergoing reactions and diffusion was developed only partially [44, 45, 67,68,69,70]. Yet, such a framework would be a highly desirable starting point to systematically derive numerical schemes for reaction–diffusion processes and to analytically connect PBRD models with coarse-grained descriptions such as the RDME and the ST-CME. For example, these compartmentalized descriptions are obtained by locally integrating out the spatial degrees of freedom, turning the diffusion process into a continuous-time random walk on a mesh of subdomains. For bimolecular reactions, however, the procedure gives rise to effective reaction rates [58, 71, 72] and markedly non-Markovian reaction time distributions [73,74,75]. For the standard RDME, where second-order reactions may occur only between particles of the same subdomain, it was shown that for decreasing mesh size, the dynamics converge to a limit where second-order reactions cease to occur [76]. This problem was addressed in terms of a convergent RDME [77, 78], which allows bimolecular reactions to take place also between particles located in different subdomains.

The aim of this work is to develop a framework for the systematic formulation of the probabilistic evolution equation for particle-based stochastic reaction–diffusion processes, which we refer to as chemical diffusion master equation (CDME). The CDME is a family of Fokker–Planck equations, each of them describing the diffusion processes for a given n-particle probability density. The equations within the family are coupled by the reaction dynamics similar in form to a chemical master equation (CME) [79, 80]. The underlying reaction schemes are not restricted to mass-conserving reactions and may include effective reactions such as insertion and removal of particles, e.g., by considering only a subset of the chemical species. Thus, the CDME is capable of describing the dynamics of an open system characterized by the overall number of particles changing in time, similarly to the standard CME [81]. To systematically formulate the CDME given a general set of chemical reactions, our framework uses creation and annihilation operators. We exemplify the framework for a birth–death process as well as the second-order reaction of mutual annihilation. Our work further provides the basis for putting reaction–diffusion models at different resolutions on the same footing, which clears the way to derive relationships between the various coarse-grained descriptions and numerical schemes for reaction–diffusion dynamics. The latter is fundamental to develop consistent multi-scale simulations. As a first step, we discretize the particle-based dynamics by doing a Galerkin projection [82] of the CDME onto a partition of the position space into subvolumes. This yields a generalized RDME, where bimolecular reactions can occur naturally between particles in different, yet close-by subvolumes. In particular, we find explicit relations between the reaction rate constants of the RDME and of the underlying particle-based model as given by the CDME.

A number of technical challenges need to be solved to achieve these goals. In general, reaction–diffusion systems are open systems in the sense that the number of particles is not fixed, but changes in the course of time due to the reactions. Whereas such situations are well-known in quantum field theory and solid-state physics, where they are addressed in terms of creation and annihilation operators, the analogous formulations for classical systems of indistinguishable particles are comparably underdeveloped; this is particularly true for the stochastic dynamics of particles undergoing Brownian motion in an open system. In a probabilistic description of reaction–diffusion dynamics, the number of particles of each species is no longer determined but obeys a statistical distribution, which evolves in time along with the particle positions. Further, the many-particle distributions do not distinguish individual particles of the same species, and the distributions are thus symmetric with respect to permutations of particle labels. The symmetry must be preserved under time evolution, which requires non-trivial combinatorial factors in the reaction operators. These aspects are addressed by borrowing the concept of the Fock space [83] from quantum mechanics and translating it to the classical setting [44, 67, 84]. A major mathematical obstacle in this endeavor is that probability densities are integrable, but not necessarily square-integrable functions, as opposed to quantum wavefunctions, and that the underlying function space is not a Hilbert space [70]. Some of these issues have been addressed in the literature of probability theory for population dynamics [68,69,70, 85, 86]; however these works do not explore the applications in the context of chemical reactions.

Outline. We start in Sect. 2 by introducing a probabilistic model for particle-based reaction–diffusion dynamics and motivating the structure of the chemical diffusion master equation that we look for. In Sect. 3, the probability functions are interpreted as elements of a Fock space; the creation and annihilation operators are introduced and central algebraic relations are derived. The main results of this work are presented in Sect. 4, where the creation and annihilation operators are used to express the symmetrized densities and the diffusion and reaction operators. This allows us to systematically formulate the CDME on a general level, as well as for two exemplary reaction systems. Finally, Galerkin projection methods are applied in Sect. 5 to derive the generalized RDME as a projection of the underlying CDME.

2 Probabilistic model for particle-based reaction–diffusion dynamics

The object of interest in this work is a collection of molecules that diffuse in space and can undergo chemical reactions. These reactions will cause changes in the number of molecules of a given species. Focusing on a single species as a first step, elementary reactions include the creation and annihilation of molecules, which is then straightforward to extend to, e.g., binary reactions among molecules of different species. The goal is to find a probabilistic description that includes both the spatial movement of molecules and the changes in the population size. In this section, we introduce the structure of the CDME and formulate the equations for an exemplary birth–death process. A systematic approach to formulate the CDME for general reaction schemes will be given in Sect. 4.

2.1 Symmetric probability density functions

Specifically, we consider point particles of only one chemical species in a bounded domain \({\mathbb {X}}\subset {\mathbb {R}}^3\). Due to the reactions, the number of particles \(N(t) \in {\mathbb {N}}_0\) at time t can vary in the course of time. Assuming that there are \(n=N(t)\) particles at time t, the configuration of all particle positions is denoted by the vector \(x^{(n)}=\left( x^{(n)}_1,\dots ,x^{(n)}_n\right) \in {\mathbb {X}}^n\). The statistical law of the configurations is encoded in the conditional probability density function \(p_n(x^{(n)},t|N(t)=n)\) at time t given that \(N(t)=n\). Following the situation of a fixed particle number, we adopt the convention that \(p_n\) is normalized:

$$\begin{aligned} \int _{{\mathbb {X}}^n} p_n(x^{(n)},t|N(t)=n) \, \hbox {d}x^{(n)} =1 \end{aligned}$$
(1)

for all \(t \geqslant 0\) and each fixed n. The unconditional probability density for \(n\geqslant 1 \) is then given by

$$\begin{aligned} \rho _n(x^{(n)},t) := p_n(x^{(n)},t|N(t)=n) {\mathbb {P}}\left[ N(t)=n\right] , \end{aligned}$$
(2)

where \({\mathbb {P}}\left[ N(t)=n\right] \) is the probability of having n particles in the system at time t; for the empty system, we set \(\rho _0(t) := {\mathbb {P}}\left[ N(t) =0\right] \). It follows that

$$\begin{aligned} {\mathbb {P}}\left[ N(t)=n\right] = \int _{{\mathbb {X}}^n} \rho _n (x^{(n)},t) \,\hbox {d}x^{(n)} . \end{aligned}$$
(3)

In particular, the admissible probability densities \(\rho _n\) belong to the space of absolutely integrable functions, \(L^1({\mathbb {X}}^n) = \{ \eta : {\mathbb {X}}^n \rightarrow {\mathbb {R}} \,; \Vert \eta \Vert _n < \infty \}\) with the standard norm

$$\begin{aligned} \Vert \eta \Vert _n := \int _{{\mathbb {X}}^n} \left| \eta \left( x^{(n)}\right) \right| \,\hbox {d}x^{(n)} . \end{aligned}$$
(4)

For \(n=0\), there is no dependence on the spatial position, so we have \(\rho _0(t) \in {\mathbb {R}}\) and set \(\Vert \rho _0(t)\Vert _0 := |\rho _0(t)|\).

As the n particles are of the same species and thus chemically indistinguishable, we consider two-particle configurations as equivalent if they differ only by a permutation of particle indices. Restricting to this reduced configuration space, the relevant probability densities are symmetric under interchanging any pair of their arguments. The same symmetry is known for bosonic many-body wave functions in quantum mechanics, albeit of totally different physical origin. The statistical indistinguishability of classical particles was introduced already by Gibbs to resolve the mixing paradox in statistical mechanics [87].

The open system with a variable number of particles is then characterized by the family of symmetrized probability densities,

$$\begin{aligned} \rho (t)=(\rho _0(t), \rho _1(\cdot ,t), \dots , \rho _n(\cdot ,t), \dots ). \end{aligned}$$
(5)

Note that we will sometimes skip the time argument t in the notation. Recalling that \(\Vert \rho _n(\cdot , t)\Vert _n = {\mathbb {P}}\left[ N(t)=n\right] \), the total probability theorem implies that

$$\begin{aligned} \sum _{n=0}^\infty \Vert \rho _n(\cdot , t)\Vert _n = 1 \quad \text {for all }t \geqslant 0, \end{aligned}$$
(6)

which expresses the conservation of probability also within chemical reaction. The underlying space of such a family of distributions has a specific algebraic structure and is called the Fock space; it will be introduced in detail in Sect. 3. A similar probabilistic description, albeit differing in detail, was employed recently in a model of open systems that are coupled explicitly to a spatially separated reservoir [88, 89]. In particular, the many-particle densities therein obey a set of coupled Liouville-type evolution equations that preserve total probability and the particle exchange symmetry.

We emphasize that the family of densities [Eq. (5)] must not be confused with the hierarchy of correlation functions \(f_1, f_2, \dots \) that is used in statistical mechanics and is governed by the BBGKY equations [90], where \(f_n\) is also referred to as the reduced n-particle (phase space) density. Specifically, \(f_1\) is the probability density of a tagged particle’s position and \(f_2\) refers to the correlation between a pair of particles in the presence of all other particles. These functions are obtained by marginalization of the distribution of the overall system that consists of a large, but fixed number of particles. In particular, \(f_1\) can be obtained from \(f_2\) by integration, which is conceptually different from the present approach, where \(\rho _1\) and \(\rho _2\) do not share such a relation.

2.2 Chemical diffusion master equation

The main goal of this work is to develop a framework to formulate the evolution equation for the family of symmetrized n-particle densities in the presence of diffusion and reactions.

In the absence of reactions, the particle number is fixed and the system of interest may be associated with a closed system of n particles that diffuse in space, possibly subject to physical interactions or an imposed flow. In this case, the conditional density \(p_n(x^{(n)},t|N(t)=n)\) of n-particle configurations \(x^{(n)} \in {\mathbb {X}}^n\) obeys the Fokker–Planck equation

$$\begin{aligned} \frac{\partial p_n}{\partial t} = {\mathcal {D}}_n p_n, \end{aligned}$$
(7)

where \({\mathcal {D}}_n\) is the corresponding Fokker–Planck operator. In the most general situation, it is a semi-elliptic linear operator and takes the form [91]

$$\begin{aligned} {\mathcal {D}}_n p_n = -\sum _{i=1}^{n} \nabla _i \cdot \left( A_i p_n\right) + \sum _{i,j=1}^{n} \nabla _i \cdot \left( D_{ij} \nabla _j p_n \right) , \end{aligned}$$
(8)

where \(A_i=A_i(x^{(n)},t)\) describes the deterministic drift, the \(D_{ij} = D_{ij}(x^{(n)})\) are \(3\times 3\) diffusion matrices composing the \(3n \times 3n\) diffusion tensor, and \(\nabla _i\) denotes differentiation with respect to the position \(x_i^{(n)}\) of particle i. If the drift originates from an interaction potential \(U(x^{(n)})\), then

$$\begin{aligned} A_i = - \sum _{j=1}^{n} D_{ij} \nabla _j U. \end{aligned}$$
(9)

In the absence of the drift term and assuming that diffusion is isotropic, the diffusion operator reduces to that of standard Brownian motion, \({\mathcal {D}}_n \rho _n = D\Delta \rho _n\), with a scalar diffusion constant \(D > 0\), where \(\Delta \) is the Laplace operator.

In addition to diffusive motion, the particles of the considered species \(\text {A}\) undergo reactions of the form

$$\begin{aligned} k\text {A}\rightarrow l \text {A}, \quad k,l\in {\mathbb {N}}_0. \end{aligned}$$
(10)

For each reaction, there is a reaction rate function

$$\begin{aligned} \lambda :{\mathbb {X}}^l\times {\mathbb {X}}^k \rightarrow [0,\infty ), \end{aligned}$$
(11)

where the value \(\lambda (y^{(l)},x^{(k)})\geqslant 0\) corresponds to the rate at which the reaction occurs given that the k reactants are at positions \(x^{(k)}\in {\mathbb {X}}^k\) and the l products are placed at positions \(y^{(l)}\in {\mathbb {X}}^l\). The reaction rate function \(\lambda \) is assumed to be symmetric under particle exchange within the configuration \(y^{(l)}\) and also within \(x^{(k)}\).

In the presence of both reactions and diffusion, the total number of particles and their positions can change simultaneously over time. Given that there are S different chemical reactions, the family of n-particle densities, \(\rho = (\rho _0, \rho _1, \dots )\), should obey a linear evolution equation of the form

$$\begin{aligned} \partial _t \rho = \left( {\mathcal {D}} + \sum _{r=1}^S {\mathcal {R}}_r\right) \rho \end{aligned}$$
(12)

which we will refer to as the chemical diffusion master equation (CDME). Here, \({\mathcal {D}}\) is the diffusion operator as above, and the reaction operator \({\mathcal {R}}_r\) encodes the r-th reaction, which is parametrized by a reaction rate function \(\lambda _r\). A central assumption is that diffusion and reactions occur independently, which allows us to split the operator on the right-hand side into the sum \({\mathcal {D}} + {\mathcal {R}}\), where \({\mathcal {R}}= \sum _{r=1}^S {\mathcal {R}}_r\) combines all reaction operators into one to simplify the notation. The reaction operators couple components \(\rho _n\) of \(\rho \) for different n, similarly to the CME. More precisely, treating \(\rho \) as an infinitely long column vector, Eq. (12) reads in matrix notation:

$$\begin{aligned} \frac{\partial }{\partial t} \underbrace{ \begin{pmatrix} \rho _0 \\ \rho _1 \\ \vdots \\ \rho _n \\ \vdots \end{pmatrix}}_{\textstyle \rho } = \underbrace{ \begin{pmatrix} {\mathcal {D}}_0\rho _0 \\ {\mathcal {D}}_1\rho _1 \\ \vdots \\ {\mathcal {D}}_n\rho _n \\ \vdots \end{pmatrix}}_{\textstyle \mathcal {{\mathcal {D}}}\rho } + \underbrace{\begin{pmatrix} {\mathcal {Q}}_{00} &{} {\mathcal {Q}}_{01} &{} \dots &{} {\mathcal {Q}}_{0n} &{} \dots \\ {\mathcal {Q}}_{10} &{} {\mathcal {Q}}_{11} &{} \dots &{} {\mathcal {Q}}_{1n} &{} \dots \\ \vdots &{} \vdots &{}&{} \vdots &{} \dots \\ {\mathcal {Q}}_{n0} &{} {\mathcal {Q}}_{n1} &{} \dots &{} {\mathcal {Q}}_{nn} &{} \dots \\ \vdots &{} \vdots &{} &{}\vdots &{} \ddots \end{pmatrix}}_{\textstyle {\mathcal {R}}} \begin{pmatrix} \rho _0 \\ \rho _1 \\ \vdots \\ \rho _n \\ \vdots \end{pmatrix}. \end{aligned}$$
(13)

Each entry \({\mathcal {Q}}_{nm}\) is an operator that condenses the effect of all the reactions that act on a given \(\rho _{n'}\) yielding the temporal change of \(\rho _n\), similarly to the CME. To ensure conservation of probability [Eq. (6)] we impose reflective boundary conditions at the boundaries of the domains \({\mathbb {X}}^n\) separately for every n, i.e., the diffusive flux across these boundaries is zero. Under the assumption of well-mixed conditions, the spatial degrees of freedom can be integrated out, and Eq. (13) should yield the conventional CME [80]. On the other hand, if there are no reactions, the equations will uncouple and yield a set of independent Fokker–Planck equations for the symmetrized densities \(\rho _n\), see Eq. (7).

The stochastic system trajectories corresponding to Eq. (13) combine continuous diffusion in the configuration spaces \(({\mathbb {X}}^0, {\mathbb {X}}^1, \dots , {\mathbb {X}}^n, \dots )\) for fixed n and a discrete jump process between \({\mathbb {X}}^m\) and \({\mathbb {X}}^n\) for \(m\ne n\), modeling creation and annihilation of particles due to reactions (Fig. 1). The model thus fits into the category of stochastic hybrid systems, where continuous dynamics and discrete events coexist in the same process. However, a particular challenge for the mathematical formalization is the change of dimensionality that is induced by the discrete jumps.

Example (birth–death process). Consider a chemical species \(\text {A}\) that undergoes degradation and creation reactions: Otherwise, it looks as if Fig. 1 contains the reactions that we refer to

$$\begin{aligned} \mathrm {(I)} \quad \text {A}\xrightarrow {\,\lambda _d(x)\,} \varnothing , \qquad \mathrm {(II)} \quad \varnothing \xrightarrow {\,\lambda _c(x)\,} \text {A}. \end{aligned}$$
(14)

Here, \(\lambda _d(x)\) denotes the rate for reaction \(\mathrm {(I)}\) to occur for a particle located at position \(x\in {\mathbb {X}}\) (i.e., the probability per unit of time for this particle to disappear), while \(\lambda _c(x)\) is the rate for a new particle to be created at position x by reaction \(\mathrm {(II)}\). Explicitly, we assume that the rates depend only on the position in space, but not on the configuration of all particle positions. Both \(\lambda _d\) and \(\lambda _c\) are special cases of the generic reaction rate function \(\lambda \) in (11).

Fig. 1
figure 1

Illustration of the configuration space of the stochastic process represented by the chemical diffusion master equation (13). The position space for every particle is \({\mathbb {X}}\subset {\mathbb {R}}^3\). The configuration space is composed of subspaces \({\mathbb {X}}^{n}\) of dimension \(n=0,1,2,\dots \), which is equal to the number of particles in the system. Chemical reactions lead to transitions between these subspaces by adding or removing particles with position-dependent rates as encoded in the matrix \(({\mathcal {Q}}_{nm})\) of reaction operators. \({\mathcal {Q}}_{nm}\) represents the transition from a configuration with m particles to a configuration with n particles. For simplicity, only transitions that differ by one particle are shown

Arguments analogous to the formulation of the CME lead us to propose the following equation for the time evolution of \(\rho _n(x^{(n)},t)\) for \(n\geqslant 1\), taking into account the symmetry of the densities:

$$\begin{aligned} \begin{aligned} \partial _t \rho _n\left( x^{(n)}_1,\dots ,x^{(n)}_n,t\right)&= {\mathcal {D}}_n\rho _n\left( x^{(n)}_1,\dots ,x^{(n)}_n,t\right) \\&\quad + (n+1)\int _{\mathbb {X}}\lambda _d(y) \rho _{n+1}\left( x^{(n)}_1,\dots ,x^{(n)}_n,y,t\right) \, \hbox {d}y \\&\quad -\sum _{i=1}^n \lambda _d(x^{(n)}_i) \rho _n\left( x^{(n)}_1,\dots ,x^{(n)}_n,t\right) \\&\quad + \frac{1}{n}\sum _{i=1}^n \lambda _c(x^{(n)}_i)\rho _{n-1}\left( x^{(n)}_1,\dots ,x^{(n)}_{i-1},x^{(n)}_{i+1},\dots ,x^{(n)}_n,t\right) \\&\quad - \int _{\mathbb {X}}\lambda _c(y) \rho _n(x^{(n)}_1,\dots ,x^{(n)}_n,t) \, \hbox {d}y , \end{aligned}\end{aligned}$$
(15)

where the first line refers to spatial diffusion, the second and third lines are gain and loss terms due to reaction \(\mathrm {(I)}\), and the last two lines relate to reaction \(\mathrm {(II)}\). For \(n=0\), we have

$$\begin{aligned} \partial _t \rho _0(t) = \int _{{\mathbb {X}}} \lambda _d(x) \rho _1(x,t) \hbox {d}x -\int _{\mathbb {X}}\lambda _c(x) \rho _0(t) \, \hbox {d}x. \end{aligned}$$
(16)

The boundary-value problem induced by Eqs. (15) and (16) is well-posed for an elliptic diffusion operator \({\mathcal {D}}\) and regular reaction rate functions \(\lambda _\mathrm {d}\) and \(\lambda _\mathrm {c}\). Equation (15) corresponds to the n-th row of Eq. (13), and the components of the reaction operator matrix are:

$$\begin{aligned} ({\mathcal {Q}}_{n,n+1}\rho _{n+1})(x^{(n)})&= \quad (n+1)\int _{\mathbb {X}}\lambda _d(y) \rho _{n+1}\left( y,x^{(n)}_1,\dots ,x^{(n)}_n\right) \, \hbox {d}y, \end{aligned}$$
(17a)
$$\begin{aligned} ({\mathcal {Q}}_{n,n-1}\rho _{n-1})(x^{(n)})&= \quad \frac{1}{n} \sum _{i=1}^n \lambda _c\left( x^{(n)}_i\right) \rho _{n-1}\left( x^{(n)}_1,\dots ,x^{(n)}_{i-1},x^{(n)}_{i+1},\dots ,x^{(n)}_n\right) , \end{aligned}$$
(17b)
$$\begin{aligned} ({\mathcal {Q}}_{n,n}\rho _n)(x^{(n)})&= - \left[ \sum _{i=1}^n \lambda _d\left( x^{(n)}_i\right) + \int _{\mathbb {X}}\lambda _c(x) \, \hbox {d}x \right] \rho _n\left( x^{(n)}_1,\dots ,x^{(n)}_n\right) , \end{aligned}$$
(17c)

and for \(n=0\), they are

$$\begin{aligned} {\mathcal {Q}}_{0,1}\rho _1&= \quad \int _{{\mathbb {X}}} \lambda _d(x) \rho _1(x) \hbox {d}x , \end{aligned}$$
(18a)
$$\begin{aligned} {\mathcal {Q}}_{0,0}\rho _0&= -\int _{\mathbb {X}}\lambda _c(x)\rho _0 \, \hbox {d}x , \end{aligned}$$
(18b)

where \(\rho _0\in {\mathbb {R}}\) is a constant.

We verify that the CME related the reactions (I) and (II) is recovered from Eq. (15) by integrating out the spatial degrees of freedom [Eq. (3)]. To this end, we define the marginal distribution

$$\begin{aligned} P(n,t):= {\mathbb {P}}\left[ N(t)=n\right] = \Vert \rho _n(\cdot , t) \Vert _n \end{aligned}$$
(19)

and assume the reaction rate functions to be constants, \(\lambda _d(x)=\gamma _\mathrm {d}\) and \(\lambda _c(x)=\gamma _\mathrm {c}\) for all \(x\in {\mathbb {X}}\). Then, integrating Eq. (15) over the space \({\mathbb {X}}^n\) yields:

$$\begin{aligned} \partial _t P(n,t)&= (n+1)\gamma _\mathrm {d} P(n+1,t) - n\gamma _\mathrm {d} P(n,t) \nonumber \\&\quad + \gamma _\mathrm {c} |{\mathbb {X}}| P(n-1,t) - \gamma _\mathrm {c} |{\mathbb {X}}| P(n,t), \end{aligned}$$
(20)

where \(|{\mathbb {X}}|<\infty \) is the volume of the domain \({\mathbb {X}}\). Note that the diffusion term vanishes due to the no-flux boundary condition by Gauss’ theorem. Equation (20) is exactly the CME as derived from the classical law of mass action for reactions of order zero and one in spatially well-mixed systems. One checks easily that summation of the right-hand side over \(n \geqslant 0\) yields zero, as required for a continuous-time Markov chain.

In the next two sections, we will develop a systematic way to construct the CDME such as Eq. (15) corresponding to a given set of chemical reactions [e.g., Eq. (14)]. In particular, we will specify the reaction operators [Eqs. (17a)–(17c)] and find their correct combinatorial prefactors, which is often not a straightforward task. We do so by means of the Fock space formalism, which yields one possible explicit representation of the probabilistic evolution described by the CDME.

3 Fock space formalism

The mathematical formalization of the dynamics of open systems requires means for the insertion and deletion of particles. In reaction–diffusion problems, this can occur everywhere in the domain \({\mathbb {X}}\). Further, in the probabilistic description, a particle is described by a probability density rather than by a single point. A similar problem was solved in quantum field theory, where the n-particle densities are represented by symmetric or anti-symmetric wavefunctions and (quasi-)particles can be created in or annihilated from such states. The underlying algebraic construction is called Fock space and relies on the fact that the space of n-particle densities is generated from products of single-particle densities. In the quantum case, the wavefunctions are square-integrable and form a Hilbert space whereas the probability densities of classical particles are absolutely integrable [Eq. (3)]. As an important consequence, the corresponding space \(L^1({\mathbb {X}}^n)\) is merely a Banach space, i.e., it does not possess an inner product. This technical deficiency can be circumvented by resorting to the dual space. In the following, we will introduce the Fock space for the family of symmetrized probability densities. Suitably defined creation and annihilation operators will then serve as efficient instruments to represent the reaction operators in the CDME as well as its solutions. This program will be carried out in Sect. 4.

3.1 Symmetrized n-particle spaces

Single-particle space. We start with the one-particle space \(H:=L^1({\mathbb {X}})\), which contains the probability density functions of a single particle’s position on the space of motion \({\mathbb {X}}\), and re-collect some facts from functional analysis [92]. The dual space of \(L^1({\mathbb {X}})\) is isometrically isomorph to \(L^\infty ({\mathbb {X}})\), so that we can identify the dual space \(H^*\) with \(L^\infty ({\mathbb {X}})\), i.e., the bounded functions on \({\mathbb {X}}\). In the application to reaction–diffusion dynamics below, we will see that, for example, reaction rate functions are elements of \(H^*\). A dual pairing \(\langle \cdot ,\cdot \rangle : H^* \times H\rightarrow {\mathbb {R}}\) is defined by

$$\begin{aligned} \langle \zeta , \eta \rangle := \int _{{\mathbb {X}}} \zeta (x) \eta (x) \hbox {d}x , \end{aligned}$$
(21)

which acts as a substitute for the missing inner product on H and yields the “overlap” between the functions \(\zeta \in H^*\) and \(\eta \in H\). The next step is to choose a (Schauder) basis \((u_1, u_2, \dots )\) of the space H, which can even be taken to be nonnegative [93] and normalized, \(u_\alpha \geqslant 0\) and \(\Vert u_\alpha \Vert _1 = 1\) for all \(\alpha \in {\mathbb {N}}\). The basis induces the dual set of linear functionals \((u_1^*, u_2^*, \dots )\), here identified with functions \(u^*_\alpha \in L^\infty ({\mathbb {X}})\), such that \( \langle u^*_\alpha , u_\beta \rangle = \delta _{\alpha ,\beta } \) for all \(\alpha , \beta \in {\mathbb {N}}\), using the Kronecker symbol \(\delta _{\alpha ,\beta }\). Thus, a density \(\eta \in H\) of a single particle has the representation

$$\begin{aligned} \eta = \sum _{\alpha =1}^\infty \langle u_\alpha ^*, \eta \rangle u_\alpha \end{aligned}$$
(22)

in terms of the one-particle basis \((u_\alpha )_{\alpha \in {\mathbb {N}}}\). We note that the family \((u_{\alpha }^*)_{\alpha \in {\mathbb {N}}}\) is countable and thus cannot span the dual space \(H^* \cong L^\infty (X)\), which is not separable. However, this deficiency of \((u_\alpha ^*)\) is not of practical relevance for the following treatment.

Tensor spaces. A natural extension to the space \(L^1({\mathbb {X}}^n)\) of n-particle densities uses the observation that the pure tensor \(u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n}\), given as products of n one-particle densities,

$$\begin{aligned} (u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})(x^{(n)}) := u_{\alpha _1}(x^{(n)}_1) \ldots u_{\alpha _n}(x^{(n)}_n) , \end{aligned}$$
(23)

span the space \(L^1({\mathbb {X}}^n)\). Thus, the tensor space

$$\begin{aligned} H^{\otimes n} := \bigotimes _{i=1}^nH= {\overline{{{\,\mathrm{span}\,}}}} (u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})_{\alpha _i \in {\mathbb {N}}} \end{aligned}$$
(24)

coincides with \(L^1({\mathbb {X}}^n)\) and we refer to \((u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})_{\alpha _i \in {\mathbb {N}}}\) as a tensor basis. As convention for \(n=0\), we set \(H^{\otimes 0} := {\mathbb {R}}\). Similarly to the one-particle case, we define a dual pairing for \(\eta \in H^{\otimes n}\), \(\zeta \in (H^{\otimes n})^*\) as

$$\begin{aligned} \langle \zeta , \eta \rangle := \int _{{\mathbb {X}}^n} \zeta (x^{(n)}) \, \eta (x^{(n)}) \, \hbox {d} x^{(n)}. \end{aligned}$$
(25)

Then, the dual set of the tensor basis consists of the dual pure tensor

$$\begin{aligned} (u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})^* = u_{\alpha _1}^* \otimes \dots \otimes u_{\alpha _n}^* , \end{aligned}$$
(26)

which satisfy

$$\begin{aligned} \langle u_{\alpha _1}^* \otimes \dots \otimes u_{\alpha _n}^*, u_{\alpha _1'} \otimes \dots \otimes u_{\alpha _n'} \rangle&= \langle u_{\alpha _1}^*, u_{\alpha _1'} \rangle \dots \langle u_{\alpha _n}^*, u_{\alpha _n'} \rangle \nonumber \\&= \delta _{\alpha _1 \alpha _1'} \dots \delta _{\alpha _n \alpha _n'} \end{aligned}$$
(27)

for all multi-indices \((\alpha _1, \dots , \alpha _n), (\alpha _1', \dots , \alpha _n') \in {\mathbb {N}}^n\). Finally, the basis representation of an element \(\eta \in H^{\otimes n}\) reads

$$\begin{aligned} \eta =\sum _{\alpha _1, \dots , \alpha _n} c_{\alpha _1,\dots ,\alpha _n} \, u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n} , \end{aligned}$$
(28)

with coefficients \(c_{\alpha _1,\dots ,\alpha _n} := \langle u_{\alpha _1}^* \otimes \dots \otimes u_{\alpha _n}^*,\eta \rangle \) and each of the summation indices \(\alpha _1 \dots \alpha _n\) running from 1 to \(\infty \).

Symmetrization. The probability density of a system of n identical particles is symmetric in all particle positions (see Sect. 2.1). Thus, the spaces \(H^{\otimes n}\) are too large for our purposes and we need to project onto the symmetrized functions. To this end, we introduce the symmetrization operator \({\mathcal {S}}_n: H^{\otimes n} \rightarrow H^{\otimes n}\),

$$\begin{aligned} {\mathcal {S}}_n \eta \left( x^{(n)}_1,\dots ,x^{(n)}_n,t\right) := \frac{1}{n!}\sum _{\sigma \in \Sigma _n} \eta \left( x^{(n)}_{\sigma (1)}, \dots , x^{(n)}_{\sigma (n)},t\right) , \end{aligned}$$
(29)

where \(\Sigma _n\) is the set of permutations on \(\{1,\dots ,n\}\). We note that for \(n=0\) or \(n=1\), the symmetrization is the identity: \({\mathcal {S}}_0\eta = \eta \) for \(\eta \in H^{\otimes 0}\) or \(\eta \in H^{\otimes 1}\). Dividing by the number n! of possible permutations ensures that normalization is preserved, i.e., \(\Vert {\mathcal {S}}_n \eta \Vert _n = \Vert \eta \Vert _n\). The operator \({\mathcal {S}}_n\) is indeed a linear projection, in particular \({\mathcal {S}}_{n}^2 = {\mathcal {S}}_{n}\), and it is also “orthogonal” with respect to the dual pairing (proof in Appendix A.1):

$$\begin{aligned} \langle {\mathcal {S}}_{n} \zeta , \eta \rangle = \langle \zeta , {\mathcal {S}}_{n} \eta \rangle = \langle {\mathcal {S}}_{n} \zeta , {\mathcal {S}}_{n} \eta \rangle \end{aligned}$$
(30)

for any \(\eta \in H^{\otimes n}\) and \(\zeta \in (H^{\otimes n})^*\). Throughout this work, we will refer to the symmetrized tensor space \({\mathcal {S}}_nH^{\otimes n}= \{ {\mathcal {S}}_n v : v \in H^{\otimes n} \}\) as the n-particle space.

A basis of \({\mathcal {S}}_nH^{\otimes n}\) is obtained by symmetrization of the n-particle tensor basis:

$$\begin{aligned} \bigl ({\mathcal {S}}_n (u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n}) \bigr )_{\alpha _1\leqslant \dots \leqslant \alpha _n}, \end{aligned}$$
(31)

where the action of \({\mathcal {S}}_n\) on a pure tensor amounts to a linear combination of all permutations of the factors \(u_{\alpha _1}, \dots , u_{\alpha _n}\). The ordering of the indices \(\alpha _1 \leqslant \cdots \leqslant \alpha _n\) is needed to avoid double counting; the equality is included here as, for example, \(u_1 \otimes u_1\) belongs to \({\mathcal {S}}_2 H^{\otimes 2}\). The dual set of the symmetrized tensor basis obeys again a biorthogonality relation [see Eq. (27)]:

$$\begin{aligned} \langle {\mathcal {S}}_n( u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})^*, {\mathcal {S}}_n(u_{\alpha _1'} \otimes \dots \otimes u_{\alpha _n'}) \rangle = \delta _{\alpha _1 \alpha _1'} \dots \delta _{\alpha _n \alpha _n'} \end{aligned}$$
(32)

with the understanding that in the expression \({\mathcal {S}}_n( \dots )^*\) dualization is carried out after symmetrization. It is evident from Eq. (30) that the two operations do not commute, which motivates us to introduce “normalization” coefficients

$$\begin{aligned} s_{\alpha _1,\dots ,\alpha _n} := \langle {\mathcal {S}}_n( u_{\alpha _1}^* \otimes \dots \otimes u_{\alpha _n}^*), {\mathcal {S}}_n\left( u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n}\right) \rangle , \end{aligned}$$
(33)

so that the symmetrized duals are given in terms of the unsymmetrized duals by

$$\begin{aligned} {\mathcal {S}}_n( u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})^* = \frac{1}{s_{\alpha _1,\dots ,\alpha _n} } {\mathcal {S}}_n( u_{\alpha _1}^* \otimes \dots \otimes u_{\alpha _n}^*) . \end{aligned}$$
(34)

As an example, for \(n=2\), one calculates

$$\begin{aligned} s_{\alpha \beta }&= \langle {\mathcal {S}}_{2} (u_\alpha ^* \otimes u_\beta ^*), {\mathcal {S}}_{2} (u_\alpha \otimes u_\beta ) \rangle \nonumber \\&= \left\langle \frac{1}{2}(u_\alpha ^* \otimes u_\beta ^* + u_\beta ^* \otimes u_\alpha ^*), \frac{1}{2}(u_\alpha \otimes u_\beta + u_\beta \otimes u_\alpha ) \right\rangle \nonumber \\&= \frac{1}{2}(1 + 1\delta _{\alpha \beta }) \end{aligned}$$
(35)

so that \(s_{\alpha \beta } = \frac{1}{2}\) for \(\alpha \ne \beta \) and \(s_{\alpha \beta } = 1\) otherwise. With this, a symmetrized function \(\eta \in {\mathcal {S}}_nH^{\otimes n}\) has the basis representation

$$\begin{aligned} \eta =\sum _{\alpha _1\leqslant \dots \leqslant \alpha _n}{\tilde{c}}_{\alpha _1,\dots ,\alpha _n} {\mathcal {S}}_n (u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n}) \end{aligned}$$
(36)

with coefficients

$$\begin{aligned} {\tilde{c}}_{\alpha _1,\dots ,\alpha _n}&:= \langle {\mathcal {S}}_n (u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})^*, \eta \rangle \nonumber \\&~= \frac{1}{s_{\alpha _1,\dots ,\alpha _n} } \langle u_{\alpha _1}^* \otimes \dots \otimes u_{\alpha _n}^*, \eta \rangle \end{aligned}$$
(37)

for \(1\leqslant \alpha _1\leqslant \dots \leqslant \alpha _n < \infty \), using Eqs. (30) and (34) in the second line. For later reference, we again define the subspace spanned by the duals of the symmetrized tensor basis:

$$\begin{aligned} ({\mathcal {S}}_n H^{\otimes n})' := {\overline{{{\,\mathrm{span}\,}}}}\bigl ({\mathcal {S}}_n (u_{\alpha _1} \otimes \dots \otimes u_{\alpha _n})^*\bigr )_{\alpha _i \in {\mathbb {N}}} \subset ({\mathcal {S}}_n H^{\otimes n})^* . \end{aligned}$$
(38)

Copy number representation. In the basis representation (36), the indices \(\alpha _1,\dots ,\alpha _n\) take values that are not necessarily different from each other. This motivates counting the occurrence of every value \(\alpha =1, 2, \dots \) in a given multi-index \((\alpha _1,\dots ,\alpha _n)\) and switching to a sequence of frequencies \((N_1, N_2, \dots )\), where most of the entries are zero. We refer to these frequencies as copy numbers since \(N_\alpha \) counts how many times the factor \(u_\alpha \) is repeated in an element of the tensor basis, i.e., how many particles have a position distributed according to \(u_\alpha \); in quantum mechanics, the term occupation number is used instead. Given the number of particles \(n\in {\mathbb {N}}\), we define

$$\begin{aligned} {\mathbb {M}}_n := \left\{ N=(N_1,N_2,\dots ): N_\alpha \in {\mathbb {N}}_0, \sum _{\alpha =1}^{\infty } N_\alpha =n \right\} \end{aligned}$$
(39)

as the set of possible sequences of copy numbers and use it to enumerate the symmetrized n-particle tensor basis. Then, for \(\eta \in {\mathcal {S}}_nH^{\otimes n}\), we have

$$\begin{aligned} \eta = \sum _{N\in {\mathbb {M}}_n } p_{N} \, {\mathcal {S}}_n\left( u_1^{\otimes N_1}\otimes u_2^{\otimes N_2}\otimes \dots \right) \end{aligned}$$
(40)

with coefficients \(p_{N} = \bigl \langle {\mathcal {S}}_n(u_1^{\otimes N_1}\otimes u_2^{\otimes N_2}\otimes \dots )^*, \eta \bigr \rangle \) . Expanding the symmetrization operator and contracting the dual pairings in Eq. (33), one can show that

$$\begin{aligned} {\mathcal {S}}_n \left( u_1^{*\otimes N_1}\otimes u_2^{*\otimes N_2}\otimes \dots \right) = \frac{N_1! \dots N_M!}{n!} \, {\mathcal {S}}_n\left( u_1^{\otimes N_1}\otimes u_2^{\otimes N_2}\otimes \dots \right) ^* \end{aligned}$$
(41)

so that

$$\begin{aligned} p_{N} = \frac{n!}{N_1!N_2! \dots } \, \left\langle u_1^{*\otimes N_1}\otimes u_2^{*\otimes N_2}\otimes \dots , \eta \right\rangle , \end{aligned}$$
(42)

where \({\mathcal {S}}_n\) has been omitted in the left factor on the r.h.s. since \(\eta \) is symmetrized. As \(N_\alpha \) is nonzero for at most n values of \(\alpha \) (and recalling that \(0! = 1\) in all other cases), the multi-nomial coefficients \(n!/(N_1!N_2! \dots )\) are well defined. Note these multi-nomial coefficients simply correspond to the “normalization” coefficients defined in Eq. (33).

3.2 The Fock space

The Fock space \(F(H)\) holds the probability densities on the configuration space of the open system, depicted in Fig. 1. The elements of \(F(H)\) are families \(\rho =(\rho _0,\rho _1,\rho _2,\dots )\) of symmetrized n-particle densities, which form the direct sum of symmetrized n-particle spaces (see Sect. 3.1),

$$\begin{aligned} \bigoplus _{n=0}^\infty {\mathcal {S}}_n H^{\otimes n} = \left\{ \rho =(\rho _0,\rho _1,\rho _2,\dots ) : \rho _n\in {\mathcal {S}}_n H^{\otimes n} \text{ for } \text{ all } n\in {\mathbb {N}}_0 \right\} . \end{aligned}$$
(43)

It is sometimes convenient to interpret \(\rho _n \in {\mathcal {S}}_n H^{\otimes n}\) as the Fock space element \((0,\dots ,0,\rho _n,0,\dots )\) and to introduce a component-wise addition on \(F(H)\), which allows for a compact notation such as in

$$\begin{aligned} \rho = \sum _{n=0}^\infty \rho _n . \end{aligned}$$
(44)

Further, we introduce the following generalization of the \(L^1\)-norm,

$$\begin{aligned} \Vert \rho \Vert := \sum _{n=0}^\infty \Vert \rho _n \Vert _n, \, \end{aligned}$$
(45)

with \(\Vert \cdot \Vert _n\) as in Eq. (4), and define \(F(H)\) as the set of probability densities of the open system that are integrable and absolutely summable:

$$\begin{aligned} F(H):= \left\{ \rho \in \bigoplus \nolimits _{n=0}^\infty {\mathcal {S}}_n H^{\otimes n} : \Vert \rho \Vert <\infty \right\} . \end{aligned}$$
(46)

In reaction–diffusion problems, we will consider probability densities \(\rho \in F(H)\) which are normalized, \(\Vert \rho \Vert = 1\), and preserve this normalization under time evolution [see Eq. (6)].

In contrast to the \(L^2\)-norm used in quantum mechanics, the \(L^1\)-norm on H and likewise the norm \(\Vert \cdot \Vert \) on \(F(H)\) is not induced by any inner product. Hence, \(F(H)\) cannot be a Hilbert space, but is merely a Banach space. The dual space of \(F(H)\) is given by

$$\begin{aligned} F(H)^* := \left\{ \nu \in \bigoplus \nolimits _{n=0}^\infty {\mathcal {S}}_n (H^{\otimes n})^* : {\Vert \nu \Vert _\infty < \infty } \right\} \end{aligned}$$
(47)

with elements \(\nu =(\nu _0, \nu _1,\nu _2,\dots )\) and the supremums norm,

$$\begin{aligned} \Vert \nu \Vert _\infty := \sup _n \sup _{x\in {\mathbb {X}}^n} |\nu _n(x)| . \end{aligned}$$
(48)

The dual pairing for \(\rho \in F(H)\) and \(\nu \in F(H)^*\) is

$$\begin{aligned} \langle \nu , \rho \rangle := \sum _{n=0}^\infty \langle \nu _n, \rho _n\rangle , \end{aligned}$$
(49)

with \(\langle \nu _n, \rho _n\rangle \) defined in Eq. (25).

3.3 Creation and annihilation operators

The creation and annihilation operators raise or lower the number of particles in the system by mapping an n-particle density to an \((n+1)\)-particle density or \((n-1)\)-particle density, respectively. The creation operator \(a^+\{w\}\) adds a particle whose position is described by the probability density \(w(x)\in H\), and the annihilation operator \(a^-\{f\}\) removes a particle with reaction rate function \(f(x)\in H^*\). These operators are defined on the symmetrized n-particle spaces and, most importantly, preserve symmetrization:

$$\begin{aligned} a^+\{w\}&: {\mathcal {S}}_nH^{\otimes n} \rightarrow {\mathcal {S}}_{n+ 1}H^{\otimes (n+1)} , \end{aligned}$$
(50a)
$$\begin{aligned} a^-\{f\}&: {\mathcal {S}}_nH^{\otimes n} \rightarrow {\mathcal {S}}_{n- 1}H^{\otimes (n-1)} . \end{aligned}$$
(50b)

There action on a symmetrized pure tensor \(v={\mathcal {S}}_n (v_1 \otimes \dots \otimes v_n) \) for \(v_i \in H\) is defined as

$$\begin{aligned} a^+\{w\}v&:= {\mathcal {S}}_{n+1} (w\otimes v_1 \otimes \dots \otimes v_n) , \end{aligned}$$
(51a)
$$\begin{aligned} a^-\{f\}v&:= \sum _{j=1}^n \langle f,v_{j} \rangle {\mathcal {S}}_{n-1}\left( v_{\setminus \{j\}}\right) , \end{aligned}$$
(51b)

where \(v_j\) is omitted in \(v_{\setminus \{j\}}:=v_1\otimes \dots \otimes v_{j-1}\otimes v_{j+1}\otimes \dots \otimes v_n\); for \(n=0\), we set \(a^-\{f\} 1 := 0\). By linearity, these definitions extend naturally to the space \({\mathcal {S}}_nH^{\otimes n}\), since the elements of its tensor basis are of the form v, and to the whole Fock space \(F(H)\) by acting component-wise on \(\rho \).

The sum in the annihilation operator [Eq. (51b)] expresses the fact that there are n different ways to remove a particle. It reduces to a factor n in the well-mixed case without spatial resolution (where all \(v_i\) are equal to the uniform distribution). The above definitions thus differ from the ones used for quantum systems, where \(\sqrt{n+1}\) and \(\sqrt{n}\) are the coefficients of \(a^+\) and \(a^-\), respectively. The present choice is suitable for systems of indistinguishable classical particles [44, 67, 94], and for chemical systems, they avoid cumbersome prefactors in the subsequent results.

The creation and annihilation operators have expansions in the basis \((u_\alpha )\) of the single-particle space H [see Eqs. (B2) and (B4)]:

$$\begin{aligned} a^+\{w\}&= \sum _{\alpha } \langle u_\alpha ^*, w \rangle a^+\{ u_\alpha \} , \end{aligned}$$
(52a)
$$\begin{aligned} a^-\{f\}&= \sum _{\alpha } \langle f, u_\alpha \rangle a^-\{u_\alpha ^*\} . \end{aligned}$$
(52b)

A basis-free representation of the action of the two operators on a symmetrized n-particle density is given in Eqs. (B3) and (B5). We note that for a given annihilation operator \(a^-\{f\}\) the choice of the reaction rate function f is not unique. It is seen from the second relation that \(a^-\{f\} = a^-\{f + \zeta \}\) for any \(\zeta \in H^*\) such that \(\langle \zeta , u_\alpha \rangle = 0\) for all \(\alpha \). Such \(\zeta \ne 0\) exist since \((u_\alpha ^*)\) does not span \(H^*\). However, this mathematical issue has no further implications for the present work.

Operator algebra. The creation and annihilation operators satisfy a number of basic relations that define an operator algebra, which is useful to derive representations in terms of these operators.

  1. 1.

    Removing a particle from the (normalized) vacuum element \(\rho _\text {vac}:= (1, 0, 0, \dots ) \in F(H)\) yields zero, i.e., \(a^-\{f\} \rho _\text {vac}= 0\) for any \(f \in H^*\).

  2. 2.

    A symmetrized pure tensor \({\mathcal {S}}_n (v_1 \otimes \dots \otimes v_n) \in {\mathcal {S}}_nH^{\otimes n}\) with \(v_i \in H\) is generated from a sequence of creation operators acting on \(\rho _\text {vac}\):

    $$\begin{aligned} {\mathcal {S}}_n (v_1 \otimes \dots \otimes v_n) = a^+\{ v_1 \} \dots a^+\{ v_n \} \rho _\text {vac}. \end{aligned}$$
    (53)
  3. 3.

    The creation and annihilation operators satisfy the following commutation relations:

    $$\begin{aligned} {[}a^-\{f\},a^+\{w\}]&= \langle f,w\rangle {\mathcal {I}}, \end{aligned}$$
    (54a)
    $$\begin{aligned} {[}a^+\{w\},a^+\{\nu \}]&= 0, \end{aligned}$$
    (54b)
    $$\begin{aligned} {[}a^-\{f\},a^-\{g\}]&= 0, \end{aligned}$$
    (54c)

    for \(w, \nu \in H\) and \(f, g\in H^*\) and using the commutator \([a,b]:=ab-ba\) of operators ab on \(F(H)\). The proofs are found in Appendix A.3.

  4. 4.

    The particle number operator is defined as

    $$\begin{aligned} {\mathcal {N}}:= \sum _{\alpha } a^+\{u_\alpha \} a^-\{u_\alpha ^*\}, \end{aligned}$$
    (55)

    where \((u_\alpha )_{\alpha \in {\mathbb {N}}}\) is a basis of the single-particle space H. The name of the operator refers to the fact that a density \(\rho _n\) with fixed particle number n is an eigenfunction to the eigenvalue n, that is

    $$\begin{aligned} {\mathcal {N}}\rho _n = n\rho _n , \quad \rho _n \in {\mathcal {S}}_n H^{\otimes n}. \end{aligned}$$
    (56)

    We prove this statement in Appendix A.4. For a general, normalized function \(\rho (t) \in F(H)\) with \(\Vert \rho (t) \Vert =1\), the average number of particles is obtained as:

    $$\begin{aligned} \Vert {\mathcal {N}} \rho (t) \Vert = \sum _{n\geqslant 0} \Vert {\mathcal {N}} \rho _n(t) \Vert _n = \sum _{n\geqslant 0} n P(n,t) = {\mathbb {E}}\left[ N(t)\right] . \end{aligned}$$
    (57)

    Powers of \({\mathcal {N}}\) yield the higher-order factorial moments of N(t), for example,

    $$\begin{aligned} \Vert {\mathcal {N}}^2\rho (t) \Vert = {\mathbb {E}}\left[ N(t) (N(t) - 1)\right] , \end{aligned}$$
    (58)

    as shown in Appendix A.5. We note that \(\Vert \rho \Vert =1\) does not necessarily imply \({\mathcal {N}} \rho \in F(H)\) and the domain of \({\mathcal {N}}\) is only a subspace of \(F(H)\). In particular, there are reaction networks showing an explosion in finite time \(T<\infty \), i.e., \(\Vert {\mathcal {N}} \rho (t)\Vert = {\mathbb {E}}[N (t)] \rightarrow \infty \) for \(t \rightarrow T\) although \(\Vert \rho (t)\Vert =1\) for all \(0 \leqslant t \leqslant T\).

4 Chemical diffusion master equation in terms of creation and annihilation operators

The chemical diffusion master equation (CDME) is generally composed of diffusion and reaction operators, see Eq. (12). In this section, we will show how to formulate the CDME in a systematic way by expressing these operators in terms of creation and annihilation operators. We distinguish operators that conserve the number of particles and those that do not. The diffusion operator belongs to the first class, whereas the reaction operator of a general single reaction can be decomposed into a conserving and a non-conserving part. We start with particle number conserving operators and then follow up with reaction operators. The scheme is worked out in detail for two exemplary reaction systems at the end of this section.

4.1 Particle number conserving operators

We begin by expanding operators that do not change the number of particles if applied to a function \(\rho _n \in {\mathcal {S}}_n H^{\otimes n}\), i.e., one with a determined number of particles. One can think of their action as moving particles in space or extracting information from the system. These operators will look different depending on the number of particles they act on. As an example, consider a many-particle system where particles diffuse independently. In this case, the diffusion operator is a conserving operator acting on single particles. Conversely, diffusion in the presence of pair interactions can be expressed by a conserving operator acting on two particles at a time.

4.1.1 Conserving single-particle operators

For operators acting on a single particle, let A denote a linear operator on the single-particle space H. We denote by \({\mathcal {A}}_j\) the action of A on the jth argument of a function in the many-particle space \(H^{\otimes n}\). The action of A on every particle of an n-particle system (\(n \geqslant 1\)) is then given by

$$\begin{aligned} {\mathcal {A}}^n := \sum _{j=1}^n {\mathcal {A}}_j, \end{aligned}$$
(59)

and focusing on symmetrized spaces, one has \({\mathcal {A}}^n: {\mathcal {S}}_n H^{\otimes n} \rightarrow {\mathcal {S}}_n H^{\otimes n}\). For any operator \(A:H\rightarrow H\) it is shown in Appendix B.2 that the operator \({\mathcal {A}}^n\) can be written as

$$\begin{aligned} {\mathcal {A}}= \sum _{\alpha ,\beta } \langle u_\alpha ^*, A u_\beta \rangle \,\, a^+\{ u_\alpha \} a^-\{ u_\beta ^* \}, \end{aligned}$$
(60)

where we dropped the superindex n as the form of the right-hand side is the same for every n. Note that if A is the identity, we recover the particle number operator \({\mathcal {N}}\), see Eq. (55).

Applying the operator \({\mathcal {A}}\) component-wise extends its action to general elements of the Fock space, \(\rho = (\rho _0,\rho _1,\rho _2,\dots )\in F(H)\), that is \({\mathcal {A}}\rho := ({\mathcal {A}} \rho _0,{\mathcal {A}} \rho _1,{\mathcal {A}} \rho _2,\dots )\), with the convention that \({\mathcal {A}} \rho _0 := 0\).

4.1.2 Conserving two-particle operators

Analogously, let B denote a linear operator on the two-particle space \(H^{\otimes 2}\). The action of B on every possible pair of particles of an n-particle system (\(n \geqslant 2\)) is

$$\begin{aligned} {\mathcal {B}}^n := \sum _{1\leqslant i< j \leqslant n} {\mathcal {B}}_{ij}, \end{aligned}$$
(61)

where \({\mathcal {B}}_{ij}\) denotes the action of B on the ith and jth components of a symmetrized many-particle function:

$$\begin{aligned} {\mathcal {B}}_{ij}( {\mathcal {S}}_n(v_1\otimes \dots \otimes v_n)) := {\mathcal {S}}_n(B(v_i \otimes v_j)\otimes v_{\setminus \{i,j\}}) \end{aligned}$$
(62)

where \(v_{\setminus \{i,j\}}:=v_1\otimes \dots \otimes v_{i-1}\otimes v_{i+1}\otimes \dots \otimes \dots \otimes v_{j-1}\otimes v_{j+1}\otimes \dots \otimes v_n\) for \(i < j\). We further assume B to be symmetric, \({\mathcal {B}}_{i,j}={\mathcal {B}}_{j,i}\), so it does not distinguish the labeling of the particles. We prove in Appendix B.3 that \({\mathcal {B}}^n\) has the following expansion:

$$\begin{aligned} {\mathcal {B}}&=\frac{1}{2} \sum _{\begin{array}{c} \alpha \leqslant \beta \\ \gamma \leqslant \delta \end{array}} \frac{1}{ s_{\gamma \delta }} \langle {\mathcal {S}}_2(u_\alpha \otimes u_\beta )^*, B (u_\gamma \otimes u_\delta )\rangle \,\, a^+\{ u_\alpha \} a^+\{ u_\beta \} a^-\{ u_\gamma ^* \} a^-\{ u_\delta ^* \} \end{aligned}$$
(63)
$$\begin{aligned}&=\frac{1}{2}\sum _{\begin{array}{c} \alpha , \beta \\ \gamma ,\delta \end{array}} \langle u_\alpha ^* \otimes u_\beta ^*, B (u_\gamma \otimes u_\delta )\rangle \,\, a^+\{ u_\alpha \} a^+\{ u_\beta \} a^-\{ u_\gamma ^* \} a^-\{ u_\delta ^* \} \end{aligned}$$
(64)

for \(s_{\alpha \beta }\) defined in Eq. (33). Note that we again dropped the super index n on \({\mathcal {B}}\) since the representations do not depend on n. The factor 1/2 appears in the derivation, it accounts for the fact that removing first particle i and then j is the same as removing particle j first and then i. Expansion (63) is more adequate to easily obtain the explicit coefficients of complex expansions, e.g., three-particle operators (\(n=3\)). However, throughout this work, we will write the expansions in the form of Eq. (64) due to its simpler notation. Also note that due to Eq. (30), the expansion (63) only needs the symmetrization operator in one of the arguments of the dual pairing.

We can again extend the action of the operator \({\mathcal {B}}\) to general functions in the Fock space, \(\rho = (\rho _0,\rho _1,\rho _2,\dots )\in F(H)\), by applying the operator component-wise according to \({\mathcal {B}}\rho := ({\mathcal {B}} \rho _0,{\mathcal {B}} \rho _1,{\mathcal {B}} \rho _2,\dots ). \) Note \({\mathcal {B}} \rho _0 = {\mathcal {B}} \rho _1 = 0\) by construction.

Analogously, we could extend this result to conserving n-particle operators for \(n \geqslant 3\); the coefficient leading the expansion would then be 1/n!. However, in practice, it will be unlikely to encounter these operators for \(n \geqslant 3\), so we do not explicitly work them out here.

4.2 Reaction operators

In the previous section, we focused on conserving operators that yield a result in \({\mathcal {S}}_n H^{\otimes n}\) if acting on \({\mathcal {S}}_n H^{\otimes n}\). However, reactions involve a change in the number of particles, and thus, they cannot be expressed only in terms of particle number conserving operators. For an arbitrary reaction, the reaction operator can naturally be decomposed into two parts:

  • a conserving operator to specify the probability outflow from the current state,

  • a non-conserving operator to specify the probability inflow from another state (with a different number of particles) into the current state.

In order to specify the two operators that form the reaction operator of a general reaction \( k\text {A}\rightarrow l \text {A}\), we first need to define their action on a group of k particles. Using the corresponding reaction rate function \(\lambda \) (see Sect. 2.2), we introduce these operators as \(\Lambda ^{(k)}:H^{\otimes k} \rightarrow H^{\otimes k}\) and \(\Lambda ^{(k,l)}:H^{\otimes k} \rightarrow H^{\otimes l}\) with

$$\begin{aligned} \left( \Lambda ^{(k)}(u_{\beta _1}\otimes \dots \otimes u_{\beta _k})\right) (x^{(k)})&:= (u_{\beta _1}\otimes \dots \otimes u_{\beta _k}) (x^{(k)})\int _{{\mathbb {X}}^l} \lambda (y^{(l)},x^{(k)}) \hbox {d}y^{(l)}, \end{aligned}$$
(65)
$$\begin{aligned} \left( \Lambda ^{(k,l)}(u_{\beta _1}\otimes \dots \otimes u_{\beta _k})\right) (y^{(l)})&:= \int _{{\mathbb {X}}^k} \lambda (y^{(l)},x^{(k)})(u_{\beta _1}\otimes \dots \otimes u_{\beta _k}) (x^{(k)}) \hbox {d}x^{(k)}. \end{aligned}$$
(66)

Here, \(\Lambda ^{(k)}\) encodes the rate of leaving a given configuration \(x^{(k)}\) with k particles and going to any other configuration with l particles, whereas \(\Lambda ^{(k,l)}\) is the rate of going from any configuration of k particles to the configuration \(y^{(l)}\) with l particles.

From the previous subsection, we already know how to extend a conserving operator to act on all possible combinations of k particles in an n-particle space. For instance, for the reaction \(\text {A}+\text {A}\rightarrow \text {A}\), the conserving part of the operator is [Eq. (64)]:

$$\begin{aligned} {\mathcal {R}}^{(2)}= \frac{1}{2}\sum _{\begin{array}{c} \alpha _1, \alpha _2\\ \beta _1,\beta _2 \end{array}} \langle u_{\alpha _1}^* \otimes u_{\alpha _2}^*, \Lambda ^{(2)}( u_{\beta _1} \otimes u_{\beta _2} )\rangle \,\, a^+\{ u_{\alpha _1} \} a^+\{ u_{\alpha _2} \} a^-\{ u_{\beta _1}^* \} a^-\{ u_{\beta _2}^* \}.\nonumber \\ \end{aligned}$$
(67)

Analogously, we can construct a similar expression for the non-conserving operator, where two particles are removed and one particle is created:

$$\begin{aligned} {\mathcal {R}}^{(2,1)} = \frac{1}{2}\sum _{\begin{array}{c} \alpha \\ \beta _1,\beta _2 \end{array}} \langle u_\alpha ^*, \Lambda ^{(2, 1)} (u_{\beta _1} \otimes u_{\beta _2}) \rangle a^+\{ u_\alpha \} a^-\{ u_{\beta _1}^* \} a^-\{ u_{\beta _2}^* \}. \end{aligned}$$
(68)

The proofs of the expansion of non-conserving operators are analogous to those for conserving operators given in Appendices B.2 and B.3. The reaction operator \({\mathcal {R}}\) in the Fock space is composed by the sum of these two operators, acting pointwise according to \(({\mathcal {R}}\rho )_n= {\mathcal {R}}^{(2,1)}\rho _{n+1}-{\mathcal {R}}^{(2)}\rho _n\). Note that the conserving operator will always carry a minus in the CDME, as it refers to the outflow from a given state. The joint action of both operators ensures that probability is conserved in the reaction.

For a general reaction \(k\text {A}\rightarrow l\text {A}\), the reaction operator is given component-wise by \(({\mathcal {R}}\rho )_n= {\mathcal {R}}^{(k,l)}\rho _{n+k-l}-{\mathcal {R}}^{(k)}\rho _n\), where

$$\begin{aligned} {\mathcal {R}}^{(k)}&= \frac{1}{k!}\sum _{\begin{array}{c} \alpha _1, \dots , \alpha _k \\ \beta _1, \dots , \beta _k \end{array}} \left\langle \bigotimes _{i=1}^k u_{\alpha _i}^* , \Lambda ^{(k)} \bigotimes _{j=1}^k u_{\beta _j} \right\rangle \,\, \prod _{i=1}^{k} a^+\{ u_{\alpha _i} \}\prod _{j=1}^{k} a^-\{ u_{\beta _j}^* \}, \end{aligned}$$
(69)
$$\begin{aligned} {\mathcal {R}}^{(k,l)}&= \frac{1}{k!}\sum _{\begin{array}{c} \alpha _1 ,\dots ,\alpha _l \\ \beta _1 , \dots , \beta _k \end{array}} \left\langle \bigotimes _{i=1}^l u_{\alpha _i}^* , \Lambda ^{(k,l)} \bigotimes _{j=1}^k u_{\beta _j} \right\rangle \prod _{i=1}^{l} a^+\{ u_{\alpha _i} \}\prod _{j=1}^{k} a^-\{ u_{\beta _j}^* \}. \end{aligned}$$
(70)

Note that it holds \({\mathcal {R}}^{(k)}\rho _n = {\mathcal {R}}^{(k,l)}\rho _n = 0\) for \(n<k\), which implies that \(({\mathcal {R}}\rho )_n= -{\mathcal {R}}^{(k)}\rho _n\) for \(k \leqslant n< l\), while \(({\mathcal {R}}\rho )_n= {\mathcal {R}}^{(k,l)}\rho _{n+k-l}\) for \(l \leqslant n< k\). As there are k! ways to choose (i.e., remove) the same k particles, the factor 1/k! is required to avoid double counting. Note these expansions can also be written in terms of the symmetrized basis, see Appendix B.4.

Below we list the expansions of the non-conserving part of frequently used reaction operators involving one species:

$$\begin{aligned} {\mathcal {R}}^{(0,1)}&= \sum _{\alpha } \langle u_\alpha ^*, \Lambda ^{(0, 1)} {\mathbf {1}} \rangle a^+\{ u_\alpha \}, \end{aligned}$$
(71a)
$$\begin{aligned} {\mathcal {R}}^{(1, 0)}&= \sum _{\beta } \langle {\mathbf {1}} ,\Lambda ^{(1, 0)} u_\beta \rangle a^-\{ u_\beta ^* \}, \end{aligned}$$
(71b)
$$\begin{aligned} {\mathcal {R}}^{(0, 2)}&= \sum _{\alpha _1 , \alpha _2} \langle u_{\alpha _1}^* \otimes u_{\alpha _2}^*, \Lambda ^{(0,2)} {\mathbf {1}} \rangle a^+\{ u_{\alpha _1} \} a^+\{ u_{\alpha _2} \}, \end{aligned}$$
(71c)
$$\begin{aligned} {\mathcal {R}}^{(2,0)}&= \frac{1}{2}\sum _{\beta _1 , \beta _2} \langle {\mathbf {1}}, \Lambda ^{(2, 0)}(u_{\beta _1}\otimes u_{\beta _2}) \rangle a^-\{ u_{\beta _1}^* \} a^-\{ u_{\beta _2}^* \}, \end{aligned}$$
(71d)
$$\begin{aligned} {\mathcal {R}}^{(1, 2)}&= \sum _{\alpha _1 ,\alpha _2} \sum _{\beta } \langle u_{\alpha _1}^* \otimes u_{\alpha _2}^*, \Lambda ^{(1, 2)} u_\beta \rangle a^+\{ u_{\alpha _1} \} a^+\{ u_{\alpha _2} \} a^-\{ u_\beta ^* \}, \end{aligned}$$
(71e)
$$\begin{aligned} {\mathcal {R}}^{(2,1)}&= \frac{1}{2}\sum _{\alpha } \sum _{\beta _1 ,\beta _2} \langle u_\alpha ^*, \Lambda ^{(2, 1)} (u_{\beta _1} \otimes u_{\beta _2}) \rangle a^+\{ u_\alpha \} a^-\{ u_{\beta _1}^* \} a^-\{ u_{\beta _2}^* \}. \end{aligned}$$
(71f)

These reaction operators are useful to formulate the CDME for a general reaction system.

4.3 Representation of the chemical diffusion master equation

Given a set of reactions indexed by \(r=1,..,S\), each of the form \(k\text{ A } \rightarrow l \text{ A }\) for some \(k,l \in {\mathbb {N}}_0\) and with corresponding reaction operators \({\mathcal {R}}_r\) composed by their conserving part \({\mathcal {R}}_r^{(k)}\) and their non-conserving part \({\mathcal {R}}_r^{(k,l)}\), the CDME (12) may be written as

$$\begin{aligned} \partial _t \rho = \left( {\mathcal {D}} + \sum _{r=1}^S \Big [{\mathcal {R}}_r^{(k,l)}-{\mathcal {R}}_r^{(k)}\Big ]\right) \rho , \end{aligned}$$
(72)

where k and l depend on r. For each component \(\rho _n\) of \(\rho \in F(H)\) this means

$$\begin{aligned} \partial _t \rho _n = {\mathcal {D}}\rho _n + \sum _{r=1}^S \left[ {\mathcal {R}}_r^{(k,l)} \rho _{n+k-l} - {\mathcal {R}}_r^{(k)} \rho _{n}\right] . \end{aligned}$$
(73)

That is, for several reactions, the overall reaction operator is simply the sum of individual reaction operators.

The representation Eq. (72) of the CDME, together with the reaction operator expansions in Eqs. (69) and (70) form the main results of this work. It allows for a structured and systematic formulation of the probabilistic evolution described by the CDME with the physics of the system encoded in the given reaction rate functions and diffusion operators. We note that the expansions of the conserving single and two-particle operators in Eqs. (60) and (64), respectively, are further useful to expand the diffusion operator or higher-order particle-conserving operators.

In (72), the operators do not explicitly depend on the particle number n, which greatly simplifies the expressions. With this, the operators \({\mathcal {Q}}_{nm}\) entering the matrix in Eq. (13) are given as

$$\begin{aligned} {\mathcal {Q}}_{nm} = {\left\{ \begin{array}{ll} \sum _{r=1}^S {\mathcal {R}}_r^{(k,l)} \delta _{m-n,k-l} &{}\quad \text {if} \quad m \ne n, \\ -\sum _{r=1}^S {\mathcal {R}}_r^{(k)} &{}\quad \text {if} \quad m = n. \end{array}\right. } \end{aligned}$$
(74)

The \({\mathcal {Q}}\)-matrix has a band-structure since there is only a finite number of reactions, each of them changing the number of particles by a finite amount, i.e., there is some \(\Delta n_\text {max}\) such that \({\mathcal {Q}}_{nm} = 0\) for \(|n-m| > \Delta n_\text {max}\). Another important property is related to the local conservation of probability and generalizes the fact that for a Markov chain on a finite state space column sums of the rate matrix are zero. For the CDME, we show in Appendix C that this is expressed for any fixed \(m\in {\mathbb {N}}_0\) as

$$\begin{aligned} \sum _{n=0}^\infty {\mathcal {J}}_{nm}(\cdot ) = 0 \end{aligned}$$
(75)

in terms of the linear functionals

$$\begin{aligned} {\mathcal {J}}_{nm}(\eta ) := \int _{{\mathbb {X}}^m} ({\mathcal {Q}}_{nm} \eta )(x^{(m)}) \, \hbox {d}x^{(m)} , \quad \eta \in {\mathcal {S}}_m H^m. \end{aligned}$$
(76)

As an interpretation, \({\mathcal {J}}_{nm}(\cdot )\) yields the probability flux from the space with m particles to one with n particles for \(n \ne m\); the total loss from the m-particle space is summarized in \(-{\mathcal {J}}_{mm}(\cdot )\).

CDME as an evolution equation. The CDME (72), shortly denoted as \(\partial _t \rho = ({\mathcal {D}} + {\mathcal {R}})\rho \) has the form of a linear evolution equation, and the question arises whether it is well-posed in the sense that solutions exist (in a finite time horizon, at least) and are unique. Furthermore, it is a priori not clear that the positivity and normalization of the probability density are preserved, \(\Vert \rho (t)\Vert = 1\) and \(\rho _n(t) \geqslant 0\) for \(t \geqslant 0\) and for each n, and how a permissible initial density \(\rho (0)\) looks like. These questions are brought up already when considering the scenario of well-mixed reaction–diffusion systems characterized by the conventional CME, which is an evolution equation on the space \(\ell ^1\) of discrete probability distributions \(p=(p_0, p_1, \dots )\), where \(p_n(t) = \Vert \rho _n(t)\Vert _n\). The issue was addressed by the pioneers of probability theory for a broad class of Markov jump processes on a countable state space [95,96,97], providing non-trivial criteria to answer these questions [98]. Pathological examples can be found in refs. [98,99,100] and the topic is still a subject of ongoing research [101, 102].

Technically, one employs the Hille–Yosida theory in the setting of an abstract Banach space, which is \(F(H)\) in our case, to specify necessary and sufficient conditions that the operator \({\mathcal {A}} := {\mathcal {D}}+{\mathcal {R}}\) generates a contraction semigroup \(\bigl (\exp (t {\mathcal {A}})\bigr )_{t\geqslant 0}\) on F(H). For a dissipative operator, the Lumer–Phillips theorem [103,104,105] provides more tractable criteria for this to hold. For example, in addition to verifying that \({\mathcal {A}}\) is dissipative on a suitable dense domain, which is proven in Appendix C, one would need to investigate when the operator \(\mu - {\mathcal {A}}\) is surjective for each \(\mu > 0\). A comprehensive analysis of the issue for the CDME exceeds the scope of the present work and is left for future research.

Multiple species. Using the formalism developed above, we can obtain the CDME systematically for an arbitrary reaction–diffusion system with one chemical species. Extensions to multiple species require a straightforward generalization of the notation: In the first place, for a system of L species, the probability densities \(\rho _n \in {\mathcal {S}}_n H^{\otimes n}\) generalize to \(\rho _{n_1,\ldots ,n_L} \in {\mathcal {S}}_{n_1} H^{\otimes n_1} \otimes \dots \otimes {\mathcal {S}}_{n_L} H^{\otimes n_L}\) with an index \(n_l\) for the number of particles of each species; the arguments of \(\rho _{n_1,\ldots ,n_L}\) refer to the particle positions for each species. Note that since any two particles of different species are distinguishable, the \(\rho _{n_1,\ldots ,n_L}\) must not be symmetrized with respect to all particle positions, but only with respect to those of each species. The basis of the space of \(\rho _{n_1,\ldots ,n_L}\) is the tensor product of the bases of the \(n_1\)- to \(n_L\)-particle spaces of the single species case. Secondly, the diffusion part hardly changes except for the fact that the diffusion constant and physical interactions may vary among species, i.e., the diffusion operator will have as many indices as the system has species, indicating its different actions on particles of different species. Thirdly, for the reaction part, we get two indices per species, counting the gains or losses with respect to that species on the reactant as well as on the product side of the reaction. As a consequence, we will have rate functions \(\lambda (x^{(l_1)},\ldots x^{(l_L)};x^{(k_1)},\ldots x^{(k_L)})\) which depend on 2L position tuples for L species. In the many-species generalization, the conserving part of the reaction operator will involve an integration over all product positions of all species. Analogously, the non-conserving part integrates over the reactant positions of all species. Also the creation and annihilation operators have to be specified as to which species it is that is created or destroyed, so that there are creation and annihilation operators separately for each species.

4.4 Exemplary reaction systems

For the examples given in the following, we will reside with the setting of a single species for the sake of clarity. Given the diffusion properties and the reaction rate functions of the system, which encode the physics, we will specify the CDME for some exemplary reaction systems in terms of creation and annihilation operators, and we will show that the equations are consistent with well-known results, e.g., those given in Sect. 2.2. Any chemical reaction can be decomposed into a combination of unimolecular reactions and/or bimolecular reactions, we thus focus on creation and degradation to represent unimolecular reactions and on mutual annihilation as an example for a bimolecular reaction.

4.4.1 Creation and degradation

We consider the birth–death process given already in Eq. (14). It consists of the degradation and creation reactions, \(\text {A}\rightarrow \varnothing \) and \(\varnothing \rightarrow \text {A}\), occurring with rate functions \(\lambda _d(x)\) and \(\lambda _c(x)\), respectively; in addition, each particle of species \(\text {A}\) diffuses freely with diffusion coefficient D. The chemical diffusion master equation can be written in terms of a diffusion operator \({\mathcal {D}}\) and one reaction operator per reaction, \({\mathcal {R}}_d\) and \({\mathcal {R}}_c\), as shown in Sect. 4.2:

$$\begin{aligned} \partial _t \rho _n = {\mathcal {D}} \rho _n + \underbrace{{\mathcal {R}}_d^{(1,0)} \rho _{n+1}-{\mathcal {R}}_d^{(1)} \rho _n }_{{\mathcal {R}}_d \text { (degradation)}} +\underbrace{ {\mathcal {R}}_c^{(0,1)} \rho _{n-1}-{\mathcal {R}}_c^{(0)}\rho _n }_{{\mathcal {R}}_c \text { (creation)}}, \end{aligned}$$
(77)

with

$$\begin{aligned} {\mathcal {D}}&= \sum _{\alpha ,\beta } \langle u_\alpha ^*, D\nabla ^2 u_\beta \rangle a^+\{ u_\alpha \} a^-\{ u_\beta ^* \},&\end{aligned}$$
(78a)
$$\begin{aligned} {\mathcal {R}}_d^{(1)}&= \sum _{\alpha ,\beta } \langle u_\alpha ^*, \Lambda ^{(1)}_d u_\beta \rangle a^+\{ u_\alpha \} a^-\{ u_\beta ^* \},&{\mathcal {R}}_d^{(1,0)}&= \sum _{\alpha } \langle {\mathbf {1}} ,\Lambda ^{(1, 0)}_d u_\alpha \rangle a^-\{ u_\alpha ^* \}, \end{aligned}$$
(78b)
$$\begin{aligned} {\mathcal {R}}_c^{(0)}&= \Lambda ^{(0)}_c,&{\mathcal {R}}_c^{(0,1)}&= \sum _{\alpha } \langle u_\alpha ^*, \Lambda ^{(0, 1)}_c {\mathbf {1}} \rangle a^+\{ u_\alpha \}, \end{aligned}$$
(78c)

where \(\rho _n = \rho _n(x^{(n)},t)\), and the reaction rate operators for each reaction are

$$\begin{aligned} \left( \Lambda ^{(1)}_du_{\beta }\right) (x)&= \lambda _d(x)u_{\beta } (x),&\Lambda ^{(1,0)}_d u_{\alpha } = \int _{\mathbb {X}}\lambda _d(x)u_{\alpha } (x) \hbox {d}x, \end{aligned}$$
(79a)
$$\begin{aligned} \Lambda ^{(0)}_c&= \int \lambda _c(y)\hbox {d}y,&\left( \Lambda ^{(0,1)}_c {\mathbf {1}} \right) (x) = \lambda _c(x), \end{aligned}$$
(79b)

see Eqs. (65) and (66). Writing the CDME in matrix form as in Eq. (13), the reaction operator

$$\begin{aligned} {\mathcal {R}}= \begin{pmatrix} -{\mathcal {R}}_c^{(0)} &{} {\mathcal {R}}_d^{(1,0)} &{} 0 &{} 0 &{} \dots &{} \\ {\mathcal {R}}_c^{(0,1)} &{} -({\mathcal {R}}_d^{(1)} + {\mathcal {R}}_c^{(0)}) &{} {\mathcal {R}}_d^{(1,0)} &{} 0 &{} \dots &{} \\ 0 &{} {\mathcal {R}}_c^{(0,1)} &{} -({\mathcal {R}}_d^{(1)} + {\mathcal {R}}_c^{(0)}) &{} {\mathcal {R}}_d^{(1,0)} &{} \dots \\ \vdots &{} \vdots &{} &{} \ddots \end{pmatrix} \end{aligned}$$
(80)

attains a tridiagonal form. Along the diagonal there is the conserving part \({\mathcal {R}}_d^{(1)} + {\mathcal {R}}_c^{(0)}\) with a minus sign, while the non-conserving parts \({\mathcal {R}}_d^{(1,0)}\) and \({\mathcal {R}}_c^{(0,1)}\) are found on the secondary diagonals. Moreover, as the reaction operators given in terms of creation and annihilation operators do not depend on the particle number n, we let them act directly on elements of the Fock space, \(\rho =(\rho _0,\rho _1,\dots ,\rho _n,\dots )\), and rewrite the CDME in compact form:

$$\begin{aligned} \partial _t \rho = \left( {\mathcal {D}} + {\mathcal {R}}_d^{(1,0)} - {\mathcal {R}}_d^{(1)} + {\mathcal {R}}_c^{(0,1)} - {\mathcal {R}}_c^{(0)}\right) \rho . \end{aligned}$$
(81)

To write the CDME explicitly as in Sect. 2, we start with the particle number conserving operators. The expansions in terms of creation/annihilation operators corresponds to applying the operators to all the possible particles the operators can act on, thus

$$\begin{aligned} {\mathcal {D}}\rho _n&= \sum _{i=1}^n D\nabla _i^2 \rho _n, \qquad {\mathcal {R}}_d^{(1)}\rho _n = \sum _{i=1}^n \lambda _d(x_i) \rho _n, \qquad {\mathcal {R}}_c^{(0)}\rho _n = \rho _n \int _{{\mathbb {X}}} \lambda _c(y)\hbox {d}y, \end{aligned}$$
(82)

where the last one corresponds to a conserving zero-particle operator and thus it acts on no particles. For the non-conserving operators, we need to explicitly apply the creation and annihilation operators. In Appendix B.1, we show how to apply the creation and annihilation operators from Eq. (51) to densities. Using these relations and using \(\rho _n=\sum _{\beta _1\leqslant \dots \leqslant \beta _n}{\tilde{c}}_{\beta _1,\dots ,\beta _n} {\mathcal {S}}_n (u_{\beta _1} \otimes \dots \otimes u_{\beta _n})\), we obtain

$$\begin{aligned} ({\mathcal {R}}_d^{(1,0)} \rho _{n+1})(x^{(n)})&{\mathop {=}\limits ^{(71\mathrm{b}) }} \sum _{\beta } \langle {\mathbf {1}} ,\Lambda ^{(1, 0)}_d u_\beta \rangle \left( a^-\{u^*_\beta \} \rho _{n+1}\right) (x^{(n)}) \nonumber \\&{\mathop {=}\limits ^{(\mathrm{B5})}} \sum _{\beta } \langle {\mathbf {1}} ,\Lambda ^{(1, 0)}_d u_\beta \rangle (n+1)\int _{\mathbb {X}}u^*_\beta (y) \rho _{n+1}(x^{(n)},y) \hbox {d}y \nonumber \\&{\mathop {=}\limits ^{(\mathrm{A1})}} (n+1) \int _{\mathbb {X}}\lambda _d(y) \rho _{n+1}(x^{(n)},y) \hbox {d}y \end{aligned}$$
(83)

and

$$\begin{aligned} ( {\mathcal {R}}_c^{(0,1)}\rho _{n-1})(x^{(n)})&{\mathop {=}\limits ^{(\mathrm{71a}) }} \sum _{\alpha } \langle u_\alpha ^*, \Lambda _c^{(0, 1)} {\mathbf {1}} \rangle \left( a^+\{u_\alpha \}\rho _{n-1}\right) (x^{(n)}) \nonumber \\&{\mathop {=}\limits ^{(\mathrm{B3})}} \sum _{\alpha } \langle u_\alpha ^*, \Lambda _c^{(0, 1)} {\mathbf {1}} \rangle \frac{1}{n} \sum _{j=1}^n u_\alpha (x_j^{(n)}) \rho _{n-1}(x^{(n)}_{/j}) \nonumber \\&{\mathop {=}\limits ^{(22)}} \frac{1}{n} \sum _{j=1}^n \lambda _c\left( x_j^{(n)}\right) \rho _{n-1}\left( x^{(n)}_{/j}\right) . \end{aligned}$$
(84)

Gathering all the terms, this matches exactly the proposal in Eq. (15), which serves as a first consistency check of the presented formalism.

4.4.2 Mutual annihilation

Next, we consider the mutual annihilation reaction \(\text {A}+ \text {A}\rightarrow \varnothing \) with rate function \(\lambda (x_1,x_2)\). The CDME in component-wise form is simply

$$\begin{aligned} \partial _t \rho _n = {\mathcal {D}}\rho _n + {\mathcal {R}}^{(2,0)}\rho _{n+2} - {\mathcal {R}}^{(2)}\rho _n \end{aligned}$$
(85)

for \(n\geqslant 0\). The diffusion term is the same as before, and the reaction operator can be decomposed into two parts, as shown in Sect. 4.2:

$$\begin{aligned} {\mathcal {R}}^{(2)}&= \frac{1}{2}\sum _{\begin{array}{c} \alpha _1,\alpha _2 \\ \beta _1,\beta _2 \end{array}} \langle u_{\alpha _1}^* \otimes u_{\alpha _2}^*, \Lambda ^{(2)} (u_{\beta _1} \otimes u_{ \beta _2}) \rangle a^+\{ u_{\alpha _1} \} a^+\{ u_{\alpha _2} \} a^-\{ u_{\beta _1}^* \} a^-\{ u_{\beta _2}^* \} , \end{aligned}$$
(86a)
$$\begin{aligned} {\mathcal {R}}^{(2,0)}&= \frac{1}{2}\sum _{\beta _1 , \beta _2} \langle {\mathbf {1}}, \Lambda ^{(2, 0)}(u_{\beta _1}\otimes u_{\beta _2}) \rangle a^-\{ u_{\beta _1}^* \} a^-\{ u_{\beta _2}^* \} . \end{aligned}$$
(86b)

In matrix notation, the full reaction operator acting on \(\rho \in F(H)\) reads

$$\begin{aligned} {\mathcal {R}}= \begin{pmatrix} -{\mathcal {R}}^{(2)} &{} 0 &{} {\mathcal {R}}^{(2,0)} &{} 0 &{} 0 &{} \dots &{} \\ 0 &{} -{\mathcal {R}}^{(2)} &{} 0 &{} {\mathcal {R}}^{(2,0)}&{} 0 &{} \dots &{} \\ \vdots &{} \vdots &{} &{} \ddots &{} \end{pmatrix} . \end{aligned}$$
(87)

We will now recover the explicit form of the CDME for mutual annihilation. For the conserving part of the reaction operator, we use the relations Eqs. (61), (62) and (64) and apply definition (65) of the reaction rate operator to obtain

$$\begin{aligned} {\mathcal {R}}^{(2)}\rho _n = \sum _{1\leqslant i < j \leqslant n} \lambda (x_i^{(n)}, x_j^{(n)}) \rho _n. \end{aligned}$$
(88)

For the non-conserving operator, we insert the definitions of the reaction rate operators [Eq. (66)] and of the annihilation operator [Eq. (51b)],

$$\begin{aligned} {\mathcal {R}}^{(2,0)} \rho _{n+2}&= \frac{1}{2}\sum _{\beta _1,\beta _2} \langle {\mathbf {1}}, \Lambda ^{(2, 0)}(u_{\beta _1}\otimes u_{\beta _2}) \rangle {\sum _{\begin{array}{c} i,j=1\\ j\ne i \end{array}}^{n+2} \langle u_{\beta _1}, v_i \rangle \langle u_{\beta _2}, v_j \rangle {\mathcal {S}}_{n} (v_{\setminus \{i,j\}})}\nonumber \\&= \frac{1}{2}\sum _{\beta _1,\beta _2} \langle {\mathbf {1}}, \Lambda ^{(2, 0)}(u_{\beta _1}\otimes u_{\beta _2}) \rangle {\sum _{\begin{array}{c} i,j=1\\ j\ne i \end{array}}^{n+2} \langle u_{\beta _1} \otimes u_{\beta _2}, v_i \otimes v_j \rangle {\mathcal {S}}_{n} (v_{\setminus \{i,j\}})} \nonumber \\&= \frac{1}{2}{\sum _{\begin{array}{c} i,j=1\\ j\ne i \end{array}}^{n+2} \langle {\mathbf {1}}, \Lambda ^{(2, 0)} (v_i \otimes v_j) \rangle {\mathcal {S}}_{n} (v_{\setminus \{i,j\}})} \nonumber \\&= \frac{1}{2}{\sum _{\begin{array}{c} i,j=1\\ j\ne i \end{array}}^{n+2}} \int _{{\mathbb {X}}^2} \lambda (y_1,y_2) \rho _{n+2}(x^{(n)}, y_1, y_2)\hbox {d}y_1 \hbox {d}y_2 \nonumber \\&= \frac{(n+2) (n+1)}{2} \int _{{\mathbb {X}}^2} \lambda (y_1, y_2) \rho _{n+2}(x^{(n)},y_1,y_2)\hbox {d}y_1 \hbox {d}y_2 \end{aligned}$$
(89)

for \(v_{\setminus \{i,j\}}:=v_1\otimes \dots \otimes v_{i-1}\otimes v_{i+1}\otimes \dots \otimes \dots \otimes v_{j-1}\otimes v_{j+1}\otimes \dots \otimes v_{n+2}\). So, the full expression of the CDME of mutual annihilation is given in component-wise form as

$$\begin{aligned} \partial _t \rho _n(x^{(n)})= & {} {\mathcal {D}}\rho _n(x^{(n)}) + \frac{(n+2)(n+1)}{2} \int _{{\mathbb {X}}^2} \lambda (y_1,y_2) \rho _{n+2}(x^{(n)},y_1,y_2)\hbox {d}y_1 \hbox {d}y_2 \nonumber \\&-\sum _{1\leqslant i < j \leqslant n} \lambda \left( x_i^{(n)}, x_j^{(n)}\right) \rho _n(x^{(n)}) . \end{aligned}$$
(90)

By comparing to the CME for mutual annihilation [35], one finds that both the structure of the equation and the coefficients obtained within the present approach are consistent with well-known models at a more coarse-grained level. Note that for many analyses and derivations, this explicit form of the equation is not needed. Instead, we will work on the operator level in terms of creation and annihilation operators in the following.

5 Spatial discretization

In the previous sections, we laid out a theoretical basis for the probabilistic description of particle-based reaction–diffusion systems. Adapting the concept of the Fock space, we developed a systematic method to formulate CDMEs for arbitrary reaction networks. The CDME fully characterizes the stochastic reaction–diffusion dynamics. Solving it analytically or numerically, however, will in general be a demanding issue. It either requires solving directly a huge system of partial differential equations (PDEs) or performing stochastic simulations of the underlying particle-based reaction–diffusion process to obtain costly Monte Carlo estimates of the solution to the CDME. However, there are situations where the physical or structural features of a specific system permit an approximation of the solutions by a (small) finite set of distinguished basis functions. In such cases, a significant complexity reduction is achieved by a projection onto the subspace spanned by this reduced basis set. Our framework is an ideal starting point for this as it already provides a basis representation of the CDME. As an example, we will use a basis of indicator functions completely covering the domain of particle positions, which amounts to a spatial coarse-graining. We thus obtain a generalized RDME—consistent with the convergent RDME [77, 78]—that extends the standard RDME by reactions between particles located in different subdomains.

5.1 Galerkin projection

Let \({\hat{H}} \subset H\) be a finite-dimensional linear subspace of H, and let \(\xi _1,\dots ,\xi _M\) be a normed basis of \({\hat{H}}\), i.e., \(\Vert \xi _i\Vert _1=1\) for \(i=1,\dots ,M\). The dual basis \(\xi _1^*,\dots ,\xi _M^*\) is such that \(\langle \xi _i^*,\xi _j \rangle = \delta _{i,j}\) for all ij. For example, the \(\xi _i\) could be indicator functions of subsets for a given spatial discretization—a special case which will be analyzed in Sect. 5.4. The set \({\hat{H}}= {{\,\mathrm{span}\,}}( \xi _i )\) induces a subspace \(\hat{F}\subset F(H)\) of the Fock space F(H) defined in Eq. (43). We will now consider a projection \(Q:F(H) \rightarrow \hat{F} \subset F(H)\) onto this subspace.

The Galerkin ansatz for an element \(\rho \in F(H)\) is given by \({\hat{\rho }} =({\hat{\rho }}_0,{\hat{\rho }}_1,\dots )\in \hat{F}\) with

$$\begin{aligned} {\hat{\rho }}_n = Q\rho _n= \sum _{1 \leqslant i_1\leqslant \ldots \leqslant i_n\leqslant M} c_{i_1,\ldots ,i_n} \, {\mathcal {S}}_n(\xi _{i_1}\otimes \ldots \otimes \xi _{i_n}) \end{aligned}$$
(91)

for coefficients

$$\begin{aligned} c_{i_1,\ldots ,i_n}&:= \langle {\mathcal {S}}_n (\xi _{i_1} \otimes \dots \otimes \xi _{i_n})^*,\rho _n\rangle \nonumber \\&~= \frac{1}{s_{\xi _{i_1},\dots ,\xi _{i_n}}}\langle {\mathcal {S}}_n (\xi ^*_{i_1} \otimes \dots \otimes \xi ^*_{i_n}),\rho _n\rangle \end{aligned}$$
(92)

with \(s_{\xi _{i_1},\dots ,\xi _{i_n}}\) defined in Eq. (33). In accordance with the notation in Eq. (44), we write

$$\begin{aligned} {\hat{\rho }}&= \sum _{n=0}^\infty \sum _{i_1\leqslant \ldots \leqslant i_n} c_{i_1,\ldots ,i_n} \, {\mathcal {S}}_n(\xi _{i_1}\otimes \ldots \otimes \xi _{i_n}) \in \hat{F} \end{aligned}$$
(93)

for the basis representation, or, in terms of creation operators,

$$\begin{aligned} {\hat{\rho }}&= \sum _{n=0}^\infty \sum _{i_1\leqslant \ldots \leqslant i_n} c_{i_1,\ldots ,i_n} \, a^+\{\xi _{i_1}\} \dots a^+\{\xi _{i_n}\} \,\rho _\text {vac}, \end{aligned}$$
(94)

where \(\rho _\text {vac}= (1, 0, 0, \dots ) \in F(H)\) is the normalized vacuum element. Equal indices are again included in the sum because, e.g., \(\xi _1 \otimes \xi _1\) is an allowed two-particle density. In the following, we will use the abbreviations

$$\begin{aligned} a_i^+ := a^+ \{\xi _i \} \quad \text {and} \quad a_i^- := a^- \{\xi _i^* \} . \end{aligned}$$
(95)

For the diffusion operators \({\mathcal {D}}\) and the reaction operators \({\mathcal {R}}\) we derive the projected operators \(\hat{{\mathcal {D}}}=Q{\mathcal {D}}Q\) and \(\hat{{\mathcal {R}}}=Q{\mathcal {R}}Q\), respectively, by extending the basis of the subspace \(\hat{H}\) by the complement basis \(\chi _1,\chi _2,\dots \), such that \((u_1,u_2,\dots ) = (\xi _1,\dots , \xi _M, \chi _1,\chi _2,\dots )\) is a basis of the full space H. Then, using the operator expansions derived in Sect. 4, we obtain equivalent expressions for the projected operators: After projecting, only the sum over the \(\xi _i\) components remains due biorthogonality, i.e., \(\langle \chi _j^*, \xi _i \rangle = \langle \xi _i^*, \chi _j \rangle = 0\) for any ij. The expressions for the projected operators can thus be obtained by simply replacing sums over \((u_\alpha )\) by sums over \((\xi _i)\). For example, for the diffusion operator \({\mathcal {D}}\), we obtain

$$\begin{aligned} \hat{{\mathcal {D}}} = \sum _{i,j} \langle \xi _i^* ,{\mathcal {D}}\xi _j \rangle a^+_i a^-_j , \end{aligned}$$
(96)

see Eq. (60), while for the non-conserving operator \({\mathcal {R}}^{(0,1)} \) of the reaction \(\varnothing \rightarrow A\), we get

$$\begin{aligned} \hat{{\mathcal {R}}}^{(0,1)} = \sum _{i}\langle \xi _i^*, \Lambda ^{(0, 1)} {\mathbf {1}} \rangle a^+_i \end{aligned}$$
(97)

instead of the original expression Eq. (71a).

Copy number representation. The copy number representation introduced in Eq. (40) is particularly useful for densities projected onto a finite Galerkin basis \(\xi _1,\ldots , \xi _M\). We simply need to redefine the index set \({\mathbb {M}}_n\) of Eq. (39) by restricting to the M basis elements, i.e., to multi-indices \(N=(N_1,\dots ,N_M)\). Analogously to Eq. (40), the n-particle density \(\hat{\rho }_n\) as in Eq. (91) can then be written as

$$\begin{aligned} {\hat{\rho }}_n =&\sum _{N\in {\mathbb {M}}_n } p_{N_1,\ldots ,N_M} \, {\mathcal {S}}_n\left( \xi _1^{\otimes N_1}\otimes \dots \otimes \xi _M^{\otimes N_M}\right) \nonumber \\ =&\sum _{N\in {\mathbb {M}}_n } p_{N_1,\ldots ,N_M} \, (a_1^+)^{N_1}\ldots (a_M^+)^{N_M}\rho _\text {vac}\end{aligned}$$
(98)

with coefficients

$$\begin{aligned} p_{N_1,\ldots , N_M}&= \frac{n!}{N_1! \dots N_M!} \left\langle \xi _{1}^{^*\otimes N_1} \otimes \dots \otimes \xi _{M}^{^*\otimes N_M}, \rho _n\right\rangle . \end{aligned}$$
(99)

In the following sections, we will use the short-hand notation

$$\begin{aligned} \vert N_1, \dots , N_M\rangle := (a_1^+)^{N_1}\ldots (a_M^+)^{N_M}\rho _\text {vac}\end{aligned}$$
(100)

for the copy number representation. An element of the projected Fock space \(\hat{F}\) then has the copy number representation

$$\begin{aligned} {\hat{\rho }} =&\sum _{n\geqslant 0}\sum _{N\in {\mathbb {M}}_n} p_{N_1,\ldots ,N_M} \, \vert N_1, \dots , N_M\rangle \nonumber \\ =&\sum _{N_1,\dots ,N_M=0}^\infty p_{N_1,\ldots , N_M} \, \vert N_1, \dots , N_M\rangle , \end{aligned}$$
(101)

replacing the representation (94).

5.2 Normalization and positivity of the projected densities

Given \(\rho \in F(H)\) with \(\rho _n\geqslant 0\) for all n and \(\Vert \rho \Vert =1\), we would like to get a projected function \({\hat{\rho }}\) which fulfills these properties, too. In general, using Eqs. (45) and (4) as well as the standard triangle inequality, we have

$$\begin{aligned} \Vert {\hat{\rho }} \Vert \leqslant \sum _{n=0}^\infty \sum _{N\in {\mathbb {M}}_n } |p_{N_1,\ldots ,N_M}| \cdot \left\| {\mathcal {S}}_n\left( \xi _1^{\otimes N_1}\otimes \dots \otimes \xi _M^{\otimes N_M}\right) \right\| . \end{aligned}$$
(102)

From \(\Vert \xi _i\Vert _1=1\) for all i, it follows that \(\Vert \xi _1^{\otimes N_1}\otimes \dots \otimes \xi _M^{\otimes N_M}\Vert _n=1\) as well as \(\Vert {\mathcal {S}}_{n}(\xi _1^{\otimes N_1}\otimes \dots \otimes \xi _M^{\otimes N_M})\Vert _n=1\) for all \(N=(N_1,\dots ,N_M)\in {\mathbb {M}}_n\), such that we obtain

$$\begin{aligned} \Vert {\hat{\rho }} \Vert \leqslant \sum _{n=0}^\infty \sum _{N\in {\mathbb {M}}_n } |p_{N_1,\ldots ,N_M}|. \end{aligned}$$
(103)

In order to obtain equality, we have to assume both the basis functions \(\xi _i\) and the coefficients \(p_{N_1,\ldots ,N_M}\) to be positive, in which case it holds \({\hat{\rho }}_n\geqslant 0\) for all n and

$$\begin{aligned} \Vert {\hat{\rho }} \Vert = \sum _{n=0}^\infty \sum _{N\in {\mathbb {M}}_n } p_{N_1,\ldots ,N_M}. \end{aligned}$$
(104)

This will be true for the special case of a full spatial partition with rescaled indicator functions, as we will see below.

However, as soon as the basis functions \(\xi _i\) are positive-valued and overlapping in position space \({\mathbb {X}}\), the dual basis functions \(\xi _i^*\) have negative values and, consequently, also the coefficients \(p_{N_1,\ldots ,N_M}\) as defined by the dual pairing (99) can become negative. In this case, equality (104) is not fulfilled and an interpretation of the coefficients as probabilities becomes pointless.

The positivity of the coefficients is only guaranteed if we assume the dual basis functions \(\xi _i^*\) to be positive, \(\xi _i^*\geqslant 0\) for all i. Demanding in addition that the dual basis functions sum up to one everywhere in position space, \(\sum _i \xi _i^*(x^{(1)}) =1\) for all \( x^{(1)} \in {\mathbb {X}}\) (as given, e.g., for committor functions in the context of transition path theory [106, 107]), this guarantees that the coefficients sum up to one, as well. In this case, the functions \(\xi _i\) themselves are not necessarily positive, and consequently, also the projected functions \(\hat{\rho }_n\) can have negative values, which renders their interpretation as projected probability distribution questionable. These insights motivate us to restrict the following analysis to a full-partition approach.

5.3 Full-partition approach

In order to make sure that both the coefficients and the projected probability distributions are positive-valued, we consider non-overlapping basis functions as indicator functions of a full spatial partition into subsets. That is, we split the position space \({\mathbb {X}}\) into finitely many disjoint subsets \({\mathbb {X}}_i\), \(i=1,\dots ,M\) such that

$$\begin{aligned} {\mathbb {X}} = \bigcup _{i=1}^M {\mathbb {X}}_i, \quad \text{ with } {\mathbb {X}}_i\cap {\mathbb {X}}_j = \varnothing \text{ for } i\ne j. \end{aligned}$$
(105)

Given these subsets \({\mathbb {X}}_i\subset {\mathbb {X}}\), we can define the rescaled indicator functions

$$\begin{aligned} \xi _i:=\frac{1}{\text{ vol }({\mathbb {X}}_i)}1_{{\mathbb {X}}_i}=\frac{1}{\Vert 1_{{\mathbb {X}}_i}\Vert _1}1_{{\mathbb {X}}_i} , \end{aligned}$$
(106)

which fulfill \(\Vert \xi _i\Vert _1=1\). In this special case, the duals are given by

$$\begin{aligned} \xi ^*_i= \text{ vol }({\mathbb {X}}_i)\cdot \xi _i=1_{{\mathbb {X}}_i}. \end{aligned}$$

For this approach of a full spatial partition, the norm is naturally retained: Let \(\rho \in F(H)\) be such that \(\rho _n \geqslant 0\) for all n and \(\Vert \rho \Vert =1\) for the norm defined in Eq. (45). This means that it holds

$$\begin{aligned} \sum _{n=0}^\infty {\mathbb {P}}[N=n] =1 \end{aligned}$$
(107)

for \({\mathbb {P}}[N=n] := \int \rho _n(x^{(n)}) \, \hbox {d}x^{(n)} \geqslant 0,\) see also Eq. (3). Now we note that for fixed n it holds

$$\begin{aligned} \sum _{N\in {\mathbb {M}}_n} p_N = \sum _{i_1,\dots ,i_n} \langle \xi _{i_1}^* \otimes \ldots \otimes \xi _{i_n}^*, \rho _n \rangle \end{aligned}$$
(108)

for the coefficients \(p_N=p_{N_1,\ldots .,N_M}\) defined in Eq. (99). Moreover, we have

$$\begin{aligned} \sum _{i_1,\dots ,i_n} (\xi _{i_1}^* \otimes \ldots \otimes \xi _{i_n}^*)(x^{(n)}) = \sum _{i_1,\dots ,i_n} \xi ^*_{i_1}(x^{(n)}_1) \cdot \ldots \cdot \xi ^*_{i_n}(x^{(n)}_2) = 1 \quad \forall x^{(n)} \in {\mathbb {X}}^n\nonumber \\ \end{aligned}$$
(109)

for the given basis functions \(\xi _i\). Inserting into Eq. (108) we obtain

$$\begin{aligned} \sum _{N\in {\mathbb {M}}_n} p_N&= \sum _{i_1,\dots ,i_n} \int (\xi _{i_1} \otimes \ldots \otimes \xi _{i_n})^*(x^{(n)}) \rho _n(x^{(n)}) \, \hbox {d}x^{(n)} \nonumber \\&= \int \rho _n(x^{(n)}) \, \hbox {d}x^{(n)} \nonumber \\&= {\mathbb {P}}[N=n], \end{aligned}$$
(110)

so, due to property (107), we find

$$\begin{aligned} \Vert {\hat{\rho }} \Vert = \sum _{n=0}^\infty \sum _{N\in {\mathbb {M}}_n} p_N =1 \end{aligned}$$
(111)

with \(p_N \geqslant 0\) for all N. This means that the norm is preserved and the coefficients \(p_N\) may be interpreted as probabilities. Also \(\hat{\rho }_n\geqslant 0\) is fulfilled such that \(\hat{\rho }_n\) is again a probability density function. This discretization can be understood in analogy to conservative finite volume methods, where the conserved quantity is the probability.

Average concentration field. As a simple application of the Galerkin projection and the probabilistic interpretation of Eq. (99), we calculate the expected number of particles in a ball \(B_\varepsilon (y)\) of radius \(\varepsilon \) centered at \(y \in {\mathbb {X}}\). For the Galerkin basis, we choose only \(M=2\) basis functions, namely the indicator functions on \({\mathbb {X}}_1 = B_\varepsilon (y)\) and on its complement \({\mathbb {X}}_2 = {\mathbb {X}} \setminus B_\varepsilon (y)\). Then, the probability that at time t there are n particles in the system and exactly k out of them are located in \(B_\varepsilon (y)\) is obtained from the n-particle component of a given \(\rho (t) \in F(H)\) as the coefficient \(p_{k,n-k}(t)\) in Eq. (99), explicitly:

$$\begin{aligned} p_{k,n-k}(t) = \frac{n!}{k!(n-k)!} \int _{B_\varepsilon (y)^k \times ({\mathbb {X}}\setminus B_\varepsilon (y))^{n-k}} \, \rho _n(x^{(n)},t) \, \hbox {d}x^{(n)} . \end{aligned}$$
(112)

The average number of particles in \(B_\varepsilon (y)\) is found by taking the expectation of k with respect to the joint distribution of k and n as

$$\begin{aligned} X_\varepsilon (y, t) := \sum _{n=0}^\infty \sum _{k=1}^n k \, p_{k,n-k}(t) . \end{aligned}$$
(113)

Dividing further by the volume of the ball and taking its radius to zero yields the average molecular concentration at point y:

$$\begin{aligned} c(y, t) := \lim _{\varepsilon \rightarrow 0} \frac{1}{\mathrm {vol}(B_\varepsilon (y))} X_\varepsilon (y, t) , \end{aligned}$$
(114)

which, after carrying out the limit, reduces to

$$\begin{aligned} c(y, t)&= \sum _{n=0}^\infty \sum _{k=1}^{n} \frac{n!}{(k-1)!(n-k)!} \int _{\{y\}^{k-1} \times {\mathbb {X}}^{n-k}} \, \rho _n(y, x^{(n-1)},t) \, \hbox {d}x^{(n-1)} \nonumber \\&= \sum _{n=0}^\infty n \int _{{\mathbb {X}}^{n-1}} \, \rho _n(y, x^{(n-1)},t) \, \hbox {d}x^{(n-1)} \end{aligned}$$
(115)

since in the first line the integral is nonzero only for \(k=1\) as \(\{y\}^{k-1}\) is a null set otherwise. The last result, Eq. (115), can serve as starting point to derive the deterministic reaction–diffusion equation in terms of average concentrations from a given CDME.

5.4 Generalized reaction–diffusion master equation

Given the setting of a full spatial partition with basis functions defined in Eq. (106), we will investigate next the projected diffusion and reaction operators for some basic scenarios and derive the corresponding generalized RDME as an evolution equation for the coefficients \(p_N\). Explicit calculations can be found in Appendix D.2.

5.4.1 Diffusion

Consider the projected diffusion operator given in Eq. (96) and define \(d_{ij} := \left\langle \xi _i^*, {\mathcal {D}}\xi _j \right\rangle \), such that

$$\begin{aligned} \hat{{\mathcal {D}}} = \sum _{i,j} d_{ij}a^+_i a^-_j . \end{aligned}$$
(116)

This means that \(d_{ij}\) refers to the rate to go from basis j to basis i. We apply this operator \(\hat{{\mathcal {D}}}\) to \({\hat{\rho }}\) given in Eq. (101). We find (see Eq. (D8))

$$\begin{aligned} \hat{{\mathcal {D}}} \hat{\rho }= & {} \sum _{N_1,\dots ,N_M} \sum _{\begin{array}{c} i,j\\ i\ne j \end{array}} p_{N_1,\ldots ,N_i-1, \ldots , N_j+1, \ldots , N_M} d_{ij} (N_j+1)\cdot \vert N_1,\ldots ,N_M\rangle \nonumber \\&+ \sum _{N_1,\dots ,N_M} \sum _{i} p_{N_1,\ldots ,N_M}d_{ii} N_i\cdot \vert N_1,\ldots ,N_M\rangle . \end{aligned}$$
(117)

Defining the operator \(\mathrm {D}\) acting on the coefficients according to

$$\begin{aligned} \mathrm {D}p_{N_1,\ldots ,N_M}&:= \sum _{\begin{array}{c} i,j\\ i\ne j \end{array}}p_{N_1,\ldots , N_i-1, \ldots , N_j+1, \ldots , N_M} d_{ij} (N_j+1) + \sum _{i} p_{N_1,\ldots ,N_M}d_{ii} N_i \nonumber \\&= \sum _{\begin{array}{c} i,j\\ i\ne j \end{array}}\left[ d_{ij} (N_j+1)p_{N_1,\ldots ,N_i-1, \ldots , N_j+1, \ldots , N_M} - d_{ji} N_i p_{N_1,\ldots ,N_M} \right] , \end{aligned}$$
(118)

we can write

$$\begin{aligned} \hat{{\mathcal {D}}} \hat{\rho } = \sum _{N_1,\dots ,N_M} Dp_{N_1,\ldots ,N_M} \cdot \vert N_1, \dots , N_M\rangle . \end{aligned}$$
(119)

In Eq. (118), we used the identity \(d_{ii}= - \sum _{j\ne i} d_{ji}\), which follows for the chosen basis of indicator functions from the equality \(\xi ^*_i =1-\sum _{j\ne i} \xi ^*_j\) after integration by parts.

In the time-dependent setting, where \(\rho =\rho (\cdot ,t)\) is a function of t, we turn the diffusion equation \(\partial _t \rho = {\mathcal {D}} \rho \) into a “diffusion master equation” for the time-dependent coefficients \(p_{N_1,\dots ,N_M}(t)\) of \({\hat{\rho }} (t)\) and get

$$\begin{aligned} \frac{\text {d}}{\text {d}t}p_{N_1,\dots ,N_M}(t)&= \mathrm {D}p_{N_1,\ldots , N_M}(t) \end{aligned}$$
(120)

as the diffusive part of the RDME.

5.4.2 Creation and degradation

Consider the chemical diffusion master equation for creation and degradation, see Eq. (77). Let \(\lambda _d\) denote the rate function of the degradation reaction \(\text {A}\rightarrow \varnothing \), while \(\lambda _c\) is the rate function for the creation reaction \(\varnothing \rightarrow \text {A}\). The corresponding operators are denoted by \({\mathcal {R}}^{(1)}_d\) and \({\mathcal {R}}^{(1,0)}_d\) for degradation and by \({\mathcal {R}}^{(0)}_c\) and \({\mathcal {R}}^{(0,1)}_c\) for creation.

Degradation. The projected conserving one-particle reaction operator \(\hat{{\mathcal {R}}}_d^{(1)}\) acts similarly to the diffusion operator. Defining

$$\begin{aligned} \lambda _d^{i} := \left\langle \xi ^*_i, \Lambda _d^{(1)}\xi _i\right\rangle = \int \xi ^*_i(x)\lambda _d(x)\xi _i(x) \hbox {d}x = \int \lambda _d(x)\xi _i(x) \hbox {d}x \end{aligned}$$
(121)

for \(\Lambda _d^{(1)}\) given in Eq. (79a), we find [Eq. (D9)]:

$$\begin{aligned} \hat{{\mathcal {R}}}_d^{(1)} {\hat{\rho }} = \sum _{N_1,\dots ,N_M} \sum _{i} p_{N_1,\ldots , N_M}\lambda _d^{i} N_i\cdot \vert N_1,\ldots ,N_M\rangle . \end{aligned}$$
(122)

Applying the projected non-conserving operator \(\hat{{\mathcal {R}}}_d^{(1,0)}= \sum _i \langle 1,\Lambda _1^{(1,0)}\xi _i \rangle a^-_i\) to \({\hat{\rho }} = \sum _{n \geqslant 0}{\hat{\rho }}_n\) given in Eq. (101), we get [Eq. (D10)]

$$\begin{aligned} \hat{{\mathcal {R}}}_d^{(1,0)} \hat{\rho } = \sum _{N_1,\dots ,N_M} \sum _i p_{N_1,\ldots , N_i+1, \ldots ,N_M} \,\lambda _d^i (N_i+1)\cdot \vert N_1,\ldots ,N_M\rangle . \end{aligned}$$
(123)

Combining the results, we define the operator \(\mathrm {R}_{d}\) of the degradation reaction in terms of coefficients by

$$\begin{aligned} \mathrm {R}_d p_{N_1,\dots ,N_M} := \sum _i \left[ \lambda _d^i (N_i+1) p_{N_1,\ldots , N_i+1 \ldots , N_M}\,- \lambda _d^i N_i p_{N_1,\ldots ,N_M} \right] . \end{aligned}$$
(124)

Creation. As for the creation reaction \(\varnothing \rightarrow \text {A}\), the conserving part \(\hat{{\mathcal {R}}}_c^{(0)}\) acts as a mere constant [Eq. (D11)]:

$$\begin{aligned} \hat{{\mathcal {R}}}_c^{(0)} {\hat{\rho }}&= \Lambda _c^{(0)} \sum _{N_1,\dots ,N_M} p_{N_1,\ldots , N_M} \vert N_1,\ldots ,N_M\rangle \nonumber \\&= \Lambda _c^{(0)} {\hat{\rho }} , \end{aligned}$$
(125)

with the reaction rate constant

$$\begin{aligned} \Lambda _c^{(0)} = \int \lambda _c(x) \, \hbox {d}x. \end{aligned}$$
(126)

For the non-conserving part \(\hat{{\mathcal {R}}}^{(0,1)}\), we set

$$\begin{aligned} \lambda _c^i := \langle \xi ^*_i,\Lambda _c^{(0,1)}1 \rangle = \int \xi ^*_i(x) \,\lambda _c(x) \,\hbox {d}x \end{aligned}$$
(127)

and obtain [Eq. (D12)]

$$\begin{aligned} \hat{{\mathcal {R}}}_c^{(0,1)} {\hat{\rho }}&= \sum _{N_1,\dots ,N_M} \sum _i p_{N_1,\ldots , N_i -1,\ldots , N_M}\lambda _c^i \, \vert N_1,\ldots ,N_M\rangle . \end{aligned}$$
(128)

In terms of coefficients, and observing that \(\Lambda _c^{(0)} =\sum _i \lambda _c^i\), we obtain the operator \(\mathrm {R}_{c}\) as

$$\begin{aligned} \mathrm {R}_{c} p_{N_1,\dots ,N_M} :=&\sum _i \lambda _c^i \left[ p_{N_1,\ldots ,N_i-1,\ldots ,N_M}- p_{N_1,\ldots ,N_M} \right] . \end{aligned}$$
(129)

In combination with the diffusion operator, we obtain the standard RDME for the system of creation and degradation

$$\begin{aligned} \frac{\text {d}}{\text {d}t}p_{N_1,\dots ,N_M}(t)&= (\mathrm {D} + \mathrm {R}_{d}+\mathrm {R}_{c})p_{N_1,\dots ,N_M}(t) \nonumber \\&= \sum _{\begin{array}{c} i,j\\ i\ne j \end{array}}\left[ d_{ij} (N_j+1)p_{N_1,\ldots ,N_i-1, \ldots , N_j+1, \ldots , N_M}(t) - d_{ji} N_i p_{N_1,\ldots ,N_M}(t) \right] \nonumber \\&\quad + \sum _i \lambda _d^i\left[ (N_i+1) p_{N_1,\ldots , N_i+1, \ldots , N_M}(t) \,- N_i p_{N_1,\ldots ,N_M}(t) \right] \nonumber \\&\quad + \sum _i\lambda _c^i \left[ p_{N_1,\ldots , N_i-1, \ldots , N_M}(t)- p_{N_1, \ldots , N_M}(t) \right] . \end{aligned}$$
(130)

Scaling by volume. Assuming that the reaction rate function \(\lambda _c\) of creation is constant, \(\lambda _c(x)=\gamma \) for all \(x\in {\mathbb {X}}\), it holds \(\lambda _c^i=\gamma \int \xi ^*_i(x) \hbox {d}x= \gamma \mathrm {vol}({\mathbb {X}}_i)\) and \(\lambda _c= \gamma \mathrm {vol}({\mathbb {X}})\). As for degradation, we analogously obtain \(\lambda _d^i=\gamma \). In both cases, this is the usual volume-scaling of a reaction of order zero or one, respectively.

5.4.3 Mutual annihilation

For the mutual annihilation given by the reaction \(\text {A}+ \text {A}\rightarrow \varnothing \), let \(\lambda (x^{(2)})\) denote the rate for two particles to react when they are located at \(x^{(2)}=(x_1^{(2)},x_2^{(2)})\in {\mathbb {X}}^2\). By virtue of Eq. (66) with \(k=2\) and \(l=0\) we set

$$\begin{aligned} \lambda ^{ij}&:= \langle \xi ^*_i\otimes \xi ^*_j,\Lambda ^{(2)} (\xi _i\otimes \xi _j)\rangle \nonumber \\&=\int (\xi ^*_i\otimes \xi ^*_j)(x^{(2)})\lambda (x^{(2)}) (\xi _i\otimes \xi _j)(x^{(2)})\, \hbox {d}x^{(2)} \end{aligned}$$
(131)

and obtain the conserving part \(\hat{{\mathcal {R}}}^{(2)}\) of the reaction as [Eq. (D15)]

$$\begin{aligned} \hat{{\mathcal {R}}}^{(2)} {\hat{\rho }}= & {} \sum _{N_1,\dots ,N_M} \Bigg [ \sum _{i} p_{N_1,\ldots , N_M}\frac{1}{2} \lambda ^{ii} N_i(N_i-1)\, \vert N_1,\ldots ,N_M\rangle \nonumber \\&+ \sum _{i< j} p_{N_1,\ldots , N_M} \lambda ^{ij} N_i N_j \, \vert N_1,\ldots ,N_M\rangle \Bigg ]. \end{aligned}$$
(132)

On the other hand, under the assumption of non-overlapping basis functions, we find the same \(\lambda ^{ij}\) for the non-conserving part:

$$\begin{aligned} \langle (1,\Lambda ^{(2,0)} (\xi _i\otimes \xi _j)\rangle =\int \lambda (x^{(2)}) (\xi _i\otimes \xi _j)(x^{(2)})\, \hbox {d}x^{(2)} = \lambda ^{ij}, \end{aligned}$$
(133)

and thus [Eq. (D18)]

$$\begin{aligned} \hat{{\mathcal {R}}}^{(2,0)} {\hat{\rho }}= & {} \sum _{N_1,\dots ,N_M} \Bigg [ \sum _{i} p_{N_1,\ldots , N_i+2,\ldots , N_M} \frac{1}{2}\lambda ^{ii} (N_i+2)(N_i+1) \, \vert N_1,\ldots ,N_M\rangle \nonumber \\&+\sum _{i<j} p_{N_1,\ldots , N_i+1,\ldots , N_j+1, \ldots , N_M} \lambda ^{ij} (N_i+1) (N_j+1) \, \vert N_1,\ldots ,N_M\rangle \Bigg ].\nonumber \\ \end{aligned}$$
(134)

In terms of the coefficients, we obtain the generalized RDME

$$\begin{aligned}&\frac{\text {d}}{\text {d}t}p_{N_1,\dots ,N_M}(t) = (\mathrm {D}+\mathrm {R})p_{N_1,\dots ,N_M}(t) \nonumber \\&\quad = \sum _{\begin{array}{c} i,j\\ i\ne j \end{array}}\left[ d_{ij} (N_j+1)p_{N_1,\ldots ,N_i-1, \ldots , N_j+1, \ldots , N_M}(t) - d_{ji} N_i p_{N_1,\ldots ,N_M}(t) \right] \nonumber \\&\qquad + \frac{1}{2}\sum _i \lambda ^{ii} \left[ (N_i+2)(N_i+1)p_{N_1,\ldots , N_i+2, \ldots , N_M}(t) - N_i(N_i-1) p_{N_1, \ldots , N_M}(t) \right] \nonumber \\&\qquad +\sum _{i< j} \lambda ^{ij} \left[ (N_i+1)(N_j+1)p_{N_1,\ldots , N_i+1, \ldots , N_j+1, \ldots , N_M}(t) - N_i N_jp_{N_1, \ldots , N_M}(t) \right] , \end{aligned}$$
(135)

where the last two lines define the operator \(\mathrm {R}\). The very last line refers to reactions between particles located in different “boxes.” This makes the equation more general than the standard RDME which would only allow reactions between particles located in the same box.

Volume scaling of the rate constant. Let the reaction rate function \(\lambda \) be of the form \(\lambda (x,y)=\gamma 1_{B_r(x)}(y)\), which corresponds to the standard situation of the Doi reaction model [45]; here, \(\gamma > 0\) is a reaction rate constant, \(r > 0\) is some maximum reaction distance, and \(1_{B_r(x)}\) denotes the indicator function of the ball \(B_r(x)\) of radius r centered at x, i.e., \(1_{B_r(x)}(y) = 1\) if \(\Vert x - y\Vert \leqslant r\) and 0 otherwise. For simplicity, we ignore boundary effects for positions x close to a subdomain boundary such that the reactive volume around x can be assumed to be the same all over a subdomain \({\mathbb {X}}_i\), i.e., \(\int _{{\mathbb {X}}_i} 1_{B_r(x)}(y) \hbox {d}y = V_0\) does not depend on \(x \in {\mathbb {X}}_i\), which is justified if the volume of \({\mathbb {X}}_i\) is large compared to the reactive volume [108]. Then, we obtain

$$\begin{aligned} \lambda ^{ii}&= \int _{{\mathbb {X}}\times {\mathbb {X}}} \xi _i^*(x)\xi _i^*(y)\lambda (x,y) \xi _i(x)\xi _i(y) \hbox {d}x \hbox {d}y \nonumber \\&= \frac{\gamma }{\text{ vol }({\mathbb {X}}_i)^2} \int _{{\mathbb {X}}_i \times {\mathbb {X}}_i} 1_{B_r(x)}(y) \,\hbox {d}x \hbox {d}y \nonumber \\&= \frac{\gamma }{\text{ vol }({\mathbb {X}}_i)^2} \int _{{\mathbb {X}}_i} V_0 \hbox {d}x \nonumber \\&= \frac{\gamma V_0}{\text{ vol }({\mathbb {X}}_i)} , \end{aligned}$$
(136)

which is the standard scaling of the reaction rate constant for a second-order reaction in a finite volume.

6 Discussion and perspectives

In summary, we developed a probabilistic framework to formalize stochastic, particle-resolved reaction–diffusion dynamics. A main result is the structured formulation of the CDME (73), which governs the temporal evolution of the probability distribution of the many-particle open system, by means of systematically constructed diffusion and reaction operators. As the framework is based on suitable creation and annihilation operators, we translated the concept of Fock space, well-known for Hilbert spaces in quantum mechanics, to the setting of probability densities, which are absolutely integrable rather than square-integrable. We introduced creation and annihilation operators [Eq. (51)] as a natural means to express operations on symmetrized many-particle densities, and we used them as basic building blocks to represent the reaction and diffusion operators, and thus the complete CDME. Diffusion operators are expressed as conserving particle operators, as they do not change the number of particles. However, reaction operators are decomposed into two parts, one that conserves and one that does not conserve the number of particles, representing loss and gain contributions to the probability density, respectively [e.g., Eqs. (78) and (86)]. At the core of the reaction operators are position-dependent reaction rate functions, which encode details of the underlying PBRD model such as where to place reaction products [47, 52, 59, 109]. Domains with open boundary conditions can be simulated by including reactions that insert or remove particles in a boundary layer only. Some of the reaction operators take explicitly the form of integrals over n-particle densities, e.g., [Eq. (89)], so the CDME in general is a family of coupled integro-partial-differential equations. The CDME is proposed as an evolution equation on the Fock space \(F(H)\). Similarly as for the CME—valid for well-mixed systems—there is the question when do solutions to the CDME exist and are unique, which will be addressed elsewhere. We worked out the explicit form of the CDME for typical examples, namely a birth–death process [Eq. (77)] and a mutual annihilation reaction [Eq. (85)]. We point out that the framework extends beyond these specific examples and is applicable to general reaction schemes. We briefly sketched the extension to multiple species (see Sect. 4.3), which is straightforward for few species, but results in a clumsy notation for a larger number of species. Using the Galerkin projection technique to discretize space, we derived a generalized RDME with non-local higher-order reactions as an approximation of the CDME [e.g., Eqs. (130) and (135)]. As a by-product, we found relations between the reaction rate functions of the CDME and the rate constants of the RDME [Eq. (131)].

The (generalized) RDME as a spatial discretization of the CDME may, in principle, appear suitable for a direct numerical treatment due to its form as an evolution equation for the expansion coefficients of the Fock space element \({\hat{\rho }} \in {\hat{F}}\). However, such an attempt would be computationally prohibitive, which follows from a brief estimate of the amount of data to be processed. For a Galerkin basis of length M and limiting the maximum copy number per basis element to \(N_\mathrm {max}\), corresponding to a maximum of \(M \times N_\mathrm {max}\) molecules in the system, the function \({\hat{\rho }}\) has coefficients \(p_{N_1,\dots ,N_M}\) for M indices \(N_1, \dots , N_M\) each ranging from 1 to \(N_\mathrm {max}\), see Eq. (98). The memory requirement to store such a dense coefficient array is \((N_\mathrm {max})^M\) floating-point numbers, which in the setting of the ST-CME with few compartments and an exemplary, conservative choice of \(M=5\) and \(N_\mathrm {max} = 100\) would require already \((N_\mathrm {max})^M=10^{10}\) double words or 75 gigabytes of memory that need to be processed in every time integration step. Conversely, in the RDME-like setting of a regular mesh of \(M=10\times 10\) cells with \(N_\mathrm {max}=5\), one would need the unthinkable amount of \((N_\mathrm {max})^M\approx 10^{70}\) double words. Thus, instead of solving the CDME or RDME directly, the method of choice is to calculate Monte Carlo estimates from simulations of the underlying stochastic process either in continuous space for the CDME [57, 58] or, much less costly, on a lattice for the RDME [110,111,112].

The obtained framework is broadly applicable for formulating and analyzing a wide range of arbitrary reaction–diffusion processes. It provides the theoretical backbone to unify reaction–diffusion models at multiple scales that emerge from the CDME in specific limits or regimes. For instance, macroscopic and mesoscopic descriptions rely on (possibly fluctuating) concentration fields. Testing the assumptions behind the emergence of these descriptions requires analysis on a more refined model such as the CDME. The present formalism also enables the development of consistent hybrid and multi-scale numerical schemes. For example, we have shown that the spatial discretization of the CDME by a Galerkin projection naturally yields a consistent, non-local RDME, which supports higher-order reactions between different subdomains and which converges to the original CDME as the mesh size tends to zero—in contrast to the standard local RDME. Our work thus complements previous numerical studies on convergent RDMEs [77, 78].

A relevant direction of future research would consist on fully integrating out the spatial degrees of freedom from the CDME, which should recover the classical CME under well-mixed conditions. This is straightforward for unimolecular reactions [Eq. (20)], whereas higher-order reactions are influenced by diffusion such that the spatial distribution of reacting molecules enters the rates effectively observed in the CME [47,48,49, 58]; further it gives rise to additional reaction channels [71, 72] and non-Markovian effects [73,74,75]. Moreover, deterministic reaction–diffusion equations emerge from spatially resolved stochastic models in the limit of large copy numbers [108, 113, 114]. It would be of practical value to derive such, in general nonlinear, macroscopic equations from the CDME; see Eq. (115) for how to obtain locally averaged molecular concentrations from the probability densities of the CDME. Future research may also include the extension of Sect. 5 to other types of spatial discretizations by projecting onto basis functions different from indicator functions, e.g., committor functions or locally supported, piecewise-linear functions (hat functions), yielding alternative RDME models that could be numerically advantageous. In conclusion, we have given the probabilistic description of particle-resolved reaction–diffusion systems along with systematic means to formulate the corresponding CDME, which opens rich perspectives for future mathematical and numerical investigations.