This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Revisiting Kinetic Monte Carlo Algorithms for Time-dependent Processes: from open-loop control to feedback control

Supraja S. Chittari    Zhiyue Lu zhiyuelu@unc.edu Department of Chemistry, University of North Carolina-Chapel Hill, NC, USA
Abstract

Simulating stochastic systems with feedback control is challenging due to the complex interplay between the system’s dynamics and the feedback-dependent control protocols. We present a single-step-trajectory probability analysis to time-dependent stochastic systems. Based on this analysis, we revisit several time-dependent kinetic Monte Carlo (KMC) algorithms designed for systems under open-loop-control protocols. Our analysis provides an unified alternative proof to these algorithms, summarized into a pedagogical tutorial. Moreover, with the trajectory probability analysis, we present a novel feedback-controlled KMC algorithm that accurately captures the dynamics systems controlled by external signal based on measurements of the system’s state. Our method correctly captures the system dynamics and avoids the artificial Zeno effect that arises from incorrectly applying the direct Gillespie algorithm to feedback-controlled systems. This work provides a unified perspective on existing open-loop-control KMC algorithms and also offers a powerful and accurate tool for simulating stochastic systems with feedback control.

preprint: APS/123-QED

I Introduction

At the molecular scale, biological processes are complex and stochastic.Shahrezaei and Swain (2008); Levine and Hwa (2007) Currently, numerical simulations contribute critical insights into the stochastic dynamics of the systems.Székely Jr and Burrage (2014) One example approach involves solving for the master equation,Earnshaw and Keener (2010); Lee and Othmer (2010); Meister et al. (2014) constructed either through molecular dynamics simulations (e.g., via Markov state model approaches Anderson and Kurtz (2011); Bowman, Pande, and Noé (2013); Husic and Pande (2018)) or experimental results (e.g., kinetic proofreadingNelson and Nelson (2004); Alon (2019)). In this case, if the system is reduced to a few state Markov network, one can numerically solve for the master equation, given the initial probability distribution and the control protocol. Another example, when the system’s state space is too large, is to utilize the Gillespie AlgorithmGillespie (2001) or kinetic Monte Carlo (KMC) simulation to obtain an ensemble of the stochastic trajectories of the process.

Numerous biological processes also respond either to external control or other coupled processes.Iglesias and Ingalls (2010) These stochastic systems are more complex than stationary systems, as their kinetic rates changes over time via open-loop (non-feedback) or closed-loop (feedback) control. Examples of feedback controlled systems span multiple length- and time-scales, from metabolic regulationLorendeau et al. (2015); Atkinson (1965); Goyal et al. (2010) to bacterial chemotaxisYi et al. (2000a); Hamadeh et al. (2011); Yi et al. (2000b) to cell-cycle regulation.Murray (1992); Domian, Reisenauer, and Shapiro (1999); Cross and Tinkelenberg (1991); Li and Murray (1991) Understanding feedback controlled systems is essential in unraveling their dynamics and optimizing their performance. However, it remains challenging to simulate feedback controlled stochastic systems due to the presence of in-time feedback.

Gillespie first proposed a direct KMC method that allows one to simulate the stochastic dynamics for a system that evolves under a constant set of rates.Gillespie (1977) Unfortunately, this method cannot be directly extended to simulate time-inhomogeneous systems, where the system’s dynamical rates changes over time. Naively implementing the direct KMC simulation by discretizing the simulation into a sequence of constant rate windows may lead to an incorrect underestimation of the transition frequency of the systems, which resembles the Zeno effect. In quantum mechanics, the Zeno effect describes the system dynamics being trapped into a single state due to frequent repetitive projective measurements.Möbus and Wolf (2019); Itano et al. (1990); Streed et al. (2006)

In the past few decades, open-loop-control KMC algorithm has been proposed to simulate various time-inhomogeneous biological systems whose kinetic rates changes over time due to an open-loop (non-feedback) control protocol. These works were presented for various biological processes including ion channels in neurons,Anderson, Ermentrout, and Thomas (2015); Ding et al. (2016); Chow and White (1996) RNA folding,Li et al. (2009) and chemical reactions.Anderson (2007); Anderson and Kurtz (2011) In 2007, Anderson proposed a modified next-reaction simulation method, where the transition rate of one possible reaction could change over time due to the occurrence of another possible reaction that takes place in a shorter time.Anderson (2007) In this case, the simulation addresses the changes of the reaction rates by providing a modification to the generation of the waiting time of reactions. Later, a general class of methodsAnderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) were formulated for simulating systems with time-dependent rates. These works address systems that fall into the category of open-loop controlled stochastic systems,Bechhoefer (2021) where the system’s transition rates are controlled by external signal as a function of time according to a given protocol. However, still missing is a general theory and algorithm for simulating feedback controlled stochastic systems, where the protocol is updated at each scheduled measurement time based on the instantaneous measurement outcome.Franklin et al. (2002) The main difficulty in developing a KMC algorithm for feedback controlled systems is that the control protocol at future times is unknown, as it depends on the results of the future measurements of the system.

In this work, we first provide an alternative derivation for the open-loop-controlled KMC, which recapitulates the methods developed in a number of existing references.Anderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) This alternative derivation, based on single-trajectory probability analysis, lays the foundation to the development of a novel algorithm able to simulate systems under in-time feedback control. The validity and the implementation of the algorithm is demonstrated by a Maxwell’s feedback control refrigerator.

II Theory and Algorithms

II.1 Theory: Single-step trajectory probability

This article begins by revisiting the theoretical foundation of the open-loop-control KMC method by providing a pedagogical proof that recapitulates various versions of these algorithms.Anderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) The theory is constructed by comparing the true probability of single-step trajectories and the simulated trajectory probability generated within one step of a modified KMC algorithm. This trajectory analysis not only provides an alternative proof for open-loop-control KMC methods described previouslyAnderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) but also provides the foundation from which a closed-loop-control KMC method can be derived.

Consider a continuous-time discrete-state Markov process that is subject to an external control protocol λ(t)\lambda(t) as an arbitrary function of time tt. The system contains a discrete number of states nsn_{s} and is initialized with probability distribution p(t=0)\vec{p}(t=0). The dynamics of p(t)\vec{p}(t) is characterized by the master equation

dpdt=R^(λ(t))p\frac{d\vec{p}}{dt}=\hat{R}(\lambda(t))\vec{p} (1)

where matrix element Rji(λ(t))R_{ji}(\lambda(t)) is the transient transition probability rates from ii to jj given the control parameter λ\lambda at time tt. The diagonal element satisfying Rii(t)=jiRji(t)R_{ii}(t)=-\sum_{j\neq i}R_{ji}(t) is the negative transient escape rate from state ii at time tt. The master equation evolution of p(t)\vec{p}(t) can also be expressed in terms of the dynamics of ii-th state’s probability:

dpidt=jiRij(λ(t))pj(t)+Rii(λ(t))pi(t)\frac{{\rm d}p_{i}}{{\rm d}t}=\sum_{j\neq i}R_{ij}(\lambda(t))p_{j}(t)+R_{ii}(\lambda(t))p_{i}(t) (2)

For an open-loop controlled system, the control protocol λ(t)\lambda(t) is externally determined. In contrast, for a closed-loop controlled system (e.g., one with a series of feedback measurements), the specific form of λ(t)\lambda(t) may depend on the system’s state.

Each individual step of a KMC simulation is concerned with only generating the next stochastic event (i.e., evolving to state state xk+1x_{k+1} at time tk+1t_{k+1} from the previous state xkx_{k} and time tkt_{k}). This event can be expressed as a single-step trajectory Xsingle=(xk,tk,x,t)X_{\rm single}=(x_{k},t_{k},x^{\prime},t^{\prime}) given the previous step. The conditional probability for this single-step trajectory can be written as

p[x,t|xk,tk]=etktRxkxk(t)dtRxxk(t)p[x^{\prime},t^{\prime}|x_{k},t_{k}]=e^{\int_{t_{k}}^{t^{\prime}}{R_{x_{k}x_{k}}(t){\rm d}t}}R_{x^{\prime}x_{k}}(t^{\prime}) (3)

which is also a joint probability distribution of the next event’s time tt^{\prime} and state xx^{\prime}. This formula is true for any Markov dynamics regardless of whether the dynamical rates are constants or the rates change over time. We show below that, in the case of time-independent or time-dependent rates, the direct Gillespie Algorithm or an open-loop-control KMC algorithm, respectively, can correctly capture the dynamics.

