## Abstract

Fluctuation theorems specify the non-zero probability to observe negative entropy production, contrary to a naive expectation from the second law of thermodynamics. For closed particle trajectories in a fluid, Stokes theorem can be used to give a geometric characterization of the entropy production. Building on this picture, we formulate a topological fluctuation theorem that depends only by the winding number around each vortex core and is insensitive to other aspects of the force. The probability is robust to local deformations of the particle trajectory, reminiscent of topologically protected modes in various classical and quantum systems. We demonstrate that entropy production is quantized in these strongly fluctuating systems, and it is controlled by a topological invariant. We demonstrate that the theorem holds even when the probability distributions are non-Gaussian functions of the generated heat.

## Introduction

Concepts from topology have played a key role in understanding a wide range of physical phenomena by providing an intuitive and mathematically rich effective description of the system^{1,2}. In classical systems, topology has played a crucial role, for instance, in characterizing 2D turbulence^{3} and defect-mediated phase transitions^{4}. Topological defects abound in soft matter systems, such as dislocation and disclination pairs in 2D melting^{5} and various liquid crystalline systems^{6}, and have recently featured in a variety of intrinsically non-equilbrium active matter systems^{7,8,9,10,11}. An early example of topological protection arose from use of the Gauss-Bonnet theorem in the physics of membranes^{12}. More recent work examined relevant topological invariants in mechanical lattices^{13} or dissipative systems in continuous space^{14} or lattice models with underlying periodic structure^{15,16,17,18,19,20}. Many such systems exhibit non-Hermitian properties such as exceptional points^{21,22,23,24,25} and a non-zero topological vorticity of the edge state^{14,20}. The topological systems that support protected edge states are robust to disorder and perturbations, providing a key towards understanding such phenomena.

Fluctuations can give rise to particle trajectories with negative entropy, which appears to contradict a fundamental law of macroscopic physics. Fluctuation theorems provide a quantitative, probabilistic prediction for this negative entropy production. These universal laws are valid even during processes that drive systems far from equilibrium. While the probability to observe such “violations” is typically exponentially small in the relevant system size, it can be appreciable in small systems. The first theorem was discovered over two decades ago by computer simulations and justified heuristically^{26}, then proven for a large class of systems^{27,28,29}. This led to a class of relations dealing with the distribution functions of thermodynamic quantities such as exchanged heat, applied work or entropy production^{30}. Additional relations were moreover found in a variety of systems with non-reversible microscopic dynamics^{31,32,33,34,35,36}. Further work extended the concepts of thermodynamics to the level of individual trajectories^{37,38}. Another key insight related entropy production in the medium to that part of the stochastic action, which determines the weight of trajectories that is odd under time reversal^{39,40}. These and other developments opened the possibility for experimental or numerical measurements on the single molecule level, providing verification of the fluctuation theorems^{41,42}. Notably, critical insights were obtained for the behavior of bio-molecules^{43}. Brownian dynamics of tracers in the presence of vortex-like singularities has been studied with an empasis on the winding number distribution and extensions to entanglement problems in polymer physics^{44,45,46,47,48}. However, no connection has so far been made to stochastic thermodynamics.

Here, we identify a topological invariant that predicts observable quantities, in a strongly fluctuating system without underlying periodic structure. Our analysis allows us to quantify the ratio of particles with negative entropy production, purely as a function of winding number around vortex cores. We build on the geometrical properties of individual trajectories under the influence of external forces. This is studied in the context of a stochastic particle in a force-field, which is ubiquitous in nature (see Fig. 1). In particular, a particle moving around a closed path picks out only the non-conservative component of the force-field, which gives the entropy production. This allows us to formulate a topological fluctuation theorem based only on the vortex winding number. While previous work looked at entropy production in flow-fields^{49,50}, the topological equivalence of particle trajectories and its consequences have not been studied. We begin with a general statement of the theorem using the examination of entropy production in the medium. We then demonstrate it in various examples including one or several vortices by calculating the corresponding exact winding number distribution or performing Brownian dynamics simulations. We find that even when the winding number distributions are non-Gaussian functions of the vortex circulation, the theorem holds exactly.

## Results

Consider the motion in *d* dimensions of a tracer particle with diffusivity *D* and mobility *μ* in a stationary force field **F**(**r**), where *D* = *μ**k*_{B}*T* with *k*_{B}*T* representing the thermal energy. The stochastic dynamics of the particle is characterized as a function of time 0≤*τ*≤*t* by its trajectory **r**(*τ*), which satisfies the Langevin equation

where ** ξ** represents a

*d*-dimensional Gaussian white noise of zero mean and unit variance. Using the Helmholtz-Hodge decomposition, the force field can generally be separated into a conservative component that derives from a potential

*U*(

**r**) and a rotational component

**f**(

**r**) that satisfies

**⋅**

*∇***f**(

**r**) = 0, i.e.,

**F**(

**r**) = −

*∇**U*(

**r**) +

**f**(

**r**). Let us assume that the rotational component of the force field is generated by a topological defect, such as the vortex line shown in Fig. 1a for the physically relevant case

*d*= 3. In the general case, such a defect takes the form of codimension 2 manifold Σ giving rise to a vorticity field satisfying

where *S* is an arbitrary smooth surface intersecting Σ transversally at a single point, the constant *Q* is the strength of the vortex and summation is performed over *i* < *j* (distinct pairs)^{51,52}. For such a vortex-induced force-field, we derive a topological fluctuation theorem in terms of the probability *p*(*n*, *t*) for any closed trajectory of duration *t* to wind *n* times around the vortex, which reads

