Entropy Production in Exactly Solvable Systems

The rate of entropy production by a stochastic process quantifies how far it is from thermodynamic equilibrium. Equivalently, entropy production captures the degree to which global detailed balance and time-reversal symmetry are broken. Despite abundant references to entropy production in the literature and its many applications in the study of non-equilibrium stochastic particle systems, a comprehensive list of typical examples illustrating the fundamentals of entropy production is lacking. Here, we present a brief, self-contained review of entropy production and calculate it from first principles in a catalogue of exactly solvable setups, encompassing both discrete- and continuous-state Markov processes, as well as single- and multiple-particle systems. The examples covered in this work provide a stepping stone for further studies on entropy production of more complex systems, such as many-particle active matter, as well as a benchmark for the development of alternative mathematical formalisms.


Introduction
Stochastic thermodynamics has progressively evolved into an essential tool in the study of non-equilibrium systems as it connects the quantities of interest in traditional thermodynamics, such as work, heat and entropy, to the properties of microscopically resolved fluctuating trajectories [1][2][3]. The possibility of equipping stochastic processes with a consistent thermodynamic and information-theoretic interpretation has resulted in a number of fascinating works, with the interface between mathematical physics and the biological sciences proving to be a particularly fertile ground for new insights (e.g., [4][5][6][7][8]). The fact that most of the applications live on the small scale is not surprising, since it is precisely at the microscopic scale that fluctuations start to play a non-negligible role.
The concept of entropy and, more specifically, entropy production has attracted particular interest, as a consequence of the quantitative handle it provides on the distinction between equilibrium systems, passive systems relaxing to equilibrium and genuinely non-equilibrium, 'active' systems. While there exist multiple routes to the mathematical formulation of entropy production [9][10][11][12][13][14], the underlying physical picture is consistent: the entropy production associated with an ensemble of stochastic trajectories quantifies the degree of certainty with which we can assert that a particular event originates from a given stochastic process or from its suitably defined conjugate (usually, its time-reverse). When averaged over long times (or over an ensemble), a non-vanishing entropy production signals time-reversal symmetry breaking at the microscopic scale. This implies, at least for Markovian systems, the existence of steady-state probability currents in the state space, which change sign under time-reversal. When a thermodynamically consistent description is available, the average rate of entropy production can be related to the rate of energy or information exchange between the system, the heat bath(s) it is connected to, and any other thermodynamic entity involved in the dynamics, such as a measuring device [15][16][17]. Whilst the rate of energy dissipation is of immediate interest since it captures how 'costly' it is to sustain specific dynamics (e.g., the metabolism sustaining the development of an organism [18,19]), entropy production has also been found to relate non-trivially to the efficiency and precision of the corresponding process via uncertainty relations [3,20]. Entropy production along fluctuating trajectories also plays a fundamental role in the formulation of various fluctuation theorems [12].
Given the recent interest in stochastic thermodynamics and entropy production in particular, as well as the increasing number of mathematical techniques implemented for the quantification of the latter, it is essential to have available a few, well-understood reference systems, for which exact results are known. These can play the role of benchmarks for new techniques, while helping neophytes to develop intuition. This is not to say that exact results for more complicated systems are not available, see for example [21], however they are usually limited to small systems and/or require numerical evaluation. In this work, we will present results exclusively in the framework proposed by Gaspard [11], specifically in the form of Equations (4), (15) and (16), which we review and contextualise by deriving them via different routes in Section 2. In Section 3, we begin the analysis with processes in discrete state space (Sections 3.1-3.8), and subsequently extend it to the continuous case (Sections 3.9-3.11). Finally, in Sections 3.12 and 3.13 we consider processes that involve both discrete and continuous degrees of freedom. Time is taken as a continuous variable throughout.

