Conservation Laws shape Dissipation

Starting from the most general formulation of stochastic thermodynamics---i.e. a thermodynamically consistent nonautonomous stochastic dynamics describing systems in contact with several reservoirs---, we define a procedure to identify the conservative and the minimal set of nonconservative contributions in the entropy production. The former is expressed as the difference between changes caused by time-dependent drivings and a generalized potential difference. The latter is a sum over the minimal set of flux--force contributions controlling the dissipative flows across the system. When the system is initially prepared at equilibrium (e.g. by turning off drivings and forces), a finite-time detailed fluctuation theorem holds for the different contributions. Our approach relies on identifying the complete set of conserved quantities and can be viewed as the extension of the theory of generalized Gibbs ensembles to nonequilibrium situations.


I. INTRODUCTION
Stochastic ermodynamics provides a rigorous formulation of nonequilibrium thermodynamics for open systems described by Markovian dynamics [ -]. ermodynamic quantities uctuate and the rst and second law of thermodynamics can be formulated along single stochastic trajectories. Most notably, entropy-production uctuations exhibit a universal symmetry, called uctuation theorem (FT). is la er implies, among other things, that the average entropy production (EP) is non-negative. Besides being conceptually new, this framework has been shown experimentally relevant in many di erent contexts [ ]. It also provides a solid ground to analyze energy conversion [ , , ], the cost of information processing [ -], and speed-accuracy trade-o s [ , ] in small systems operating far from equilibrium.
In stochastic thermodynamics, the dynamics is expressed in terms of Markovian rates describing transition probabilities per unit time between states. e thermodynamics, on the other hand, assigns conserved quantities to each system state (e.g. energy and particle number). is means that transitions among states entail an exchange of these conserved quantities between the system and the reservoirs. e core assumption providing the connection between dynamics and thermodynamics is local detailed balance. It states that the log ratio of each forward and backward transition rate corresponds to the entropy changes in the reservoirs caused by the exchange of the conserved quantities (divided by the Boltzmann constant). ese changes are expressed as the product of the entropic intensive elds characterizing the reservoirs (e.g. inverse temperature, chemical potential divided by temperature) and the corresponding changes of conserved quantities in the reservoirs, in accordance to the fundamental relation of equilibrium thermodynamics in the entropy representation. Microscopically, the local detailed balance arises from the assumption that the reservoirs are at equilibrium [ ].
In this paper, we ask a few simple questions which lie at the heart of nonequilibrium thermodynamics. We consider a system subject to time-dependent drivings-i.e. nonautonomousand in contact with multiple reservoirs. What is the most fundamental representation of the EP for such a system? In other words, how many independent nonconservative forces multiplied by their conjugated ux appear in the EP? Which thermodynamic potential is extremized by the dynamics in absence of driving when the forces are set to zero? How do generic time-dependent drivings a ect the EP? Surprisingly, up to now, no systematic procedure exists to answer these questions. We provide one in this paper based on a systematic identi cation of conserved quantities. While some of them are obvious from the start (e.g. energy and particle number) the others are system speci c and depend on the way in which reservoirs are coupled to the system and on the topology of the network of transitions. e main outcome of our analysis is a rewriting of the EP, Eq. ( ), which identi es three types of contributions: A driving contribution caused by the nonautonomous mechanisms, a change of a generalized Massieu potential, and a ow contribution made of a sum over a fundamental set of ux-force contributions. For autonomous systems relaxing to equilibrium-all forces must be zero-, the rst and the third contributions vanish and the dynamics maximizes the potential. is amounts to a dynamical realization of the maximization of the Shannon entropy under the constrains of conserved quantities, which is commonly done by hand when deriving generalized Gibbs distributions. For (autonomous) steady-state dynamics, the rst two contributions vanish and we recover the results of Ref. [ ], showing that conservation laws reduce the number of forces created by the reservoirs.
e key achievement of this paper is to demonstrate that conservation laws are essential to achieve a general and systematic treatment of stochastic thermodynamics.
Important results ensue. We show that system-speci c conservation laws can cause the forces to depend on system quantities and not only on intensive elds. We derive the most general formulation of nite-time detailed FTs expressed in terms of measurable quantities. is result amounts to make use of conservation laws on the FT derived in Ref. [ ]. We identify the minimal cost required for making a transformation from one system state to another one. In doing so we generalize to multiple reservoirs the nonequilibrium Landauer's principle derived in Refs. [ -]. We also apply our method to four di erent models which reveal di erent implications of our theory. is paper is organized as follows. In § II we derive an abstract formulation of stochastic thermodynamics. We then describe the procedure to identify all conserved quantities, which we use to rewrite the local detailed balance in terms of potential and (nonconservative) ow contributions. In § III we use the above decomposition to establish balance equations along stochastic trajectories, which allow us to formulate our nite-time detailed FT, § IV. In § V we discuss the ensemble average description of the EP decomposition and discuss the nonequilibrium Landauer's principle. ree detailed applications conclude our analysis, § VI: in the rst, § VI A, we describe a quantum point contact tightly coupled to a quantum dot; in § VI B we analyze a molecular motor; nally, we investigate a randomized grid in § VI C; In addition, we exemplify our theory throughout the paper using a double quantum dot.

II. EDGE LEVEL DESCPRIPTION
We here introduce continuous-time Markov jump processes, as well as a general formulation of stochastic thermodynamics. We then identify the conservative and nonconservative contributions of the local detailed balance.

A. Stochastic Dynamics
We consider an externally driven open system characterized by a discrete number of states, which we label by n. Transitions between pairs of states, n ν ← m, are denoted by directed edges, e ≡ (nm, ν ). e index ν = 1, . . . labels di erent types of transitions between the same pair of states, e.g. transitions due to di erent reservoirs. e time evolution of the probability of nding the system in the state n, p n ≡ p n (t), is governed by the master equation which is here wri en as a continuity equation. Indeed, the incidence matrix D, transition N e ≡ (χ, r ) conserved quantity χ from reservoir r N y = N χ N r α cycle N α λ conservation law and conserved quantity N λ are expressed in terms of the transition rates, {w ν nm ≡ w e ≡ w e (t)}, which describe the probability per unit time of transitioning from m to n via a transition of type ν . For thermodynamic consistency, each transition e ≡ (nm, ν ) with nite rate w e has a corresponding backward transition −e ≡ (mn, ν ) with a nite rate w −e . e stochastic dynamics is assumed to be ergodic at any time.
Notation From now on, upper-lower indices and Einstein summation notation will be used: repeated upper-lower indices implies the summation over all the allowed values for those indices. e meaning of all the indices that will be used is summarized in Tab. I. Time derivatives are denoted by "d t " or "∂ t " whereas the overdot " " is reserved for rates of change of quantities that are not exact time derivatives. We also take the Boltzmann constant k B equal to 1.