Time-independent rates: In the case where the dynamics of the system are constant over time 111Here constant rate over time is used to describe the time period between two consecutive stochastic events. Naturally, when the system state changes after the next event, the possible transitions and their rates are naturally updated., the direct Gillespie AlgorithmGillespie (1977) is sufficient. From a probability theory perspective, the single-step transition probability of the next state xx^{\prime} and next time tt^{\prime} can be factored into the product of two statistically independent distributions and can be generated separately from their own probability distributions Px(x)P_{x}({x^{\prime}}) and Pt(t)P_{t}({t^{\prime}}).

p[x,t|xk,tk]\displaystyle p[{x^{\prime}},{t^{\prime}}|x_{k},t_{k}] =Pt(t)Px(x),t>tk,xxk\displaystyle=P_{t}({t^{\prime}})\cdot P_{x}({x^{\prime}})~{}~{},~{}t^{\prime}>t_{k},~{}x^{\prime}\neq x_{k} (4)
=e(ttk)RxkxkRxxk\displaystyle=e^{({t^{\prime}}-t_{k})\cdot{R_{x_{k}x_{k}}}}\cdot R_{{x^{\prime}}x_{k}}

In this case, the direct KMC Gillespie (1977) is carried out by generating the next transition time tt^{\prime} according to Pt(t)eRxkxk(ttk)P_{t}({t^{\prime}})\propto e^{{R_{x_{k}x_{k}}\cdot({t^{\prime}}-t_{k})}} and generating the next state xx^{\prime} according to the state probability Px(x)RxxkP_{x}({x^{\prime}})\propto R_{{x^{\prime}}x_{k}}.

Time-dependent rates: If the rates change over time, the direct KMC approachGillespie (1977) fails to generate the correct dynamics since the next event’s time and state are statistically correlated. In this case, we can still factorize the joint probability of tt^{\prime} and xx^{\prime}, P(x,t)p[x,t|xk,tk]P({x^{\prime}},{t^{\prime}})\equiv p[{x^{\prime}},{t^{\prime}}|x_{k},t_{k}] as the product of two probability distributions:

P(x,t)=Ptmarg(t)Pxcond(x|t)P({x^{\prime}},{t^{\prime}})=P^{\text{marg}}_{t}(t^{\prime})\cdot P^{\text{cond}}_{x}({x^{\prime}}|{t^{\prime}}) (5)

where the marginal distribution of the transition time tt^{\prime} (given the previous xkx_{k} and tkt_{k}) is denoted by

Ptmarg(t)\displaystyle P^{\text{marg}}_{t}(t^{\prime}) =xxkp[x,t|xk,tk]\displaystyle=\sum_{{x^{\prime}}\neq x_{k}}p[{x^{\prime}},t^{\prime}|x_{k},t_{k}] (6)
=etktRxkxk(t)𝑑tRxkxk(t)\displaystyle=-e^{\int_{t_{k}}^{t^{\prime}}R_{x_{k}x_{k}}(t)dt}\cdot R_{x_{k}x_{k}}(t^{\prime})

and the conditional probability distribution of next state xx^{\prime} conditioned on the transition time being tt^{\prime} is

Pxcond(x|t)=Rxxk(t)Rxkxk(t)P^{\text{cond}}_{x}({x^{\prime}}|{t^{\prime}})=\frac{R_{{x^{\prime}}x_{k}}(t^{\prime})}{-R_{x_{k}x_{k}}(t^{\prime})} (7)

In this case, a modified KMC algorithm should be capable of faithfully generating the stochastic trajectory. In one simulation step of the modified KMC algorithm, one first generates the next transition’s time t=tt^{\prime}=t^{*} according to Eq. 6 and then generates the next state xx^{\prime} according to Eq. 7 given the proposed time t=tt^{\prime}=t^{*}. One can verify that the generated pair of xx^{\prime} and tt^{\prime} follows the true single-step trajectory probability distribution (Eq. 3). This analysis is applicable to arbitrary time-dependent processes, where the system’s rates change over time either due to (1) open-loop control according to a scheduled protocolAnderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) or (2) closed-loop control with a series of feedback measurements.

II.2 Review of open-loop-control KMC: General algorithm

In this section, we review the open-loop-control KMC methods previously described in Anderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009). This review also serves as an alternative derivation and justification of these algorithms in the language of single-step trajectory generation introduced in Section II.1. The representation of the single-step trajectory probability as the product of a marginal probability and a conditional probability, Eq. 5, allows one to separately generate the next transition’s time tt^{\prime} and state xx^{\prime}, even when the time-dependence of the system’s rate creates statistical correlation between tt^{\prime} and xx^{\prime}.

Generating transition time tt^{\prime}: The random generation of transition time t>tkt^{\prime}>t_{k} according to the marginal probability density in Eq. 6 can be realized by first obtaining the cumulative density function

c.d.f.(t)=1etktRxx(t)dt\text{c.d.f.}(t^{\prime})=1-e^{\int_{t_{k}}^{t^{\prime}}R_{xx}(t){\rm d}t} (8)

and then generating a random number uu following a uniform distribution between 0 and 11, and finally solving for tt^{*} according to the following equation:

u=c.d.f.(t)=1etktRxx(t)dtu=\text{c.d.f.}(t^{*})=1-e^{\int_{t_{k}}^{t^{*}}R_{xx}(t){\rm d}t} (9)

Or equivalently, for a random number v=1uv=1-u also following a uniform distribution between 0 and 11, one can solve tt^{*} as the root of the following equation

ln(v)=H(t),t(tk,)\ln(v)=H(t^{*})~{},~{}t^{*}\in(t_{k},\infty) (10)

where

H(t)=tktRxx(t)dt,t(tk,)H(t^{*})=\int_{t_{k}}^{t^{*}}R_{xx}(t){\rm d}t~{},~{}t^{*}\in(t_{k},\infty) (11)

and Rxx(t)R_{xx}(t) is the negative escape rate from state xx at arbitrary time tt.

Generating the next state xx^{\prime}: Once the transition time tt^{*} is generated, the selection of the next state xx^{\prime} is straightforward – the new state’s probability is proportional to their transient transition rates evaluated at the chosen transition time tt^{*}, as defined in Eq. 7. This resembles the state generation in the direct KMC method, with the only difference being the probability to jump to state xx^{\prime} here is proportional to the transient rate Rxxk(t)R_{x^{\prime}x_{k}}(t^{*}) evaluated at the chosen time tt^{*}.

To summarize, one simulation step of the open-loop-control KMC algorithm can be enumerated in Section II.2. Furthermore, by including appropriate approximations (see Section II.3), one can reproduce various open-loop-control KMC algorithms previously described in Anderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009).

{algorithm}

Open-loop-control KMC

1:  The starting time of the current simulation step is tt with the starting state xx.
2:  Generate the list of all possible states that the system can jump to, and evaluate the time-dependent escape rate from state xx as Rxx=xxRxx(t)-R_{xx}=\sum_{x^{\prime}\neq x}R_{x^{\prime}x}(t) where the summation takes all possible new states xx^{\prime} into consideration.
3:  Generate a random number v(0,1]v\in(0,1] following a uniform distribution. Obtain the next event time tt^{*} by solving for t>tt^{*}>t from Eq. 10.
4:  Given the proposed transition time tt^{*}, propose the transition event (e.g., to state xx^{\prime}) with the probability proportional to their transient transition rates p(x)Rxx(t)p(x^{\prime})\propto R_{x^{\prime}x}(t^{*}) (Eq. 7).
5:  Update the system state to xx^{\prime} and time to tt^{*}. Continue the iteration by going to step 2.

II.3 Piece-wise approximations to open-loop control

In practice, solving for the next event’s time tt^{*} by a given random number vv and the equation Eq. 10 for arbitrarily complex time-dependent rates may be challenging. We now briefly review a few ways to approximately solve for this integral equation. Various methods have been proposed in simulating specific biological processes.Anderson, Ermentrout, and Thomas (2015); Chow and White (1996); Ding et al. (2016); Li et al. (2009) For illustrative purposes, we demonstrate two approximations and sketch the corresponding algorithms for: (i) piece-wise linear function approximation and (ii) piece-wise step function approximation for the escape rate Rxx(t)-R_{xx}(t).