Brief Review of Entropy Production
Entropy production of jump processes. The concept of time-dependent informational entropy associated with a given ensemble of stochastic processes was first introduced by Shannon [22]. For an arbitrary probability mass function P n (t) of time t over a discrete set of states n ∈ Ω, the Shannon entropy is defined as S(t) = − ∑ n P n (t) ln P n (t) (1) with the convention henceforth of x ln x = 0 for x = 0. It quantifies the inherent degree of uncertainty about the state of a process. In the microcanonical ensemble P n is constant in t and n and upon providing an entropy scale in the form of the Boltzmann constant k B , Shannon's entropy reduces to that of traditional thermodynamics given by Boltzmann's S = k B ln |Ω|, where |Ω| = 1/P n is the cardinality of Ω. In Markovian systems, the probability P n (t) depends on n and evolves in time t according to the master equationṖ with non-negative transition rates w mn from state m to state n = m. Equation (2) reduces toṖ n (t) = ∑ m P m (t)w mn by imposing the Markov condition ∑ m w nm = 0, equivalently w nn = − ∑ m =n w nm , which we will use in the following. For simplicity, we will restrict ourselves to time-independent rates w nm but as far as the following discussion is concerned, generalising to time-dependent rates is a matter of replacing w nm by w nm (t). The rate of change of entropy for a continuous time jump process can be derived by differentiating S(t) in Equation (1) with respect to time and substituting (2) into the resulting expression [11,23], thus obtaininġ S(t) = − ∑ m,n P m (t)w mn ln (P n (t)) = ∑ m,n P n (t)w nm ln P n (t) P m (t) =Ṡ e (t) +Ṡ i (t) (3) where we definė S e (t) = − 1 2 ∑ m,n (P n (t)w nm − P m (t)w mn ) ln w nm w mn (4a) = − ∑ m,n P n (t)w nm ln w nm w mn = − ∑ m,n (P n (t)w nm − P m (t)w mn ) ln w nm w 0 Ṡ i (t) = 1 2 ∑ m,n (P n (t)w nm − P m (t)w mn ) ln P n (t)w nm P m (t)w mn (4b) = ∑ m,n P n (t)w nm ln P n (t)w nm P m (t)w mn = ∑ m,n (P n (t)w nm − P m (t)w mn ) ln P n (t)w nm w 0 with arbitrary positive rate w 0 to restore dimensional consistency, that cancel trivially. Here we follow the convention [1] to split the rate of entropy change into two contributions: the first, Equation (4a), commonly referred to as "external" entropy production or entropy flow, is denoted byṠ e . It contains a factor ln(w nm /w mn ) corresponding, for systems satisfying local detailed balance, to the net change in entropy of the reservoir(s) associated with the system's transition from state n to state m. For such thermal systems,Ṡ e can thus be identified as the rate of entropy production in the environment [9,24]. The second contribution, Equation (4b), termed "internal" entropy production and denoted byṠ i is non-negative because (x − y) ln(x/y) ≥ 0 for any two real, positive x, y and using the convention z ln z = 0 for z = 0. The internal entropy production vanishes when the global detailed balance condition P n (t)w nm = P m (t)w mn is satisfied for all pairs of states. In this sense, a non-vanishingṠ i is the fingerprint of non-equilibrium phenomena. Defining π n = lim t→∞ P n (t) as the probability mass function at steady-state, the internal entropy production rate can be further decomposed into two non-negative contributions,Ṡ i (t) =Ṡ a i (t) +Ṡ na i (t), of the forṁ S a i (t) = ∑ m,n P n (t)w nm ln π n w nm π m w mn (5a) These contributions are usually referred to as adiabatic (or housekeeping) and non-adiabatic (or excess) entropy production rates, respectively [1]. The non-adiabatic contribution vanishes at steady-state, lim t→∞Ṡ na i (t) = 0. While these quantities have received attention in the context of fluctuation theorems [23], they will not be discussed further here. At steady-state, namely whenṖ n (t) = 0 for all n,Ṡ(t) in Equation (3) vanishes by construction, so that the internal and external contributions to the entropy production cancel each other exactly,Ṡ(t) =Ṡ e (t) +Ṡ i (t) = 0, while they vanish individually only for systems at equilibrium. Equation (4) will be used throughout the present work to compute the entropy productions of discrete-state processes.
Entropy production as a measure of time-reversal-symmetry breaking. As it turns out, a deeper connection between internal entropy production and time-reversal symmetry breaking can be established [11]. The result, which we re-derive below, identifiesṠ i as the relative dynamical entropy (i.e., the Kullback-Leibler divergence [25]) per unit time of the ensemble of forward paths and their time-reversed counterparts. To see this, we first need to define a path n = (n 0 , n 1 , . . . , n M ) as a set of trajectories starting at time t 0 and visiting states n j at successive discrete times t j = t 0 + jτ with j = 0, 1, . . . , M, equally spaced by a time interval τ. For a time-homogeneous Markovian jump process in continuous time, the joint probability of observing a particular path is P (n; t 0 , Mτ) = P n 0 (t 0 )W(n 0 → n 1 ; τ)W(n 1 → n 2 ; τ) . . . W(n M−1 → n M ; τ) (6) where P n 0 (t 0 ) is the probability of observing the system in state n 0 at time t 0 , while W(n j → n j+1 ; τ) is the probability that the system is in state n j+1 time τ after being in state n j . This probability can be expressed in terms of the transition rate matrix w with elements w mn . It is W(n → m; τ) = [exp(wτ)] nm , the matrix elements of the exponential of the matrix wτ with the Markov condition imposed. It can be expanded in small τ as where δ n,m is the Kronecker-δ function. We can now define a dynamical entropy per unit time [22] as where the limit is to be considered a continuous time limit taken at fixed ∆t = t M − t 0 = Mτ [26], thus determining the sampling interval τ, and the sum runs over all possible paths n. Other than τ, the paths are the only quantity on the right-hand side of Equation (8) that depend on M. The dynamical entropy h(t 0 , ∆t) may be considered the expectation of ln(P (n; t 0 , ∆t)) across all paths. Similarly to the static Shannon entropy, the dynamical entropy h(t 0 , ∆t) quantifies the inherent degree of uncertainty about the evolution over a time ∆t of a process starting at a given time t 0 . To compare with the dynamics as observed under time-reversal, one introduces the time-reversed path n R = (n M , n M−1 , . . . , n 0 ) and thus the time-reversed dynamical entropy per unit time as ..,n M P (n; t 0 , ∆t) ln P (n R ; t 0 , ∆t) .
While similar in spirit to h(t 0 , ∆t), the physical interpretation of h R (t 0 , ∆t) as the expectation of ln P (n R ; ∆t) under the forward probability P (n; t 0 , ∆t) is more convoluted since it involves the forward and the backward paths simultaneously, which have potentially different statistics. However, time-reversal symmetry implies precisely identical statistics of the two ensembles, whence h(t 0 , ∆t) = h R (t 0 , ∆t). The motivation for introducing h R (t 0 , ∆t) is that the difference of the two dynamical entropies defined above is a non-negative Kullback-Leibler divergence given by Using Equation (6) in (10) with Equation (7) provides the expansion which is an instantaneous measure of the Kullback-Leibler divergence. The limit of h R (t 0 , ∆t) − h(t 0 , ∆t) in small ∆t is finite and identical to the internal entropy production (4b) derived above. This result establishes the profound connection between broken global detailed balance, Equation (4), and Kullback-Leibler divergence, Equation (11), both of which can thus be recognised as fingerprints of non-equilibrium systems. In light of this connection, it might not come as a surprise that the steady-state rate of entropy production is inversely proportional to the minimal time needed to decide on the direction of the arrow of time [27]. Entropy production for continuous degrees of freedom. The results above were obtained for Markov jump processes within a discrete state space. However, the decomposition of the rate of change of entropy in Equation (3) into internal and external contributions can be readily generalised to Markovian processes with continuous degrees of freedom, for example a spatial coordinate. For simplicity, we will restrict ourselves to processes in one dimension but as far as the following discussion is concerned, generalising to higher dimensions is a matter of replacing spatial derivatives and integrals over the spatial coordinate with their higher dimensional counterparts. The dynamics of such a process with probability density P(x, t) to find it at x at time t are captured by a Fokker-Planck equation of the formṖ(x, t) = −∂ x j(x, t), with j the probability current, augmented by an initial condition P(x, 0). Starting from the Gibbs-Shannon entropy for a continuous random variable S(t) = − dx P(x, t) ln(P(x, t)/P 0 ) with some arbitrary density scale P 0 for dimensional consistency, we differentiate with respect to time and substitute −∂ x j(x, t) forṖ(x, t) to obtaiṅ where the second equality follows upon integration by parts using dxṖ(x, t) = 0 by normalisation. For the paradigmatic case of an overdamped colloidal particle, which will be discussed in more detail below (Sections 3.9-3.11), the probability current is given by j(x, t) = −D∂ x P(x, t) + µF(x, t)P(x, t) with local, time-dependent force F(x, t). We can then decompose the entropy productionṠ(t) = S i (t) +Ṡ e (t) into internal and external contributions aṡ respectively. The Kullback-Leibler divergence between the densities of forward and time-reversed paths can be calculated as outlined above for discrete state systems, thus producing an alternative expression for the internal entropy production in the forṁ Here we have introduced the propagator W(x → x, τ), the probability density that a system observed in state x will be found at x time τ later. In general, here and above, the density W(x → x , τ) depends on the absolute time t, which we have omitted here for better readability. The corresponding expression for the entropy flow is obtained by substituting (15) into the balance equationṠ e (t) = Since lim τ→0 W(x → x , τ) = δ(x − x ) [28] and P(x, t)δ(x − x ) = P(x , t)δ(x − x), the factor in front of the logarithm in (15) and (16) vanishes in the limit of small τ, lim τ→0 P(x, t)W(x → x ; τ) − P(x , t)W(x → x; τ) = 0. Together with the prefactor 1/τ, this necessitates the use of L'Hôpital's rule where we used the shorthandẆ which is generally given by the Fokker-Planck equation of the process, so thaṫ In the continuum processes considered below, in particular Sections 3.11-3.13,Ẇ(x → x ) is a kernel in the form of Dirac δ-functions and derivatives thereof, acting under the integral as the adjoint Fokker-Planck operator on P(x, t). With Equation (17) the internal entropy production of a continuous process (15) may conveniently be written aṡ with suitable constants W 0 and P 0 . Correspondingly, the (external) entropy flow (16) iṡ All of these expressions assume that the limits of the logarithms exist. Naively replacing them by ln(δ(x − x )/δ(x − x)) produces a meaningless expression with a Dirac δ-function in the denominator. Equations (20) and (21) are identically obtained in the same manner as Equation (4) with the master Equation (2) replaced by the Fokker-Planck Equation (19). All of these expressions, Equations (4), (20) and (21), may thus be seen as Gaspard's [11] framework. Langevin description and stochastic entropy. We have seen in Equations (13) and (14) how the notion of entropy production can be extended to continuous degrees of freedom by means of a Fokker-Planck description of the stochastic dynamics. The Fokker-Plank equation is a deterministic equation for the probability density and thus provides a description at the level of ensembles, rather than single fluctuating trajectories. A complementary description can be provided by means of a Langevin equation of motion, which is instead a stochastic differential equation for the continuous degree of freedom [29]. The presence of an explicit noise term, which usually represents faster degrees of freedom or fluctuations induced by the contact with a heat reservoir, allows for a clearer thermodynamic interpretation. A paradigmatic example is that of the overdamped colloidal particle mentioned above, whose dynamics is described byẋ with µ a mobility, F(x, t) a generic force and ζ(t) a white noise term with covariance ζ(t)ζ(t ) = 2Dδ(t − t ). For one-dimensional motion on the real line, the force F(x, t) can always be written as the gradient of a potential V(x, t), namely F(x, t) = −∂ x V(x, t), so that it is conservative. For time-independent, stable potentials, V(x, t) = V(x), this leads over long timeframes to an equilibrium steady-state. This property does not hold in higher dimensions and for different boundary conditions (e.g., periodic), in which case the force F(x, t) need not have a corresponding potential V(x, t) for which F(x, t) = −∇V(x, t) [30]. The concept of entropy is traditionally introduced at the level of ensembles. However, due to its role in fluctuation theorems [1,24], a consistent definition at the level of single trajectories is required. This can be constructed along the lines of [12] by positing the trajectory-dependent entropy S(x * (t), t) where x * (t) is a random trajectory as given by Equation (22) and Here, P(x, t) denotes the probability density of finding a particle at position x at time t as introduced above and P 0 is a scale as used above to maintain dimensional consistency. Given that x * (t) is a random variable, so is S(x * (t), t), which may be regarded as an instantaneous entropy. Taking the total derivative with respect to t produces where we have used the processes' Fokker-Planck equation The total time derivative has been taken as a conventional derivative implying the Stratonovich convention indicated by •, which will become relevant below. The term in (24) containing ∂ t P(x, t) accounts for changes in the probability density due to its temporal evolution, such as relaxation to a steady state, and any time-dependent driving protocol. The product F(x * (t), t) • x * (t) can be interpreted as a power expended by the force and in the absence of an internal energy of the particle, dissipated in the medium. With Einstein's relation defining the temperature of T = D/µ of the medium, the last term may be written aṡ and thus interpreted as the entropy change in the medium. Together with the entropy change of the particle, this gives the total entropy change of particle and medium, which is a random variable, as it depends on the position x * (t). It also draws on P(x, t) and j(x, t) which are properties of the ensemble. To make the connection to the entropies constructed above we need to take an ensemble average of the instantaneousṠ tot (t). To do so, we need an interpretation of the last term of (26), where the noise ζ(t) ofẋ * (t), Equation (22), multiplies j(x * (t), t)/P(x * (t), t).
Equivalently, we need the joint density P(x,ẋ; t) of position x and velocityẋ at time t. In the spirit of Ito, this density trivially factorises into a normally distributedẋ − µF(x, t) and P(x, t) as the incremenṫ xdt on the basis of (22) depends only on the particle's current position x(t). However, this is not so in the Stratonovich interpretation of P(x,ẋ; t), as here the increment depends equally on x(t) and x(t + dt) [1,31,32]. Taking the ensemble average ofṠ tot thus produces where x * andẋ * are now dummy variables. The first term on the right hand side vanishes, because P(x * , t) = dẋ * P(x * ,ẋ * ; t) is the marginal of P(x * ,ẋ * ; t) and dx * ∂ t P(x * , t) = 0 by normalisation. The integral overẋ * in the second term produces the expected particle velocity conditional to its position, in the Stratonovich sense, where it gives rise to the current [12], ẋ * |x which vanishes only in the absence of any probability current, i.e., in thermodynamic equilibrium.
In the Ito sense, the conditional expectation (28) would have instead given rise to the ensemble-independent drift, ẋ * |x * , t = µF(x * , t). Comparing to Equation (13), the expectation Ṡ tot (t) turns out to be the internal entropy productionṠ i (t), so thatṠ tot (t) of Equation (26) may be regarded as its instantaneous counterpart. Path integral methods. An interesting aspect of working with the Langevin description is the possibility of casting probability densities p([x]; t) for paths x(t ) with t ∈ [0, t] into path integrals, for example in the Onsager-Machlup formalism [33,34]. For the colloidal particle introduced in (22), in the Stratonovich discretisation, which differs from the Ito form only by the second term ( [34], Section 4.5), which is the Jacobian of the transform of the noise ζ(t) to x(t), Equation (22). The Stratonovich form is needed so that the action does not give preference to a particular time direction [35]. This choice plays a role in every product of white noise, as is implicit toẋ, and a random variable. We therefore indicate the choice by a • also in powers, reminding us that F(x(t ), t ) should be read as F((x(t ) + x(t + ∆t))/2, t + ∆t) andẋ(t ) as (x(t + ∆t) − x(t ))/2 with discretisation time step ∆t. Evaluating the action for the reversed path If the force is even under time reversal, F(x, t ) = F(x, t − t ), in particular when it is independent of time, the path probability density obeys with random variables multiplied with Stratonovich convention. With Equation (25), the integral in Equation (33) can be identified as the entropy of the medium. When the driving is time-independent and the system's probability distribution eventually becomes stationary, such that lim t→∞ Ṡ (x * , t) = 0, Equation (23), the only contribution to the total entropy change is due to change of entropy in the medium, Equation (26). Assuming that the system is ergodic, we have the equivalence lim t→∞ S m (t)/t = lim t→∞ Ṡ tot (t) , where • denotes an ensemble average. Using Equations (13) and (29) gives lim t→∞ S m (t)/t = lim t→∞Ṡi (t). Equation (33) can therefore be used directly to compute the steady-state internal entropy production rate. The equivalence between the long-time limit t → ∞ and the ensemble average holds only for ergodic systems, whose unique steady-state does not depend on the specific initialisation x(0). This connection between stochastic thermodynamics and field theory has stimulated a number of works aimed at characterising the non-equilibrium features of continuum models of active matter [13,36]. Extensions of this formalism to systems driven by correlated noise have also been proposed [37].