for any *U*(**r**) (see Fig. 1a for a depiction of a representative force profile and closed loop in *d* = 3). Here, *Q* corresponds to the quantum of heat generated via the closed trajectories of the tracer particle that enclose the vortex domain. It is helpful to define *γ* ≡ *Q*/(*k*_{B}*T*) as the quantum of entropy production (in units of *k*_{B}). Figure 1b shows a number of exemplar closed trajectories with different winding numbers. Note that the theorem [Eq. (3)] is valid at any time *t*. Therefore, while the positive and negative winding number distributions are expected to evolve with time and be affected by conservative contributions from the force, their ratio is topologically protected.

The derivation of the topological fluctuation theorem starts from the probability distribution of the particle to be at position **x** after time *t* starting initially from **x**_{0}, which can be be found via

where the probability of a specific stochastic trajectory is defined in terms of the Onsager-Machlup action associated with Eq. (1) as

where \({{{{{{{\mathcal{N}}}}}}}}\) is a normalization factor, and the Stratonovich convention is implied. Defining the kinematically reversed, or backward, trajectory \(\tilde{{{{{{{{\bf{r}}}}}}}}}(\tau )\) as \(\tilde{{{{{{{{\bf{r}}}}}}}}}(\tau )\equiv {{{{{{{\bf{r}}}}}}}}(t-\tau )\), we then find from Eq. (5) that the ratio between the probabilities of the backward and forward paths is given by the part of the stochastic action that is odd under this transformation, namely,

where \({{\Gamma }}\equiv \frac{1}{{k}_{{{{{{{{\rm{B}}}}}}}}}T}\int\nolimits_{0}^{t}{{{{{{{\rm{d}}}}}}}}\tau \,\dot{{{{{{{{\bf{r}}}}}}}}}(\tau )\cdot {{{{{{{\bf{F}}}}}}}}({{{{{{{\bf{r}}}}}}}}(\tau ))\) corresponds to the heat generated (in units of *k*_{B}*T*), or entropy production, during the motion of the particle along the trajectory. We then consider a closed trajectory described by a curve *C* (by setting **x** = **x**_{0}), which does not intersect with Σ, and implement the Stokes Theorem ∫_{∂S}*ω* = ∫_{S}d*ω* for the 1-form *ω* = *F*_{i}d*r*^{i} over the surface *S* enclosed by *C*^{2}, namely

It is manifest in Eq. (7) that Γ picks out only the rotational component of the force. Moreover, using the decomposition **F** = − ∇ *U* + **f** and Eq. (2) directly yields Γ = *γ**n*, with *n* the number of times that the forward trajectory winds around the vortex singularity. We thus find that Γ is independent of the initial position **x**_{0} or the specific shape of *C* so long as it corresponds to the same winding number *n*. Hence, Γ is identical for topologically equivalent curves (see Fig. 1b), and independent of the conservative component of the force-field.

To complete the calculation, we thus set **x** = **x**_{0} in Eq. (6) and integrate over all initial positions and topologically equivalent loops to obtain a topological fluctuation theorem for vortex-induced force fields (details in Methods)

where *p*(*n*, *t*) denotes the probability for any closed trajectory of length *t* to wind *n* times around the vortex axis.

The above derivation is easily generalizable to the case of *m* non-intersecting vortex branes. Denoting *γ*_{i} and *n*_{i} the dimensionless quantum of heat and winding number associated with a given vortex *i*, the entropy production becomes \({{\Gamma }}=\mathop{\sum }\nolimits_{i = 1}^{m}{\gamma }_{i}{n}_{i}\). Integrating Eq. (6) over initial conditions and trajectories, which share the same set of winding numbers \({\{{n}_{i}\}}_{i = 1,\ldots m}\), the topological fluctuation theorem for multiple vortices then reads

where *p*({*n*_{i}}, *t*) is the probability that a closed trajectory of length *t* has wrapped *n*_{i} times around each vortex *i* for *i* = 1, …*m*.

As for a single vortex, Eq. (9) is set by topology and thus holds at all times and for any conservative force affecting the particle motion. Moreover, as both sides of Eq. (9) depend only on the set of winding numbers {*n*_{i}} reached at time *t*, the fluctuation theorem is insensitive to the history leading to {*n*_{i}} and in particular to the order in which the trajectory winds around each vortex. Since any combination of winding numbers leading to the same value of Γ leaves the r.h.s. of Eq. (9) unchanged, the latter can be further summed over all such configurations in order to get a weaker formulation of the theorem:

### Exact solution for a single vortex

To shed some light on the topological fluctuation theorem (3), we now focus on the physically relevant case *d* = 3 and consider the motion of a tracer particle in a flow field created by a single straight vortex line oriented along **e**_{z}, which is given in cylindrical coordinates (*r*, *ϕ*, *z*) by

where \({{{{{{{{\bf{e}}}}}}}}}_{\phi }=(-\sin \phi ,\cos \phi ,0)\) and \({{{{{{{{\bf{r}}}}}}}}}_{\perp }=r(\cos \phi ,\sin \phi )\), so that from Eq. (7) we can readily evaluate \({{\Gamma }}=\frac{1}{{k}_{{{{{{{{\rm{B}}}}}}}}}T}{\int}_{S}{{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{S}}}}}}}}\cdot \nabla \times {{{{{{{\bf{F}}}}}}}}({{{{{{{\bf{r}}}}}}}})=\gamma n\). The simple case where the particle motion is restricted to a ring following the flow streamlines, such that the drive is effectively uniform, has been treated previously^{38}. This problem (generalizable to higher dimensions) corresponds to a biased random walk and the fluctuation theorem can be shown to result from the Gaussian form of the winding distribution.

However, from the above derivation the relation (3) holds even when the Brownian particle is allowed to move transversally to flow streamlines. Considering closed trajectories winding around a vortex line in free space, the Fokker–Planck equation describing the evolution of the distribution \({{{{{{{\mathcal{P}}}}}}}}(r,\phi ,z,t)\) can be solved exactly^{53}, such that the winding distribution is given, up to a normalizing constant, by (details in the Methods section below)