Here we illustrate the algorithms by focusing on one step of the simulation. Let us denote the previous state as xk=xx_{k}=x and the previous time tk=tlastt_{k}=t_{\rm last}; then the algorithm’s task is to generate the next event’s time tt^{*} and the next state xx^{\prime}. As illustrated in Fig. 1a, the negative escape rate from the state xx, Rxx(t)R_{xx}(t) (shown as black curve) can be approximated by (i) a consecutive set of straight line segments (top panel), or (ii) approximated by a set of step-wise step functions (bottom panel).

Refer to caption
Figure 1: Approximating open-loop protocol control. a) Graphical representation of both (i) piece-wise linear rate function and ii) piece-wise step-function rates. The black curve is the actual negative escape rate Rxx(t)R_{x}x(t). The approximation breaks the time into multiple windows. Each window wiw_{i} starting at time τi\tau_{i} is represented by shaded regions, and the colored straight lines represent the approximated piece-wise negative escape rate. b) Cartoon of one possible trajectory of the system. Here the trajectory within the step of simulation is shown by the bold black lines; previous and future trajectory are shown by light gray lines. This simulation step is conditioned on the starting time tlastt_{\rm last} and state xx, and proposes to jumped to a new state xx^{\prime} at time t>tkt^{*}>t_{k}.

(i) Piece-wise linear escape rates. Let us denote each window wiw_{i} by a time interval (τi,τi+1)(\tau_{i},\tau_{i+1}) and also set the beginning of the first window at τ1=tlast\tau_{1}=t_{\rm last}. The negative escape rate from state xx at each window’s left edge is denoted by Rxxτi=xxRxx(τi)R_{xx}^{\tau_{i}}=-\sum_{x^{\prime}\neq x}R_{x^{\prime}x}(\tau_{i}). Under this assumption, the numerical integration involved in Eqs. 10 and 11 can be considered as:

H(t)=A1+A2+Ai1+ττitRxx(t)dtH(t^{*})=A_{1}+A_{2}+\cdots A_{i-1}+\int_{\tau_{\tau_{i}}}^{t^{*}}R_{xx}(t){\rm d}t (12)

for τi<t<τi+1\tau_{i}<t^{*}<\tau_{i+1}. Here the integral for each window starting from τ1=tlast\tau_{1}=t_{\rm last} is defined as

Ai=(τi+1τi)Rxxτi+Rxxτi+1Rxxτi2(τi+1τi)A_{i}=(\tau_{i+1}-\tau_{i})R_{xx}^{\tau_{i}}+\frac{R_{xx}^{\tau_{i+1}}-R_{xx}^{\tau_{i}}}{2}(\tau_{i+1}-\tau_{i}) (13)

Here, AiA_{i} is the integrated negative escape rate within the window wiw_{i} defined from τi\tau_{i} to τi+1\tau_{i+1}. Successive windows wiw_{i} starting from i=1i=1 will be evaluated until the jj-th window where the transition time is chosen, which can be identified by i=1j1Ai<lnv<i=1jAi\sum_{i=1}^{j-1}A_{i}<-\ln v<\sum_{i=1}^{j}A_{i}. Given Eqs. 12 and 13, we can solve for the tt^{*} according to Eq. 10 in sequence, starting from i=1i=1 and continuing until the appropriate tt^{*} can be drawn from the jj-th window according to:222In practical implementation of the numerical code, when qiqi1q_{i}\approx q_{i-1}, the quadratic equation reduces to the linear, which can be solved from Eq. 15.

i=1j1Ai+Rxxτj(tτj)+Rxxτj+1Rxxτj2(τj+1τj)(tτj)2=lnv\sum_{i=1}^{j-1}A_{i}+R_{xx}^{\tau_{j}}(t^{*}-\tau_{j})+\frac{R_{xx}^{\tau_{j+1}}-R_{xx}^{\tau_{j}}}{2(\tau_{j+1}-\tau_{j})}(t^{*}-\tau_{j})^{2}=\ln v (14)

(ii) Piece-wise step-function escape rates. When the time dependent escape rate from state xx is considered as a piece-wise step function, where Rxx(t)=RxxτiR_{xx}(t)=R_{xx}^{\tau_{i}} for each window t(τi,τi+1)t\in(\tau_{i},\tau_{i+1}), we can determine the next event’s time tt^{*} by solving for a linear equation

(tτk)Rxxτk+i=1k1Bi=lnv(t^{*}-\tau_{k})R_{xx}^{\tau_{k}}+\sum_{i=1}^{k-1}B_{i}=\ln v (15)

where vv is a random number uniformly distributed between 0 and 11 and the integrated negative escape rate for each window is denoted by

Bi=(τi+1τi)RxxτiB_{i}=(\tau_{i+1}-\tau_{i})R_{xx}^{\tau_{i}} (16)

By solving for the above equations starting from the first window, one can find the next event’s time as t(τk,τk+1)t^{*}\in(\tau_{k},\tau_{k+1}) occurring at kk-th window. We demonstrate this method in a 1D lattice diffusion problem as shown in the Appendix.

II.4 Closed-loop feedback controlled systems: General algorithm

Consider a feedback control scheme where a scheduled series of measurements will be taken at a set of observation time points τ1,,τi,τi+1,τi+k,\tau_{1},\cdots,\tau_{i},\tau_{i+1},\cdots\tau_{i+k},\cdots (see Fig. 2a). At each observation time τj\tau_{j}, the measurement outcome is determined by the transient state of the stochastic system: mj=x(τj)m_{j}=x(\tau_{j}).333Here the measurement of the system may not be as detailed as the specific state that the system is in. It is possible that a subset of states will give a same measurement outcome (i.e., coarse-grained measurement). The method can be applied to both cases. Immediately, the measurement outcome updates the system’s kinetic rates via a rapid feedback control mechanism. Let us denote the control signal as an explicit function of time λ(t)\lambda(t), which can be represented by a piece-wise function where each piece is defined for the time between two consecutive measurements and is determined by all previous measurement outcomes. The actual protocol can be piece-wise constant (see illustrative example in Sections II.5 and III.1), or in more general cases, could be a solution of an ODE parameterized by the measurement outcomes at each feedback measurement. The general algorithm proposed here is applicable to arbitrary functional forms of the control protocol.

The key to correctly simulate the feedback controlled system is to recognize that, when carrying out each step of a KMC simulation, one only needs to predict the next transition event given the present state and the transition rates set by the control protocol. Now consider a system placed at state xx and time tlastt_{\rm last} set by the previous step of simulation. Without losing generality, let us consider the current time as τi1<tlast<τi\tau_{i-1}<t_{\rm last}<\tau_{i}, so that the current system has gone through the (i1)(i-1)-th measurement and the very next feedback measurement (the ii-th measurement) will occur at a future time τi\tau_{i}.

To carry out the present simulation step and predict the next transition time tt^{*} and next state xx^{\prime}, there are only two possible scenarios to consider, which are separated by a milestone time – the immediate next measurement time, τi\tau_{i}. The two scenarios are the following: (i) the next event takes place at a time before the milestone time (t<τit^{*}<\tau_{i}, Fig. 2b[i]) or (ii) the next event takes place at any time after the milestone time (t>τit^{*}>\tau_{i}, Fig. 2b[ii]). The milestone time τi\tau_{i} is highlighted by the color scheme transition from red to yellow in Fig. 2b[ii]. This color scheme is also used in Eq. 17 and Eq. 18.

In the first case, one does not need to consider the control protocol after the next measurement and only needs to consider the protocol before τi\tau_{i}. For this case, the control protocol for any t<τit<\tau_{i} is fully determined without any ambiguity, given the historical trajectory of the simulation. This pre-milestone part of control protocol before τi\tau_{i} can be generally represented by the following function and is fully determined:

λ(t)={λ1(t;m1)τ1t<τ2λi1(t;m1,,mi1)τi1t<τi\lambda(t)=\begin{cases}\lambda_{1}\left(t;m_{1}\right)&\tau_{1}\leq t<\tau_{2}\\ \vdots\\ {\color[rgb]{0.65,0,0}\lambda_{i-1}(t;m_{1},\cdots,m_{i-1})}&{\color[rgb]{0.65,0,0}\tau_{i-1}\leq t<\tau_{i}}\end{cases} (17)

where λj\lambda_{j} denotes the control protocol for time window τj<tτj+1\tau_{j}<t\leq\tau_{j+1}, and its functional form can be impacted by the all previous measurement results m1,m2,,mjm_{1},m_{2},\cdots,m_{j} through any prescribed feedback mechanisms. Here, jj must be smaller than ii.

In the second case, we need to treat the system with a step-wise protocol where the system still evolves according to the pre-milestone protocol (Eq. 17) up to the milestone time τi\tau_{i}, and then the protocol is updated to a future post-milestone protocol. It may appear that the post-milestone protocols (for t>τit>\tau_{i}) cannot be fully determined due to the ambiguity of the future system states. However, as we have argued, each step of the KMC simulation involves the generation of a single step trajectory that starts at (x,tlast)(x,t_{\rm last}), remains at state xx and only jumps to an unknown state xx^{\prime} at a future unknown transition time tt^{*}. Thus, for any unknown transition time t>τit^{*}>\tau_{i} larger than the milestone time, each futuristic feedback measurement according to the trajectory under consideration will return a measurement outcome based on the system state xx. In other words, the post-milestone protocol for any future tτit\geq\tau_{i} is denoted by:

λ~(t)={λ~i(t;m1,,mi1,x)τit<τi+1λ~i+1(t;m1,,mi1,x,x)τi+1t<τi+2λ~i+1(t;m1,,mi1,x,x,x)τi+2t<τi+3{\color[rgb]{0.85,0.34,0.17}\tilde{\lambda}(t)}=\begin{cases}{\color[rgb]{0.85,0.34,0.17}\tilde{\lambda}_{i}(t;m_{1},\cdots,m_{i-1},x)}&{\color[rgb]{0.85,0.34,0.17}\tau_{i}\leq t<\tau_{i+1}}\\ {\color[rgb]{0.85,0.34,0.17}\tilde{\lambda}_{i+1}(t;m_{1},\cdots,m_{i-1},x,x)}&{\color[rgb]{0.85,0.34,0.17}\tau_{i+1}\leq t<\tau_{i+2}}\\ {\color[rgb]{0.85,0.34,0.17}\tilde{\lambda}_{i+1}(t;m_{1},\cdots,m_{i-1},x,x,x)}&{\color[rgb]{0.85,0.34,0.17}\tau_{i+2}\leq t<\tau_{i+3}}\\ {\color[rgb]{0.85,0.34,0.17}\vdots}\end{cases} (18)

which is determined without ambiguity because all future measurements must detect the system at the current state xx (i.e., mi,mi+1,mi+2,=xm_{i},m_{i+1},m_{i+2},\cdots=x). In this argument, all futuristic protocols are then determined by the combination of the historical measurement outcomes and the asserted futuristic measurement outcomes, m1,m2,,mi2,mi1,x,x,x,m_{1},m_{2},\cdots,m_{i-2},{\color[rgb]{0.65,0,0}m_{i-1}},{\color[rgb]{0.85,0.34,0.17}x,x,x,\cdots}.

{algorithm}

Closed-loop-control KMC

1:  In the current simulation step, the last transition event takes place between the (i1)(i-1)-th and ii-th measurement τi1<t<τi\tau_{i-1}<t<\tau_{i}, and landing at the present state xx; the control protocol λ(t)\lambda(t) can be determined up to t<τit<\tau_{i}, (see Eq. 17) with the last measurement outcome being mi1=x(τi1)m_{i-1}=x(\tau_{i-1}). (See Fig. 2)
2:  To project future control protocols for tτit\geq\tau_{i}, take the current state xx for all future measurements. The projected control protocols are written in Eq. 18.
3:  Generate the list of all possible states that the system can jump to from current state xx, and evaluate the time-dependent escape rate from state xx as Rxx(t)=xxRxx(t)-R_{xx}(t)=\sum_{x^{\prime}\neq x}R_{x^{\prime}x}(t). This time-dependent rates Rxx((λ(t)))R_{x^{\prime}x}((\lambda(t))) are determined by the protocol λ(t)\lambda(t). The control protocol are described by the combination of the deterministic part for t<τit<\tau_{i} Eq. 17 and the projected part for tτit\geq\tau_{i} Eqs. 17 and 18.
4:  Generate a random number v(0,1]v\in(0,1] following a uniform distribution. Obtain the next event time tt^{*} by solving for t>tt^{*}>t from Eq. 10, where H(t)H(t^{*}) is defined by Eq. 11 where the rates Rxx(λ(t))R_{xx}(\lambda(t)) are dictated by the protocols defined in Eqs. 17 and 18.
5:  Given the proposed transition time tt^{*}, propose the transition event (e.g., to state xx^{\prime}) with the probability proportional to their transient transition rates (Eq. 7). If t<τit^{*}<\tau_{i}, the transient rates are determined by the deterministic protocol from Eq. 17. If t>τit^{*}>\tau_{i}, the rates are determined by the projected protocol from Eq. 18.
6:  Update the system time to tt^{*} and state to xx^{\prime}. If the time duration between tt and tt^{*} includes one or more scheduled feedback measurements, also record measurement results of state xx.
7:  Continue the iteration by returning to step 2.

In summary, through our single-step trajectory probability argument introduced in Section II.1, we are able to assert a fully determined protocol for a feedback control system. This determined protocol combines Eq. 17, the pre-milestone protocol λ(t)\lambda(t) for t<τit<\tau_{i}, which is fully determined by historical feedback measurements, and Eq. 18, the futuristic post-milestone protocol λ~(t)\tilde{\lambda}(t) for t>τit>\tau_{i}, which appears to be unknown due to the future feedback measurement outcomes. As a result, even for closed-loop controlled systems, one can utilize an open-loop-control KMC algorithmAnderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) reviewed in Section II.2 to generate the next transition event according to the correct probability distribution Eqs. 5, 6 and 7. This general algorithm is shown in Section II.4. For illustrative purpose, the following demonstrates a simple application of the proposed feedback-control KMC algorithm.

II.5 Application: Piece-wise-constant feedback control

Here, we demonstrate the proposed new algorithm with a general yet simple scenario. In this example, the rates within each measurement window remain constant and are instantaneously updated based on each measurement. For more complicated feedback control regimes (e.g., the control protocol evolves deterministically in time according to differential equations parameterized by historical measurement outcomes), one can simply extend this algorithm in accordance with general feedback controlled KMC algorithm described in Section II.4.

Refer to caption
Figure 2: Closed-loop control protocol. a) Graphical representation of a series of scheduled measurements occurring at τi1,τ,,τi+k\tau_{i-1},\tau,\cdots,\tau_{i+k}. b) Two types of single-step trajectories illustrated in the piece-wise step-function feedback control: i) the next event occurs prior the the next scheduled measurement evolved using the determined protocol based on the last measurement Rxx(λa)R_{xx(\lambda_{a}}) or ii) event occurs after the kk additional measurements, and the rate is projected by fixing the future measurements to be state xx resulting in control signal being λb\lambda_{b}, and the escape rate is Rxx(λb)R_{xx}(\lambda_{b}).

We here describe a model algorithm where the control parameter λ(t)\lambda(t) between two consecutive measurement events are always maintained at a constant value. In this case, both the determined protocol λi1(t)=λa,tlast<t<τi\lambda_{i-1}(t)=\lambda_{a},~{}t_{\rm last}<t<\tau_{i} and the projected protocols λ~(t)=λb,t>τi\tilde{\lambda}(t)=\lambda_{b},~{}t>\tau_{i} are both piece-wise constants. Therefore, the escape rate from state xx is a piece-wise constant function with only two pieces (see Fig. 2b):