Systems
In this section, we calculate the entropy production rate on the basis of Gaspard's framework [11], Equations (4), (15) and (16), for different particle systems. We cover the systems listed in Table 1, with both discrete and continuous states and with one or multiple particles. Table 1. List of particle systems for which we have calculated their entropy productionṠ i (t).

Two-State Markov Process
Consider a particle that hops between two states, 1 and 2, with transition ratesẆ(1 → 2) = α andẆ(2 → 1) = β, see Figure 1 [23,38], and using the notation in Equation (18) for discrete states. The rate-matrix (see Equation (7)) may thus be with P(t) = (P 1 (t), P 2 (t)) the probability of the particle to be in state 1 or 2 respectively as a function of time. By normalisation, P 1 (t) + P 2 (t) = 1, with probabilistic initial condition P(0) = (p, 1 − p). Solving the master equation in Equation (2) yields with r = αp − β(1 − p), corresponding to an exponentially decaying probability current The internal entropy production (4b) is theṅ see Figure 2, and the entropy flow (4a), At stationarity,Ṡ i =Ṡ e = 0 and therefore the two-state Markov process reaches equilibrium. In this example, the topology of the transition network does not allow a sustained current between states, which inevitably leads to equilibrium in the steady state and, therefore, there is production of entropy only due to the relaxation of the system from the initial state.
Entropy production of the two-and three-state Markov processes (black and grey lines respectively) discussed in Sections 3.1 and 3.2 as a function of time. For the two-state system we plot Equation (37) with p = 1 both for the symmetric, α = β (solid lines), and for the asymmetric case, α = β (dashed lines). In both, the entropy production decays exponentially over long timeframes. For the three-state system, Equation (41), the asymmetric case displays a finite entropy production rate over long timeframes, consistent with Equation (42) and the condition that at stationarityṠ i (t) = −Ṡ e (t).