B. Stochastic ermodynamics
Physically, each system state, n, is characterized by given values of some system quantities, {χ n }, for χ = 1, . . . , N χ , which encompass the internal energy, E n , and possibly additional ones, see Tab. II for some examples. ese must be regarded as conserved quantities, as their change in the system is always balanced by an opposite change in the reservoirs. Indeed, when labeling the reservoirs with {r }, for r = 1, . . . , N r , the balance equation for χ can be wri en as quanti es the ow of χ supplied by the reservoir r to the system along the transition e. For the purpose of our discussion, we introduce the index = (χ, r ), i.e. "the conserved quantity χ exchanged with the reservoir r ", and de ne the matrix Y whose entries are {Y e ≡ Y (χ,r ) e }. Enforcing microscopic reversibility, one concludes that Y e = −Y −e . As a rst remark, more than one reservoir may be involved in each transition, see Fig. and the application in § VI A. As a second remark, the conserved quantities may not be solely {χ n }, since additional ones may arise due to the topological properties of the system, as we will see in the next subsection.
FIG. . Pictorial representation of a system coupled to several reservoirs. Transitions may involve more than one reservoir and exchange between reservoirs. Work producing reservoirs are also taken into account.
system quantity χ intensive eld f (χ,r ) energy, E n inverse temperature, β r particles number, N n chemical potential, −β r µ r charge, Q n electric potential, −β r V r displacement, X n generic force, −β r k r angle, θ n torque, −β r τ r TABLE II. Examples of system quantity-intensive eld conjugated pairs in the entropy representation [ , § -]. β r := 1/T r denotes the inverse temperature of the reservoir. Since charges are carried by particles, the conjugated pair (Q n , −β r V r ) is usually embedded in (N n , −β r µ r ), see e.g. Refs. [ , ].
Each reservoir r is characterized by a set of entropic intensive elds, { f (χ,r ) } χ =1, ...,N χ , which are conjugated to the exchange of the system quantities {χ n } [ , § -]. A short list of χ -f (χ,r ) conjugated pairs is reported in Tab. II. e thermodynamic consistency of the stochastic dynamics is ensured by the local detailed balance property, ( ) It relates the log ratio of the forward and backward transition rates to the entropy change generated in the reservoirs, i.e. minus the entropy ow {−f Y e }. e second term on the rhs is the internal entropy change occurring during the transition, since S n denotes the internal entropy of the state n. is point is further evidenced when writing the entropy balance along a transition which expresses the edge EP, the lhs, as the entropy change in each reservoir r plus the system entropy change, the rhs.
In the most general formulation, the internal entropy S n , the conserved quantities {χ n } (hence {Y e }), and their conjugated elds { f }, may change in time. Physically, this modeling corresponds to two possible ways of controlling a system: either through {χ n } or {S n } which characterize the system states, or through { f } which characterize the properties of the reservoirs.
roughout the paper, we use the word "driving" to describe any of these time-dependent controls, while we refer to those systems that are not time-dependently driven as autonomous.
Example . Let us consider the system made of two singlelevel quantum dots (QD) depicted in Fig. a and  Energy, E n , and total number of electrons, N n , characterize each system state: where the rst entry in n refers to the occupancy of the upper dot while the second to the lower. e entries of the matrix Y corresponding to the forward transitions are Fig. c, whereas the entries related to backward transition are equal to the negative of the forward. For instance, along the rst transition the system gains ϵ u energy and 1 electron from the reservoir 1. e vector of entropic intensive elds is given by Since the QDs and the electrons have no internal entropy, S n = 0, ∀ n, the local detailed balance property, Eq. ( ), can be easily recovered from the product −fY . From a stochastic dynamics perspective, the detailed balance property arises when considering fermionic transition rates: w e = Γ e (1 + exp{ f Y e }) −1 and w −e = Γ e exp{ f Y e }(1 + exp{ f Y e }) −1 for electrons entering and leaving the dot.

C. Network-Speci c Conserved antities
We now de ne the procedure to identify the complete set of conserved quantities of a system. For this purpose, let  In this representation, they can be interpreted as cycles, since its entries identify sets of transitions forming loops.
In the examples, we will represent cycles using the set of forward transitions only, and negative entries denote transitions along the backward direction. We denote the matrix whose columns are {C α } by C ≡ {C e α }. By multiplying the matrices Y and C, we obtain the Mmatrix [ ]: is fundamental matrix encodes the physical topology of the system. It describes the ways in which the conserved quantities {χ n } are exchanged between the reservoirs across the system, as its entries quantify the in ux of { } along each cycle, α. e physical topology is clearly build on top of the network topology encoded in C. e bases of coker M, { λ } λ=1, ...,N λ ≡dim coker M , identify the complete sets of conservation laws, are conserved quantities, since their changes along all cycles vanish [ ], and the above equations can be interpreted as balance equations: the lhs identi es the change of {L λ } in the system, while the rhs expresses their change in the reservoirs. Importantly, the vector space spanned by the conserved quantities, {L λ }, encompasses the system quantities {χ n }. ey correspond to χ ≡ χ (χ ,r ) = δ χ χ , so that the balance equations ( ) are recovered. e remaining conservation laws arise from the interplay between the speci c topology of the network, C, and its coupling with the reservoirs, Y , and we will refer to them as nontrivial. Only for these, the row vector may depend on time since M is a function of time, see Ex. and the application in § VI A.
Variations in time of the system properties {χ n } induce changes in the matrix M. If these changes cause a modi cation of the size of its cokernel, i.e. a change in the number of conserved quantities, we say that the physical topology was altered. We emphasize that these changes are not caused by changes in the network topology since this la er remains unaltered. An example of change of physical topology is given in the Ex. and in the application in § VI C, while one of a changed network topology is brie y discussed in § VI B.
Example . We now come back to the two single-level QDs depicted in Fig FIG. . e independent set of cycles corresponding to the columns of C in Eq. ( ). e rst corresponds to the sequence "electron in u → electron in d → electron out of u → electron out of d", in which the lower QD is populated by the third reservoir. e second and third cycle correspond to the ow of one electron from the second reservoir to the third one, when the upper QD is empty and lled, respectively. the above matrix, e rst vector identi es the energy state variable, E n , ( ) e other two, instead, give the occupancy of the upper and lower dots, N u n and N d n ,