Rxx(λ(t))={Rxx(λa)tlastt<τiRxx(λb)tτiR_{xx}(\lambda(t))=\begin{cases}R_{xx}(\lambda_{a})&~{}t_{\rm{last}}\leq t<\tau_{i}\\ R_{xx}(\lambda_{b})&~{}t\geq\tau_{i}\end{cases} (19)

In this case, the simulation chooses the next event’s occurrence time by solving for the solution of the piece-wise function:

ln(v)={Rxx(λa)(ttlast)t<τiRxx(λb)(tτi)+Rxx(λa)(τitlast)tτi\ln(v)=\begin{cases}R_{xx}(\lambda_{a})(t^{*}-t_{\rm last})&t<\tau_{i}\\ R_{xx}(\lambda_{b})(t^{*}-\tau_{i})+R_{xx}(\lambda_{a})(\tau_{i}-t_{\rm last})&t\geq\tau_{i}\end{cases} (20)

where vv is a uniformly distributed random number between 0 and 11, and the r.h.sr.h.s of the equation is defined by Eq. 11. There are two types of possible simulation outcomes of the single-step trajectories. At possibility #1\#1 (top panel of Fig. 2b), when the next event occurs before the next measurement, tlast<t<τit_{\rm{last}}<t^{*}<\tau_{i}, the dynamical rates remains unchanged throughout the time, and the rates was determined by the last measurement outcome mi1=x(τi1)m_{i-1}=x(\tau_{i-1}) (see red shaded regions in Fig. 2b). At possibility #2\#2 (bottom panel of Fig. 2b), when the next event occurs after kk more future measurements τi+k1<t<τi+k\tau_{i+k-1}<t^{*}<\tau_{i+k}, for k=1,2,k=1,2,\cdots, the dynamics are initially governed by the old rates R^(λa)\hat{R}(\lambda_{a}) before the ii-th measurement, and then by a new rate R^(λb)\hat{R}(\lambda_{b}) after τi\tau_{i} (see yellow shaded regions in Fig. 2b). We demonstrate this method in a two-state refrigerator model in Section III.1.

III Results and Discussion

III.1 Demonstration: 2-state feedback control Maxwell’s Refrigerator

To demonstrate the new feedback controlled KMC algorithm proposed in Section II.4, we utilize an example feedback control system whose behavior can be solved analytically. Feedback control systems have been extensively studies in various stochastic systemsBechhoefer (2021); Annby-Andersson et al. (2022); Horowitz and Jacobs (2014); Horowitz and Parrondo (2011a, b); Horowitz and Vaikuntanathan (2010); Bhattacharyya and Jarzynski (2022); Sagawa and Ueda (2012a, 2010, b); Parrondo, Horowitz, and Sagawa (2015). Here we choose to simulate the stochastic trajectories of a 2-state refrigerator inspired by referenceMandal, Quan, and Jarzynski (2013).

Consider a 2-level system coupled to a heat bath. The ground state level’s energy is E0=0E_{0}=0 and the excited level’s energy is controlled externally by a binary toggle switch. At control AA the excited state energy is E1A=1E_{1}^{A}=1; at control condition BB, E1B=ϵ>1E_{1}^{B}=\epsilon>1. The feedback control is facilitated by a periodic sequence of instantaneous measurements to the system’s state at times τi=i/ν\tau_{i}=i/\nu, where ν\nu is the measurement frequency. If the measurement detects the system at the ground state “0”, the control is switched to BB, and if excited state “1”, control is AA(see Fig. 3a).

This system falls into the category of the step-wise constant feedback control scenario (discussed in II.5). In this case, the system evolves either according to the transition rates set by control condition AA or by condition BB. At each instantaneous time, the transition rates takes the Arrhenius form Rij=eBijEjR_{ij}=e^{B_{ij}-E_{j}}, where we have taken the unit such that the inverse temperature β=1/(kBT)=1\beta=1/(k_{B}T)=1. In our demonstration, we set the barrier for the transition to Bij=2B_{ij}=2, and set the energies according to E1A=1E_{1}^{A}=1, and E1B=ϵ=1.5E_{1}^{B}=\epsilon=1.5. Under this feedback control, it was shown that the system behaves as a refrigerator, constantly drawing energy from the heat bath and performs work against the external control. This refrigerator does not require energy expenditure but rather operates at the cost of information obtained via the measurements. For a comprehensive overview of the definition of heat and work in the stochastic systems, refer to the book Sekimoto . For the connection between information and thermodynamic entropy, a few representative works can be found in Penrose (2005); Bennett (1973); Landauer (1961); Mandal and Jarzynski (2012); Zurek (1989); Deffner (2013); Strasberg et al. (2013); Sagawa and Ueda (2012a, 2010, b); Parrondo, Horowitz, and Sagawa (2015); Lu, Mandal, and Jarzynski (2014).

At each stochastic transition from the ground state to the excited state, the system draws from the heat bath energy Qsys=1Q_{\rm sys}=1 (for control AA) or Qsys=ϵQ_{\rm sys}=\epsilon (for control BB). At the transition from excited state to the ground state, the system’s heat gain is Qsys=1Q_{\rm sys}=-1 (for control AA) and Qsys=ϵQ_{\rm sys}=-\epsilon (for control BB). At any schedule measurement causing a control switch from AA to BB (the system is at the ground state), there is no work or heat exchange (W=0W=0, Q=0Q=0). At the scheduled measurement causing a control switch from BB to AA, the system performs positive work to the controller Wext=ϵ1W_{\rm ext}=\epsilon-1, and there is no heat exchange Q=0Q=0 within the instantaneous measurement time. By counting the frequencies of the stochastic transitions of system (0 to 11 or 11 to 0) under different control conditions AA and BB respectively, one can calculate the average heat rate (the average heat drawn by the system per unit time).

Refer to caption
Figure 3: Two-state refrigerator through periodic feedback control. a) i) Design of energy landscape of two-state system in two different conditions and ii) feedback control decision occurring at each measurement time. b) Time-averaged thermodynamic properties of the refrigerator including (left) information rate and (right) entropy production rate computed under different feedback measurement frequencies. To demonstrate the artificial Zeno effect, both the correct feedback controlled KMC method (correct) and an naively implemented direct KMC method (incorrect) are shown. c) System’s thermodynamic efficiency (η1\eta\leq 1) calculated under different feedback control frequencies with both the correct and the incorrect algorithms.

By implementing the feedback controlled KMC algorithm, we are able to obtain an ensemble of 100 statistically independent stochastic trajectories from such a feedback controlled refrigerator. Each trajectory is of time length 500 and we exclude the initial relaxation period of length 100 from statistics. From the trajectory, one can compute the bath’s entropy change rate, which is equal to the total entropy change rate of the system and the bath:

S˙tot=J01A(E0E1A)+j01B(E0E1B)T\dot{S}_{tot}=\frac{J^{A}_{0\rightarrow 1}\cdot(E_{0}-E_{1}^{A})+j^{B}_{0\rightarrow 1}\cdot(E_{0}-E_{1}^{B})}{T} (21)

where the net transition current JJ is defined by the difference between the detailed currents:

J01A\displaystyle J^{A}_{0\rightarrow 1} =j01Aj10A\displaystyle=j^{A}_{0\rightarrow 1}-j^{A}_{1\rightarrow 0} (22)
J01B\displaystyle J^{B}_{0\rightarrow 1} =j01Bj10B\displaystyle=j^{B}_{0\rightarrow 1}-j^{B}_{1\rightarrow 0} (23)

Furthermore, since each measurement is binary, one can calculate the information rate simply by multiplying the information per measurement with the measurement frequency: kBI˙=νln2k_{B}\dot{I}=\nu\ln 2. Finally, we also computed the efficiency of the refrigerator as the entropy decrease rate over the information gain rate:

η=S˙totkBI˙1\eta=\frac{-\dot{S}_{tot}}{k_{B}\dot{I}}\leq 1 (24)

which characterizes the system’s ability to decrease entropy at the expenditure of information change. Notice that according to the generalized second law of thermodynamics S˙tot+kBI˙0\dot{S}_{tot}+k_{B}\dot{I}\geq 0,Sagawa and Ueda (2012a, b, 2010); Parrondo, Horowitz, and Sagawa (2015), the efficiency must be lower than or equal to 1. The simulation results for a range of measurement frequencies are shown in Fig. 3b-c.

One can verify the proposed feedback controlled KMC by comparing its result to the analytical solution of the system. In the limit of the infinitely high frequency measurements, ν1\nu\gg 1, one can obtain an effective constant rate matrix of the system and analytically obtain its average heat rate and entropy change rate. Due to infinitely frequent measurements, the system’s transition rate from state 11 to 0 is always equal to R01eff=R01A=e1R^{\rm eff}_{01}=R^{A}_{01}=e^{-1} and the system’s transition rate from state 0 to 11 is always equal to R10eff=R10B=e2R^{\rm eff}_{10}=R^{B}_{10}=e^{-2}. As a result, the effective rate matrix under infinite frequency feedback control is