Three-State Markov Process
We extend the system in Section 3.1 to three states, 1, 2 and 3, with transition ratesẆ(1 → 2) = α, Figure 3, and using the notation Equation (18) for discrete states. The rate matrix (see Equation (7)) is then Assuming the initial condition P(0) = (1, 0, 0), the probabilities of states 1, 2 and 3 respectively, evolve according to Equation (2), which has solution with φ = (α + β)/2 and ψ = (α − β)/2. The entropy production (4b) is then, using (40), see Figure 2, and the entropy flow (4a), which is constant throughout. At stationarity, the system is uniformly distributed and, if α = β, the entropy production and flow satisfyṠ i = −Ṡ e = 0. If α = β, the particle has a net drift that sustains a probability current (α − β)/3 in the system, which prevents the system from reaching equilibrium. This setup can be generalised straightforwardly to M-state Markov processes characterised by the same cyclic structureẆ(i → i + 1 (mod M)) = α andẆ(i → i − 1 (mod M)) = β, to find that the steady-state entropy production is independent of M. These can be seen as simple models of protein conformational cycles driven by instantaneous energy inputs of order k B T ln(α/β), for example ATP hydrolysis [39].

Random Walk on a Complete Graph
Consider a random walker on a complete graph with d nodes, where each node is connected to all other nodes, and the walker jumps from node j ∈ {1, 2, . . . , d} to node k ∈ {1, 2, . . . , d}, k = j, with rate w jk , see Figure 4. These are the off-diagonal elements of the corresponding Markov matrix whose diagonal elements are The probability vector P(t) = (P 1 (t), P 2 (t), . . . , P d (t)) has components P j (t) that are the probability that the system is in state j at time t. The general case of arbitrary transition rates is impossible to discuss exhaustively. In the uniform case, w jk = α, the Markov matrix has only two distinct eigenvalues, namely eigenvalue αd with degeneracy d − 1 and eigenvalue 0 with degeneracy 1. Assuming an arbitrary initial condition P(0), the probability distribution at a later time t is The steady state, which is associated with the vanishing eigenvalue, is the uniform distribution lim t→∞ P j (t) = 1/d for all j ∈ {1, 2, . . . , d}. The entropy production (4b) of the initial state relaxing to the uniform state isṠ and the entropy flow (4a) isṠ e = 0 throughout. If the walker is initially located on node k, so that P j (0) = δ j,k , the entropy production simplifies tȯ We can see that the system reaches equilibrium at stationarity, since lim t→∞Ṡi (t) =Ṡ e (t) = 0. Over long timeframes (de −dαt 1), the asymptotic behaviour ofṠ i iṡ by expanding the logarithm in the small exponential. . The black blob indicates the current state of the system. For uniform transition rates, the symmetry under node relabelling leads to an equilibrium, homogeneous steady-state with P j = 1/d for all j.

N Independent, Distinguishable Markov Processes
In the following, we consider N non-interacting, distinguishable particles undergoing Markovian dynamics on a discrete state space, see Figure 5. Each of the N particles carries an index ∈ {1, 2, . . . , N} and is in state n ∈ {1, 2, . . . , d }, so that the state of the entire system is given by an N-particle state n = (n 1 , n 2 , . . . , n N ). Particle distinguishability implies the factorisation of state and transition probabilities into their single-particle contributions, whence the joint probability P n (t) of an N-particle state n factorises into a product of single particle probabilities P ( ) n (t) of particle to be in state n , Further, the Poissonian rate w nm from N-particle state n to N-particle state m = n vanishes for all transitions n → m that differ in more than one component , i.e., w nm = 0 unless there exists a single ∈ {1, 2, . . . , N} such that m k = n k for all k = , in which case w nm = w ( ) n m , the transition rates of the single particle transition of particle .
The entropy production of this N-particle system according to Equation (4b), (48) simplifies considerably due to w nm , as the sum may be re-written as with m = (n 1 , n 2 , . . . , n −1 , m , n +1 , . . . , n N ) so that w nm = w ( ) n m anḋ Since m k = n k for any k = inside the curly bracket, we may write The product ∏ N k = P (k) n k (t) can thus be taken outside the curly bracket in Equation (50) and be summed over, as well as cancelled in the logarithm. After changing the dummy variables in the remaining summation from n and m to n and m respectively, the entropy production iṡ which is the sum of the entropy productions of the single particle ∈ {1, 2, . . . , N}, Equation (4b), irrespective of how each particle is initialised. The same argument applies toṠ e , the entropy flow Equation (4a). The entropy production and flow obviously simplify to an N-fold product of the single particle expressions if w ( ) nm do not depend on and all particles are initialised by the same P n (0) independent of . This result may equally be found from the dynamical entropy per unit time, Equation (8).

N Independent, Indistinguishable Two-State Markov Processes
Suppose that N identical, indistinguishable, non-interacting particles follow the two-state Markov process described in Section 3.1, Figure 6 [23]. There are Ω = N + 1 distinct states given by the occupation number n ∈ {0, 1, . . . , N} of one of the two states, say state 1, as the occupation number of the other state follows as N − n given the particle number N is fixed under the dynamics. In the following, P(n, t) denotes the probability of finding n particles in state 1 at time t. The master equation is theṅ P(n, t) = −αnP(n, t) + α(n + 1)P(n + 1, t) − β(N − n)P(n, t) + β(N − n + 1)P(n − 1, t) .
The state space and the evolution in it can be thought of as a hopping process on a one-dimensional chain of states with non-uniform rates. Provided P(n, 0) initially follows a binomial distribution, P(n, 0) = ( N n )p n (1 − p) N−n with probability p for a particle to be placed in state 1 initially, the solution of Equation (53) is easily constructed from the solution P 1 (t) in Equation (35) of Section 3.1 via with P 1 (0) = p, asṖ 1 (t) = −αP 1 (t) + β(1 − P 1 (t)), which can be verified by substituting Equation (54) into Equation (53). Using Equations (34) and (54) in (4b), the entropy production readṡ which is the N-fold multiple of the result of the corresponding single particle system, Equation (37). This result, Equation (55b), depends on the initialisation being commensurable with Equation (54) which otherwise is recovered only asymptotically and only if the stationary distribution is unique. Further, the entropy production of N indistinguishable particles being the N-fold entropy production of a single particle does not extend to the external entropy flow, which lacks the simplification of the logarithm and giveṡ thus picking up a correction in the form of the additional sum in the curly bracket that vanishes only at N = 1 or P 1 (t) = 1/2, but does not contribute at stationarity because of the overall prefactor αP 1 − β(1 − P 1 ) that converges to 0. To make sense of this correction in relation to particle indistinguishability, with the help of Equation (54) we can rewrite the difference between the right hand side of Equation (56) and the N-fold entropy flow of a single two-state system (38) as which now explicitly involves the net probability current from the occupation number state with n + 1 particles in state A to that with n particles in state A, as well as a the logarithm Written in terms of the same combinatorial factors appearing in Equation (54), the logarithm (58) can be interpreted as a difference of microcanonical (Boltzmann) entropies, defined as the logarithm of the degeneracy of the occupation number state if we were to assume that the N particles are distinguishable. With the help of the master Equation (53) as well as Equation (54) and (58), the term Equation (57) may be rewritten to givė This result is further generalised in Equation (70). 1 2 α β Figure 6. N independent, indistinguishable two-state Markov processes in continuous time. The black blobs indicate the current state of the single-particle sub-system. Since processes are indistinguishable, states are fully characterised by the occupation number of either state, if the total number of particles is known.