where \({k}_{u}=\sqrt{{u}^{2}+iu\gamma /(2\pi )}\), *r*_{0} denotes the initial radial position of the particle and *I*_{ν} is the modified Bessel function of the first kind, of order *ν*.

A detailed examination of this probability distribution reveals that it is strongly non-Gaussian. Indeed, for positive winding numbers *p*(*n*, *t*∣*r*_{0}) is asymptotically scale free: *p*(*n*, *t*∣*r*_{0}) \(\mathop{\sim}\limits_{{n}\,{{{{\rightarrow}}}}+\infty}\) *n*^{−3/2} ^{53} (see Fig. 2a), while, as a consequence of the fluctuation theorem (3), it decays exponentially as *n* → − *∞*. This difference in scaling behaviors results in a strong asymmetry of the overall distribution between the positive and negative winding number sectors (see Fig. 2b).

### Computational verification of the theorem

For more complicated force profiles, solving the Fokker–Planck equation may not be possible, and one needs to resort to Brownian dynamics simulations. Below we address two such non-trivial cases in order to illustrate the quantization of the medium entropy production in presence of an external potential, as well as the application of the theorem to the multi-vortex case.

As the data shown in Fig. 2b suggests, a numerical verification of the theorem in free space would be very demanding due to the need for excessive sampling. On the contrary, constraining the stochastic trajectories inside a finite volume with an externally applied potential *U*(** r**) significantly speeds up the winding number statistics convergence. In practice, however, such confinement also imposes to make sure that stochastic trajectories cannot reach the vortex cores where the winding angle is ill-defined; which we achieve by means of a stiff potential barrier (see Methods for details about numerical simulations). For simplicity, we moreover consider the case of an effectively two-dimensional vortex force such that all vortex lines are along the third spatial direction, as described by Eq. (11). For such force fields, the dissipated heat (7) reads

where, as before, *γ*_{i} denotes the *i*^{th} vortex strength, while Δ*ϕ*_{i} and Δ*U* are the corresponding total winding angle and potential energy difference between the final and initial positions. Note that Eq. (13) holds irrespectively of the observation time, such that the numerical verification of the theorem can be carried out either looking at finite time distributions, or after time averaging at fixed initial conditions.

### Quantization of the medium entropy production

We first discuss the quantization of the medium entropy production for closed trajectories as predicted by Eqs. (2) and (7) in a configuration where the Brownian particle is harmonically trapped, namely for which

where (*x*, *y*, *z*) denote the cartesian coordinates of ** r**, while the parameter

*α*introduces anisotropy in the confinement and the position of the potential minimum can be shifted along

*x*by varying

*x*

_{c}. In an experiment,

*U*would, e.g., model the confinement operated on a colloidal particle by optical tweezers.

From Eq. (13), the dissipated heat only depends on the total winding angle around the vortex and the potential difference between both ends of the trajectories. It is thus enlightening to consider the probability ratio

where *p*(Δ*ϕ*, Δ**r**, *t*∣**r**_{0}) denotes the joint probability of total winding angle Δ*ϕ* and difference between initial and final positions Δ**r** for a trajectory of length *t* given an initial condition **r**_{0}. Naturally, setting Δ**r** = **0** (closed trajectories) leads to Δ*ϕ* = 2*π**n* and vanishing Δ*U*, such that the theorem (8) is readily recovered.

Let us now consider trajectories for which the initial and final points share the same radial and axial coordinates: Δ*r* = Δ*z* = 0, while the total winding angle Δ*ϕ* remains arbitrary. In case I where the potential is isotropic (*α* = 1) and its ground state coincides with the vortex core (*x*_{c} = 0), Δ*U* is independent of the winding angle Δ*ϕ* such that the probability ratio *ϑ* averaged over trajectory time and initial positions follows the predicted exponential scaling for all winding angles (see orange line in Fig. 2f). In general, however, Γ is affected by the symmetries of the trap such that *ϑ* does not decay exponentially with the winding angle Δ*ϕ*. Setting *α* ≠ 1 (case II, Fig. 2d), Δ*U* depends explicitly on Δ*ϕ* and vanishes only for Δ*ϕ* = *n**π*. Consequently, the averaged winding angle probability ratio departs from the exponential scaling for all Δ*ϕ* not multiple of *π* (see red line in Fig. 2f). Moreover, in the third case of an isotropic harmonic potential, but whose minimum is shifted of *x*_{c} ≠ 0 (Fig. 2e), the winding angle probability ratio shows similar oscillations as in case II, except that due to the lack of reflection symmetry of *U* those are 2*π*-periodic (blue line in Fig. 2f). In all cases, thanks to the topological protection offered by closed loops the data shown in Fig. 2f systematically falls on the predicted exponential curve for Δ*ϕ* integer factor of 2*π*.

### The multi-vortex case

To simplify the following analysis and allow for the study of fixed time trajectories, we now consider the case where the potential *U*(**r**) acts as a stiff wall confining the particles inside a cylinder of radius *R* and such that *U* = 0 inside of the cylinder. For such confinement and a single vortex line located at *r* = 0, we find that for *t* ≪ *R*^{2}/*D* the distribution *p*(*ϕ*, *t*) exhibits exponential tails, while for *t* ≫ *R*^{2}/*D* the effect of confining boundaries leads to *p*(*ϕ*, *t*) being Gaussian (see Fig 2c). As expected from Eq. (13), in this case one can set Δ*U* = 0 and the fluctuation theorem is found to hold at winding angles for all observation times, independently of the particular shape of the distribution.

We now address the multi-vortex case considering a configuration of four counter rotating vortices of strengths ± *Q* in a closed domain of radius *R*, all located at *r* = *R*/2 and 90 degrees from each other, as depicted in Fig. 1d, except that for simplicity the particle motion in simulations is restricted to two dimensions.