( )
A posteriori, we see that these conservation laws arise from the fact that no electron transfer from one dot to the other is allowed. e total occupancy of the system, N n , is recovered from the sum of the last two vectors. Despite u and d are nontrivial conservation laws, they do not depend on any system quantity, Eq. ( ), [ ].
Let us now imagine that the interaction energy between the two dots is switched o , i.e. u → 0. Two conservation laws emerge in addition to those in Eq. ( ) e rst is related to the upper-lower QD decoupling, as it corresponds to the conservation of energy of the lower dot ( ) e conservation of energy in the upper dot is obtained as the di erence between Eqs. ( a) and ( a), and it reads ( ) e second one, Eq. ( b), arises from the tight coupling between the transport of energy and ma er through the second dot. Since t is in coker Y , the conserved quantity L t n is a constant for all n, which can be chosen arbitrarily, see Remark . Notice the dependence on the system quantity ϵ d of the nontrivial conservation law ( b). We thus showed that changes of system quantities (u in our case) can modify the properties of M, and hence the set of conservation laws-without changing the network topology.

D. Network-Speci c Local Detailed Balance
We now make use of the conserved quantities, {L λ }, to separate the conservative contributions in the local detailed balance ( ) from the nonconservative ones. To do so, we split the set { } into two groups: a "potential" one { p }, and an "force" one { f }. e rst must be constructed with N λ elements such that the matrix whose entries are { λ p } is nonsingular. We denote the entries of the inverse of the la er matrix by { p λ }. Crucially, since the rank of the matrix whose rows are { λ } is N λ , it is always possible to identify a set of { p }. However, it may not be unique and di erent sets have di erent physical interpretations, see Exs. and as well as the following sections. e second group, With the above prescription, we can write the entries ( ) e local detailed balance ( ) can thus be rewri en as ( ) e rst contribution is conservative since it derives from the potential is a linear combination of entropic intensive elds. Since ϕ n is the entropy of the state n minus a linear combination of conserved quantities, it can be viewed as the Massieu potential of the state n.
[We recall that Massieu potentials are the thermodynamic potentials of the entropy representation, see [ , § -].] In contrast, the nonconservative fundamental forces, are caused by the presence of multiple reservoirs. Importantly, "fundamental" must be understood as a property of the set of these forces, since they are independent and in minimal number.
Remark . We saw that driving in the system quantities {χ n }, may induce changes in the physical topology, whereas the driving in the reservoir properties, { f },-as well as in the entropy, S n -is unable to do so. Accordingly, ϕ n and {F f }, Eq. ( ), change: the break of conservation laws entails the emergence of fundamental forces, and vice versa the creation of conservation laws destroys some fundamental forces and creates additional terms in ϕ n , see Ex. .

Remark .
Even in absence of topological changes, the form of ϕ n and {F f } may change in presence of driving. It is clear that ϕ n changes when {χ n }, S n , or { f p } change, see Eq. ( ).
Notice that since { f p } are entropic elds, they always depend on the inverse temperature of the reservoirs that they refer to, see Tab. II. Hence, whenever f f is a eld conjugated with the exchange of energy with one of the reservoirs in { p }-i.e. an inverse temperature that appears in { f p }-, its changes will a ect ϕ n , too. Changes in the other f f , leave ϕ n unaltered. In turn, the fundamental forces depend on both { f p } and { f f }, see Eq. ( ). But in presence of nontrivial conservation laws, they may also depend on the system quantities {χ n } via the vectors { λ }, see Ex. and the application in § VI A.
e identi cation of ϕ n and {F f } and their relation with the local detailed balance, Eq. ( ), is the key result of our paper and we summarize it in Fig. . e complete set of conservation laws played an essential role in this identi cation. In the following sections we will explore the various physical implications of Eq. ( ).
Example . We now provide the expressions of ϕ n and F f for the two single-level QDs depicted in Fig. a From Eq. ( ) we see the validity of this spli ing, as the matrix whose entries are { λ p } is an identity matrix. e elds conjugated with the complete set of conservation laws, Eq. ( ), are from which the Massieu potential of the state n follows ( ) e fundamental forces are given by ( c) e rst two forces rule the energy owing from the rst to the second and third reservoir, respectively, whereas the third force rules the electrons owing from the second to the third reservoir.
Concerning the way the changes of ϕ n and {F f } are intertwined, we see that the former depends on β 1 , µ 1 , µ 2 , and β 2 , which arises from f (N ,2) . erefore, while the changes of f (E,3) = β 3 and f (N ,3) = −β 3 µ 3 only a ect the forces, the changes of f (E,2) = β 2 a ect both the forces and ϕ n . Since the vectors of conservation laws ( ) do not depend on {χ n }, see Ex. , the forces do not depend on {χ n } either.
Alternatively, one may split the set With respect to the previous decomposition, the interest here is shi ed from the energy ow in the second reservoir, to that in the rst reservoir, and the electrons ow from the third to the second reservoir.
Let us now imagine that the interaction energy u vanishes, as in the previous example. e ve conservation laws that we consider are E n , E d n , N u n , N d n , L t n , and we choose to split whereas the only force is We see that the creation of two conservation laws destroyed two forces, Eqs. ( a) and ( b), whose expression can be spo ed in the new potential, Eq. ( ). Notice also how the emergence of the nontrivial conservation law ( b) makes the fundamental force dependent on the system quantity ϵ d .  (2) and (10) M α Eq. (11) topology physical FIG. . Schematic representation of our local detailed balance decomposition, which we summarize as follows. On the one hand, the system is characterized by those system quantities which are exchanged with the reservoirs along transitions, as well as by the topological properties of its network of transitions. e former is accounted for by the matrix of exchanged conserved quantities Y , while the la er by the incidence matrix, D, Eq. ( ), which determines the matrix of cycles, C, Eq. ( ). ese two matrices combined give the M-matrix, Eq. ( ), which encodes the physical topology of the system and whose cokernel identi es the complete set of conservation laws and conserved quantities, Eq. ( ) and ( ). On the other hand, the reservoirs are characterized by entropic intensive elds, { f }, which combined with the matrix of exchanged conserved quantities, Y , gives the local detailed balanced, Eq. ( ). Having identi ed all conservation laws, the variables can be split into "potential" , { p }, and "force" , { f }. e rst group identi es a Massieu potential for each state n, ϕ n , Eqs. ( ), while the second one identi es the fundamental forces, Eq. ( ). ese two set of thermodynamic quantities are thus combined in the local detailed balanced, ( ).