N Independent, Indistinguishable d-State Processes
We generalise now the results in Sections 3.3 and 3.5 to N independent d-state Markov processes, see Figure 7. These results represent a special case of those obtained in [40] when the N processes are non-interacting. In this section, we consider non-interacting, indistinguishable particles hopping on a graph of d nodes with edge-dependent hopping rates w jk . As in the two-state system in Section 3.5, we find that the internal (but not the external) entropy production of the d-state systemṠ i is N times the entropy production of the individual processes assuming the initial condition is probabilistically identical for all single-particle sub-systems. The entropy productions of a single such process according to Equation (4) readṠ where P j (t) is the time-dependent probability of a single-particle process to be in state j, Section 3.3.
To calculate the entropy production of the N concurrent indistinguishable processes using the occupation number representation, we first derive the probability of an occupation number configuration n = (n 1 , n 2 , . . . , n d ), with ∑ d j=1 n j = N, which similarly to Equation (54) is given by the multinomial distribution for the probability P n (t) of the system to be in state n at time t assuming that each particle is subject to the same single-particle distribution P j (t), j ∈ {1, 2, . . . , d} for all t, i.e., in particular assuming that all particles are initialised identically, by placing them all at the same site or, more generally, by placing them initially according to the same distribution P j (0). Given this initialisation, Equation (61) solves with the transition rates w mn discussed below. For non-interacting processes with a unique stationary distribution, Equation (61) is always obeyed in the limit of long times after initialisation, since the single-particle distributions P j (t) are identical at steady state. The entropy production Equation (4b) of the entire system has the same form as Equation (48) of Section 3.4 (N independent, distinguishable particles) with w nm , however now the transition rate between the occupation number state n = (n 1 , n 2 , . . . , n d ) with 0 ≤ n k ≤ N to occupation number state m = (m 1 , m 2 , . . . , m d ). The rate w nm vanishes except when m differs from n in exactly two distinct components, say m j = n j − 1 ≥ 0 and m k = n k + 1 ≥ 1 in which case w nm = n j w jk with w jk the transition rates of a single particle from j to k as introduced above. For such m, the rate obeys w mn = m k w kj and the probability P m (t) fulfills which simplifies the entropy production Equation (48) tȯ where the sum ∑ n runs over all allowed configurations, namely 0 ≤ n j ≤ N for j = 1, 2, . . . , d with ∑ j n j = N and m = (n 1 , n 2 , . . . , n j − 1, . . . , n k + 1, . . . , n d ) is derived from n as outlined above. Strictly, P n (t) has to be defined to vanish for invalid states n, so that the first bracket in the summand of Equation (64) vanishes, in particular when n j = 0, in which case m j = −1. To proceed, we introduce the probabilityPn defined to vanish for n j = 0, so that P n (t)n j = NP j (t)Pn j (t). The probabilityPn j (t) is that of finding n i particles at states i = j and n j − 1 particles at state j. It is Equation (61) evaluated in a system with only N − 1 particles and configurationn j = (n 1 , n 2 , . . . , n j−1 , n j − 1, n j+1 , . . . , n d ) =m k a function of n. Equation (64) may now be rewritten aṡ where we have used that the arguments of the logarithm are independent of n and m. The summation over n gives ∑ nPn so thatṠ which is the N-fold entropy production of the single particle systemṠ i (t), Equation (60a), or equivalently that of N distinguishable particles, Equation (52), Section 3.4. As in Section 3.5, this dramatic simplification does not carry over to the external entropy flow Equation (4a) where of the last two terms only the first is the N-fold entropy flow of the single particle systemṠ e (t), Equation (60b). The reason for the second term is the lack of a cancellation mechanism to absorb the n j and n k + 1 from the logarithm. Rewriting the second term as using Equation (62) where we re-expressed the logarithm as ln n j n k + 1 = ln N n 1 , . . . , n j − 1, . . . , n k + 1, . . . , n d − ln N n 1 , . . . , n d , shows that the correction term has the same form as the corresponding term in the two-state system, Equation (57), namely that of a difference of microcanonical (Boltzmann) entropies of the multi-particle states. It vanishes when all n j are either 0 or 1, as expected for d N and also at stationarity wheṅ P n (t) = 0. In that limitṠ e = −Ṡ i when indeed Equation (60a) gives lim t→∞Ṡ (1) with P j = lim t→∞ P j (t). As far as the entropy productionṠ i (t) is concerned, we thus recover and generalise the result in Section 3.5 on indistinguishable particles in a two-state system, which produce N times the entropy of a single particle. In Section 3.4, it was shown that N distinguishable particles have the same entropy production and flow as the sum of the entropy productions of individual particles. In Sections 3.5 and 3.6, it was shown that the entropy production of indistinguishable particles, which require the states to be represented by occupation numbers, show the N-fold entropy production of the single particle system, provided suitable initialisation, but asymptotically independent of initialisation, provided the stationary state has a unique distribution. The same does not apply to the entropy flow, which generally acquires additional logarithmic terms accounting for the degeneracy of the occupation number states. The extra terms, however, are bound to vanish at stationarity, whenṠ e (t) = −Ṡ i (t).