To be able to sample winding number distributions with sufficiently accurate statistics, we define the joint probability *p*({*ϕ*_{+}, *ϕ*_{−}}, *t*) of total winding angles *ϕ*_{+} and *ϕ*_{−} around, respectively, counter-clockwise (CCW) and clockwise (CW) rotating vortices. The distribution, shown in Fig. 3a, exhibits a non-trivial, time-invariant, 2*π*-periodic structure. In particular, while *p*({*ϕ*_{+}, *ϕ*_{−}}, *t*) shows local maxima when both *ϕ*_{+} and *ϕ*_{−} are integer factors of 2*π*, it vanishes up to numerical precision when both of them are odd integer factors of *π*. Despite this complex behavior, representing the ratio *p*({−*ϕ*_{+}, −*ϕ*_{−}}, *t*)/*p*({*ϕ*_{+}, *ϕ*_{−}}, *t*) as a function of *γ*(*ϕ*_{+} −*ϕ*_{−}) reveals a clear exponential scaling at all accessible times (see Fig. 3b), in agreement with Eq. (9).

We now examine the total entropy production distribution *p*(Γ, *t*). Figure 3c shows that although it exhibits a Gaussian envelope, it features prominent modulations that can not be described in terms of simple functions. Nevertheless, the ratio *p*( − Γ, *t*)/*p*(Γ, *t*) always verifies Eq. (10) at all times and for all winding angle configurations (see Fig. 3d).

Lastly, our Brownian dynamics simulations allow us to record the individual winding distributions *p*_{±}(*ϕ*, *t*) associated with CCW(+) and CW(−) rotating vortices. As shown in Fig. 3e, the two distributions show smooth damped oscillations and are symmetric with respect to each other. Examining the ratios *p*_{±}( − *ϕ*, *t*)/*p*_{±}(*ϕ*, *t*), we find that they do not satisfy the theorem. Namely, we find in both cases that the probability ratio of winding oppositely to the direction set by the vortex flow to that of winding along it is always larger than predicted by the theorem (see Fig. 3f). This striking feature is a direct consequence of the fact that in presence of many vortices, trajectories winding with an angle *ϕ* around a given vortex are not all topologically equivalent.

### Towards a description of emergent topological phases

It would be interesting to connect the fluctuation theorem (8) to the topologically protected edge currents found in a variety of condensed matter systems driven out of equilibrium^{13,15,16,17,18,19,20,25}. Although in depth treatment of this problem, in particular the formulation of a counterpart of (8) for field theories describing emergent features of many body systems (see refs. ^{54,55,56,57} for relevant references), lies outside of the scope of this work, here we outline a possible avenue to tackle it in non-equilibrium Markov networks.

In this part, we consider the minimal model introduced and studied in ref. ^{20}, which consists of a two-dimensional on-lattice dynamics made of repeating motifs playing the role of non-equilibrium cycles in some abstract space (conformation, chemical, etc...). We moreover restrict the study to a square lattice as represented in Fig. 4 such that to each motif, or lattice site, are associated four internal states labeled from A to D. The following results nevertheless remain easily generalizable to other types of lattices, and we show in the SM that similar conclusions can be reached from the study of an analogous one-dimensional model.

The lattice model sketched in Fig. 4 involves two kinds of transitions, respectively, referred to as “internal” and “external”, respectively, between internal states (A–D) at each site or between neighboring sites. We denote *γ*_{ext} and *γ*_{in} the associated clockwise external and counter-clockwise internal rates, while the reverse transition rates are written with primes. The possible moves from a lattice site at position (*x*, *y*) are thus:

with *a* denoting the lattice step. In ref. ^{20} it was found that for chiral systems (e.g. \({\gamma }_{{{{{{{{\rm{ext}}}}}}}}}^{\prime}\ll {\gamma }_{{{{{{{{\rm{ext}}}}}}}}}\), \({\gamma }_{{{{{{{{\rm{in}}}}}}}}}^{\prime}\ll {\gamma }_{{{{{{{{\rm{in}}}}}}}}}\)) and fast external rates (*γ*_{ext} ≫ *γ*_{in}) this dynamics leads to topologically protected chiral modes localized at the edge of the simulation domain.

Using a systematic coarse-graining approach, we derive the Fokker–Planck equation describing the effective dynamics of the total density *ρ* ≡ *ρ*_{A} + *ρ*_{B} + *ρ*_{C} + *ρ*_{D}:

where Einstein summation over repeated indices is implied. The derivation of Eq. (15) for the fully chiral case is presented in Methods, while the longer version accounting for reversed transitions can be found in the SM. The effective drift **v** and diffusivity **D** are non-trivial functions of the rates \({\gamma }_{{{{{{{{\rm{in}}}}}}}}}^{({\prime} )}\) and \({\gamma }_{{{{{{{{\rm{ext}}}}}}}}}^{({\prime} )}\), and their general expressions are given in Methods. We find that the bulk dynamics is essentially diffusive with \({v}_{\alpha }^{{{{{{{{\rm{bulk}}}}}}}}}=0\) and \({D}_{\alpha \beta }^{{{{{{{{\rm{bulk}}}}}}}}}={D}_{{{{{{{{\rm{b}}}}}}}}}{\delta }_{\alpha \beta }\). At the system’s boundaries, however, **v**^{edge} = *v*_{∥}**e**_{∥} is non-zero and **D**^{edge} = *D*_{∥}**e**_{∥}**e**_{∥} + *D*_{⊥}**e**_{⊥}**e**_{⊥}, where the unit vector **e**_{⊥} is orthogonal to the boundaries and points inside the system, while **e**_{∥} is obtained from **e**_{⊥} by a \(-\frac{\pi }{2}\) rotation (see Fig. 4).

Moreover, our derivation leads to conclude that the density *ρ* takes distinct values in the bulk and at the edges of the system. Namely, we find in the limit \({\gamma }_{{{{{{{{\rm{in}}}}}}}}},{\gamma }_{{{{{{{{\rm{in}}}}}}}}}^{\prime}\ll {\gamma }_{{{{{{{{\rm{ext}}}}}}}}},{\gamma }_{{{{{{{{\rm{ext}}}}}}}}}^{\prime}\) of interest that

where we have introduced the ratios \({\zeta }_{{{{{{{{\rm{in}}}}}}}}}\equiv {\gamma }_{{{{{{{{\rm{in}}}}}}}}}^{\prime}/{\gamma }_{{{{{{{{\rm{in}}}}}}}}}\) and \({\zeta }_{{{{{{{{\rm{ext}}}}}}}}}\equiv {\gamma }_{{{{{{{{\rm{ext}}}}}}}}}^{\prime}/{\gamma }_{{{{{{{{\rm{ext}}}}}}}}}\). For fully chiral rates corresponding to small or large values of the ratios *ζ*_{in} and *ζ*_{ext}, it appears clearly from Eq. (16) that most of the density is concentrated at the boundaries. Namely, in this limit *ρ* is found to decay from *ρ*^{edge} to *ρ*^{bulk} exponentially with a penetration depth ≃ *a*^{20}. Considering without loss of generality both *ζ*_{in} ≪ 1 and *ζ*_{ext} ≪ 1, the effective drift at the edges simplifies at leading order as *v*_{∥} ≃ *γ*_{in}*a*, while the bulk and edge diffusivities are given by

Thus, as the system is brought to the fully chiral limit its bulk is depleted and its edges retain most of the probability density. The global dynamics is essentially one-dimensional with chiral currents traveling along the borders with mean speed *v*_{∥} > 0 and vanishing fluctuations strength *D*_{∥}.

In this context, we can apply the fluctuation theorem to this problem considering closed trajectories following the boundary of the system. We then obtain for the winding number probability ratio

with *N*_{edge} denoting the total number of lattice sites at the edge and where *n* here corresponds to the number of times the trajectory has wound around the system. Equation (17) shows that the ratio of clockwise to counter-clockwise flux probabilities is topologically protected as it does not depend explicitly on the shape of the system boundary. However, it depends on the total perimeter as the transition rates \({\gamma }_{{{{{{{{\rm{in}}}}}}}}}^{({\prime} )}\) and \({\gamma }_{{{{{{{{\rm{ext}}}}}}}}}^{({\prime} )}\) were assumed constant. We finally note that Eq. (17) was formally obtained in the limits *ζ*_{ext} ≪ 1 and *ζ*_{in} ≪ 1. Thus and since the ratio in the exponential involves a factor that scales with the system size, computational or experimental verification of Eq. (17) might be challenging in practice.

## Discussion

We have demonstrated a topological fluctuation theorem that identifies a relevant topological invariant able to predict observable quantities, in a strongly fluctuating system without underlying periodic structure. The ratio of particle trajectories going against the flow to those going along it is purely a function of heat generated along the vortices and is topologically protected against deformations of these trajectories. Thanks to this property, the theorem holds for any finite observation time and is insensitive to conservative contributions to the force-field such as a confining potential, which makes it generic and observable in realistic experimental conditions.

In the context of micro-machines, where some degrees of freedom are driven out-of-equilibrium by external forces and torques that are even under time-reversal, the fluctuation theorem constrains the probability ratio of negative and positive entropy production created over cycles performed by the machine. Remarkably, the theorem predicts that this ratio is topologically protected for closed cycles in phase space, as discussed recently for the one-dimensional case in ref. ^{58}, thus providing some insight for the optimization and design of micro-machines.

Finally, it will be interesting to investigate how the above results generalize with the introduction of non-equilibrium activity, be it as a correlated bath or as persistence in the particle motion^{59}.

## Methods

### Detailed derivation of the topological fluctuation theorem

For closed trajectories of total duration *t*, the winding number distribution is defined up to a normalizing constant as \(p(n,t)\propto \int {{{{{{{\rm{d}}}}}}}}{{{{{{{{\bf{x}}}}}}}}}_{0}\pi ({{{{{{{{\bf{x}}}}}}}}}_{0}){\oint }_{{{{{{{{{\bf{x}}}}}}}}}_{0}}{{{{{{{\mathcal{D}}}}}}}}{{{{{{{\bf{r}}}}}}}}(\tau )P[{{{{{{{\bf{r}}}}}}}}(\tau )| {{{{{{{{\bf{x}}}}}}}}}_{0}]\delta ({{\Gamma }}-\gamma n)\), with *π*(**x**_{0}) the distribution of initial positions **x**_{0}. Using the same convention as in the main text that + *n* windings correspond to trajectories evolving forward in time, we thus write

where the first equality makes use of Eq. (6), while the second equality is obtained noting that the total circulation is odd under time reversal (\(\tilde{{{\Gamma }}}=-{{\Gamma }}\)) and that integrating over forward and time-reversed trajectories is equivalent^{42}. Finally, the the last equality derives from the relation Γ = *γ**n* valid when the rotational component of the force field satisfies Eq. (2).

### Brownian dynamics simulations

Here, we provide the details of the Langevin dynamics simulations. Denoting **r**(*τ*) the particle position at time *τ*, which is discretized in units of d*τ*, it is updated by means of an Euler–Maruyama scheme:

where **f**(**r**) denotes the applied vortex field, *μ* is the mobility of the particle, *U* is a confining potential, and ** ξ** is a Gaussian white noise vector with unit variance.

For the multi-vortex study, the potential *U* was chosen to ensure that all trajectories are confined inside a cylinder of radius *R*, and that they cannot reach the vortex centers where the winding angles are not defined. Namely, we used the following form for the potential

When the length-scale \(\ell \equiv \sqrt{{k}_{{{{{{{{\rm{B}}}}}}}}}T/k}\) is small compared to *R*_{*} and *R*, the trajectories do not penetrate the limiting regions with *r* > *R* and ∣**r** − **r**_{i}∣ < *R*_{*} (see Fig. 5), such that Δ*U* in Eq. (13) can be set to 0.

Rescaling space and time in Eq. (18), we set *D* = 1 and *μ**k* = 10^{3}. With these units, we used in all simulations *γ* = 0.1 × 2*π*, d*t*/(*μ**k*) = 10^{−5}, \(R/\ell =1{0}^{3}\sqrt{10}\), and \({R}_{* }/\ell =50\sqrt{10}\). We have verified that varying moderately these parameters did not affect our results. Both the data shown in Figs. 2 and 3 were obtained by sampling the winding distributions over 10^{6} to 10^{8} independent trajectories with uniform initial conditions.