E. Fundamental Cycles
We now show the conservative-nonconservative-forces decomposition of the local detailed balance in terms of cycle a nities. e thermodynamic forces acting along cycles are referred to as cycle a nities. Using the local detailed balance ( ), they read As observed in Ref. [ ], di erent cycles may be connected to the same set of reservoirs, thus carrying the same cycle a nity. ese are regarded as symmetries and they correspond to bases of ker M, {ψ ρ } ρ=1, ...,N ρ ≡dim ker M , as its entries identify sets of cycles which, once completed, leave the state of the reservoirs unchanged, see Ex. and the application in § VI C. As rst derived in Ref. [ ], the ranknullity theorem applied to the matrix M allows us to relate the number of symmetries to the number of conservation laws Notice that, while the N y and N α are xed for a given system, N λ , and hence N ρ , can change due to changes in the physical topology. From Eq. ( ) we thus learn that for any broken (resp. created) conservation law, a symmetry must break (resp. be created), see Ex. . e symmetries identi ed by Eq. ( ) lead us to de ne N η := N α − N ρ cycles, labeled by η, for which the entries of M, {M η }, identify a maximal rank matrix. ese cycles can be thought of as physically independent, since they cannot be combined to form cycles that leave the reservoirs unchanged upon completion. We refer to these cycles as fundamental cycles. As a result, the matrix whose entries are {M f η } is square and nonsingular, see Note [ ], and there is a oneto-one correspondence between fundamental forces, Eq. ( ), and cycle a nities corresponding to fundamental cycles, where {M η f } are the entries of the inverse matrix of that having {M f η } as entries. We will refer to {A η } as fundamental a nities. In terms of these la er, the local detailed balance, Eq. ( ), reads quanti es the contribution of each transition e to the current along the fundamental cycle η as well as all those cycles which are physically dependent on η, see Ex. . Algebraically, the row vectors of ζ , {ζ η }, are dual to the physically independent cycles, {C η }, Example .
e two single-level QD, Fig. a, has no symmetries for u 0, since its M-matrix, Eq. ( ), has empty kernel. Its three cycle a nities, Eqs. ( ) and ( ), are thus fundamental and read while the matrix relating fundamental cycles to edges, Eq. ( ), is given by In sharp contrast with the fundamental forces, Eq. ( ), the fundamental a nities, Eq. ( ), depend both on the elds, Eq. ( ), and the system quantities, Eq. ( ).
As the interaction energy is turned o , two symmetries emerge: in agreement with the creation of two conservation laws, see Eqs. ( ) and ( ). ey inform us that since the QDs are decoupled: (i) the cycle 1 does not produces changes in the reservoirs, i.e. its a nity is zero; (ii) the cycle 2 and 3 are physically dependent since the ow of electrons from the second to the third bath is the same with empty and lled upper dot. Choosing the third cycle as the fundamental one, its a nity reads ( ) whereas the matrix of cycle contributions, see Eq. ( ) and Ex. , reads Notice that both the transition +3-which belongs to the cycle 2-and +6-which belongs to the cycle 3-contribute to the current along the fundamental cycle 3.

F. Detailed-Balanced Networks
A dynamics is detailed balanced if at any stage the forces are zero or equivalently the a nities are zero-see Eq. ( ). A driven detailed-balance dynamics implies that the driving must keep the forces equal to zero at all times, while changing the potential ϕ n . An autonomous detailed-balanced dynamics will always relax to an equilibrium distribution [ , ] p eq n = exp ϕ n − Φ eq , ( ) de ned by the detailed balance property: w ν nm p eq m = w ν mn p eq n , ∀ n, m, ν. e last term, Φ eq , is the log of the partition function Remark . One can transform a nondetailed-balance dynamics with the potential ϕ n into a detailed-balanced dynamics with the same potential, if one can turn o the forces-set them to zero-without changing the potential. Example . From Eq. ( ), we see that the two single-level QDs model of Fig. is detailed balanced when β 1 = β 2 = β 3 and µ 2 = µ 3 . In this case the Massieu potential of state n, Eq. ( ), is given by ( ) e only element distinguishing the la er from that in Eq. ( ) is the fact that β 2 = β 1 , which arises from F (E,2) = 0. erefore, a nondetailed-balanced dynamics described by the decomposition ( )-( ) can become detailed-balance without changing ϕ n as long as F (E,2) = 0. e decomposition ( )-( ), instead, requires both F (E,1) and F (E,3) to be zero.

Remark .
e equilibrium distribution, Eq. ( ), can be obtained from a Maximum Entropy approach [ , ]. Indeed, the distribution maximizing the entropy functional constrained by given values of the average conserved quantities { L λ = L λ }, is is the equilibrium distribution, Eq. ( ), when the Lagrange multipliers are given by a = Φ eq and a λ = F λ , see Eq. ( ) and ( ).

III. TRAJECTORY LEVEL DESCRIPTION
We now scale our description to the level of trajectories. A stochastic trajectory of duration t, n t , is de ned as a set of transitions {e i } sequentially occurring at times {t i } starting from n 0 at time t 0 . If not otherwise stated, the transitions index i runs from i = 1 to the last transition prior to time t, N t , whereas the state at time τ ∈ [t 0 , t] is denoted by n τ . e values of S n , {χ n }, and { f } between time t 0 and an arbitrary time t are all encoded in the protocol π τ , for τ ∈ [t 0 , t].
We rst derive the balance for the conserved quantities, Eq. ( ). e conservative and nonconservative contributions identi ed at the level of single transitions via the local detailed balance, Eqs. ( ) and ( ), are then used to decompose the trajectory EP into its three fundamental contributions.