Random Walk on a Lattice
In this section, we study a particle on a one-dimensional lattice that hops to the right nearest neighbouring site with rate r and to the left with rate , see Figure 8. The case of unequal hopping rates, = r, is generally referred to as an asymmetric random walk and can be seen as a minimal model for the directed motion of a molecular motor on a cytoskeletal filament [41]. The position x of the particle at time t, after N(t) jumps, is where the random hops ∆x i are independent and identically distributed, and x 0 is the initial position at time t = 0. If a is the lattice spacing, the distance increments are ∆x i = +a with probability r/( + r) and ∆x i = −a with probability /( + r). The probability distribution of the particle position is where H(n, t) is the probability that by time t, the particle has hopped N(t) = n times, and P n (x; x 0 ) is the probability that the particle is at position x after n hops starting from x 0 . Since jumping is a Poisson process with rate r + , the random variable N(t) has a Poisson distribution, On the other hand, the distribution of the position x after n jumps is the binomial distribution where k x = (n + (x − x 0 )/a)/2 is the number of jumps to the right, 0 ≤ k x ≤ n with (77) implied to vanish if k x is not integer. From Equation (74), the parity of (x − x 0 )/a and N(t) are identical. Using (76) and (77), the probability distribution in (75) reads where I(n, z) is the modified Bessel function of the first kind of n, z ∈ C, which is defined as [42] I(m, z) = ∞ ∑ j=0 1 j!Γ(j + m + 1) The transition probability is then Using (78) and (80) to calculate the entropy production (4b), we need the following identity for |y − x|/a = |m| ≥ 1, lim which follows immediately from the definition of the modified Bessel function, Equation (79). It indicates that the only transitions that contribute to the entropy production are those where the particle travels a distance equal to the lattice spacing a. Then, the entropy production readṡ see Figure 9. The entropy flow isṠ e (t) = −(r − ) ln(r/ ) independent of t, which owes its simplicity to the transition rates being independent of the particle's position. We are not aware of a method to perform the sum in (82) in closed form and, given that this expression involves terms competing at large times t, we cannot calculate the stationary entropy production lim t→∞Ṡi (t). If we naively assume that the sum in Equation (82) converges such that it is suppressed by the exponential exp (−(r + )t), then the entropy productionṠ i appears to converge to 1 2 (r − ) ln(r/ ). If that were the case,Ṡ =Ṡ i +Ṡ e would converge to a negative constant, while S(t), Equation (1), which vanishes at t = 0 given the initialisation of P(x, t; x 0 ) = δ (x−x 0 )/a,0 , is bound to be strictly positive at all finite t. Given that P(x, t; x 0 ) does not converge, not much else can be said about S(t) orṠ. Numerically, using the GNU Scientific Library [43] implementation of Bessel functions, we find that, asymptotically for large times, Equation (82) isṠ Figure 9.  To take the continuum limit a → 0 of the probability distribution (78), we define v and D such that r + = 2D/a 2 and r − = v/a. Using the asymptotic expansion of I(m, z) in m [42] which is valid for | arg z| < π/2, we obtain in fact the Gaussian distribution, which corresponds to the distribution of a drift-diffusive particle, which is studied in Section 3.9. Therefore, all results derived in Section 3.9, apply to the present system in the continuum limit.

Random Walk on a Ring Lattice
In this section, we extend the system in Section 3.7 to a random walk on a ring lattice of length L > 2, so that 1 ≤ x ≤ L, see Figure 10. The probability distribution P L (x, t) of the particle on the ring follows from the distribution on the one-dimensional lattice P(x, t) in (78), by mapping all positions x + jL on the one-dimensional lattice to position x ∈ {1, 2, . . . , L} on the ring with j being the winding number irrelevant to the evolution of the walker. Then, the distribution on the ring lattice reads, and similarly for the transition probability W(x → y, τ) = P L (y, τ; x). To calculate the entropy production (4b), each pair of points x, y on the lattice is mapped to a pair of points on the ring. For L > 2, as τ → 0 only transitions to distinct, nearest neighbours contribute and the expression for the entropy production simplifies dramatically, S i (t) = (r − ) ln r + L/a ∑ m=1 P L (ma, t; x 0 ) r ln P L (ma, t; x 0 ) P L ((m + 1)a, t; x 0 ) + ln P L (ma, t; x 0 ) P L ((m − 1)a, t; x 0 ) and similarly forṠ While the entropy flowṠ e on a ring is thus identical to that of a particle on a one-dimensional lattice, the entropy productionṠ i on a ring is in principle more complicated, but with a lack of cancellations of √ r/ in the logarithm as found in Section 3.7 and P L reaching stationarity comes the asymptote This is easily derived from lim t→∞ P L (x, t; x 0 ) = 1/L taken into the finite sum of Equation (87). It follows thatṠ(t) =Ṡ i (t) +Ṡ e (t) converges to 0 at large t, as expected for a convergent stationary distribution.
r Figure 10. Simple random walk on an periodic, one-dimensional 'ring' lattice in continuous time. This model generalises the three-state Markov chain discussed in Section 3.2 to L states. The black blob indicates the current position of the random walker. Due to the finiteness of the state space, this process is characterised by a well defined steady-state, which is an equilibrium one for symmetric rates = r.
The case L = 2 and the less interesting case L = 1 are not covered above, because of the different topology of the phase space of L > 2 compared to L = 2. The difference can be observed in the different structure of the transition matrices (34) and (39). The framework above is based on each site having two outgoing and two incoming rates, 2L in total. However, for L = 2 there are only two transitions, which cannot be separated into four to fit the framework above, because even when rates of concurrent transitions between two given states are additive, their entropy production generally is not. The case of L = 2 is recovered in the two-state system of Section 3.1 with α = β = r + , which is at equilibrium in the stationary state.

Driven Brownian Particle
In continuum space, the motion of a freely diffusive particle with diffusion constant D and drift v is governed by the Langevin equationẋ = v + √ 2Dξ(t), where ξ(t) is a Gaussian white noise with zero mean, ξ(t) = 0, and covariance ξ(t)ξ(t ) = δ(t − t ), see Figure 11 [44]. The corresponding Fokker-Planck equation for the probability distribution P(x, t) is [45] ∂ t P(x, t) = −v∂ x P(x, t) + D∂ 2 x P(x, t) .
Assuming the initial condition P(x, 0) = δ(x − x 0 ), the solution to the Fokker-Planck equation is the Gaussian distribution which is also the Green function of the Fokker-Planck Equation (90). We therefore also have the transition probability density from state x to state y over an interval τ, Substituting (91) and (92) into Equation (15) for the internal entropy production of a continuous system giveṡ where the Gaussian integrals can be evaluated in closed form,Ṡ i (t) = lim τ→0 1/(2t) + v 2 /D + v 2 τ/(2Dt) . Taking the limit τ → 0 then gives the entropy production rate [44,46,47],Ṡ see Figure 12. Similarly, following (16), the entropy flow readsṠ e (t) = −v 2 /D independent of time t. AsṠ i (t) = 0, we see that for finite t or v = 0, the system is out of equilibrium with a sustained probability current, so that there is in fact no steady-state distribution. We can verify Equation (94) for the time-dependent internal entropy production by computing the probability current and substituting it together with (91), into (29). As expected, the two procedures return identical results. The independence of the transient contribution 1/(2t) to the internal entropy production on the diffusion constant is remarkable although necessary on dimensional grounds, as a consequence oḟ S i having dimensions of inverse time. The diffusion constant characterising the spatial behaviour of diffusion suggests that it is the temporal, rather than the spatial, features of the process that determine its initial entropy production.
v D Figure 11. Driven Brownian particle on the real line. The black blob indicates the particle's current position.

Driven Brownian Particle in a Harmonic Potential
Consider a drift-diffusive particle such as in Section 3.9 that is confined in a harmonic potential V(x) = 1 2 kx 2 , where k is the potential stiffness, see Figure 13 [48]. The Langevin equation where ξ(t) = 0 and ξ(t)ξ(t ) = δ(t − t ) and the Fokker-Planck equation for Assuming the initial condition P(x, 0) = δ(x − x 0 ), the solution to the Fokker-Plank equation is the Gaussian distribution corresponding to a probability current j(x, t) = (v − kx − D∂ x )P(x, t) of the form .
The transition probability density within τ is then also of Gaussian form, namely Using (97) and (99) in (15) gives the entropy production ratė see Figure 12, and in (16) the external entropy floẇ In the limit t → ∞, the system will reach equilibrium as P(x, t) in Equation (97)  of the effective potential 1 2 kx 2 − vx at temperature D. This is consistent with (100) and (101), since lim t→∞Ṡi (t) = lim t→∞Ṡe (t) = 0. Similarly to drift diffusion on the real line, Equation (94), there is a transient contribution to the entropy production that is independent of the diffusion constant D but does now depend on the stiffness k, which has dimensions of inverse time, through the rescaled time kt. For vanishing potential stiffness, k → 0, we recover Equation (94) for a free drift-diffusion particle. In particular, for v = 0 the entropy production decays algebraically, while for v = 0 it converges to the constant value v 2 /D. For k > 0, the algebraic decay is suppressed exponentially over long timeframes as the process settles into its equilibrium steady-state.
v D Figure 13. Driven Brownian particle in a harmonic potential. This process reduces to the standard Ornstein-Uhlenbeck process upon rescaling x → x + v/k. The black blob indicates the particle's current position. The presence of a binding potential implies that the system relaxes to an equilibrium steady-state over long timeframes.