### The two-dimensional lattice model with out-of-equilibrium cycles

Here we detail the coarse-graining of the non-equilibrium lattice model described in the text and pictured in Fig. 4. As it involves less lengthy expressions, we restrict here to fully chiral rates (\({\gamma }_{{{{{{{{\rm{ext}}}}}}}}}^{\prime}={\gamma }_{{{{{{{{\rm{in}}}}}}}}}^{\prime}=0\)) while for completeness the derivation for the general case is presented in the SM.

#### The bulk dynamics

We first investigate the behavior of the system far from any boundary. Assuming an infinite system or periodic boundary conditions, the dynamics each state density can be written in the following compact form

where *σ* is the 4-periodic map of *i* ∈ {0, . . . , 3} to {*A*, . . . , *D*}, **x** = *x***e**_{x} + *y***e**_{y} and \({{\Delta }}{{{{{{{{\bf{x}}}}}}}}}_{i}=a{{{{{{{\mathcal{R}}}}}}}}(-\frac{i\pi }{2}){{{{{{{{\bf{e}}}}}}}}}_{x}\) where the operator \({{{{{{{\mathcal{R}}}}}}}}(\theta )\) rotates vectors in the plane by an angle *θ*. We now use the fact that to Eq. (20) only corresponds one conserved quantity: the total bulk density \({\rho }_{{{{{{{{\rm{b}}}}}}}}}=\frac{1}{4}({\rho }_{{{{{{{{\rm{A}}}}}}}}}+{\rho }_{{{{{{{{\rm{B}}}}}}}}}+{\rho }_{{{{{{{{\rm{C}}}}}}}}}+{\rho }_{{{{{{{{\rm{D}}}}}}}}})\). To complete the set of fields, we moreover define three additional auxiliary fields:

After straightforward algebra, the set of equations given by Eq. (20) for *i* = 0, . . . , 3 is then recast up to second order in *a* as

where we have defined the operators

while \(\bar{\gamma }\equiv {\gamma }_{{{{{{{{\rm{ext}}}}}}}}}+{\gamma }_{{{{{{{{\rm{in}}}}}}}}}\) and Δ*γ* ≡ *γ*_{ext} − *γ*_{in}.

Since the total bulk density *ρ*_{b} is the only slow field, we now enslave *ρ*_{1,2,3} keeping terms up to second order in *a*. A quick inspection of the rhs of Eq. (21a) indicates that *ρ*_{1} should be expressed at zeroth order in *a*, while the expressions of *ρ*_{2} and *ρ*_{3} should include terms up to order *a*. However, we find from Eq. (21b) that setting ∂_{t}*ρ*_{1} = 0 the resulting solution for *ρ*_{1} is at least of order *a*, such that the *ρ*_{1} terms contribute to orders *a*^{3} and *a*^{2} in the equations for *ρ*_{b} and *ρ*_{2,3}, respectively. We thus neglect these terms in what follows.

Setting ∂_{t}*ρ*_{2} = ∂_{t}*ρ*_{3} = 0, we end up with

Inverting the 2 × 2 matrix on the lhs, we finally get

Replacing these expressions in Eq. (21a), we find that the bulk density dynamics simply amounts to isotropic diffusion:

Here, we note that the bulk diffusivity is symmetric by exchange of *γ*_{ext} ↔ *γ*_{in} and is essentially controlled by the smallest transition rate, as

#### The dynamics near boundaries

It was discovered in ref. ^{20} that when considered in a finite volume, the lattice model dynamics is dominated by the effect of boundaries. Namely, the model shows persistent chiral modes localized at its edges. Here, we consider an effective description where the system boundary in contact with an homogeneous bulk whose density satisfies Eq. (24). Considering without loss of generality the bottom boundary (see Fig. 4 for a schematic) such that external transitions to B and from C are suppressed, we have

where *ρ*_{b} here accounts effectively the states A and D close to the boundary. As before, we now define

Carrying out a similar calculation as for the bulk dynamics, we find that *ρ*_{e} is the only conserved field such that \({\rho }_{1,2}^{\prime}\) can be enslaved to it. Solving the resulting equations for \({\rho }_{1,2}^{\prime}\), we get

Replacing these expressions into that of *ρ*_{e}, we finally obtain

with the coefficients

Finally, for a general boundary defined by the unit vectors **e**_{∥} and **e**_{⊥}, respectively, tangent and orthogonal to the boundary, where **e**_{⊥} always points inside the system and \({{{{{{{{\bf{e}}}}}}}}}_{\perp }={{{{{{{\mathcal{R}}}}}}}}(\frac{\pi }{2}){{{{{{{{\bf{e}}}}}}}}}_{\parallel }\), Eq. (27) is rewritten in a more general form as

with the Frobenius norm defined as \({{{{{{{\bf{A}}}}}}}}:{{{{{{{\bf{B}}}}}}}}={{{{{{{\rm{Tr}}}}}}}}({{{{{{{\bf{A}}}}}}}}{{{{{{{\bf{B}}}}}}}})\) and **D** ≡ *D*_{∥}**e**_{∥}**e**_{∥} + *D*_{⊥}**e**_{⊥}**e**_{⊥}.