A. Balance of Conserved antities
Since the conserved quantities are state variables their change along a trajectory for a given protocol reads ( ) e rst term on the rhs accounts for the instantaneous changes due to the time-dependent driving, while the second accounts for the nite changes due to stochastic transitions, since are the trajectory-dependent instantaneous currents at time τ . Using the edge-wise balance, Eq. ( ), we can recast the above equation into quantify the instantaneous in ux of at time t.
B. Entropy Balance e trajectory entropy balance is given by As for the edge-wise balance, Eq. ( ), the lhs is the EP, while the rst and second term on the rhs are the entropy ow dynamics ∆Φ σ autonomous NESS driven detailed-balanced autonomous detailed-balanced TABLE III. Entropy production for common processes. " " denotes vanishing or negligible contribution, NESS is the acronym of nonequilibrium steady state. and the entropy change of the system [ , ]. Using our decomposition of the local detailed balance, Eq. ( ), we can recast the la er equality into Since ϕ n is a state variable, its variations along the trajectory can be wri en as Eq. ( ), is the major result of our paper. It shows the EP decomposed into a time-dependent driving contribution, a potential di erence, and a minimal set of ux-force terms. e rst term only arises in presence of time-dependent driving. It quanti es the entropy dissipated when ϕ n is modi ed and we refer to it as the driving contribution. e second term is entirely conservative as it involves a di erence between the nal and initial stochastic Massieu potential, Eq. ( ). e last terms are nonconservative and prevent the systems from reaching equilibrium. Each σ f [n t |π ] quanti es the entropy produced by the ow of { f }, and we refer to them as ow contributions.
To develop more physical intuition of each single term, we now discuss them separately and consider some speci c cases. When writing the rate of driving contribution explicitly, Eq. ( ), one obtains When all { λ } are independent from system quantities, the terms, {∂ τ F λ L λ,n }, account for the entropy dissipated during the manipulation of the intensive elds { p }, Eq. ( ). In contrast, {F λ ∂ τ L λ,n } and −∂ τ S n characterize the dissipation due to the direct manipulation of the system quantities. e changes of those f f that are not elds conjugated with the exchange of energy with a reservoir in { p } do not contribute to [n t |π ], see Remarks and . For autonomous networks, the EP becomes are the integrated currents of { f } along the trajectory. e di erence between the nal and initial stochastic Massieu potential captures the dissipation due to changes of the internal state of the system. For nite-dimensional autonomous networks, it is typically subextensive in time and negligible with respect to the nonconservative terms for long trajectories ( ) e nonconservative ow contributions, Eqs. ( ) and ( ), quantify the dissipation due to the ow of conserved quantities across the network. Finally, for autonomous detailedbalanced systems, the nonconservative terms vanish, in agreement with the fact that these systems exhibit no net ows, and the EP becomes ( ) Table III summarizes the contributions of the EP for these common processes.
Remark . It may occur that the driving protocol causes a change of the physical topology, which consequently alters the EP decomposition, see Remark and Exs. and . e trajectory must be thus decomposed into subtrajectories characterized by the same physical-topology properties. For each of these, our decomposition ( ) applies.

Remark .
e contributions of the EP in Eq. ( ) depend on the choice of { p } and { f }. When aiming at quantifying the dissipation of a physical system, some choices may be more convenient than others depending on the experimental apparatus, see next Example. is freedom can be thought of as a gauge of the EP. In the long time limit, it only a ects the ow contributions and it can be understood as a particular case of the gauge freedoms discussed in Refs. [ , ], which hinge on graph-theoretical arguments.
Example . For the sake of illustration let us assume that the system energy, E n (t), the chemical potential of the second reservoir, µ 2 (t), and the temperature of the third one, β 3 (t), are controlled in time, in our favorite model of two single-level QDs. According to the expressions of ϕ n and {F f } derived in Ex. , we can distinguish two driving contributions of the EP, Eqs. ( ) and ( ): where the rst term, is usually referred to as mechanical work in stochastic thermodynamics (up to β 1 ), while the second, is the entropy dissipated due to the change of the chemical potential of the second reservoir. e ow contributions, Eq. ( ), are instead given by where, the forces are given in Eq. ( ), while the instantaneous currents of f are given by We thus see that the rst and the second ow contribution, Eqs. ( a) and ( b), quantify the dissipation due to the energy ow in the second and third reservoir, respectively. Analogously, the third contribution, Eq. ( c), characterizes the EP due to the ow of electrons in the third reservoir. e total EP of the system is thus the sum of the terms in Eqs. ( ) and ( ) plus a di erence of stochastic Massieu potential, Eqs. ( ) and ( ). We notice that the change in time of β 3 is accounted for by the second and third ows, Eqs. ( b) and ( c), while not by a driving contribution, as β 3 does not contribute to ϕ n , Eq. ( ).
It is worth noting that, from an experimental point of view, the driving contribution demands information on the states of the trajectory. Instead, the ow contributions require the measurement of the energy ow in the second and third reservoir and the electron ow in the third. Let us now compare the above decomposition with that based on a di erent choice of { p , f }, e.g. the second one made in Ex. ( ). In this case the driving contribution reads, ( ) e ow contributions read as in Eq. ( ) with forces given in Eq. ( ) and other expressions for the currents. Now, the measurement of the energy ow in the rst and third reservoir, as well as the electron ow in the second reservoir, are required to quantify these terms in experiments.
To make the di erence between the two choices even sharper, one can easily see that if the only quantity changing in time is µ 2 , the driving contribution of the second choice vanishes while that of the rst does not. erefore, depending on the physical system and the experimental apparatus, one choice may be more convenient than another when it comes to estimating the dissipation.

Remark .
e driving contribution and the nonequilibrium Massieu potential Φ n are de ned up to a gauge. is is evidenced when transforming the state variables {L λ } according to where {U λ λ } identify a nonsingular matrix, {u λ } are nite coe cients, and {1 n } a vector whose entries are 1. e rst term can be considered as a basis change of coker M, while the second as a reference shi of L λ . Under the transformation ( ), the elds ( ) transform as so that scalar products are preserved. As a consequence, the stochastic Massieu potential, Eq. ( ), and the rate of driving contribution, Eq. ( ), transform as Crucially, neither the local detailed balance ( ) nor the EP ( ) are a ected, as the physical process is not changed. Also, if only a basis change is considered, {u λ = 0}, then f(t) = 0, and both Φ n and are le unchanged. Finally, for cyclic protocols, it is easily shown that the driving work over a period is unchanged, since the gauge term f(t) is non uctuating. e above gauge is akin to that a ecting the potential-work connection and which led to several debates, see Ref.
[ ] and references therein. e problem is rooted in what is experimentally measured, as di erent experimental set-ups constrain to di erent gauge choices [ ]. We presented a general formulation of the gauge issue, by considering reference shi s of any conserved quantity, and not only of energy.

Fundamental Cycles
An equivalent decomposition of the EP, Eq. ( ), can be achieved using the potential-a nities decomposition of the local detailed balance, Eq. ( ): quantify the dissipation along the fundamental cycles, as {ζ η,e e (τ )} η=1, ...,N η are the corresponding instantaneous currents, Eq. ( ). For autonomous networks, the EP becomes Example . For the scenario described in the previous example, Ex. , the ow contributions along fundamental cycles ( ) read where the a nities are given in Eq. ( ) and the cycle-edge coupling matrix ζ in Eq. ( ). Concerning their physical interpretation, the rst contribution corresponds to the ow of energy from the third reservoir to the rst, while the la er two to the entropy dissipated when transferring electrons from the second reservoir to the third with empty and lled upper dot, respectively.