R^eff=[e2e1e2e1]\hat{R}^{\rm eff}=\begin{bmatrix}-e^{-2}&e^{-1}\\ e^{-2}&-e^{-1}\end{bmatrix} (25)

The steady state probability for this system can be written as (p0ss,p1ss)=(e1+e,11+e)(p^{\rm ss}_{0},p^{\rm ss}_{1})=(\frac{e}{1+e},\frac{1}{1+e}). This allows us to compute the detailed transition current from 0 to 1 as e1+ee2\frac{e}{1+e}e^{-2}, and current from 1 to 0 as 11+ee1\frac{1}{1+e}e^{-1}. Due to the frequent measurement, each transition from 0 to 1 must occur under control BB, which takes energy ϵ\epsilon from the bath, and each transition from 1 to 0 must occurs under control AA, which deposits energy 11 into the bath. As a result, for a system at the steady state (no system entropy change), the total entropy change of the system and the bath is purely the bath entropy change with the rate

limνS˙tot=j10A1+j01B(ϵ)T0.0494690099\lim_{\nu\rightarrow\infty}\dot{S}_{tot}=\frac{j^{A}_{1\rightarrow 0}\cdot 1+j^{B}_{0\rightarrow 1}\cdot(-\epsilon)}{T}\approx-0.0494690099 (26)

where the detailed steady-state currents are

j10A\displaystyle j^{A}_{1\rightarrow 0} =R01effp1ss=R01Ap1ss\displaystyle=R^{\rm eff}_{01}\cdot p^{\rm ss}_{1}=R^{A}_{01}\cdot p^{\rm ss}_{1} (27)
j01B\displaystyle j^{B}_{0\rightarrow 1} =R10effp0ss=R10Bp0ss\displaystyle=R^{\rm eff}_{10}\cdot p^{\rm ss}_{0}=R^{B}_{10}\cdot p^{\rm ss}_{0} (28)

From Fig. 3 one can verify that the entropy change rate at high frequency limit obtained from our proposed feedback controlled KMC algorithm matches well with the analytical result in Eq. 26

III.2 Discussion: Avoiding artificial Zeno effect

This work proposed a new algorithm to simulate systems under feedback control. Here we illustrate that for systems with time-dependent control (both open-loop and closed-loop), the direct implementation of the original Gillespie algorithmGillespie (2001) can lead to erroneous results, where the system’s dynamics appears to be immobilized due to frequent changes of the external control parameter or frequent feedback controls. We name this erroneous results the artificial Zeno effect. This effect appears to resemble the quantum Zeno effectFischer, Gutiérrez-Medina, and Raizen (2001) but is fundamentally different – the former is an artificial numerical error, and the latter is a true physical phenomenon.

In the quantum Zeno effectFischer, Gutiérrez-Medina, and Raizen (2001) frequent projective measurements may reset the system’s wave function into an eigenstate and, in the limit of infinitely high measurement frequency, the system’s wave function is frozen at the eigenstate and the system appears to be non-evolving. In contrast, classical stochastic systems, where the measurement does not directly impact the system’s state444Under feedback control measurements, the system’s kinetic rates can be updated after the measurement, but the system’s state is not directly altered by the action of measurement., should not have any Zeno effect. The artificial Zeno effect is a numerical error only when one naively implements the direct KMC algorithm in a piece-wise manner for time-dependent systems.

For illustrative purpose we first demonstrate the erroneous artificial Zeno effect in the feedback control system discussed in Fig. 3. In the Appendix, this discussion has been extended to an open-loop controlled time-dependent systems (Fig. 4).

For the feedback controlled system, one naive way to implement the original Gillespie algorithmGillespie (2001) is to reset the KMC simulation at each measurement time point. Specifically, one may perform a constant-rate KMC simulation for each measurement time window. Consider a system at state xx at time <τi1<t<τi<\tau_{i-1}<t<\tau_{i}. If the direct KMC approach proposes the next transition’s time to be t>τit^{*}>\tau_{i}, one simply evolves the system time to t=τit^{\prime}=\tau_{i} while maintaining the system state to be xx and then starts another step of the direct KMC simulation, with the initial state xx and initial time τi\tau_{i}. This approach appears to be valid, since the predicted time tt^{*} is indeed longer than the time of the next measurement, and the system should not change until after the next measurement. However, this direct implementation of the KMC method leads to wrong results that can become obvious by considering the infinitely frequent measurement limit, where the time till the next measurement approaches 0 and the chance that the direct KMC proposes a tt^{*} before the next measurement becomes zero. Thus the simulation is frozen to state xx. This artificial Zeno effect becomes more prominent for higher frequency measurements.

To illustrate this mistake, we implement the above direct KMC simulation for the Maxwell’s refrigerator discussed in Section III.1 and show that the artificial Zeno effect significantly underestimates the transition events of the systems dynamics, resulting in an underestimation of the refrigerator’s entropy decreasing rate and thermodynamic efficiency (see Fig. 3bc).

For a feedback controlled system where one measures and acquires system’s states at a scheduled sequence of times, plainly restarting the clock of the KMC simulation from the measured state to simulate the dynamics of the system will lead to an artificial Zeno effect. The closed-loop-control algorithm demonstrated here avoids this pitfall and preserves the correct dynamics. In the Appendix, we show that similar mistakes may occur in open-loop-control systems only if one overlooks previously introduced algorithmsAnderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009)

IV Conclusion

In conclusion, we here propose a new method to simulate stochastic trajectories of systems experiencing feedback control. This new method is derived based on a general single-step trajectory probability analysis. This analysis can be used to derive and recapitulate several previously proposed open-loop-control KMC algorithms for non-feedback control systems whose rates change in time under a given protocol. Then, we demonstrate that feedback controlled systems can be simulated by combining pre-milestone control protocol and a post-milestone control protocol. This allows us to perform a time-dependent KMC simulation for feedback controlled systems with a modified open-loop-control KMC algorithm. We validate our claims using simulation of a two-state feedback control Maxwell’s refrigerator. Our correct algorithm provides the true dynamics of the system. The simulation results are compared with the analytical results obtained in the infinitely frequent controlled scenarios, and the numerical results are in perfect agreement with the analytical result. Furthermore, the new modified KMC algorithms avoid the artificial Zeno effect, where a wrongly implementation of the direct KMC may lead to an erroneous underestimation of the frequency of transitions.

The algorithms described herein can find broad applicability in a number of fields, particularly in biological systems which experience rapid fluctuations in local environments and frequent feedback control via interaction with surroundings. Multiple processes – such as neurophysiology,Seidler, Noll, and Thiers (2004) transcriptional regulation,Henninger et al. (2021) circadian clocks,Brown and Doyle III (2020) and metabolic regulationChaves and Oyarzún (2019) – are examples of such systems beyond the scope of analytical solutions. A KMC algorithm to treat these feedback controlled systems would allow the relevant dynamics to be sampled and captured. Even though the example provided in Fig. 3 is a binary state model which is analytically solvable, the algorithm can be directly applied to complex systems that are not analytically solvable (see Section II.5). If the system’s control protocol follows complex rules, one can still apply the general algorithm by making necessary approximations on the control protocol similar to those sketched in Section II.3. While rapid feedback control or complex dynamics may pose challenges by increasing the computational cost of these simulations, our derivation provides a flexible path to tackling these problems. We believe that the relevant non-equilibrium behavior and thermodynamic quantities in a wide variety of feedback controlled chemical and biological system, such as reaction turnover rates, binding affinity, or assembly properties, can be accurately captured by using the new algorithm.

V Appendix

If one overlooks the existing open-loop-control KMC methodsAnderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) and approximates the control protocol by piecewise functions, it is possible that an artificial Zeno effect similar to Fig. 3 appears. Below we demonstrate a comparison between the correct methodAnderson (2007); Anderson, Ermentrout, and Thomas (2015); Anderson and Kurtz (2011); Chow and White (1996); Li et al. (2009) and the erroneous result.