Driven Brownian Particle on a Ring with Potential
Consider a drift-diffusive particle on a ring x ∈ [0, L) in a smooth potential V(x), Figure 14, initialised at position x 0 . The Langevin equation of the particle is [49][50][51] where ξ(t) is Gaussian white noise. The Fokker-Planck equation is then with V (x) = d dx V(x) and boundary condition P (n) (0, t; x 0 ) = P (n) (L, t; x 0 ) for for all n ≥ 0 derivatives and t ≥ 0. At stationarity, in the limit t → ∞, where ∂ t P(x, t; x 0 ) = 0, the solution to the Fokker-Planck Equation (102) is [29,51,52] where Z is the normalisation constant. The corresponding steady-state probability current j = (v − ∂ x V)P s − D∂ x P s is independent of x by continuity, 0 = ∂ t P = −∂ x j, and reads [45] v D Figure 14. Driven Brownian particle on a ring x ∈ [0, L) with a periodic potential satisfying V(x) = V(x + L). Any finite diffusion constant D > 0 results in a stationary state over long timeframes that is non-equilibrium for v = 0. The black blob indicates the particle's current position.
In order to calculate the entropy production according to (15) and (16) using (17), we need W(x → y; τ) for small τ. As discussed after Equation (17), W(x → y; τ) obeys the Fokker-Planck Equation (102) in the form with lim τ→0 W(x → y; τ) = δ(y − x), so thaṫ to be evaluated under an integral, where δ (y − x) = d dy δ(y − x) will require an integration by parts. As for the logarithmic term, we use [28,45] The entropy flow Equation (16) in the more convenient version Equation (21a) can be obtained easily using Equations (106) and (108) after suitable integration by parts, whereby derivatives of the δ-function are conveniently interpreted as derivatives with respect to y to avoid subsequent differentiation of P(x, t). Since δ(y − x)(y − x) = 0, the factor (y − x)/(2D) needs to be differentiated for a term to contribute. In the absence of a potential, P(x, t) = 1/L at stationarity, so that Equation (111)  (v − V (x)) P(x, t), the entropy flow simplifies further tȯ so that at stationarity, when the current is spatially uniform, lim t→∞Ṡe (t) = − lim t→∞ j(x, t)vL/D as the potential is periodic, entering only via the current. An equivalent calculation ofṠ i on the basis of (20a) giveṡ with the last line identical to Equation (13). By considering the functional derivative δZ/δV(z) in

Run-and-Tumble Motion with Diffusion on A ring
Consider the dynamics of a run-and-tumble particle on a ring x ∈ [0, L) with Langevin equatioṅ x = v(t) + √ 2Dξ(t), where the drift v(t) is a Poisson process with rate α that alternates the speed of the particle between the constants v 1 and v 2 , and ξ(t) is Gaussian white noise, Figure 15. Run-and-tumble particles are widely studied as a model of bacterial motion [53]. The drift being v(t) = v 1 or v(t) = v 2 will be referred to as the mode of the particle being 1 or 2 respectively. Defining P 1 (x, t) and P 2 (x, t) as the joint probabilities that the particle is at position x at time t and in mode 1 or 2 respectively, the coupled Fokker-Planck equations for P 1 and P 2 are whose stationary solution is the uniform distribution lim t→∞ P 1 (x, t) = lim t→∞ P 2 (x) = 1/(2L), as is easily verified by direct substitution. The corresponding steady-state probability currents thus read Figure 15. Run-and-tumble motion with diffusion on a ring x ∈ [0, L). A run-and-tumble particle switches stochastically, in a Poisson process with rate α, between two modes 1 and 2 characterised by an identical diffusion constant D but distinct drift velocities v 1 and v 2 . The two modes are here represented in black and grey, respectively. For arbitrary positive diffusion constant D or tumbling rate α with v 1 = v 2 , the steady state is uniform but generally non-equilibrium.
In the following, we denote by the propagator W(x → y, Q → R; τ) the probability density that a particle at position x in mode Q is found time τ later at position y in mode R. For Q = R, this propagation is a sum over all even numbers m of Poissonian switches, that occur with probability (ατ) m exp (−ατ) /m!, which includes the probability exp (−ατ) of not switching at all over a total of time τ. For Q = R, the propagation is due to an odd number of switches.
For m = 0, the contribution to W(x → y, Q → R; τ) is thus exp (−ατ) W(x → y; τ), with W(x → y; τ) of a drift diffusion particle on a ring, Section 3.11, but without potential, approximated at short times τ by the process on the real line, Equation (92) with drift v = v 1 or v = v 2 according to the particle's mode. For m = 1, the contribution is a single convolution over the time t ∈ [0, τ) at which the particle changes mode, most easily done after Fourier transforming. Before presenting this calculation in real space, we argue that any such convolution will result in some approximate Gaussian with an amplitude proportional to 1/ √ τ multiplied by a term of order (ατ) m . In small τ, therefore only the lowest orders need to be kept, m = 0 for Q = R and m = 1 for Q = R.
More concretely, which in small τ, when v 1,2 τ/ √ 4Dτ 1, so that erf(r + ε) = erf(r) + 2ε e −r 2 / √ π + . . ., expands to whereas W(x → y, Q → Q; τ), the propagator with an even number of mode switches, is given by Equation (92) to leading order in τ, Much of the calculation of the entropy production follows the procedure in Sections 3.9 and 3.11 to be detailed further below. To this end, we also need As far as processes are concerned that involve a change of particle mode, therefore only the transition rates enter, not diffusion or drift. Given a uniform stationary spatial distribution of particles of any mode, mode changes between two modes cannot result in a sustained probability current, even when the switching rates differ, for P 1Ẇ (1 → 2) = P 2Ẇ (2 → 1) at stationarity as in the process discussed in Section 3.1. A probability current and thus entropy production can occur when different particle modes result in a different distribution, Section 3.10, or when mode switching between more than two modes results in a current in its own rights, Sections 3.2 and 3.13. Since the full time-dependent density is beyond the scope of the present work, we calculate entropy flow and production at stationary on the basis of a natural extension of Equations (4), (16) and (21a) to a mixture of discrete and continuous states which immediately follows from Sections 3.9 and 3.11, as the stationary density is constant, P Q = P R = 1/(2L), and only Q = R contribute, with If the drifts are equal in absolute value |v 1 | = |v 2 | = v, then we recover the entropy production of a simple drift-diffusive particle,Ṡ i = v 2 /D. This is because we can think of run-and-tumble as a drift-diffusion particle that changes direction instantly. Since changing the direction produces no entropy, the total entropy production rate should be the same as a drift-diffusion particle. The entropy production can alternatively be derived via (29) by computingṠ i = dx j 2 1 /(DP 1 ) + j 2 2 /(DP 2 ) with the steady-state currents stated above.