IV. FINITE-TIME DETAILED FLUCTUATION THEOREM
e driving and ow contributions of the EP, Eq. ( ), satisfy a nite-time detailed FT. We consider a forward (resp. backward) process characterized by the following properties: . e system is initially prepared at equilibrium, Eq. ( ), which is identi ed by the potential ϕ n (0) (resp. ϕ n (t)). It corresponds to the protocol state π i (resp. π f ), in which all fundamental a nities vanish. b a c k w a r d : π † τ f o r w a r d : π τ noneq: ϕ n (t ), π t noneq: ϕ n (t ), π f equilibrium: ϕ n (0), π i equilibrium: ϕ n (t ), π f noneq: ϕ n (0), π 0 relaxation: FIG. . Schematic representation of the forward and backward processes. e forward process starts at equilibrium, which corresponds to the initial protocol state π i . At time 0, the protocol is switched on, π i → π 0 , and the system evolves driven by π τ until time t, when the protocol is switched o , π t → π f . Importantly, the initial and nal switches must not change the initial and nal potential ϕ n (0) and ϕ n (t). E ectively, all the forces F f whose eld f f is conjugated with the exchange of energy with one reservoirs in { p } must be vanishing for π 0 and π t , see Remark . e backward process starts at the equilibrium de ned by π f and evolves according to the timereversed protocol: π f → π † 0 -π † τ -π † t → π i . e relaxation to the equilibrium initial condition of the backward process that follows the switching o of forward protocol is irrelevant for the FT.
. e driving protocol of the forward process, π τ , (resp. of the backward process, π † τ := π t −τ ), is arbitrary between [0, t] except at the boundaries 0 and t, where π 0 and π t must be such that the instantaneous switch from π i to π 0 (resp. from π f to π t ) leaves ϕ n (0) (resp. ϕ n (t)) invariant, see Fig. . e nite-time detailed FT states that the forward and backward process are related by is the probability of observing a driving contribution to the EP and ow ones {σ f } along the forward process. Instead, P † t (− , {−σ f }) is the probability of observing a driving contribution equal to − and ow ones {−σ f } along the backward process. e di erence of equilibrium Massieu potentials ( ) refers to the equilibrium distributions ruled by ϕ n (t) and ϕ n (0). When marginalizing with respect to the probability distribution of the backward process, the integral FT ensues We prove Eq. ( ) in App. A using a generating function technique which is new to our knowledge.
To provide a physical interpretation of the argument of the exponential on the rhs of ( ), let us observe that once the protocol is switched o , π t → π f , all fundamental forces vanish and the system relaxes to the equilibrium initial condition of the backward process. During the relaxation, neither nor {σ f } evolve and the EP is equal to Φ eq f − Φ n t , Eq. ( ). erefore, the argument of the exponential can be interpreted as the dissipation of the ctitious composite process "forward process + relaxation to equilibrium".
For protocols keeping the potential ϕ n constant, viz. = 0, the FT ( ) reads Notice that those ow contributions corresponding to f f that are elds related to the exchange of energy with reservoirs in { p } must vanish at all time for the condition to be ful lled. Yet a more speci c case is that of autonomous protocols, for which the above FT becomes wri en in terms of integrated currents of { f }, Eq. ( ). Notice that since nothing distinguishes the forward process from the backward, the lhs is the ratio of the same probability distribution but at opposite values of {I f }, see application in § VI B. Eq. ( ) builds on the FT rst derived in Ref. [ ], which is recovered when solely accounting for nontrivial conservation laws , {χ n }. In this case, the number of forces increases (they are not fundamental anymore) and the number of conservation laws that appear in the Massieu potential is decreased.
is has two crucial consequences: (i) the equilibrium distribution becomes a particular case of Eq. ( ), since it is obtained by imposing additional forces to vanish; (ii) a part of the driving EP becomes a ow contribution, and-as one can check by comparing the two formulations of the FT-the requirement is always satis ed. Finally, the Jarzynski-Crooks-like FTs [ , ] are recovered for vanishing fundamental forces, i.e. in detailed-balanced systems, Remark . As we discussed in Eq. ( ), the driving contribution consists of several subcontributions, one for each timedependent parameter appearing in ϕ n . We formulated the nite-time FT ( ) for the whole , but it can be equivalently expressed for the single subcontributions, see next Example.
Example . We now illustrate the conditions under which our FT applies to the coupled QD, Fig. . e process must start from equilibrium, Eq. ( ): all forces vanish and the potential is given in Eq. ( ). As the protocol is switched on, it must leave the elds appearing in ϕ n , Eq. ( ), (β 1 , β 2 (= β 1 ), µ 1 , and µ 2 ) unchanged, but all the others can be set to arbitrary values. Subsequently, all elds and system quantities can change controlled by π τ for τ ∈ [0, t]. At time t, the force in Eq. ( a) must be turned o , so that when the protocol is switched o -or equivalently the backward protocol is switched on-, ϕ n (t) does not change. When the above force vanishes at all times, one can formulate FTs like those in Eqs. ( ) and ( ).
To simplify the application of the FT let us consider the conditions described in Ex. , with the further simpli cation that all temperatures are equal and constant: only the E n and µ 2 change in time. Since β 2 = β 1 at all times, condition is satis ed and an application of Eq. ( ) gives us where the di erent contributions involved are given in Eqs. ( ), ( ), and ( c).

FT for Flow Contributions along Fundamental Cycles
In terms of the probability P t ( , {γ η }) of observing driving contribution and {γ η } ow contributions along the fundamental cycles, the above FT reads Its proof is discussed in App. A. Notice that, in the same way the condition imposes that some forces must be vanishing at time 0 and t, see Fig. , here some combination of fundamental a nities must vanish. ese combinations are readily identi ed using the relationship between {F f } and {A η }, Eq. ( ), see Ex. ( ). For those autonomous processes in which the above condition is ful lled at all times, one can express the FT for the integrated currents along fundamental cycles, Eq. ( ), Example . We saw in the previous example that the force F (E,2) , Eq. ( a), must be zero at time 0 and t for the FT ( ) and at all times for the FTs ( ) and ( ). Using Eq. ( ) in combination with the inverse of the submatrix of ( ) whose entries are {M f η }, we conclude that the above requirement becomes in terms of fundamental a nities, Eq. ( ).

V. ENSEMBLE AVERAGE LEVEL DESCRIPTION
We now present our results at the ensemble average level and derive a general formulation of the Nonequilibrium Landauer's Principle.

A. Balance of Conserved antities
Using the master equation ( ) and the edge-wise balance ( ), the balance equation for the average rates of changes of conserved quantities reads is the average change due to the driving, is the average currents of , see Eqs. ( ) and ( ), and ( ) accounts for the average ow of the conserved quantities in the reservoirs. Obviously, the balances ( ) can also be obtained by averaging the trajectory balances ( ) along all stochastic trajectories.