Refer to caption
Figure 4: Diffusion along a 1D lattice. a) (left panel) Schematic of the diffusion processes with jumping rates to the right and left direction denoted as r+A/Br^{A/B}_{+} and rA/Br^{A/B}_{-}. The control condition is denoted by AA and BB. (right panel) Periodic control protocol with period 2τ2\tau. b) Simulated diffusion trajectories using (top panel) averaged rate dynamics in traditional KMC, (center panel) individual rate dynamics using incorrectly applied KMC due timescale mismatch between τ\tau and time for each move Δt\Delta t, (bottom panel) individual rate dynamics correctly simulated using the KMC described herein.

Let us consider a diffusion process on a 1-dimension lattice, where random walkers experience biased transitions. The initial state of all random walkers are placed at position 0. Under a periodic switch between controls A and B, the system evolves under two sets of rates with control period set to 2τ=0.022\tau=0.02 (see Fig. 4a). In condition A, the transition rate for moving right is r+A=0.4r^{A}_{+}=0.4 and for moving left is rA=0.1r^{A}_{-}=0.1 (Fig. 4a, left panel). Conversely, in condition B, these rates are r+B=0.2r^{B}_{+}=0.2 and rB=0.1r^{B}_{-}=0.1. As the environment oscillates rapidly between conditions A and B, the system experiences alternating transition rates (Fig. 4a, right panel). To accurately simulate this scenario, we employ the correct open-loop-control KMC method to generate a set of trajectories representative of the random walker’s behavior (see Fig. 4b, top panel). To illustrate the erroneous artificial Zeno effect, we perform a piece-wise direct KMC simulation and find that the artificial Zeno effects significantly slowed down the system’s diffusion, and the random walkers are mostly frozen without many transitions (see Fig. 4b, middle panel). In the end, to verify the validity of the open-loop-control KMC, we include an alternative way to obtain the true dynamics of random workers: by acknowledging that the control switch frequency is much greater than the diffusion rates, ν=1/(2τ)=50r+/A/B\nu=1/(2\tau)=50\gg r^{A/B}_{+/-}, one can show that this system evolves under effective dynamics with constant rates Tagliazucchi, Weiss, and Szleifer (2014); Zhang, Du, and Lu (2023). In this case, the system’s dynamics can be generated by a direct KMC simulation under the effective rates, shown in Fig. 4b bottom panel. We verify that under the rapid oscillation limit, the effective dynamics and the dynamics generated by the open-loop-feedback KMC agrees with each other. However, the naive implementation of direct KMC to time-dependent dynamics results in a significant slow down of the dynamics (i.e., the artificial Zeno effect).

Supplementary Information

Numerical simulation codes can be found in the Supplementary Materials.

Data Availability Statement

Data sharing is not applicable to this article as no new data were created or analyzed in this study.

Acknowledgements.
This work was in part financially supported by the National Science Foundation under Award Number DMR-2145256. S.S.C acknowledges the National Science Foundation Graduate Research Fellowship (DGE-2040435). We also thank the UNC Research Computing group for providing the computational resources and support towards these results. The authors are also grateful for valuable feedback from Prof. Chris Jarzynski, Dr. Hong Qian, Dr. Aaron Dinner, Dr. Zhongmin Zhang, and Mr. Jiming Zheng.

References