Switching Diffusion Process on a Ring
The dynamics of a one-dimensional run-and-tumble particle discussed above can be readily generalised to the so called switching diffusion process [54] by allowing for an extended set {v i } of drift modes i = 1, . . . , M, Figure 16. The corresponding Langevin equation for the particle position on a ring x ∈ [0, L] is almost identical to that of run-and-tumble, namelyẋ = v(t) + √ 2Dξ(t), with the exception that the process v(t) is now an M-state Markov process. In the general case, a single switching rate α is thus not sufficient and the full transition rate matrix α ij needs to be provided. In this formulation, the run-and-tumble dynamics Section 3.12 correspond to the choice M = 2 with symmetric rates α 12 = α 21 = α. Defining P i (x, t) as the joint probability that at time t the particle is at position x and in mode i, thereby moving with velocity v i , the system (114) of Fokker-Planck equations generalises to where the transmutation rates α ij from mode i to mode j are assumed to be independent of position.
To ease notation we use the convention α jj = − ∑ i =j α ji . For a non-vanishing diffusion constant, the stationary solution is uniform for all modes and given by lim t→∞ P i (x, t) = z i /L, where z i is the ith element of the eigenvector z satisfying ∑ j z j = 1 and the eigenvalue relation ∑ j z j α ji = 0, which we assume to be unique for simplicity. The calculation of the steady-state entropy production follows very closely that of run-and-tumble presented above. The conditional transition probabilities including up to one transmutation event read to leading order so that We could perform the calculation of the entropy production using the procedure of Section 3.9 rather than drawing on the operator for i = j, which, however, is used in the following for convenience, see Section 3.11. Substituting (125) and (126) into (20a) and assuming steady-state densities, we arrive at where we have used Equation (126) in the operators containing the δ-functions and Equation (125) in the logarithms. The term ln α ij /α ji is obtained by the same expansion as used in Equation (117), Section 3.12. Both terms contributing to the entropy production above are familiar from previous sections: the first is a sum over the entropy production of M drift-diffusion processes with characteristic drift v i , Section 3.11 without potential, weighted by the steady-state marginal probability z i for the particle to be in state i; the second is the steady-state entropy production of an M-state Markov process with transition rate matrix α ij , which reduces to Equation (4) after integration. Carrying out all integrals, we finally have Unlike run-and-tumble, Section 3.12, the transmutation process in switching diffusion does in general contribute to the entropy production for M > 2, since the stationary state generally does not satisfy global detailed balance. However, contributions to the total entropy production originating from the switching and those from the diffusion parts of the process are effectively independent at steady state, as only the stationary marginal probabilities z i of the switching process feature as weights in the entropy production of the drift-diffusion. Otherwise, the parameters characterising the two processes stay separate in Equation (128). Further, the drift-diffusion contributions of the form v 2 i /D are invariant under the time-rescaling α ij → Tα ij . This property originates from the steady-state distributions P i (x) being uniform and would generally disappear in a potential, Section 3.10.

Discussion and Concluding Remarks
In this work, we calculate the rate of entropy production within Gaspard's framework [11] from first principles in a collection of paradigmatic processes, encompassing both discrete and continuous degrees of freedom. Based on the Markovian dynamics of each system, where we can, we derive the probability distribution of the particle (or particles) as a function of time P(x, t) from Dirac or Kronecker-δ initial conditions P(x, 0) = δ(x − x 0 ), from which the transition probability W(x → y; τ) follows straightforwardly. In some cases, we determine only the stationary density and the (short-time) propagator W(x → y; τ) to leading order in τ. We then use Equation (4) for discrete systems or Equations (20) and (21) for continuous systems to calculate the time-dependent entropy production. We set out to give concrete, exact results in closed form, rather than general expressions that are difficult to evaluate, even when we allowed for general potentials in Section 3.11. In summary, the ingredients that are needed to calculate the entropy production in closed form in the present framework are: (a) the probability (density) P(x, t) to find the system in state x ideally as a function of time t and (b) the propagator W(x → y; τ), the probability (density) that the system is found at a certain state y after some short time τ given an initial state x. If the propagator is known for any time τ, it can be used to calculate the probability P(x, t; x 0 ) = W(x 0 → x; t) for some initial state x 0 . However, this full time dependence is often difficult to obtain. The propagator is further needed in two forms, firstly lim τ→0 ∂ τ W(x → y; τ) when it is most elegantly written as an operator in continuous space, and secondly lim τ→0 ln(W(x → y; τ)/W(y → x; τ)).
For completeness, where feasible, we have calculated the probability current j(x, t) in continuous systems at position x. The mere presence of such a flow indicates broken time-reversal symmetry and thus non-equilibrium. Our results on the discrete systems (Sections 3.1 to 3.8) illustrate two important aspects of entropy production. First, the need of a probability flow P AẆ (A → B) − P BẆ (B → A) between states: in the two-state system Section 3.1 there are no transition rates α and β such that there is a sustained probability flow and therefore, the system inevitably relaxes to equilibrium. However, in the three-state system Section 3.2 the transition rates can be chosen so that there is a perpetual flow (α − β)/3 between any two states and therefore there is entropy production not only during relaxation but also at stationarity. Hence, we can ascertain these as non-equilibrium steady states in the long term limit due to the non-vanishing rate of internal entropy production. Uniformly distributed steady states can be far from equilibrium, as a rigorous analysis on the basis of the microscopic dynamics reveals, although an effective dynamics may suggest otherwise.
Second, we see how the extensivity of entropy production arises in the N-particle systems (Sections 3.4-3.6), independently of whether the particles are distinguishable or not. We therefore conclude that the number of particles in the system must be accounted for when calculating the entropy production, and doing otherwise will not lead to a correct result. This is sometimes overlooked, especially when using effective theories. In the continuous systems (Sections 3.9 to 3.11), which involve a drift v and a diffusion constant D, we always find the contribution v 2 /D to the entropy production emerging one way or another. Moreover, in the case of drift-diffusion on the real line (Section 3.9) we find that the contribution due to the relaxation of the system 1/(2t) is independent of any of the system parameters.
Finally, we have studied two systems (Sections 3.12 and 3.13) where the state space has a discrete and a continuous component. The discrete component corresponds to the transmutation between particle species, i.e., their mode of drifting, whereas the continuous component corresponds to the particle motion. We find that both processes, motion and transmutation, contribute to the entropy production rate essentially independently since any term that combines both processes is a higher-order term contribution in τ, and therefore vanishes in the limit τ → 0.
This work has applications to the field of active particle systems, where particles are subject to local non-thermal forces. In fact, the systems studied in Sections 3.2 and 3.8-3.13 are prominent examples of active systems. We have shown that their entropy production crucially relies on the microscopic dynamics of the system, which are captured by the Fokker-Planck equation (or the master equation for discrete systems) and its solution. However, in interacting many-particle systems, such a description is not available in general. Instead, we may choose to use the Doi-Peliti formalism [55][56][57][58][59][60][61][62][63] to describe the system, since it provides a systematic approach based on the microscopic dynamics and which retains the particle entity.