B. Entropy Balance
In contrast to conserved quantities, entropy is not conserved.
e EP rate measures this nonconservation and is always non-negative Σ ≡ n,m,ν w ν nm p m ln w ν nm p m w ν mn p n ≥ 0 .
( ) e EP decomposition in driving, conservative and ow contributions at the ensemble level, can be obtained by averaging Eq. ( ). Alternatively, one can rewrite Eq. ( ) as where we used the local detailed balance property ( ) and the de nition of average physical current ( ). e rst term is the average rate of entropy ow, while the second is the rate of change of the average system entropy. Using the spli ing of the set { } explained in § II, the physical currents of { p } can be expressed as where we partially inverted Eq. ( ). When combined with Eq. ( ), the EP rate can be wri en as = − n ∂ t ϕ n p n is the driving contribution, σ f = −F f I f the ow contributions, and Φ = n p n Φ n ( ) the nonequilibrium Massieu potential.

C. Nonequilibrium Massieu potential
In detailed-balanced systems, the nonequilibrium Massieu potential takes its maximum value at equilibrium, Eq. ( ), where it becomes the equilibrium Massieu potential, Eq. ( ). Indeed, where D(p p eq ) := n p n ln p n p eq n ( ) is the relative entropy between the nonequilibrium distribution and the equilibrium one which quanti es the distance from equilibrium.
Remark . For autonomous detailed-balanced networks, the di erence of equilibrium and nonequilibrium initial Massieu potential, Eq. ( ), gives the average dissipation during the relaxation to equilibrium, Σ = D(p(t 0 ) p eq ) ≥ 0. is shows how the MaxEnt principle mentioned in Remark is embedded in the stochastic thermodynamic description (see also Ref. [ ]).

D. Nonequilibrium Landauer's Principle
We now express Eq. ( ) in terms of a well de ned equilibrium distribution, obtained by turning o the forces without modifying the potential ϕ n . We already discussed that this procedure is always well de ned for isothermal systems but requires more care for nonisothermal systems, see Remark . Combining Eqs. ( ) and ( ), one nds that where we introduced the average irreversible driving contribution also ow EP must be consumed to move a system away from equilibrium, as depicted in Fig. , and that the minimal cost for doing so is precisely measured by the change in relative entropy. For driven detailed-balanced protocols connecting two equilibrium states, we recover the classical result that irr = Σ ≥ 0.

VI. APPLICATIONS
We here illustrate our formalism and main results on three more systems: a QD coupled to a quantum point contact, a molecular motor and a randomized grid.

A. QD coupled to a QPC
Here, we consider a simpli ed description of a two levels QD coupled to a thermal reservoir and a quantum point contact (QPC), Fig. . For a more detailed analysis of this class of systems we refer to Ref. [ ]. e interest of this model lies in the transition triggered by the QPC, which involves the interaction with more than one thermal reservoir. e two states of the QD, l for "low" and h for "high", are characterized by di erent energies but the same number of electrons ( ) e transition between these states can occur following either a phononic interaction with the rst reservoir, ±1, or following electron tunneling from the second to the third reservoir, ±2. Along the la er transition, an electron with energy u +ϵ leaves the second reservoir and enters the third with energy u. e +1 +2 . Model of QD coupled with a thermal reservoir and a pair of particle reservoirs modeling a QPC. e electron can jump to the excited state following either a phononic interaction with the rst reservoir or an interaction with the QPC. e la er involves an electron current from the second to the third reservoir. matrix of exchanged conserved quantities, Y , thus reads ( ) e nontrivial local detailed balance property for the second transition follows from −fY , and reads follows from the product of Y , Eq. ( ), and the matrix of cycles, ( d) e rst two conservation laws are clearly the energy and the number of particles, Eq. ( ), since E Y = (ϵ, ϵ) and N Y = (0, 0), while the other two to other constants, since 3 Y = 4 Y = (0, 0). Mindful of the gauge freedom described in Remark we can set the conserved quantities related to N , 3 , and 4 to zero. When (E, 1) is set as "force" , the eld related to the energy conservation law determine the values of the nonequilibrium Massieu potential, ϕ n = −F E E n . Concerning the nonconservative contributions, the fundamental force and the fundamental a nity read Due to the emergence of nontrivial conservation laws, Eqs. ( c) and ( d), the fundamental force depends on a system quantity. In detailed balance dynamics, F (E,1) = 0, and we readily recover ϕ n = −β 1 E n .