References

  • Shahrezaei and Swain (2008) V. Shahrezaei and P. S. Swain, “The stochastic nature of biochemical networks,” Current opinion in biotechnology 19, 369–374 (2008).
  • Levine and Hwa (2007) E. Levine and T. Hwa, “Stochastic fluctuations in metabolic pathways,” Proceedings of the National Academy of Sciences 104, 9224–9229 (2007).
  • Székely Jr and Burrage (2014) T. Székely Jr and K. Burrage, “Stochastic simulation in systems biology,” Computational and structural biotechnology journal 12, 14–25 (2014).
  • Earnshaw and Keener (2010) B. A. Earnshaw and J. P. Keener, “Invariant manifolds of binomial-like nonautonomous master equations,” SIAM Journal on Applied Dynamical Systems 9, 568–588 (2010).
  • Lee and Othmer (2010) C. H. Lee and H. G. Othmer, “A multi-time-scale analysis of chemical reaction networks: I. deterministic systems,” Journal of mathematical biology 60, 387–450 (2010).
  • Meister et al. (2014) A. Meister, C. Du, Y. H. Li,  and W. H. Wong, “Modeling stochastic noise in gene regulatory systems,” Quantitative biology 2, 1–29 (2014).
  • Anderson and Kurtz (2011) D. F. Anderson and T. G. Kurtz, “Continuous time markov chain models for chemical reaction networks,” in Design and Analysis of Biomolecular Circuits: Engineering Approaches to Systems and Synthetic Biology, edited by H. Koeppl, G. Setti, M. di Bernardo,  and D. Densmore (Springer New York, New York, NY, 2011) pp. 3–42.
  • Bowman, Pande, and Noé (2013) G. R. Bowman, V. S. Pande,  and F. Noé, An introduction to Markov state models and their application to long timescale molecular simulation, Vol. 797 (Springer Science & Business Media, 2013).
  • Husic and Pande (2018) B. E. Husic and V. S. Pande, “Markov state models: From an art to a science,” Journal of the American Chemical Society 140, 2386–2396 (2018).
  • Nelson and Nelson (2004) P. C. Nelson and P. Nelson, Biological physics (WH Freeman New York, 2004).
  • Alon (2019) U. Alon, An introduction to systems biology: design principles of biological circuits (Chapman and Hall/CRC, 2019).
  • Gillespie (2001) D. T. Gillespie, “Approximate accelerated stochastic simulation of chemically reacting systems,” The Journal of chemical physics 115, 1716–1733 (2001).
  • Iglesias and Ingalls (2010) P. A. Iglesias and B. P. Ingalls, Control theory and systems biology (MIT press, 2010).
  • Lorendeau et al. (2015) D. Lorendeau, S. Christen, G. Rinaldi,  and S.-M. Fendt, “Metabolic control of signalling pathways and metabolic auto-regulation,” Biology of the Cell 107, 251–272 (2015).
  • Atkinson (1965) D. E. Atkinson, “Biological feedback control at the molecular level: Interaction between metabolite-modulated enzymes seems to be a major factor in metabolic regulation.” Science 150, 851–857 (1965).
  • Goyal et al. (2010) S. Goyal, J. Yuan, T. Chen, J. D. Rabinowitz,  and N. S. Wingreen, “Achieving optimal growth through product feedback inhibition in metabolism,” PLoS Comput. Biol. 6, e1000802 (2010).
  • Yi et al. (2000a) T.-M. Yi, Y. Huang, M. I. Simon,  and J. Doyle, “Robust perfect adaptation in bacterial chemotaxis through integral feedback control,” Proceedings of the National Academy of Sciences 97, 4649–4653 (2000a).
  • Hamadeh et al. (2011) A. Hamadeh, M. A. J. Roberts, E. August, P. E. McSharry, P. K. Maini, J. P. Armitage,  and A. Papachristodoulou, “Feedback control architecture and the bacterial chemotaxis network,” PLoS Comput. Biol. 7, e1001130 (2011).
  • Yi et al. (2000b) T. M. Yi, Y. Huang, M. I. Simon,  and J. Doyle, “Robust perfect adaptation in bacterial chemotaxis through integral feedback control,” Proc. Natl. Acad. Sci. U. S. A. 97, 4649–4653 (2000b).
  • Murray (1992) A. W. Murray, “Creative blocks: cell-cycle checkpoints and feedback controls,” Nature 359, 599–601 (1992).
  • Domian, Reisenauer, and Shapiro (1999) I. J. Domian, A. Reisenauer,  and L. Shapiro, “Feedback control of a master bacterial cell-cycle regulator,” Proceedings of the National Academy of Sciences 96, 6648–6653 (1999).
  • Cross and Tinkelenberg (1991) F. R. Cross and A. H. Tinkelenberg, “A potential positive feedback loop controlling cln1 and cln2 gene expression at the start of the yeast cell cycle,” Cell 65, 875–883 (1991).
  • Li and Murray (1991) R. Li and A. W. Murray, “Feedback control of mitosis in budding yeast,” Cell 66, 519–531 (1991).
  • Gillespie (1977) D. T. Gillespie, “Exact stochastic simulation of coupled chemical reactions,” The journal of physical chemistry 81, 2340–2361 (1977).
  • Möbus and Wolf (2019) T. Möbus and M. M. Wolf, “Quantum zeno effect generalized,” J. Math. Phys. 60, 052201 (2019).
  • Itano et al. (1990) W. M. Itano, D. J. Heinzen, J. J. Bollinger,  and D. J. Wineland, “Quantum zeno effect,” Physical Review A 41, 2295 (1990).
  • Streed et al. (2006) E. W. Streed, J. Mun, M. Boyd, G. K. Campbell, P. Medley, W. Ketterle,  and D. E. Pritchard, “Continuous and pulsed quantum zeno effect,” Physical review letters 97, 260402 (2006).
  • Anderson, Ermentrout, and Thomas (2015) D. F. Anderson, B. Ermentrout,  and P. J. Thomas, “Stochastic representations of ion channel kinetics and exact stochastic simulation of neuronal dynamics,” Journal of computational neuroscience 38, 67–82 (2015).
  • Ding et al. (2016) S. Ding, M. Qian, H. Qian,  and X. Zhang, “Numerical simulations of piecewise deterministic markov processes with an application to the stochastic Hodgkin-Huxley model,” J. Chem. Phys. 145, 244107 (2016).
  • Chow and White (1996) C. C. Chow and J. A. White, “Spontaneous action potentials due to channel fluctuations,” Biophys. J. 71, 3013–3021 (1996).
  • Li et al. (2009) Y. Li, X. Qu, A. Ma, G. J. Smith, N. F. Scherer,  and A. R. Dinner, “Models of single-molecule experiments with periodic perturbations reveal hidden dynamics in rna folding,” The Journal of Physical Chemistry B 113, 7579–7590 (2009).
  • Anderson (2007) D. F. Anderson, “A modified next reaction method for simulating chemical systems with time dependent propensities and delays,” J. Chem. Phys. 127, 214107 (2007).
  • Bechhoefer (2021) J. Bechhoefer, Control theory for physicists (Cambridge University Press, 2021).
  • Franklin et al. (2002) G. F. Franklin, J. D. Powell, A. Emami-Naeini,  and J. D. Powell, Feedback control of dynamic systems, Vol. 4 (Prentice hall Upper Saddle River, 2002).
  • Note (1) Here constant rate over time is used to describe the time period between two consecutive stochastic events. Naturally, when the system state changes after the next event, the possible transitions and their rates are naturally updated.
  • Note (2) In practical implementation of the numerical code, when qiqi1q_{i}\approx q_{i-1}, the quadratic equation reduces to the linear, which can be solved from Eq. 15.
  • Note (3) Here the measurement of the system may not be as detailed as the specific state that the system is in. It is possible that a subset of states will give a same measurement outcome (i.e., coarse-grained measurement). The method can be applied to both cases.
  • Annby-Andersson et al. (2022) B. Annby-Andersson, F. Bakhshinezhad, D. Bhattacharyya, G. De Sousa, C. Jarzynski, P. Samuelsson,  and P. P. Potts, “Quantum fokker-planck master equation for continuous feedback control,” Physical Review Letters 129, 050401 (2022).
  • Horowitz and Jacobs (2014) J. M. Horowitz and K. Jacobs, “Quantum effects improve the energy efficiency of feedback control,” Physical Review E 89, 042134 (2014).
  • Horowitz and Parrondo (2011a) J. M. Horowitz and J. M. Parrondo, “Thermodynamic reversibility in feedback processes,” Europhysics Letters 95, 10005 (2011a).
  • Horowitz and Parrondo (2011b) J. M. Horowitz and J. M. Parrondo, “Designing optimal discrete-feedback thermodynamic engines,” New Journal of Physics 13, 123019 (2011b).
  • Horowitz and Vaikuntanathan (2010) J. M. Horowitz and S. Vaikuntanathan, “Nonequilibrium detailed fluctuation theorem for repeated discrete feedback,” Physical Review E 82, 061120 (2010).
  • Bhattacharyya and Jarzynski (2022) D. Bhattacharyya and C. Jarzynski, “From a feedback-controlled demon to an information ratchet in a double quantum dot,” Physical Review E 106, 064101 (2022).
  • Sagawa and Ueda (2012a) T. Sagawa and M. Ueda, “Nonequilibrium thermodynamics of feedback control,” Physical Review E 85, 021104 (2012a).
  • Sagawa and Ueda (2010) T. Sagawa and M. Ueda, “Generalized jarzynski equality under nonequilibrium feedback control,” Physical review letters 104, 090602 (2010).
  • Sagawa and Ueda (2012b) T. Sagawa and M. Ueda, “Fluctuation theorem with information exchange: Role of correlations in stochastic thermodynamics,” Physical review letters 109, 180602 (2012b).
  • Parrondo, Horowitz, and Sagawa (2015) J. M. Parrondo, J. M. Horowitz,  and T. Sagawa, “Thermodynamics of information,” Nature physics 11, 131–139 (2015).
  • Mandal, Quan, and Jarzynski (2013) D. Mandal, H. Quan,  and C. Jarzynski, “Maxwell’s refrigerator: an exactly solvable model,” Physical review letters 111, 030602 (2013).
  • (49) K. Sekimoto, Stochastic Energetics (Springer Berlin Heidelberg).
  • Penrose (2005) O. Penrose, Foundations of statistical mechanics: a deductive treatment (Courier Corporation, 2005).
  • Bennett (1973) C. H. Bennett, “Logical reversibility of computation,” IBM journal of Research and Development 17, 525–532 (1973).
  • Landauer (1961) R. Landauer, “Irreversibility and heat generation in the computing process,” IBM journal of research and development 5, 183–191 (1961).
  • Mandal and Jarzynski (2012) D. Mandal and C. Jarzynski, “Work and information processing in a solvable model of maxwell’s demon,” Proceedings of the National Academy of Sciences 109, 11641–11645 (2012).
  • Zurek (1989) W. H. Zurek, “Thermodynamic cost of computation, algorithmic complexity and the information metric,” Nature 341, 119–124 (1989).
  • Deffner (2013) S. Deffner, “Information-driven current in a quantum maxwell demon,” Physical Review E 88, 062128 (2013).
  • Strasberg et al. (2013) P. Strasberg, G. Schaller, T. Brandes,  and M. Esposito, “Thermodynamics of a physical model implementing a maxwell demon,” Physical review letters 110, 040601 (2013).
  • Lu, Mandal, and Jarzynski (2014) Z. Lu, D. Mandal,  and C. Jarzynski, “Engineering maxwell’s demon,” Physics Today 67, 60–61 (2014).
  • Fischer, Gutiérrez-Medina, and Raizen (2001) M. C. Fischer, B. Gutiérrez-Medina,  and M. G. Raizen, “Observation of the quantum zeno and anti-zeno effects in an unstable system,” Phys. Rev. Lett. 87, 040402 (2001).
  • Note (4) Under feedback control measurements, the system’s kinetic rates can be updated after the measurement, but the system’s state is not directly altered by the action of measurement.
  • Seidler, Noll, and Thiers (2004) R. D. Seidler, D. C. Noll,  and G. Thiers, “Feedforward and feedback processes in motor control,” Neuroimage 22, 1775–1783 (2004).
  • Henninger et al. (2021) J. E. Henninger, O. Oksuz, K. Shrinivas, I. Sagi, G. LeRoy, M. M. Zheng, J. O. Andrews, A. V. Zamudio, C. Lazaris, N. M. Hannett, et al., “Rna-mediated feedback control of transcriptional condensates,” Cell 184, 207–225 (2021).
  • Brown and Doyle III (2020) L. S. Brown and F. J. Doyle III, “A dual-feedback loop model of the mammalian circadian clock for multi-input control of circadian phase,” PLoS Computational Biology 16, e1008459 (2020).
  • Chaves and Oyarzún (2019) M. Chaves and D. A. Oyarzún, “Dynamics of complex feedback architectures in metabolic pathways,” Automatica 99, 323–332 (2019).
  • Tagliazucchi, Weiss, and Szleifer (2014) M. Tagliazucchi, E. A. Weiss,  and I. Szleifer, “Dissipative self-assembly of particles interacting through time-oscillatory potentials,” Proceedings of the National Academy of Sciences 111, 9751–9756 (2014).
  • Zhang, Du, and Lu (2023) Z. Zhang, V. Du,  and Z. Lu, “Energy landscape design principle for optimal energy harnessing by catalytic molecular machines,” Physical Review E 107, L012102 (2023).