## Data availability

The data supporting the main findings of this study are available in the paper and its Supplementary Information. Any additional data can be available from the authors upon request.

## References

Goldbart, P. M. & Kamien, R. D. Tying it all together.

*Phys. Today***72**, 46 (2019).Nakahara, M.

*Geometry, Topology, and Physics*. (CRC Press, Bristol Philadelphia, 2003).Onsager, L. Statistical hydrodynamics.

*Nuovo Cimento Suppl.***6**, 279 (1949).Kosterlitz, J. M. & Thouless, D. J. Long range order and metastability in two dimensional solids and superfluids. (application of dislocation theory).

*J. Phys. C: Solid State Phys.***5**, L124 (1972).Nelson, D. R. & Halperin, B. I. Dislocation-mediated melting in two dimensions.

*Phys. Rev. B***19**, 2457 (1979).Gennes, P.-G. & Prost, J.

*The Physics of Liquid Crystals*. (Clarendon Press Oxford University Press, Oxford New York, 1993).Uchida, N. & Golestanian, R. Synchronization and collective dynamics in a carpet of microfluidic rotors.

*Phys. Rev. Lett.***104**, 178103 (2010).Thampi, S. P., Golestanian, R. & Yeomans, J. M. Velocity correlations in an active nematic.

*Phys. Rev. Lett.***111**, 118101 (2013).Thampi, S. P., Golestanian, R. & Yeomans, J. M. Instabilities and topological defects in active nematics.

*EPL (Europhys. Lett.)***105**, 18001 (2014).Shankar, S., Bowick, M. J. & Marchetti, M. C. Topological sound and flocking on curved surfaces.

*Phys. Rev. X***7**, 031039 (2017).Shankar, S., Souslov, A., Bowick, M. J., Marchetti, M. C. & Vitelli, V. Topological active matter.

*Nat. Rev. Phys.*1–19 https://doi.org/10.1038/s42254-022-00445-3 (2021).Huse, D. A. & Leibler, S. Phase behaviour of an ensemble of nonintersecting random fluid films.

*J. Phys. France***49**, 605 (1988).Kane, C. L. & Lubensky, T. C. Topological boundary modes in isostatic lattices.

*Nat. Phys.***10**, 39 (2014).Delplace, P., Marston, J. B. & Venaille, A. Topological origin of equatorial waves.

*Science***358**, 1075 (2017).Dasbiswas, K., Mandadapu, K. K. & Vaikuntanathan, S. Topological localization in out-of-equilibrium dissipative systems.

*Proc. Natl Acad. Sci.***115**, E9031 (2018).Pedro, R. P., Paulose, J., Souslov, A., Dresselhaus, M. & Vitelli, V. Topological protection can arise from thermal fluctuations and interactions.

*Phys. Rev. Lett.***122**, 118001 (2019).Sone, K., Ashida, Y. & Sagawa, T. Exceptional non-hermitian topological edge mode and its application to active matter.

*Nat. Commun*.**1****1**, 5745 (2020).Murugan, A. & Vaikuntanathan, S. Topologically protected modes in non-equilibrium stochastic systems.

*Nat. Commun.***8**, 13881 (2017).Amir, A., Hatano, N. & Nelson, D. R. Non-hermitian localization in biological networks.

*Phys. Rev. E***93**, 042310 (2016).Tang, E., Agudo-Canalejo, J. & Golestanian, R. Topology protects chiral edge currents in stochastic systems.

*Phys. Rev. X***11**, 031015 (2021).Heiss, W. The physics of exceptional points.

*J. Phys. A***45**, 444016 (2012).Sone, K. & Ashida, Y. Anomalous topological active matter.

*Phys. Rev. Lett.***123**, 205502 (2019).You, Z., Baskaran, A. & Marchetti, M. C. Nonreciprocity as a generic route to traveling states.

*Proc. Natl. Acad. Sci. USA***117**, 19767 (2020).Saha, S., Agudo-Canalejo, J. & Golestanian, R. Scalar active mixtures: the nonreciprocal cahn-hilliard model.

*Phys. Rev. X***10**, 041009 (2020).Knebel, J., Geiger, P. M. & Frey, E. Topological phase transition in coupled rock-paper-scissors cycles.

*Phys. Rev. Lett.***125**, 258301 (2020).Evans, D. J., Cohen, E. G. D. & Morriss, G. P. Probability of second law violations in shearing steady states.

*Phys. Rev. Lett.***71**, 2401 (1993).Gallavotti, G. & Cohen, E. G. D. Dynamical ensembles in nonequilibrium statistical mechanics.

*Phys. Rev. Lett.***74**, 2694 (1995).Kurchan, J. Fluctuation theorem for stochastic dynamics.

*J. Phys. A: Math. Gen.***31**, 3719 (1998).Lebowitz, J. L. & Spohn, H. A gallavotti–cohen-type symmetry in the large deviation functional for stochastic dynamics.

*J. Stat. Phys.***95**, 333 (1999).Jarzynski, C. Equalities and inequalities: Irreversibility and the second law of thermodynamics at the nanoscale.

*Annu. Rev. Condens. Matter Phys.***2**, 329 (2011).Aumaître, S., Fauve, S., McNamara, S. & Poggi, P. Power injected in dissipative systems and the fluctuation theorem.

*Eur. Phys. J*.*B***19**, 449 (2001).Feitosa, K. & Menon, N. Fluidized granular medium as an instance of the fluctuation theorem.

*Phys. Rev. Lett.***92**, 164301 (2004).Puglisi, A., Visco, P., Barrat, A., Trizac, E. & van Wijland, F. Fluctuations of internal energy flow in a vibrated granular gas.