B. Molecular Motor
Our thermodynamic description is also applicable to biological systems, as we now show on a molecular motor moving on a one-dimensional space, see Refs. [ , ]. e presence of a work producing reservoir distinguishes this model from those described so far. e motor conformations and transitions are described in Fig. . It can step against a mechanical force k thanks to the chemical force produced by the hydrolysis of ATP into ADP, which are exchanged with reservoirs at chemical potential µ ATP and µ ADP . We label each state of the process by n = (m, x), while each transition by e x , where e ∈ {1, 2, 3, 4, 5, 6, 7} refers to the transitions at a given position x ∈ Z.
e system quantities are the internal energy, E n = ϵ m , the total number of ATP plus ADP molecules a ached to the motor, N n = N m , and the position, X n = xl where l is the size of a step. Importantly, each internal state is characterized by an internal entropy S n = s m . e matrix of exchanged conserved quantities for the transitions at given position x is wri en as Internal transitions may entail the exchange of ATP and ADP molecules with particle reservoirs (green arrows) or the hydrolysis of ATP into ADP (blue arrows). e la er only exchange energy with the thermal reservoir at inverse temperature β.
On the other side, the row vector of intensive variables is given by Di erently from all previous cases, the local detailed balance of the step transitions involves the work producing reservoir, (X , −βk), Notice that the interpretation of the rst term as minus entropy ow still holds: q +1 x ≡ (ϵ TD − ϵ DT ) − kl, since the last term is minus the work that the mechanical force exerts on the system along the step [ , ]. It is easily shown that the subnetwork at given x contains exactly one cycle c x , which entails the intake of two ATP molecules and the release of two ADP ones which clearly corresponds to the three system quantities, E n , N n , and X n , respectively. As far as the symmetries are concerned, the intersection between its in nite-dimensional column vector space and its (in nite-dimensional) kernel is one-dimensional, in agreement with the observation that all cycles {c x } are physically dependent on one. In other words, there is an in nity of symmetries and all cycles carry the same cycle a nity which is thus regarded as the fundamental a nity.
To illustrate our EP decomposition, we use {(E), (N , ADP), (X )} as set of p , while leaving (N , ATP) as f . Guided by Eqs. ( ) and ( ), the potential reads ϕ n = ω n + βkX n , ( ) where ω n := S n − βE n + β µ ADP N n , ( ) is the Massieu potential corresponding to the grand potential. e fundamental a nities, Eq. ( ), consist solely of ( ) e EP along a stochastic trajectory with autonomous protocol, Eq. ( ), is is the total number of ATP molecules owing into the system, while Φ is the stochastic Massieu potential related to ( ), Eq. ( ). Since there is only one fundamental force, the EP in terms of fundamental a nities reads exactly as Eq. ( ).
To illustrate the nite-time detailed FT, let us imagine a system with a nite number of positions x = 1, . . . , N x . e potential ( ) thus de nes a physical equilibrium state, Eq. ( ), achieved when the force is turned o : µ ATP = µ ADP . At time 0, the autonomous protocol with µ ATP µ ADP (but with the same µ ADP as at equilibrium) is switched on and the system moves far from equilibrium. Notice that any switch of µ ATP leaves ϕ n unaltered, Eq. ( ), and the process can be stopped at any time t. Hence, the probability of observing the intake of I ATP ATP molecules up to time t satis es To formulate a FT which explicitly counts the number of steps, we have to make a step backward and regard the conservative term βkl in the local detailed balance, Eq. ( ), as an additional force term, rather than as a conservative term. Under this condition the EP can be recast into where Ω n = ω n − ln p n ( ) is the stochastic Massieu potential corresponding to Eq. ( ), while X[n t ] := X n t − X n 0 ( ) the total distance traveled by the motor. If the system is initially prepared in the grandcanonical equilibrium stateachieved by turning o both the external force k and the fundamental force F (N ,ATP) -the FT reads Here, both µ ATP and k must be turned on at time 0.
Tightly coupled model As an example of change of network topology, we now consider the tightly coupled description in which the transitions {5, 6, 7} are absent, and the network becomes a one-dimensional chain of states. Since there are no cycles the whole row space of Y spans the conservation laws, which can thus be wri en as With respect to the previous model, the number of ATP and ADP molecules are separately conserved quantities, Eqs. ( b) and ( c). e set of fundamental forces is empty while the potential reads ϕ n = S n −βE n +β µ ATP N ATP n +β µ ADP N ADP n +βkX n , ( ) thus making the dissipation equal to In summary, the change of network topology achieved by removing transitions leading to cycles, prevents the reservoirs from creating forces. e potential will be thus described with the maximum amount of conserved quantities, one for each . dτ +1 x (τ ) − −1 x (τ ) .

( )
Hence, the expression of the EP and the formulation of the nite-time detailed FT read as in Eqs. ( ) and ( ), respectively.
In conclusion, the periodic boundary condition can be viewed as a change of network topology in which one conservation law is destroyed and a fundamental force is created.

C. Randomized Grid
As a nal illustration, we consider an abstract twodimensional grid of states, n = (x, z) for x, z = 1, . . . , N, coupled to random force elds. is system illustrate a class of models for which a systematic procedure for characterizing the thermodynamic behavior becomes essential. e states are characterized by a spatial coordinate X n = a x x + a z z, and jumps are only allowed between nearest neighbors: x → x ± 1 or z → z ± 1. e system is isothermal and each transition is ruled by a force f (X,r ) = −βk r , which is initially drawn randomly from a set of N r reservoirs. e Y -matrix relating transitions to reservoirs is given by i.e. if e is triggered by the work producing reservoir r , then Y r e is equal to ±a x or ±a z depending on the direction of the transition.
As an example, we consider the × grid coupled to reservoirs depicted in Fig. . We omit to report the matrices Y and C as they can be easily inferred form the picture and Eq. ( ), and move on to the M-matrix, which reads M = which corresponds to the global conserved quantity X n . In contrast, its kernel is empty denoting the absence of symmetries. Se ing −βk 1 as "potential" eld, p , the nonequilibrium potential reads ϕ n = βk 1 X n , ( ) while the fundamental forces are equal to F (X,r ) = β (k 1 − k r ) , for r = 2, . . . , 5 .
In order to show the emergence of a symmetry following a change of physical topology, let us now assume that a x = a z = a and carry on the same analysis as before. e M-matrix now becomes, e color of each transition corresponds to a di erent reservoir: , yellow; , green; , purple; , blue; and , red. whose kernel and cokernel are one and two-dimensional, respectively. e symmetries are given by identi es two state variables, the rst of which is the global conserved quantity, X n , whereas the second is V n = (0,0) (1,0) (0,1) (2,0) (1,1) (0,2) (2,1) (1,2) (2,2) 0 0 0 0 a a a a 2a ( ) whose interpretation is not obvious. It arises from the fact that xand z-transitions are indistinguishable and the reservoirs 3 and 5 split the states into three groups, see Fig. , which are identi ed by di erent values of V n , Eq. ( ). We can set (X , 1) and (X , 3) as the reservoirs of the set { p }, according to which the Massieu potential of the state n reads ( ) e number of fundamental forces is thus reduced, F (X,2) = βk 1 − βk 2 , ( a) F (X,4) = βk 1 − βk 4 , ( b) F (X,5) = βk 3 − βk 5 .

VII. CONCLUSIONS AND PERSPECTIVES
e central achievement of this paper is to show that the EP of an open system described by stochastic thermodynamics is shaped by the way conserved quantities constrain the exchanges between the system and the reservoirs. Some of these conserved quantities are the obvious ones which do not depend on the system details (e.g. energy, particle number). But we provide a systematic procedure to identify the nontrivial ones which depend on the system topology. As a result, we can split the EP into three fundamental contributions, one solely caused by the time-dependent drivings, another expressed as the change of a nonequilibrium Massieu potential, and a third one which contains the fundamental set of ux and forces. Table III indicates which of these contributions play a role in di erent known processes. We also showed how to make use of this decomposition to derive a nite-time detailed FT solely expressed in terms of physical quantities, as well as to asses the cost of manipulating nonequilibrium states via time-dependent driving and nonconservative forces.
We believe that this work provides a comprehensive formulation of stochastic thermodynamics. Our framework can be systematically used to study any speci c model (as we illustrated on several examples) and demonstrates the crucial importance of conservation laws in thermodynamics, at, as well as out of, equilibrium.

ACKNOWLEDGMENTS
We thank G. Bulnes Cuetara for advises on the FT proof. is work was funded by the National Research Fund of Luxembourg (AFR PhD Grant -, No. ) and the European Research Council (Project No. ).