*Phys. Rev. Lett.***95**, 110202 (2005).Zamponi, F., Bonetto, F., Cugliandolo, L. F. & Kurchan, J. A fluctuation theorem for non-equilibrium relaxational systems driven by external forces.

*J. Stat. Mech.***2005**, P09013 (2005).Rahbari, S. H. E., Saberi, A. A., Park, H. & Vollmer, J. Characterizing rare fluctuations in soft particulate flows.

*Nat. Commun.***8**, 11 (2017).Ekeh, T., Fodor, É., Fielding, S. M., & Cates, M. E. Power fluctuations in sheared amorphous materials: a minimal model.

*Phys. Rev. E.***105**, L052601 https://doi.org/10.1103/PhysRevE.105.L052601 (2021).Sekimoto, K. Langevin equation and thermodynamics.

*Prog. Theor. Phys. Suppl.***130**, 17 (1998).Seifert, U. Entropy production along a stochastic trajectory and an integral fluctuation theorem.

*Phys. Rev. Lett.***95**, 040602 (2005).Crooks, G. E. Entropy production fluctuation theorem and the nonequilibrium work relation for free energy differences.

*Phys. Rev. E***60**, 2721 (1999).Maes, C. & Netocný, K. Time-reversal and entropy.

*J. Stat. Phys.***110**, 269 (2003).Hummer, G. & Szabo, A. Free energy reconstruction from nonequilibrium single-molecule pulling experiments.

*Proc. Natl. Acad. Sci. USA***98**, 3658 (2001).Seifert, U. Stochastic thermodynamics, fluctuation theorems and molecular machines.

*Rep. Prog. Phys.***75**, 126001 (2012).Bustamante, C., Liphardt, J. & Ritort, F. The nonequilibrium thermodynamics of small systems.

*Phys. Today***58**, 43 (2005).Spitzer, F. Some theorems concerning 2-dimensional brownian motion.

*Trans. Am. Math. Soc.***87**, 187 (1958).Edwards, S. F. Statistical mechanics with topological constraints: I.

*Proc. Phys. Soc.***91**, 513 (1967).Prager, S. & Frisch, H. L. Statistical mechanics of a simple entanglement.

*J. Chem. Phys.***46**, 1475 (1967).Drossel, B. & Kardar, M. Winding angle distributions for random walks and flux lines.

*Phys. Rev. E***53**, 5861 (1996).Grosberg, A. & Frisch, H. Winding angle distribution for planar random walk, polymer ring entangled with an obstacle, and all that: Spitzer–edwards–prager–frisch model revisited.

*J. Phys. A: Math. Gen.***36**, 8955 (2003).Speck, T., Mehl, J. & Seifert, U. Role of external flow and frame invariance in stochastic thermodynamics.

*Phys. Rev. Lett.***100**, 178302 (2008).Tang, E. & Golestanian, R. Quantifying configurational information for a stochastic particle in a flow-field.

*New J. Phys.***22**, 083060 (2020).Shashikanth, B. N. Vortex dynamics in \({{\mathbb{R}}}^{4}\).

*J. Math. Phys.***53**, 013103 (2012).Khesin, B. The vortex filament equation in any dimension.

*Procedia IUTAM***7**, 135 (2013).Wen, H. & Thiffeault, J.-L. Winding of a brownian particle around a point vortex.

*Philos.Trans. R. Soc. A: Math. Phys. Eng. Sci.***377**, 20180347 (2019).Hurtado, P. I., Pérez-Espigares, C., del Pozo, J. J. & Garrido, P. L. Symmetries in fluctuations far from equilibrium.

*Proc. Natl Acad. Sci. USA***108**, 7704 (2011).Leonard, T., Lander, B., Seifert, U. & Speck, T. Stochastic thermodynamics of fluctuating density fields: Non-equilibrium free energy differences under coarse-graining.

*J. Chem. Phys.***139**, 204109 (2013).Markovich, T., Fodor, E., Tjhung, E. & Cates, M. E. Thermodynamics of active field theories: Energetic cost of coupling to reservoirs.

*Phys. Rev. X***11**, 021057 (2021).O’Byrne, J. Non-equilibrium currents in stochastic field theories: a geometric insight. Preprint at https://arxiv.org/abs/2108.13535 (2021).

Box, S. J., Allen, M. P., Phillips, D. B. & Simpson, S. H. Entropy production in an elementary, light driven micro-machine.

*Front. Phys.***8**, 538 (2020).Dabelow, L., Bo, S. & Eichhorn, R. Irreversibility in active matter systems: Fluctuation theorem and mutual information.

*Phys. Rev. X***9**, 021009 (2019).

## Acknowledgements

We thank Viktoryia Novak for assistance with graphic design. The work has received support from the Max Planck School Matter to Life and the MaxSynBio Consortium, which are jointly funded by the Federal Ministry of Education and Research (BMBF) of Germany, and the Max Planck Society.

## Funding

Open Access funding enabled and organized by Projekt DEAL.

## Author information

### Authors and Affiliations

### Contributions

B.M. designed and performed the simulations and carried out analytical calculations. E.T. contributed analytical calculations and participated in writing the manuscript. R.G. conceived the research, contributed analytical calculations, and supervised the project. All authors analyzed data and contributed to the redaction of the manuscript.

### Corresponding author

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Peer review

### Peer review information

*Nature Communications* thanks the anonymous, reviewer(s) for their contribution to the peer review of this work. Peer reviewer reports are available

## Additional information

**Publisher’s note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Supplementary information

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Mahault, B., Tang, E. & Golestanian, R. A topological fluctuation theorem.
*Nat Commun* **13**, 3036 (2022). https://doi.org/10.1038/s41467-022-30644-6

Received:

Accepted:

Published:

DOI: https://doi.org/10.1038/s41467-022-30644-6

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.