{'fraction_non_alphanumeric': 0.04953267002627385, 'fraction_numerical': 0.016865720315778463, 'mean_word_length': 4.379497534010791, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Macroscopic fluctuation theory

Stationary non-equilibrium states describe steady flows through macroscopic systems. Although they represent the simplest generalization of equilibrium states, they exhibit a variety of new phenomena. Within a statistical mechanics approach, these states have been the subject of several theoretical investigations, both analytic and numerical. The macroscopic fluctuation theory, based on a formula for the probability of joint space-time fluctuations of thermodynamic variables and currents, provides a unified macroscopic treatment of such states for driven diffusive systems. We give a detailed review of this theory including its main predictions and most relevant applications.


I. INTRODUCTION
Far from equilibrium behavior is ubiquitous. Indeed, most of the processes that characterize energy flow occur far from equilibrium; so do typical biological phenomena, and significant processes in molecules, solids, earth sciences, astrophysics. Classical thermodynamics does not cover such processes. It is a phenomenological theory which deals with states of matter which either do not change in time (equilibrium) or change very slowly so that they can be described by a sequence of equilibrium states.
For systems out of equilibrium it does not exist yet a macroscopic description of a scope comparable with equilibrium thermodynamics. In non-equilibrium one has to cope with a variety of phenomena much greater than in equilibrium. From a conceptual point of view the nonequilibrium situations closest to equilibrium are the stationary non-equilibrium states which describe a steady flow through some system. Simple examples are the heat flow in an iron rod whose endpoints are thermostated at different temperatures or the stationary flow of electrical current in a given potential difference. For such states the fluctuations exhibit novel and rich features with respect to the equilibrium situation. For example, as experimentally observed (Dorfman et al., 1994), the space correlations of the density extend to macroscopic distances.
Previous formulations of non-equilibrium thermodynamics, notably Onsager's theory (Onsager, 1931;Onsager and Machlup, 1953), mostly refer to situations near equilibrium where some kind of expansion can be made. Over the last ten years, a general approach to non-equilibrium diffusive systems known as Macroscopic Fluctuation Theory (MFT) (Bertini et al., 2002(Bertini et al., , 2007Derrida, 2007), making some progress in far from equilibrium processes and improving on near equilibrium linear approximations, has been developed. This theory has been inspired by stochastic models of interacting particles (stochastic lattice gases). It is based on the study of rare fluctuations of macroscopic variables in stationary states and leads to a consistent definition of non-equilibrium thermodynamic functionals as well as to significant new results and predictions.
The MFT can be seen as the next stage beyond Onsager theory which postulates simplified evolution equations. In particular, in Onsager theory the space dependence is neglected and the time derivative of thermodynamic variables are directly identified with the associated currents. The currents are assumed to be proportional to the thermodynamic forces that are identified with the derivatives of the equilibrium entropy with respect to the thermodynamic variables. The entropy is expanded around an equilibrium (maximum) value up to second order leading to linear evolution equations. Within Onsager theory the fluctuations are modeled by Gaussian processes. The near equilibrium theory has been developed further by Kubo (Kubo et al., 1991).
With respect to Onsager theory, the MFT removes two restrictions. On one hand the systems considered may admit nonlinear hydrodynamic equations. In the second place the external driving, like the potential difference, is not assumed small so that stationary states far from equilibrium are possible. In general, the fluctuations are not Gaussian. The main source of new phenomena is the non-linearity of the underlying evolution equations.
In the context of driven diffusive systems, characterized by an applied external field and contact with boundary reservoirs, the MFT allows to define a nonequilibrium functional which plays a role analogous to the entropy in the Onsager theory. The current can be expressed as the sum of two terms. The first is linear in the thermodynamic force, here identified with the derivative of this functional, while the second, absent in equilibrium, plays the role of an effective field and is orthogonal to the thermodynamic force.
In equilibrium statistical mechanics, the connection between thermodynamic functionals and fluctuations is provided by the Einstein theory (Einstein, 1910) of equilibrium fluctuations. Consider a system in contact with an environment; a fluctuation is a deviation of a thermodynamic variable, e.g. the density, from its equilibrium value. In the notation of (Landau and Lifshitz, 1968), the probability of a fluctuation is given by where κ is the Boltzmann constant and is the minimal work necessary to produce the fluctuation with a reversible transformation. ∆U , ∆S, ∆V are the corresponding variations of energy, entropy, volume, and T 0 , P 0 are the temperature and pressure of the environment. The exponent R min depends both on the environment and the state of the system and, with the opposite sign, is equal to the variation of the availability, see e.g. (Pippard, 1957). The Boltzmann-Einstein formula (1.1) is, we believe, the first example in physics of a large deviation estimate as it is called in modern probabilistic language. It is derived simply by inverting Boltzmann relationship between entropy and probability. In a nonequilibrium situation, like the case of a system in contact with reservoirs, we may expect a more complex entanglement between the variables describing the system and those related to the environment so that it is unlikely that quantities like U, S, ... can be simply defined. However, as we shall see, the MFT allows to establish a formula like (1.1), thus generalizing the notion of availability.
Dynamics plays a major role out of equilibrium. In fact what distinguishes non-equilibrium is the presence of currents flowing through the system which have to be considered together with the usual thermodynamic variables. The systems considered by the MFT are connected to several reservoirs (the environment), possibly distributed continuously on the boundary surface, characterized by their chemical potentials. The reservoirs are assumed to be much larger than the system so that their state will be essentially constant in time. When the system is put in contact with the environment, after an initial stage we expect that a description in terms of diffusive processes may apply for a wide class of microscopic dynamics. We admit also external fields such that linear response is valid. On the basis of a local equilibrium assumption, on macroscopic scale it is possible to define thermodynamic variables like the density of mass, electric charge, energy and the corresponding currents, which vary smoothly on the same scale. Microscopically, this implies that the system reaches a local equilibrium in a time which is short compared to the times typical of macroscopic evolution. So what characterizes situations in which this description can be applied is a separation of scales both in space and time. Furthermore, we assume that the system is Markovian. Namely, the currents at time t depend on the thermodynamic variables at the same time t. These assumptions are clearly discussed in (Callen, 1985;Fitts, 1962) and are behind the near equilibrium theories.
The proposed theory is based on the following formula for the probability of joint space-time fluctuations, at constant temperature T 0 , of thermodynamic variables and currents (1.3) where ρ is the thermodynamic variable, e.g., the local density, j is the actual value of the current, which is connected to ρ by the continuity equation ∂ t ρ + ∇ · j = 0, while J(ρ) is the hydrodynamic current for the given value of ρ, and χ is the mobility. Formula (1.3) depends only on the relationship between the thermodynamic variable ρ and the associated hydrodynamic current J(ρ), that is on the constitutive equations of the system. With slight modifications, (1.3) can be applied also to fluctuations of the energy as in the heat conduction case. Its structure and interpretation is otherwise universal.
According to the reductionist point of view of statistical mechanics, in the realm of classical physics, (1.3) should be derived starting from molecules interacting with realistic forces and evolving with Newtonian dynamics. This is beyond the reach of present day mathematical tools and much simpler models have to be adopted in the reasonable hope that some essential features are adequately captured. Formula (1.3) can be proven, as discussed in Section VIII.H, for a wide class of stochastic interacting particle systems.
The exponent on the right hand side of (1.3) is proportional to the energy dissipated by the extra current j − J(ρ). This can be understood relying on an active interpretation of the fluctuations. Namely, given a fluctuation, we perturb the original system by adding a (deterministic) external field for which the prescribed fluctuation becomes the trajectory followed by the system. For the fluctuation (ρ, j) such external field is F = χ(ρ) −1 j − J(ρ) . Hence, the exponent in the right hand side of (1.3) is proportional to dt dx F · χ(ρ)F . In the case of an electric circuit χ −1 is the resistance, F is the electric field, and the above integral is the energy dissipated by the extra current j − J(ρ) according to Ohm's law.
Within the scheme of fluctuating hydrodynamics (Hohenberg and Halperin, 1977;Landau and Lifshitz, 1987;Spohn, 1991), it is possible to provide an alternative justification of (1.3). Namely, one postulates j = J(ρ) + α, where, conditionally on ρ, α is a Gaussian random term with variance where the indices i, j label the space directions. Formula (1.3) can be inferred from the Gaussian distribution of the stochastic field α. However, mathematically the random noise α is singular and induces, through the nonlinear terms in the equation, ultraviolet divergences that should be properly renormalized. For Landau-Ginzburg models with constant mobility, this renormalization has been carried out in (De Dominicis and Peliti, 1978). In our setting ultraviolet divergences are not relevant as formula (1.3) is an asymptotic expression for fluctuations of macroscopic variables defined through coarse-graining. The role of lattice gases, in particular exactly solvable models, is important similarly to what happened in the theory of critical phenomena where special models have provided explicit illustrations of the more general but often heuristic renormalization group calculations.
As the Boltzmann-Einstein formula (1.1), the fundamental formula (1.3) provides a quantitative relation between the probabilities computed in the microscopic ensemble and macroscopic variables. With respect to the theory of equilibrium thermodynamic fluctuations, formula (1.3) is an important generalization that holds both in equilibrium and non-equilibrium. Note the difference in notation between formulas (1.1) and (1.3): in (1.1) P represents the ensemble over the space of configurations, while in (1.3) P represents the ensemble over space-time trajectories. We will use this same distinction throughout the paper, both for probabilities and expectation values. The Boltzmann-Einstein formula (1.1) and its nonequilibrium analogue will be derived from (1.3).
The fundamental formula (1.3) leads to the prediction of rather surprising properties of diffusive systems such as the existence of phase transitions not permitted in equilibrium, the possibility of states spontaneously breaking the time translation invariance in the fluctuations of the current, the universality of the cumulants of the current. Furthermore it predicts generic long range correlations in stationary non-equilibrium states.
The behavior of the fundamental formula (1.3) under time reversal plays a crucial role in the MFT. As well known, in the near equilibrium Onsager theory the symmetry of the transport coefficients is deduced form a statistical form of time reversal invariance of the underlying microscopic dynamics (Onsager, 1931). Of course in presence of inhomogeneous boundary conditions and/or external fields, this time reversal invariance is lost. However in the systems considered, we assume that given a microscopic path it is possible, by adding a suitable field, to modify the dynamics in such a way that the corresponding evolution is given by the time reversed path. At the level of stationary ensembles over space-time trajectories, the time reversed ensemble is then defined by assigning to a backward path the probability of the forward path under the original ensemble. In particular, the stationary macroscopic currents are inverted under the time reversal operation. For stochastic lattice gases the microscopic dynamics is Markovian and the previous definition can be directly implemented.
The splitting of the hydrodynamic current into two orthogonal terms discussed before is derived as a simple consequence of the transformation properties of (1.3) under time reversal. The even part of the current is connected with the work of thermodynamic forces active within the system in the relaxation or creation of a non-stationary state while the odd part is connected with the dissipation necessary to keep the system in a non-equilibrium state.
For the convenience of the reader we summarize the main achievements of the MFT.
From the fundamental formula (1.3) for space-time fluctuations we derive a dynamical variational principle which expresses the probability of density fluctuations of the stationary ensemble. This leads naturally to the definition of a thermodynamic functional called in the following the quasi-potential and denoted V (ρ). The argument ρ represents generic thermodynamic variables like the densities of the different types of matter composing the system. The quasi-potential is the natural extension to non-equilibrium of the availability of classical thermodynamics. In the context of finite dimensional diffusion processes, the quasi potential was first introduced by Freidlin and Wentzell, (Freidlin and Wentzell, 2012). A related analysis, motivated by applications to optics, can be found in (Graham, 1973).
The quasi-potential satisfies an infinite dimensional Hamilton-Jacobi equation which is equivalent to the splitting of the current. The density correlation functions can be computed by expanding the Hamilton-Jacobi equation around the stationary density and exhibit, generically, long range behavior. In non-equilibrium the quasi-potential V may have singularities not permitted in equilibrium. These singularities do occur in a model with external field and inhomogeneous boundary conditions, (Bertini et al., 2010).
The splitting of the current is relevant in the analysis of non-equilibrium thermodynamic transformations. Consider a slow (quasi static) transformation leading from a stationary state to another one. Since to maintain a non-equilibrium stationary state it is necessary to dissipate a positive amount of energy per unit time, the work associated to the odd part of the current will diverge when the time diverges. The equation expressing the energy balance between the system and the environment becomes then meaningless. To obtain equations in finite terms one can subtract the divergent part and define a renormalized work. It turns out that the renormalized work satisfies a Clausius type inequality with respect to which quasi-static transformations are optimal. The idea of renormalizing the work involved in a non-equilibrium transformation goes back to (Oono and Paniconi, 1998).
The MFT allows a detailed mathematical description of quasi-static thermodynamic transformations that in textbooks are discussed only in words. This is achieved through an expansion of the energy balance and of the macroscopic evolution (hydrodynamic) equations in terms of the inverse duration of the transformation. In this expansion the diverging terms cancel and we obtain new relations among finite quantities which in principle can be tested experimentally.
One of the most interesting topic in the MFT is provided by current fluctuations. From the fundamental formula (1.3) it is possible to derive the rate function describing the behavior of the average current over a long time interval T , namely where P is the probability of the fluctuation J of the averaged current and β = 1/(κT 0 ). The temperature of the environment T 0 (not to be confused with the time T ) will be mostly considered constant. The functional Φ, first introduced in (Bertini et al., 2005a), is defined by a variational principle and it is a genuine (convex) thermodynamic functional. As pointed out in the same paper, the singularities of Φ correspond to dynamical phase transitions. For some models it has then been shown (Bertini et al., 2006;Bodineau and Derrida, 2005) that for suitable values of J these transitions corresponds to a spontaneous breaking of the time translation invariance.
In the general context of non-equilibrium processes, an important role is played by the so-called Fluctuation Theorems (Crooks, 1999;Evans and Searles, 1994;Gallavotti and Cohen, 1995;Hatano and Sasa, 2001;Jarzynski, 1997;Kurchan, 1998;Lebowitz and Spohn, 1999;Maes, 1999). This topic will appear only marginally in this paper and we refer the interested reader to the reviews (Boksenbojm et al., 2010;Gallavotti, 2013;Maes et al., 2009). There are other relevant topics not covered as each of them would require an extended review. Among these topics we mention the so-called stochastic thermodynamics (Seifert, 2012), the general approach to non-equilibrium developed in (Öttinger, 2005), path integral approaches (Jordan et al., 2004), algebraic techniques for microscopic dynamics (Schütz, 2000), the analysis of rare fluctuations in finite dimensional dynamical systems, with the related discussion on current fluctuations (Maes et al., 2008), and in reactionpopulation systems (Täuber, 2014).

Reader's guide
The aim of this review is to present the MFT as an effective macroscopic theory, providing a working knowledge of the theory rather than a chronological exposition of its main results. For this reason, some computations are detailed when useful.
The general framework of driven diffusive systems and the basic principles are illustrated in Section II.
Part of the material in Section III, which deals with thermodynamic transformations between nonequilibrium states, is presented here for the first time.
We discuss quantitatively the interplay between fluctuations and thermodynamics. This section is not however used in the sequel and can be omitted on first reading.
Section IV contains the core of the MFT, deducing the statistics of density and current from the fundamental formula.
Section V discusses few models where the quasipotential can be computed (almost) explicitly. While we use the terminology of underlying microscopic models, we emphasize that the computations are macroscopic and require only the knowledge of the transport coefficients.
Section VI develops one of the most relevant consequences of the MFT by deriving the statistics of the time averaged current.
Section VII contains more specialized material related to hyperbolic conservation laws. Although these are not diffusive systems, the fluctuation formula can be obtained from the MFT by a singular limit procedure. This section can be omitted on first reading.
Finally, Section VIII describes microscopic models of stochastic lattice gases, showing how the general principles of the MFT can be analytically derived. This Section can be read independently of the others and can be anticipated if the reader wishes to do so.

II. BASICS OF THE MACROSCOPIC FLUCTUATION THEORY
We introduce the hydrodynamic description of out of equilibrium driven diffusive systems which are characterized by conservation laws. We then introduce the fundamental formula of the MFT and discuss its behavior under time-reversal together with its main implications. We restrict to the case of a single conservation law, e.g., the conservation of the mass.

A. Hydrodynamic description
We denote by Λ ⊂ R d the bounded region occupied by the system, by ∂Λ the boundary of Λ, by x the macroscopic space coordinates and by t the macroscopic time. The system is in contact with boundary reservoirs, characterized by their chemical potential λ(t, x), and under the action of an external field E(t, x).
At the macroscopic level the system is completely described by the local density ρ(t, x) and the local current j(t, x). Their evolution is given by the continuity equation together with the constitutive equation which expresses the current as a function of the density. Namely, where we omit the explicit dependence on the space variable x ∈ Λ. For driven diffusive systems the constitutive equation takes the form where the diffusion coefficient D(ρ) and the mobility χ(ρ) are d×d symmetric and positive definite matrices. Equation (2.2) relies on the diffusive approximation and on the linear response to the external field. The evolution of the density is thus given by the driven diffusive equation We emphasize that the diffusion coefficient and the mobility do depend on the value of the local density. Accordingly, equation (2.3) is nonlinear and this is the source of interesting phenomena. In contrast, the near equilibrium approximation can be obtained by expanding ρ around some (constant) equilibrium value so that (2.3) becomes linear. The transport coefficients D and χ are not arbitrary matrices. The characterization of equilibrium states implies (see Section V.A) that they satisfy the local Einstein relation where f is the equilibrium free energy per unit volume. Equations (2.1)-(2.2) have to be supplemented by the appropriate boundary condition on ∂Λ due to the interaction with the external reservoirs. If λ(t, x), x ∈ ∂Λ, is the chemical potential of the external reservoirs, the boundary condition reads While in the near equilibrium approximation the variation of λ on ∂Λ is required to be small, we shall not restrict to this case.
One of the achievements of mathematical physics is the derivation of the hydrodynamic equations (2.1)-(2.5) as laws of large numbers from an underlying microscopic stochastic dynamics in the diffusive scaling limit (Eyink et al., 1990;Kipnis and Landim, 1999;Spohn, 1991). This means taking the limit of infinitely many degrees of freedom and rescaling space and time keeping x 2 /t fixed.
We now restrict the discussion to time-independent chemical potential λ(x) and external field E(x). We denote byρ =ρ λ,E the stationary solution of (2.3),(2.5), x ∈ ∂Λ. (2.6) We will assume that this stationary solution is unique. The stationary density profileρ is characterized by the vanishing of the divergence of the associated current, ∇ · J(ρ) = 0. A special situation is when the current itself vanishes, J(ρ) = 0; if this is the case we say that the system is in an equilibrium state. Uniqueness to (2.6) can be proven in one dimension when the external field E is constant in space. It can also be proven in general, by a perturbation argument, near equilibrium. In the case of several conserved quantities, i.e. when ρ is not a scalar, uniqueness may fail. Homogeneous equilibrium states correspond to the case in which the external field vanishes and the chemical potential is constant. The stationary solution is then constant and satisfies f ′ (ρ λ,0 ) = λ. Inhomogeneous equilibrium states correspond to the case in which the external field is gradient, E = −∇U , and it is possible to choose the arbitrary constant in the definition of U such that U (x) = −λ(x), x ∈ ∂Λ. By the Einstein relation (2.4), the stationary solution satisfies −f ′ ρ λ,E (x) = U (x) and the stationary current vanishes, J(ρ λ,E ) = 0. Examples of inhomogeneous equilibrium states in presence of an external field are provided by a still atmosphere in the gravitational field or by sedimentation in a centrifuge.

B. Fundamental formula
In the context of equilibrium systems, the Einstein theory of thermodynamic fluctuations establishes a connection between the thermodynamic functionals and the probability of observing a fluctuation. The extension of this theory to non-equilibrium stationary states is provided by the fundamental formula (1.3), describing the joint fluctuations of thermodynamic variables and currents at the level of space-time paths.
Let P ρ0 be the statistical ensemble on microscopic trajectories such that at time t = T 0 the density profile is ρ 0 . Consider a path (ρ, j) satisfying the continuity equation in (2.1), the boundary condition (2.5), and ρ(T 0 ) = ρ 0 . The fundamental formula (1.3) can be written in detail as where the rate functional I is (2.8) In (2.7) ε ≪ 1 is a dimensionless scaling factor, e.g., the ratio between the microscopic length scale (say the typical inter-molecular distance) and the macroscopic one, and the symbol ≍ denotes logarithmic equivalence as ε → 0. We denote by ρ ε the empirical density, that is, ρ ε (x) is the density of particles in a macroscopically small volume around x. Analogously, j ε denotes the empirical current, that is j ε (t, x) ·ndσdt is the flow of mass across a macroscopically small surface dσ centered at x and orthogonal to the unit vectorn in the macroscopic time interval [t, t + dt]. The factor ε −d is proportional to the number of particles in the macroscopic volume. It plays the role of Avogadro's number (implicit in the Boltzmann constant) in (1.3).
The interpretation of (2.7)-(2.8) is quite intuitive and already discussed in the Introduction. In Section VIII these formulas will be derived from an underlying microscopic dynamics in the case of stochastic lattice gases.
Assume that the external drivings do not depend on time and let P be the stationary ensemble, that is the invariant measure of the underlying microscopic dynamics. Note that P is an ensemble on the configuration space. The probability of observing a fluctuation ρ of the density profile can be written in the form (2.9) While for equilibrium states V is given by the Boltzmann-Einstein formula (1.1)-(1.2), in non-equilibrium we do not have a general formula for V . In the following V will be called the quasi-potential, according to the terminology of (Freidlin and Wentzell, 2012). As we show in the following sections, the MFT provides characterizations of the quasi-potential that can be used either for exact computations or for perturbation expansions.
Let P be the stationary process, that is the ensemble on paths for which the initial conditions are sampled according to the stationary ensemble P . If we make a Markovian assumption on the microscopic dynamics, combining (2.9) and (2.7), the fluctuation formula for the stationary process P is (2.11) Formula (2.11) states that at time T 0 the density profile ρ(T 0 ) is sampled according to the stationary ensemble and the corresponding asymptotic probability is given by (2.9). Then, the probability of following the path (ρ, j) in the time interval [T 0 , T 1 ] with initial condition ρ(T 0 ) is given by (2.7). We point out that (2.11) may hold also when the microscopic dynamics is not Markovian provided the Markov property is recovered at the macroscopic level.

C. Time reversal and its consequences
We analyze the behavior of the fundamental formula (2.10)-(2.11) under time reversal and deduce, in particular, the orthogonal decomposition of the hydrodynamic current.
The time reversal operator θ on density and current paths is defined as [θρ](t) = ρ(−t), [θj](t) = −j(−t). Denote by P * the time reversal of P, that is P * = P • θ −1 . In words, P * is defined by assigning to a backward path the probability of the forward path under P.
Then P * is the stationary processes associated to some dynamics that we call adjoint. When P is Markov then P * is also Markov and has the same stationary ensemble. By definition, (2.12) At the level of large deviations the identity (2.12) implies where R * is the large deviation functional for the stationary adjoint process.
Since the stationary ensembles of process and its time reversal coincide, the functional R * can be written as (2.14) From equations (2.11), (2.13) and (2.14), we have (2.15) We now assume that the adjoint dynamics admits a hydrodynamic description of the form (2.1)-(2.5) with a suitable external field. This assumption is very natural from the physical point of view. It expresses the fact that empirically by acting on a system with suitable external fields we can invert the evolution of a process. For example, we can arrange the action on the system in such a way that heat flows from a lower temperature to a higher temperature reservoir. In view of this assumption, the adjoint process satisfies a dynamical large deviations principle of the same form as (2.7) with P replaced by P * and I replaced by I * where (2.16) in which J * (ρ) expresses the constitutive relationship of the adjoint hydrodynamics.
Relation (2.15) has far reaching consequences. By choosing [T 0 , T 1 ] = [−T, T ], dividing both sides by 2T , and taking the limit T → 0, we find which has to be satisfied for any ρ and j. Since the path ρ(t) satisfies the boundary condition (2.5), in (2.17) we can restrict to profiles ρ satisfying (2.5). For such profiles δV /δρ vanishes at the boundary (see Section IV.A), integrating by parts the left hand side of (2.17) we obtain that (2.18) These two equations are symmetric in J and J * . The first equation may be considered as a fluctuation-dissipation relation for the currents. We now define the symmetric current J S by Since the stationary densityρ is a minimum for V , then (δV /δρ)(ρ) = 0. The symmetric current thus vanishes at the stationary profile, (2.20) We rewrite the hydrodynamic current as which defines the antisymmetric current J A . In view of these definitions, equations (2.18) become In this way we see that the splitting of the currents and the orthogonality property are a consequence of the existence of a time reversed dynamics admitting an hydrodynamic behavior. Moreover, inserting the first of the two equations (2.18) into the second we obtain the equation This will be interpreted as a Hamilton-Jacobi equation. As shown in (Bertini et al., 2002), V is the maximal positive solution to (2.23) which vanishes when ρ =ρ. Since J(ρ) and J * (ρ) play a symmetric role in (2.18), the Hamilton-Jacobi equation (2.23) holds replacing J(ρ) with J * (ρ). In view of the fluctuation-dissipation relation (2.18), we may write the hydrodynamic equation and the adjoint hydrodynamic equation as respectively. Another way of writing the adjoint hydrodynamic equation is In spite of its appearance, the forward evolution of this equation is well posed. Indeed, the added external field 2∇(δV /δρ) produces a second order term which makes the equation of parabolic type. In the case of equilibrium states the adjoint hydrodynamics coincides with the original one.
We illustrate the decomposition of the current by giving three simple examples. Equilibrium states. Equilibrium states, homogeneous and inhomogeneous, are characterized by J(ρ) = 0. In this case the quasi-potential V is given by (see Section V.A) (2.25) Observe that, due to the convexity of f , V is convex, positive and is minimal on the stationary density profilē ρ. The Einstein relation (2.4) and J(ρ) = 0 imply that (2.26) Hence, the antisymmetric current vanishes, J A = 0, and the current, as in Onsager theory, is proportional to the thermodynamic force. In geometrical terms, the hydrodynamic evolution can thus be viewed as the flow along the steepest descent of V with an intensity given by the mobility.
Circulation of a fluid in a ring. In absence of an external field, we have an equilibrium state that fits in the scheme just discussed: the densityρ is constant, and the current J(ρ) is zero. Moreover, if we start with an arbitrary density profile ρ, the system evolves to the equilibrium according to the hydrodynamic equation where V (ρ) is given by (2.25). In this case, by conservation of mass, the expression (2.25) simplifies since the last term does not contribute. When we switch on a constant weak driving field E tangent to the ring, in the stationary regime the particle densityρ is still constant, but there is a non-zero current J(ρ) = χ(ρ)E. The corresponding hydrodynamic equation is The stationary non-equilibrium situation, with densitȳ ρ and current J(ρ), is not invariant under time reversal. In fact, time reversal corresponds to inverting the current, namely to changing E with −E. Therefore, the hydrodynamic equation for the time reversed system will be (2.29) A simple computation shows that these two components satisfy the orthogonality condition in (2.22).
Rarefied gas with boundary reservoirs. For simplicity we consider again to the one-dimensional case. When we can neglect the interaction among the particles the transport coefficients are D(ρ) = D 0 , χ(ρ) = χ 0 ρ where D 0 , χ 0 are constants, and the equilibrium free energy per unit volume is given by f (ρ) = (D 0 /χ 0 )ρ log ρ. The quasipotential V (ρ) is again given by (2.25). Letting Λ = (0, L), λ(0) = λ 0 , λ(L) = λ 1 , the stationary density profile isρ(x) = ρ 0 (1 − x/L) + ρ 1 x/L where ρ 0 and ρ 1 are the densities associated to λ 0 and λ 1 by (2.5). In particular, (∇ρ)(x) = (ρ 1 − ρ 0 )/L. In this case the hydrodynamic equation reduces to the heat equation and the constitutive equation to To reverse the current in the stationary state we have to add a suitable external field. The unique expression for the adjoint current such that J * (ρ) = −J(ρ) is which corresponds to which satisfy the orthogonality in (2.22).
The decomposition (2.21) of the current is entirely general for driven diffusive systems. It depends on the chemical potential λ and the external field E and can not be inferred by inspection as in the simple examples discussed above. We mention the general approach to nonequilibrium introduced in (Öttinger, 2005) that is based on a separation of the evolution equations into dissipative and conservative terms which may remind this decomposition.

III. THERMODYNAMIC TRANSFORMATIONS
As clearly stated in classical textbooks, e.g. (Callen, 1985;Landau and Lifshitz, 1968), in a transformation between equilibrium states a system necessarily goes through deviations from equilibrium which are small if the transformation is quasi-static. Classical thermodynamics is unable to describe this intrinsically dynamic aspect. The aim of this section is to develop a coherent dynamical approach to thermodynamic transformations covering both equilibrium and non-equilibrium states (Bertini et al., 2012(Bertini et al., , 2013.

A. Non-Equilibrium Clausius inequality
The second law of thermodynamics can be expressed as follows. Consider a system in an equilibrium state in thermal contact with an environment at a given temperature. The system then undergoes an isothermal transformation to a final state. By denoting with W the mechanical work done on the system, where ∆F is the difference of the free energy between the final and the initial state. If equality holds the transformation is said to be reversible. It can be implemented by performing very slow variations so that the system goes through a sequence of equilibrium states. With a slight abuse of terminology, we shall refer to (3.1) as the Clausius inequality. We present a dynamical derivation of the Clausius inequality based on the hydrodynamic description and the local Einstein relation (2.4). Consider a system in a time dependent environment, that is, E and λ depend on time, as described in Section II.A. The work done by the environment on the system in the time interval [0, T ] is wheren is the outer normal to ∂Λ and dσ is the surface measure on ∂Λ. The first term on the right hand side is the energy provided by the external field while the second is the energy provided by the reservoirs.
Fix time dependent paths λ(t) of the chemical potential and E(t) of the driving field. Given a density profile ρ 0 , let ρ(t), j(t), t ≥ 0, be the solution of (2.1)-(2.5) with initial condition ρ 0 . By using the Einstein relation (2.4) and the boundary condition f ′ (ρ(t)) = λ(t), an application of the divergence theorem yields where F is the equilibrium free energy functional, is not simply a rewriting of (3.2), as it depends on a physical principle, the local Einstein relationship.
For equilibrium states, the former dynamical derivation of Clausius inequality allows to discuss precisely in which sense quasi-static transformations approximate reversible transformations. We consider the simpler case of spatially homogeneous equilibrium states. As we mentioned before, such states are characterized by a vanishing external field E and by a constant chemical potential λ. In this case the stationary solutionρ of the hydrodynamic equations (2.1)-(2.5) is the constantρ satisfying f ′ (ρ) = λ.
Fix two constant chemical potentials λ 0 , λ 1 . Consider a system initially in the stateρ 0 which is driven to a new stateρ 1 by changing the chemical potential in time in a way that λ(t) = λ 0 for t ≤ 0 and λ(t) = λ 1 for t ≥ t 0 , where t 0 is some fixed positive time.
Let ρ(t), j(t), t ≥ 0, be the solution of (2.1)-(2.5) with initial conditionρ 0 . Since the chemical potential is equal to λ 1 for t ≥ t 0 , ρ(t) →ρ 1 as t → ∞. Moreover, asρ 1 is an equilibrium state, the current j(t) relaxes to J(ρ 1 ) = 0. We deduce that the integral in (3.3) is finite as T → ∞ and that It remains to show that in the quasi-static limit equality in (3.1) is achieved. For any fixed transformation the inequality (3.1) is strict because the second term on the right hand side of (3.5) cannot be identically zero. Therefore, reversible transformations cannot be achieved exactly. We can however exhibit a sequence of transformations for which the second term on the right hand side in (3.5) can be made arbitrarily small. This sequence of transformations is what we call a quasi-static transformation. Fix a smooth function λ(t) such that λ(0) = λ 0 and λ(t) = λ 1 for t ≥ t 0 . Given τ > 0 we set λ τ (t) = λ(t/τ ). Since E = 0, the last term on the right hand side of (3.5) is given by where ρ τ is the solution to (2.1)-(2.5) with initial conditionρ 0 and boundary conditions λ τ (t). For each t ≥ 0, letρ λ τ (t) be the equilibrium state associated to the constant chemical potential λ τ (t). Since ∇f ′ (ρ λ τ (t) ) = 0, we can rewrite the previous integral as The difference between the solution of the hydrodynamic equation ρ τ (t) and the stationary profileρ λ τ (t) is of order 1/τ uniformly in time, and so is the difference f ′ (ρ τ (t)) − f ′ (ρ λ τ (t) ). As the integration over time essentially extends over an interval of length τ , the previous expression vanishes for τ → ∞. This implies that equality in (3.1) is achieved in this limit.
For non-equilibrium states, the inequality (3.1) does not carry any significant information when we consider transformations over long time intervals. In fact, as nonequilibrium stationary states support a non vanishing current, to maintain such a current one needs to dissipate a positive amount of energy per unit time. If we consider a transformation between non-equilibrium stationary states, the energy dissipated along such transformation will necessarily include the contribution needed to maintain such states and therefore the amount of energy exchanged in an unbounded time window is unbounded. In this case, the left hand side of (3.1) is infinite while the right hand side is finite.
To transform (3.1) into a meaningful inequality, by using the decomposition (2.21) of the current, we give a natural definition of renormalized work performed along any given transformation. This definition has been inspired by the point of view in (Oono and Paniconi, 1998) further developed in (Komatsu et al., 2011;Sasa and Tasaki, 2006). We then show that the renormalized work satisfies a Clausius inequality and prove that equality is achieved in the quasi-static limit.
The idea to define a renormalized work is to subtract the energy needed to maintain the system out of equilibrium. For time independent drivings, by the orthogonal decomposition (2.21) and (2.20), J(ρ) = J A (ρ) is the macroscopic current in the stationary state. In view of the general formula for the total work (3.3), the amount of energy per unit time needed to maintain the system in the stationary profileρ is (3.6) Fix now T > 0, a density profile ρ 0 , and space-time dependent chemical potentials λ(t) and external field E(t), t ∈ [0, T ]. Let (ρ(t), j(t)) be the corresponding solution of (2.1)-(2.5) with initial condition ρ 0 . We define the renormalized work W ren [0,T ] done by the reservoirs and the external field in the time interval [0, T ] as where J A (t, ρ) is the antisymmetric current for the system with the time independent external driving obtained by freezing the time dependent chemical potential λ and external field E at time t. Observe that the definition of the renormalized work involves the antisymmetric current J A (t) computed not at density profileρ λ(t),E(t) but at the solution ρ(t) of the time dependent hydrodynamic equation. The definition (3.7) is natural within MFT and leads to a Clausius inequality. In view of (3.3) and the orthogonality in (2.22) between the symmetric and the antisymmetric part of the current, Consider a space-time dependent chemical potential and external field (λ(t), E(t)), t ≥ 0, with (λ(0), E(0)) = (λ 0 , E 0 ) and (λ(∞), E(∞)) = (λ 1 , E 1 ). Letρ 0 =ρ λ0,E0 , ρ 1 =ρ λ1,E1 be the corresponding stationary profiles and let (ρ(t), j(t)), t ≥ 0 be the solution of (2.1)-(2.5) with initial conditionρ 0 . Since ρ(T ) converges toρ 1 , the symmetric part of the current, J S (ρ(T )), relaxes as T → +∞ to J S (ρ 1 ) = 0. By letting W ren = lim T →∞ W ren [0,T ] , we thus get where F is the equilibrium free energy functional (3.4).
In particular, which is a meaningful version of the Clausius inequality for non-equilibrium states. Arguing as in the equilibrium case, we can exhibit a sequence of transformations (λ τ (t), E τ (t)) which vary appreciably on a time scale τ , such that in the quasi-static limit τ → ∞ equality in (3.10) is achieved, (3.11)

B. Excess work
Consider a homogeneous equilibrium state with vanishing external field and constant chemical potential λ 0 and letρ 0 be the corresponding homogeneous density, λ 0 = f ′ (ρ 0 ). The system is put in contact with a new environment with chemical potential λ 1 . In this case, recalling that f is the free energy per unit volume and that the temperature of the system is the same of the environment, the availability per unit volume is defined by a = f (ρ 0 ) − λ 1ρ0 , (Pippard, 1957, Ch. 7). The function a, which depends on the state of the system and on the environment, can be used to compute the maximal useful work that can be extracted from the system in the given environment. More precisely, by lettingρ 1 be such that f ′ (ρ 1 ) = λ 1 , then is the the maximal useful work per unit volume that can be extracted from the system in the given environment. Comparing −∆a with the large deviations functional V in (2.25) which expresses the probability of density fluctuations in the equilibrium ensemble corresponding to the chemical potential λ 1 , we realize that An analogous relationship can be easily obtained for spatially inhomogeneous equilibrium states. In order to discuss the thermodynamic role of the quasi-potential for non-equilibrium states, we introduce the excess work with respect to a quasi-static transformation. Consider a stationary non-equilibrium state with density profile ρ for t ≤ 0, while at time t = 0 the external driving is abruptly changed to new values (λ, E) so that for t > 0 the evolution is given by the hydrodynamic equation with initial condition ρ and time independent driving (λ, E). We define the excess of work as the difference between the renormalized work and the renormalized work involved in a quasi-static transformation from ρ toρ λ,E , namely W ex = W ren − min W ren . According to the discussion in Section III.A, the excess work is given by (3.14) whereρ is the stationary density corresponding to (λ, E). By using the orthogonality in (2.22) and the formula (2.19) for the symmetric part of the current in terms of the quasi-potential, straightforward computations yield where we have made explicit the dependence of the quasipotential on the driving. Therefore, while a definition of thermodynamic potentials, that is functionals of the state of the system (in this case of the density ρ), does not appear possible in non-equilibrium thermodynamics, the quasi-potential is the natural extension of the availability.

C. Finite time thermodynamics
We next discuss the energy balance along slow transformations from a quantitative point of view taking into account that quasi-static transformations are an idealization and real transformations take place on a finite time window whose duration is denoted by τ .
For s ∈ [0, 1] a protocol is defined by a choice of the external drivings E(s, x), x ∈ Λ, and λ(s, x), x ∈ ∂Λ. The slow transformation is then realized, for τ large, by Let ρ τ (t) and j τ (t), 0 ≤ t ≤ τ , be the solution to the hydrodynamic equations with the slow external field E τ and chemical potential λ τ , For s ∈ [0, 1], letρ(s) be the unique stationary solution of the hydrodynamics with external field E(s) and chemical potential λ(s). When τ is large the solution (ρ τ , j τ ) has an expansion of the type (recall s ∈ [0, 1]) (3.17) By (3.16) we get the corresponding linear evolution equations for the first order corrections (r, g), (3.18) which has the form of a Poisson equation for r(s).
Evaluating equations (3.3) along the transformation (ρ τ , j τ ), we obtain We can analyze this equation at the different orders in 1/τ , obtaining an identity for each order. Direct computations yield that at order τ the right hand side of (3.19) vanishes, while at order 1 we get the first non trivial equation, ( 3.20) This is an interesting relationship as it connects the variation of the free energy to the first order corrections in a real transformation. It also carries relevant information for transformations among equilibrium states, but it cannot be derived within the framework of classical thermodynamics. If we consider transformations among equilibrium states, the second line on the right hand side of (3.20) vanishes when the intermediate states are also of equilibrium so that J(s,ρ(s)) = 0 for any s. However the transformation can go through non-equilibrium intermediate states.
As a further application of the expansion (3.17), consider the equation (3.8) which expresses the energy balance in the time interval [0, τ ]. Recalling that we have already shown that the last term vanishes in the quasistatic limit, we now estimate this term when the transformation is given in term of a protocol and τ is large but finite.
We thus want to estimate, for large τ (3.21) Recalling (2.29), the symmetric part of the current is where V λ(s),E(s) is the quasi-potential associated to (λ(s), E(s)) (we regard s here as a fixed parameter). By (3.17), the symmetric current has the expansion (3.23) where ⋆ denotes convolution and Hence, for slow transformations we get that (3.21) has the form 1 (3.24) To illustrate the meaning of B, consider a transformation between and through equilibrium states. Then, up to terms of order 1/τ 2 , the work done in the (finite time) transformation is so that the inequality B ≥ 0 is a restatement of the second principle. In general, B quantifies the additional energy dissipated in the given transformation. As we have shown, in the limit τ → ∞, all protocols realize the equality W = ∆F . On the other hand, for finite time τ , this identity cannot be achieved and we can select the optimal protocol by minimizing B.
For transformations between and through equilibrium states, the quasi-potential is given by (2.25) so that B has an explicit expression. In particular, we can compute explicitly the optimal protocol for transformations through homogeneous equilibrium states. Namely, we assume that the external field vanishes and that the chemical potential does not depend on the space variable. The protocol is thus defined by a real function λ(s), s ∈ [0, 1]. The associated stationary solutionρ(s) is also constant in space and solves λ(s) = f ′ (ρ(s)). For simplicity we also assume that the diffusion coefficient is a multiple of the identity; in this case the equation (3.18) reduces the the classical Poisson equation (3.25) whose solution is given by where G 0 is the Green function of the Dirichlet Laplacian on Λ. Since The dependence on space factorizes in the pre-factor which depends only on the geometry of the domain. It is now straightforward to minimize B with respect toρ(s) with the constraintsρ(0) =ρ 0 ,ρ(1) =ρ 1 . The minimizer is the unique function satisfying the constraints such that The optimal protocol is then obtained by the relationship λ = f ′ (ρ). This protocol does not correspond to a constant rate as one could naively expect. In fact, (3.29) shows that this rate has to be adjusted to the response properties of the system.

D. Dissipation
The infinitesimal version of (3.3) gives the instantaneous energy balance which readṡ whereẆ is the power injected by the reservoirs and external field in the system. Accordingly, f ′ (ρ)ρ represents the rate of change of the density of free energy while j · χ(ρ) −1 j is the dissipated power per unit volume. For equilibrium states, the stationary density profile is characterized by the vanishing of the current and therefore it minimizes the dissipation. This is not the case for non-equilibrium stationary states. Recalling (2.20), the non-equilibrium stationary density profile is characterized by the vanishing of the symmetric current and this does not imply that the dissipation is minimal. In view of the orthogonal decomposition (2.21), The minimization of the left hand side is not achieved by making the first term on the the right hand side equal to zero. Indeed, in the simple case of a one dimensional rarefied gas discussed in section II.C the minimizer of the left hand side with the prescribed boundary conditions Observe that, in accordance with the near to equilibrium Prigogine principle (Prigogine, 1961) We remark that if we consider the renormalized work (3.8), the corresponding renormalized power iṡ Then, recalling (2.20), the stationary density profile minimizes the corresponding renormalized dissipation . Once again, in terms of the renormalized quantities, non-equilibrium stationary states behave as equilibrium states.

E. Minimum dissipation principle
Generalizing Onsager (Onsager, 1931), we introduce the dissipation function, (Bertini et al., 2004) We can then reformulate the constitutive equation j = J(ρ) in variational terms, where the minimum is understood with respect to j with ρ fixed. Indeed, by taking the variation of Ψ with respect to j we deduce that the minimum is achieved for j = The difference with respect to the near equilibrium Onsager theory (apart from the sign difference) is the insertion of the antisymmetric current J A in the dissipation function (3.32) and the replacement of the entropy with the quasi-potential. Accordingly, while in Onsager the minimum value of Ψ is half of the total dissipation, in our case is half the negative of the renormalized dissipation.

F. Comments
Within the scheme introduced, we considered only one conservation law (the conservation of the mass) and accordingly we did not distinguish between work and heat. A model where heat is naturally introduced is analyzed in (Olla, 2013).
The splitting of the current (2.21) appears very interesting conceptually. However the two currents J S and J A , apart some special cases, are not easily accessible experimentally. In fact what is directly measurable is the total current which coincides with J A in a stationary state while J S represents the total current in a relaxation to an equilibrium state. In the general case their computation require the knowledge of the quasi-potential. A measurement of the quasi-potential, via rare fluctuations is hopeless as very large times are involved. It can be either obtained from calculations by solving a variational principle (see section IV.A), or from simulations using algorithms like in (Giardinà et al., 2006). Otherwise it can be approximately estimated from measurements of correlation functions in the stationary state. In fact, as we shall see later, V is the Legendre transform of the generating functional of density correlations in the stationary state.
These remarks imply that the renormalized work is not immediately accessible. There are other possibilities to define a renormalized work (Maes and Netočný, 2014), which however have similar drawbacks. On the other hand the approach developed in subsection III.C allows, as remarked in the introduction, a detailed analysis of quasi-static transformations by relating explicitly, for example, the variation of the free energy and the corrections to an infinitely slow transformation (3.20). Actually this approach provides an infinity of relationships which should be further investigated.
Another benefit of finite time thermodynamics is related to the possibility of optimizing the protocol of a transformation both in equilibrium and non-equilibrium.
As in (Onsager, 1931), the dissipation function (3.32) provides a variational characterization of the evolution equations. For the usefulness of the dissipation function in identifying the various physical contributions, we refer to (Onsager and Fuoss, 1932) on the irreversible processes in electrolytes.

IV. STATISTICS OF DENSITY AND CURRENT FLUCTUATIONS
In this section we derive from the fundamental formula the large deviations statistics separately for the density and the current. We discuss their singularities, that will be interpreted as non-equilibrium phase transitions. The long range correlations of non-equilibrium states will be connected to the non locality of the quasi-potential.

A. Density fluctuations
We start by deriving the probability of the density trajectories. We fix a path ρ = ρ(t, x), (t, x) ∈ [T 0 , T 1 ] × Λ. There are many possible trajectories j = j(t, x), differing by divergence free vector fields, satisfying the continuity equation associated to the given density trajectory ρ. . Optimizing over the possible currents we have (4.1) Then, the asymptotic probability of a density fluctuation is given by Due to the exponential character of such probability estimates, only the minimum of the functional I [T0,T1] (ρ, j) over all possible currents j is in fact relevant.
To find the optimal current in (4.1) we observe that, given any trajectory (ρ(t), j(t)) satisfying the continuity equation, we can introduce an external field F defined by The problem can be therefore formulated as follows. Among all possible external fields F , find the one that minimizes the right hand side of (4.3) with the constraint We claim that the optimal F is F = −∇π, where π : which vanishes at the boundary of Λ for any t ∈ [T 0 , T 1 ]. Let F = −∇π +F , so that ∇ · χ(ρ)F = 0. Since π vanishes at the boundary, an integration by parts yields the orthogonality relationship Λ dx ∇π·χ(ρ)F = 0. Whence, (4.5) By construction, ∇ · (J(ρ) − χ(ρ)∇π) = −∂ t ρ, so that, by (4.5), the choice of F which minimizes (4.3) is obtained lettingF = 0. We deduce where the positive operator K(ρ) is defined on functions π : Λ → R vanishing at the boundary ∂Λ by The above argument shows that we can restrict to gradient external fields F when we are looking for fluctuations only of the density ρ (this corresponds to particular realizations of the noisy part of the current in the fluctuating hydrodynamics picture). On the other hand, if we are looking for fluctuations of the current j, then the corresponding external field F is uniquely defined by (4.2) and will not be, in general, a gradient field.
We now derive a variational formula for the quasipotential. From equation (2.15), we deduce that is the rate function of the adjoint process. Let us consider the time interval taking T 1 = 0, T 0 = −T . Denoting byρ a generic path satisfyinĝ ρ(−T ) =ρ, which implies V (ρ(−T )) = 0, andρ(0) = ρ, we obtain that Observing that I * [0,T ] (θρ) ≥ 0 and that it is equal to zero when θρ solves the adjoint hydrodynamics, we obtain that where the infimum is carried over all trajectoriesρ such thatρ(−∞) =ρ,ρ(0) = ρ. The optimal trajectoryρ satisfies Compare with (Freidlin and Wentzell, 2012) for the finite dimensional case. Optimal trajectories for non-reversible finite dimensional systems have been seen in numerical simulations (Dykman et al., 1994a) and actually experimentally observed in analogue electrical circuits with noise modeling a two-dimensional diffusion process (Luchinsky and McClintock, 1997). We refer to the bibliography in those articles for previous literature on the topic.
We can summarize the previous analysis as follows. While for equilibrium states the path leading to a fluctuation is the time reversal of the relaxation path (Onsager and Machlup, 1953), for non-equilibrium states the spontaneous emergence of a density fluctuation takes place most likely following a trajectory which is the time reversal of the relaxation path along the adjoint hydrodynamics. The optimal field to create the fluctuation is 2∇ δV δρ , that is minus twice the dissipative thermodynamic force. To understand the factor 2 think of an electric circuit. To invert the current one has to add minus twice the original electric field.
From the identity (4.8) we deduce that for profiles ρ satisfying the boundary condition (2.5) δV /δρ vanishes at the boundary of Λ. It is in fact enough to take the derivative of (4.8) and notice that the optimal pathρ has prescribed boundary values.
The quasi-potential V (4.8) is a Lyapunov functional for the hydrodynamic equations (H-theorem). In fact, we can compute the rate of decrease of V (ρ(t)) along the hydrodynamic equations. In both cases, using equation (2.23), we have (4.10) Recalling (2.19) and (3.31), we see that the rate of decrease of V is the renormalized dissipation. In particular, we have that d dt V (ρ(t)) = 0 if and only if δV δρ (ρ(t)) = 0. Since we assumed that there exists a unique stationary profileρ, (4.10) implies thatρ is globally attractive.

B. Hamiltonian structure
We regard the functional (4.6) as an action function on the set of density paths. The corresponding Lagrangian is The associated Hamiltonian H(ρ, π) is obtained by the Legendre transform of L(ρ, ∂ t ρ): (4.11) The canonical equations associated to the Hamiltonian where π vanishes at the boundary of Λ, and ρ satisfies (2.5). In this formula Hess(π) represents the Hessian of π, TrA the trace of a matrix A and χ ′ the matrix with entries χ ′ i,j (ρ). Observe that (ρ(t), 0) is a solution of the canonical equations if ρ(t) solves the hydrodynamic equation (2.1)-(2.5). In particular, (ρ, 0) is an equilibrium point of the canonical equations.
Within the Hamiltonian formalism, the variational problem (4.8) becomes a minimal action problem. Classical arguments in analytic mechanics (Arnol'd, 1989) imply that the quasi-potential V introduced in (4.8) solves the stationary Hamilton-Jacobi equation This is exactly the equation derived in (2.23) by the time reversal argument. We next discuss the time reversal within the Hamiltonian formalism. Letting L * (ρ, ∂ t ρ) be the Lagrangian associated to the action function I * , the time reversal relationship (4.7) implies the following relation between Lagrangians: (4.14) As a consequence, denoting by H * the Hamiltonian associated to L * , Let us introduce the involution Θ on the phase space (ρ, π) defined by Denoting by T t , T * t the Hamiltonian flow of H, H * , respectively, (4.15) yields that Θ acts as the time reversal in the sense that The relationship (4.16) is non trivial also for reversible processes, i.e. when H = H * , in such a case it tells us how to change the momentum under time reversal. This definition of time reversal in a Hamiltonian context agrees with the one given in (Morpurgo et al., 1954).

C. Path integral derivation of the Hamiltonian
In alternative to the previous argument, we provide here, following e.g., (Derrida and Gerschenfeld, 2009b), a derivation of the Hamiltonian (4.11) from the fundamental formula (2.7) via a path integral calculation.
When we are interested only in the fluctuations of the density, we can use formally the fundamental formula as a probability distribution in a path integral, We can take into account the constraint of the δ function by introducing an auxiliary field π. By Laplace asymp-totics, Integrating by parts the term (∇ · j)π and computing the Gaussian integral over j we get where H is the Hamiltonian (4.11). The exponential in the previous equation is the action corresponding to the Hamiltonian H. In the limit ε → 0 the dominating contributions are thus in a neighborhood of solutions of the canonical equations (4.12).

D. Non differentiability of the quasi-potential: Lagrangian phase transitions
The quasi-potential may exhibit singularities which can be interpreted as non-equilibrium phase transitions. In a finite-dimensional setting, an analogous phenomenon is discussed in (Graham and Tél, 1985) where it is shown that the quasi-potential generically exhibits points of non differentiability. An interesting example of this kind has been discussed in (Jauslin, 1987). We refer to (Dykman et al., 1994b) for further developments and examples.
We discuss this phenomenon in the infinite dimensional context of the MFT (Bertini et al., 2010). For equilibrium states, the quasi-potential V is always convex and the occurrence of first order phase transitions corresponds to the presence of a flat part in the graph of V . In non-equilibrium states V is not necessarily convex and phase transitions without an equilibrium analogue can occur. These phase transitions have a natural geometric interpretation in the Hamiltonian formalism that we next illustrate.
In the sequel we need the following result in Hamiltonian dynamics, e.g., (Arnol'd, 1989). Given a closed curve γ parametrized as γ(α) = (ρ(α), π(α)), α ∈ [0, 1], the integral γ π dρ = 1 0 dα Λ dx π(α, x) ∂ α ρ(α, x) is invariant under the Hamiltonian evolution. This means that, by denoting with γ t the evolution of γ under the Hamiltonian flow, γt π dρ = γ π dρ. In view of this result, if γ is a closed curve contained in the unstable manifold M u then γ π dρ = lim t→−∞ γt π dρ = 0. We can therefore define the pre-potential V : where the integral is carried over an arbitrary curve γ(α), α ∈ [0, 1], in M u such that γ(0) = (ρ, 0) and γ(1) = (ρ, π). The possibility of defining such potential is usually referred to by saying that M u is a Lagrangian manifold. We now establish the relationship between the quasipotential and the pre-potential ( 4.18) Indeed, fix ρ and consider π such that (ρ, π) belongs to M u . Let (ρ(t),π(t)) be the solution of the Hamilton equations starting from (ρ, π) at t = 0. Since (ρ, π) ∈ M u , (ρ(t),π(t)) converges to (ρ, 0) as t → −∞. Therefore, the pathρ(t) is a solution of the Euler-Lagrange equations for the action I (−∞,0] , which means that it is a critical path for (4.8). Since L(ρ, ∂ tρ ) = Λπ ∂ tρ − H(ρ,π) and H(ρ(t),π(t)) = 0, the action of such pathρ(t) is given by I (−∞,0] (ρ) = V(ρ, π). Hence the right hand side of (4.18) selects among all such paths the one with minimal action, and the minimal action is, by definition, the quasi-potential V (ρ). For equilibrium states, the quasi-potential is given by the expression in (2.25) and it is simple to check that the unstable manifold is M u = (ρ, π) : π = f ′ (ρ) − f ′ (ρ) . In particular, M u is globally a graph which means that for every ρ there exists an unique π so that (ρ, π) ∈ M u . On the other hand, for non-equilibrium states the unstable manifold is not necessarily a graph and it may happen, for special ρ, that the variational problem (4.18) admits more than a single minimizer (Figure 1.a). The set of profiles ρ for which the minimizer is not unique is a caustic. In general, it is a codimension one submanifold of the configuration space. We call the occurrence of this situation a Lagrangian phase transition. In this case, profiles arbitrarily close to each other but lying on opposite sides of the caustic are reached by optimal paths which are not close to each other. This implies that on the caustics the first derivative of the quasi-potential is discontinuous (Figure 1.b).
Recall the discussion in Section IV.A showing that the optimal field F in (4.2) to produce the profile ρ is given by F = 2∇ δV δρ . If ρ is a caustic point then the functional derivative of V is not defined. However we can take a profile ρ +ρ close to caustic, compute the derivative at ρ+ρ, and then take the limit asρ → 0. However, since V has a first order discontinuity, we obtain different values for the limiting derivative. In this way, if ρ is a caustic point, we can construct different fields F in (4.2) such that the corresponding action (4.3) is equal to V (ρ). To each field F there corresponds an optimal trajectory for the variational problem (4.8).
The previous geometrical considerations make plausible that, for a non-equilibrium state, Lagrangian phase transitions do generically occur. The question whether a specific model, characterized by its transport coefficients, exhibits such transitions is a completely different story. It is remarkable, as we shall see in section V.G, that the weakly asymmetric simple exclusion can be proven analytically to have such phase transitions.
We conclude with some remarks on the possibility of observing Lagrangian phase transitions. Conceptually, they can be directly detected from a detailed statistics of the stationary non-equilibrium ensemble; Lagrangian phase transitions correspond to the presence of corners in the graph of the probability distribution function in logarithmic scale. Alternatively, one could exploit the instability of the exit path. As mentioned, optimal exit paths have been experimentally observed in noisy electronic devices with a finite number of degrees of freedom (Chan et al., 2008;Luchinsky and McClintock, 1997). On the other hand, in thermodynamic systems the thermal fluctuations are very small and the direct observation of Lagrangian phase transitions appears quite difficult, as it requires an extremely long time. The problem of large fluctuations admits an interpretation as a control problem (Bertini et al., 2004). This means that rather than considering the optimal path, we look for the field driving the system from the stationary state to a chosen profile with the minimal energetic cost. The Lagrangian phase transition then corresponds to the ex-istence of two different optimal fields dissipating the same energy. In principle, these two fields can be theoretically calculated and an experiment can be designed to check the predictions.

E. Non locality of the quasi-potential and long range correlations
Long range correlations are a generic property of stationary non equilibrium states which have been experimentally measured, see (Dorfman et al., 1994) for a review. At the theoretical level, several approaches have been developed around late 70's -early 80's, e.g. (Kirkpatrick et al., 1982;Procaccia et al., 1979;Spohn, 1983). In the MFT, long range correlations are a direct consequence of the non locality of the quasi-potential. By perturbatively solving the Hamilton-Jacobi equation, the equations for correlations of arbitrary order have been obtained (Bertini et al., 2009a).
We introduce the pressure functional as the Legendre transform of the quasi-potential V , The large deviations asymptotics (2.9) implies where we recall that ρ ε denotes the empirical density and P is the stationary ensemble. We point out that the above asymptotics does not imply in general (2.9). Indeed, while the functional V ♯ is always convex, the functional V can be recovered as the Legendre transform of V ♯ only when it is convex. For example, for the KMP model, V turns out to be not convex, (Bertini et al., 2005b). On the other hand, (4.19) does suffice to recover V in a small neighborhood of the stationary profilē ρ. By taking derivatives, (4.19) yields the asymptotics of truncated correlations of the empirical density, . (4.21) By Legendre duality we have the change of variable formula h = δV δρ , ρ = δV ♯ δh , so that the Hamilton-Jacobi equation (2.23) can then be rewritten in terms of V ♯ as where h vanishes at the boundary of Λ. This an equation for the generating function V ♯ , which by Taylor expansion yields a recursive relationship for the macroscopic correlations C n . Write the two-point correlation function in the form By expanding (4.22) around the stationary profileρ we obtain the following equation for B The operator L † is the formal adjoint of the differential and, We are using the convention that repeated indices are summed. When α(x) = 0, due to the boundary conditions, the unique solution to (4.23) is B = 0 and there are no long range correlations. In the case of equilibrium states α(x) = 0 since the current vanishes. There are cases in which α(x) = 0 even if J(ρ(x)) = 0. This happens in the Ginzburg-Landau model (Guo et al., 1988) where χ does not depend on ρ. Another case is the zero range model discussed in Section V.B. If α(x) is nonvanishing the inhomogeneous equation (4.23) has a nontrivial solution and long range correlations are present.
Since L is an elliptic operator (i.e. it has a negative kernel), the sign of B is determined by the sign of α: if α(x) ≥ 0, then B(x, y) ≤ 0, while if α(x) ≤ 0, then B(x, y) ≥ 0. For example, consider the following special case. The system is one-dimensional, the diffusion coefficient is constant, D(ρ) = D 0 , the mobility χ(ρ) is a quadratic function of ρ, and there is no external field, E = 0. Then where ∆ −1 (x, y) is the Green function of the Dirichlet Laplacian. Two well studied models, the symmetric exclusion process, where χ(ρ) = ρ(1 − ρ), and the KMP process, where χ(ρ) = ρ 2 , meet the above conditions. Then (4.25) shows that their correlations have opposite signs. By developing the arguments presented above, it is possible to deduce recursive equations for the n-point correlations C n ; we refer to (Bertini et al., 2009a) for the details of this analysis.
The existence of long range correlations in stochastic lattice gases and in particular in the symmetric simple exclusion process was first established, using fluctuating hydrodynamics and a direct computation, in (Spohn, 1983). We refer to (Giardinà et al., 2007) for more recent microscopic results. Our derivation shows that long range correlations in diffusive systems with a conservation law are a generic consequence of inhomogeneous chemical potentials and external fields. In real systems couplings between different fluctuating quantities generate non-equilibrium long range correlations as discussed in (Ortiz de Zárate and Sengers, 2004). These authors consider the coupling of temperature fluctuations with velocity fluctuations. The velocity fluctuating field formally appears as an external field in the hydrodynamic equation for the temperature fluctuations. For the experimental situation the reader may consult the review (Dorfman et al., 1994).

F. Current fluctuations
Both from a theoretical and an experimental point of view, a natural observable in non-equilibrium thermodynamics is the time averaged current.
The corresponding fluctuations have been analyzed in (Bodineau and Derrida, 2004). By postulating an additivity principle, which relates the fluctuation of the time averaged current in the whole system to the fluctuations in subsystems, the corresponding asymptotic probability is deduced. However, as pointed out in (Bertini et al., 2005a(Bertini et al., , 2006, this approach may underestimate the probability of fluctuations due to the possible occurrence of a dynamical phase transition. We show that the probability of fluctuations of the time averaged current in the time window [0, T ] can be derived, without additional assumptions, from the macroscopic fluctuation theory. The probability of observing a time averaged fluctuation J can be described by a functional Φ(J) which we characterize in terms of a variational problem for the functional I [0,T ] .
Recall that j ε is the empirical current, described after equation (2.7). Given a vector field J, by the fundamental formula (2.7), In this formula, A T is the set of paths (ρ, j) whose average current is J and initial density is ρ 0 , By the local conservation of the mass, the asymptotic T → ∞ of the above probability is relevant only for divergence free vector fields. Indeed, the case in which J has not zero divergence leads either to negative mass or to a mass condensation.
Since for a divergence free current J the sequence T Φ T (J) is subadditive in T , Φ T (J) converges to a limit denoted by Φ(J), given by (4.30) The limit Φ(J) does not depend on the initial condition ρ 0 . Indeed given two different initial conditions they can be connected by a transient in a finite time that will be irrelevant for the limit.
We now prove that Φ is a convex functional. Let 0 < p < 1 and J = pJ 1 + (1 − p)J 2 , we want to show that Φ(J) ≤ pΦ(J 1 ) + (1 − p)Φ(J 2 ). Fix T > 0 and an initial density profile ρ 0 . Let (ρ 1 , j 1 ) ∈ A pT , and (ρ 2 , j 2 ) ∈ A (1−p)T be the optimal paths for the variational problem (4.27) associated to the currents J 1 , J 2 , respectively. Therefore By the same arguments used in (4.29), the path obtained by gluing j 1 with j 2 , denoted by j, is in the set A T . Therefore, By taking the limit T → ∞ and since the limiting function does not depend on the initial condition, we conclude that Φ is convex. These arguments are standard in proving the existence and the convexity of thermodynamic functions in equilibrium statistical mechanics.
We introduce the functional U on the set of time independent profiles ρ = ρ(x) and j = j(x) We then define U on divergence free currents by where the minimum is carried over all profiles ρ satisfying the boundary condition (2.5). We show that To see this, since Φ(J) does not depend on the initial condition, choose as initial condition the density profile ρ 0 which minimizes (4.32). Since J is divergence free, the constant path In one space dimension, the functional U is the one introduced in (Bodineau and Derrida, 2004). Therefore, the additivity principle postulated there provides the correct asymptotics when equality holds in (4.33). This is the case for some models and corresponds to the situation in which the optimal path in (4.30) does not depend on time. On the other hand, as we shall see in Section VI.A, for other models the inequality in (4.33) is strict and this corresponds to a spontaneous symmetry breaking of time translation invariance.
We now argue that for small deviations of the current, i.e. in a neighborhood of the stationary current J(ρ), dynamical phase transitions do not occur, i.e. Φ = U . Observe that for J(ρ) we have Φ(J(ρ)) = U (J(ρ)) = 0 and this is uniquely realized by choosing on the right hand side of (4.30) the time independent path (ρ, J(ρ)). For J close to J(ρ) the optimal path for the right hand side of (4.30), possibly time-dependent, will be close to (ρ, J(ρ)). Since the path (ρ * , J) where ρ * is the optimal profile in (4.32) is a stationary point for the right hand side of (4.30), by continuity it also will be the global minimizer.
The asymptotics (4.26) can be formulated in terms of the moment generating function of the empirical current. For each time independent, divergence-free vector field where E ρ0 denotes the expectation with respect to the probability distribution P ρ0 , and Φ ♯ (v) is the Legendre transform of Φ(J), The supremum is carried over all the divergence free vector fields J.
In connection with the functional Φ, Varadhan suggested (Varadhan, 2004a) the possibility of the alternative variational representation Φ(J) = inf U(ρ(t), j(t)) . (4.36) In this formula · represents the expectation with respect to a stationary process (ρ, j), and the infimum is carried over all such stationary processes satisfying the continuity equation ∂ t ρ + ∇ · j = 0 and the constraint j(t) = J. Note that U(ρ(t), j(t)) does not depend on t by stationarity. The representation (4.36) is not used in this paper.
The fundamental formula (2.7)-(2.8) can be used to analyze the fluctuation of the current flux across a surface. As shown in (Bodineau et al., 2008a), for models in two dimension the asymptotics for closed or open curves are different due to the possible occurrence of vortexes around the endpoints.

G. Gallavotti-Cohen symmetry
Denote by Φ * the functional defined by the variational problem (4.30) with I * in place of I. By (2.15) and since For equilibrium states this symmetry states that the functional Φ is even.
Let us consider a path j(t), t ∈ [−T, T ] such that (2T ) −1 T −T dt j(t) = J for some divergence free vector field J. Recalling the Einstein relation D(ρ)χ(ρ) −1 = f ′′ (ρ) we have that Recall (2.8) and (2.11). Since f ′ (ρ(x)) = λ(x), x ∈ ∂Λ, an integration by parts yields where dσ is the surface measure on ∂Λ andn is the outward normal to Λ. In particular this relation implies that if (ρ,) is an optimal path for the variational problem defining Φ(J) then (θρ, θ) is an optimal path for the variational problem defining Φ(−J). By taking the limit T → ∞ in (4.37) we get which is a Gallavotti-Cohen type symmetry in our space time dependent setup for macroscopic observables. Note that the right hand side of (4.38) is minus the energy given to the system by the external field and the boundary reservoirs per unit time (3.2). When Φ = U the symmetry (4.38) can be generalized as follows . Consider J and J ′ two divergence free currents such that |J(x)| 2 = |J ′ (x)| 2 then it is immediately seen that (4.39) If Φ = U , by taking J ′ = −J we recover (4.38).

H. Extended Hamiltonian structure
In section IV.B we discussed the Hamiltonian structure related to the density fluctuations. Here we show that there is an underlying (richer) Hamiltonian structure for the joint fluctuations of density and current.
To this end we write (2.8) as an action associated to a Lagrangian. This is possible using some simple changes of variables. We consider the time interval [0, T ] and assume that the external drivings do not depend on time. Let A 0 (x) be a vector field related to the initial condition by ∇·A 0 (x) = ρ(x, 0). For example we can fix A 0 = −∇h where h solves ∆h(x) = −ρ(x, 0). We then define the vector field that, apart from the initial condition and a minus sign, is the time integrated current. Since ρ and j are related by the continuity equation we have j = −∂ t A and ρ = ∇ · A. We can then write the rate functional (2.8) in terms of the vector field A (4.41) Observe that, in this form, the constraint of the continuity equation is automatically satisfied. Formula (4.41) has the form of an action for the Lagrangian (4.42) The corresponding Hamiltonian is (4.43) and the canonical equations are where we denoted by ∇ T B the matrix having entries ∇ T B i,j = ∂ xi B j and recall that Tr(·) denotes the trace. Given a solution (ρ, π) of the canonical equations (4.12) there corresponds a solution of (4.44) given by The momentum B plays the role of the external field F in (4.2). When we look only at fluctuations of the density then B is a gradient vector field with potential π as in (4.45). On the other hand when we study fluctuations of the current we need a general vector field B. Correspondingly not all the solutions of (4.44) are of the form (4.45).

V. MACROSCOPIC MODELS
To illustrate the scope of the general theory developed so far, we begin by discussing some cases where calculations can be made explicitly. From the point of view of the MFT, a system is defined by the transport coefficient D and χ. In this connection we emphasize that many microscopic models can give rise to the same macroscopic behavior encoded in such coefficients. Only in special cases the microscopic models can be solved. Specific choices of the transport coefficients are named after the underlying microscopic models. In Section VIII we discuss how these coefficients can be obtained from the microscopic dynamics.

A. Equilibrium
We briefly look upon equilibrium states from the standpoint of non-equilibrium. Recall that we defined a system in the domain Λ to be in an equilibrium state when the current in the stationary profileρ vanishes, i.e. J(ρ) = 0. A particular case is that of a homogeneous equilibrium state, obtained by setting the external field E = 0 and choosing a constant chemical potential at the boundary, i.e., λ(x) =λ.
For equilibrium states the quasi-potential, defined by the variational formula (4.8), coincides with the functional V in (2.25), that is (5.1) We show that V solves the Hamilton-Jacobi equation (2.23). Its derivative is so that, by an integration by parts, where we used (2.4) and ∇f ′ (ρ)− E = −χ(ρ) −1 J(ρ) = 0. This statement is not sufficient to conclude that the functional in (5.1) is the quasi-potential, observe for instance that V = 0 always solves the Hamilton-Jacobi equation. In order to identify V with the quasi-potential we need to verify that V is the maximal solution satisfying V (ρ) = 0. Clearly, V is positive and zero onρ. For checking that it is a maximal solution we refer to (Bertini et al., 2009a).
We next show that the condition J(ρ) = 0 is equivalent to either one of the following conditions.
-There exists a functionλ : Λ → R such that (5.4) -The system is macroscopically time reversal invariant in the sense that for each profile ρ we have J * (ρ) = J(ρ).
We emphasize that the notion of macroscopic time reversal invariance does not imply that an underlying microscopic model satisfies the detailed balance condition. Indeed, as it has been shown by explicit examples (Gabrielli et al., 1996(Gabrielli et al., , 1999, there are microscopic models not time reversal invariant for which J * (ρ) = J(ρ).
So far we have assumed the local Einstein relation and we have shown that for equilibrium systems it implies (5.1). Conversely, we now show that macroscopic reversibility and (5.1) imply the local Einstein relation (2.4). If J(ρ) = J * (ρ) then (2.26) holds, which reads, in view of (5.1), (5.5) where we used J(ρ) = 0 to eliminate E. Note that J(ρ) = 0 follows from the first equation in (2.18) and J(ρ) = J * (ρ) without further assumptions. Since ρ and ∇ρ are arbitrary the local Einstein relation D = χ f ′′ follows from (5.5).
A peculiar feature of equilibrium states that allowed the explicit derivation of the quasi-potential is that the optimal path for the variational problem (4.8) is the time reversal of the hydrodynamic trajectory. We emphasize that this can happen also if the identity J(ρ) = J * (ρ) is violated but ∇ · J(ρ) = ∇ · J * (ρ) is satisfied. Indeed, we next give an example of a system not invariant under time reversal, i.e., with J(ρ) = 0, such that the optimal trajectory for the variational problem (4.8) is the time reversal of the solution to the relaxation trajectory.
Let Λ = [0, 1], D(ρ) = χ(ρ) = 1, λ(0) = λ(1) =λ, and a constant external field E = 0. In this case the hydrodynamic evolution of the density is given by the heat equation independently of the field E. The stationary profile isρ =λ, the associated current is J(ρ) = E = 0. By a computation analogous to the one leading to (5.1), we easily get that so that V can be obtained by integrating the above equation. The identity (5.6) represents the general form, for equilibrium states, of the relationship between currents and thermodynamic forces. It holds both when the free energy is local and non local. When (5.6) holds, the quasi-potential can be computed by an integration. An example of such a situation with a non local free energy is provided by the ABC model on a ring with equal densities (Evans et al., 1998).

B. Zero range
At the macroscopic level this model is specified by the choice χ(ρ) = ϕ(ρ) and D(ρ) = ϕ ′ (ρ), where ϕ is an increasing function on R + . In particular, the local Einstein relation (2.4) holds with f ′ = ϕ ′ /ϕ. This is a very special model in which the quasipotential is a local functional of the density that can be explicitly computed. It is given similarly to the equilibrium case whereρ is the unique stationary solution of (2.6), which in the present case takes the form The proof that the local functional (5.7) solves the Hamilton-Jacobi equation (2.23) will be given in Section V.C. Assume that d = 1, that the external field E is constant, and that Λ = (0, 1). We denote by λ 0 , λ 1 the values of the chemical potential at the endpoints. In this context one can compute the functional Φ introduced in (4.30). As we will show in section VI.A for this model there are no dynamic phase transitions and Φ = U where U is the functional introduced in (4.32). Note that in one-dimension the only vector fields with vanishing divergence are constant. With the change of variable α(x) = ϕ(ρ(x)) the variational problem (4.32) reduces to inf α 1 4 where α(0) = e λ0 = ϕ 0 , α(1) = e λ1 = ϕ 1 . This implies that Φ does not depend on the function ϕ(ρ) and in particular coincides with the one for a model of independent particles, i.e. ϕ(ρ) = ρ.
The optimal profile α of the variational problem (5.8) is given by for suitable values of the constants a, b, C to be determined by the boundary conditions and the current J.
Using the explicit form of the minimizer we have where A = e λ 0 1−e −E and B = e λ 1 e E −1 . Its Legendre transform is Notice that this solution converges, as E → 0, to the solution with no external field that can be easily obtained by the general formulas in section VI.B. For a microscopic counterpart see (Harris et al., 2005).

C. Conditions for locality of the quasi-potential
It is natural to ask under what conditions the quasipotential V (ρ) is a local functional of the form (5.7), whereρ =ρ λ,E is the stationary solution associated to the boundary chemical potential λ(x) and the external driving field E(x), and f is the free energy density of the model, related to the diffusion coefficient D(ρ) and the mobility χ(ρ) by the Einstein relation (2.4).
As a first observation, we show that V (ρ) is local if and only if is independent of ρ. Indeed, if V (ρ) is as in (5.7), then J S (ρ) = −χ(ρ)∇ δV δρ can be computed explicitly, as well as J A (ρ) = J(ρ) − J S (ρ). The result is Hence (5.10) is independent of ρ. Conversely, if (5.10) is independent of ρ, then the equation χ(ρ) −1 J A (ρ) = χ(ρ) −1 J A (ρ), can be rewritten, by (2.2), (2.19), and (2.4), as This equation, together with the condition that V (ρ) has a minimum equal to 0 for ρ =ρ, gives (5.7). For example, in equilibrium J A (ρ) = 0 for all ρ, and for the (out of equilibrium) model of particles circulating on a ring driven by a constant field E, described in Section II.C, we have χ(ρ) −1 J A (ρ) = E, which is independent of ρ.
For example, in equilibrium J(ρ) = 0, so (5.13) holds trivially. In the model of particles circulating on a ring driven by a constant field E, described in Section II.A, we have ∇ρ = 0, so (5.13) still holds. Furthermore, equation (5.13) holds for arbitrary choices of external field E and boundary chemical potential λ provided that D(ρ) and χ(ρ) are related by the following equation: for arbitrary ρ andρ. This equation is an integral form of the following condition It is easily seen that there are only two situations in which condition (5.15) holds: for arbitrary D(ρ) and χ(ρ) constant in ρ, which corresponds to the called Ginzburg Landau model, (Guo et al., 1988;Spohn, 1991), and for D(ρ) = cχ ′ (ρ), for a constant c, which corresponds to a "generalized" zero range model (the zero range model is obtained for c = 1). We thus conclude, in particular, that in both these cases the quasi-potential V (ρ) is indeed local for arbitrary choices of external field E and boundary chemical potential λ.
Another situation in which (5.13) is satisfied is when J(ρ(x)) · ∇ρ(x) = 0 for any x. This happens if Λ is the d-dimensional torus and the external field is of the form −∇U +Ẽ with ∇ ·Ẽ = 0 and ∇U (x) ·Ẽ(x) = 0 for any x ∈ Λ. This can be verified with a simple calculation.
By using a matrix representation of the microscopic invariant state and combinatorial techniques, in (Derrida et al., 2001(Derrida et al., , 2002b it is shown that the quasipotential V can be expressed in terms of the solution of a non-linear ordinary differential equation. We show how this result can be deduced using the MFT. Namely, we consider the variational problem (4.8) for the onedimensional simple exclusion process and show that the associated Hamilton-Jacobi equation can be reduced to the non-linear ordinary differential equation obtained in (Derrida et al., 2001). We look for a solution of the Hamilton-Jacobi equation (5.16) by performing the change of variable for some functional ϕ(x; ρ) to be determined satisfying the boundary conditions ϕ(±1) = log ρ(±1)/[1 − ρ(±1)]. Inserting (5.17) into (5.16), we get that Adding and subtracting e ϕ /(1 + e ϕ ), we may rewrite the previous integral as Since ρ − e ϕ /(1 + e ϕ ) vanishes at the boundary, an integration by parts yields  As proven in (Derrida et al., 2002b) this equation admits a unique monotone solution which is the relevant one for the quasi-potential. Recalling (3.4), a computation shows that the derivative of the functional (5.20) is given by (5.17) when ϕ(x; ρ) solves (5.19). To prove that this is the maximal positive solution we refer to (Bertini et al., 2002).
According to the general time reversal argument, see in particular equation (2.18), the adjoint hydrodynamics can be written as where we used (5.17) and ϕ has to be expressed in function of ρ by solving (5.19). As shown in (Bertini et al., 2002), it is remarkable that this non local evolution can be directly related to the heat equation. Let γ = γ(t, x) be defined by where ϕ = ϕ(t, x) is the solution to (5.19) when ρ = ρ(t, x) evolves according to (5.21). Then γ solves ∂ t γ = ∆γ (5.23) with the appropriate initial and boundary conditions.
One may be tempted to repeat the same computation in arbitrary dimension; one would obtain a partial differential equation analogous to (5.19). However, in more than one dimension it does not exist, in general, a functional V whose derivative is given by (5.17) with ϕ and ρ related by such partial differential equation.
For this model, as proved in (Derrida et al., 2001) for the one-dimensional case and in (Bertini et al., 2002) for higher dimensions, the quasi-potential V (ρ) is larger than the local functional (2.25) withρ the non equilibrium stationary profile. For small fluctuations this follows from formula (4.25).

(5.25)
The new Hamiltonian has the same form of (5.24), that isH but the boundary conditions are ∇ϕ(±1) = ∇ψ(±1) = 0 (Tailleur et al., 2007). Since these boundary conditions corresponds to an isolated exclusion process, (5.25) realizes a map into an equilibrium system. In particularH satisfies (4.15) withH * =H and the optimal exit trajectory is simply given by the time reversal of the relaxation one. By mapping back this solution and computing the corresponding action the expression (5.20) for the quasipotential is recovered.
From a physical point of view, besides the case of external reservoirs, boundary conditions modeling a battery appear natural. Namely, we can consider the system in a ring with an external field and take the limit in which the field becomes a delta function localized at one point. The application of the MFT to this case is discussed in .

E. Kipnis-Marchioro-Presutti model
We consider the one dimensional boundary driven Kipnis-Marchioro-Presutti (KMP) model (Kipnis et al., 1982). This is a diffusive system with transport coefficients given by D(ρ) = 1 and χ(ρ) = ρ 2 . It derives from a simple stochastic model of heat conduction in a crystal. Like in the exclusion process the computation of the quasi-potential can be reduced to the solution of a non linear differential equation (Bertini et al., 2005b).
The procedure is similar to the one for the simple exclusion process. The Hamilton-Jacobi equation for the quasi-potential V is We assume that Λ = (−1, 1). We shall also assume the macroscopic density profile ρ = ρ(x) satisfies the boundary conditions ρ(±1) = ρ ± . We emphasize that ρ now represents an energy density. We look for a solution of the Hamilton-Jacobi equation (5.27) by performing the change of variable for some functional α(x; ρ) to be determined satisfying the boundary conditions α(±1) = ρ(±1).
With a calculation similar to the one in the previous section we find that the quasi-potential is where α = α(x; ρ) is the unique monotone solution to (5.30) By a direct computation it can be shown that V (ρ) is not convex. For this model, as proved in (Bertini et al., 2005b), the quasi-potential V (ρ) is smaller than the local functional (2.25) withρ the stationary profile. For small fluctuations this follows from formula (4.25).

F. Exclusion process with external field
The computation of the quasi-potential for the onedimensional boundary driven simple exclusion process reviewed in section V.D can be generalized to the case in which a constant external field is applied to the system. The first result has been obtained, using the matrix approach, in (Enaud and Derrida, 2004) and refers to the case in which the driving due to the external reservoirs and the field are in the same direction. In the same situation an approach based on the macroscopic fluctuation theory is presented in (Bertini et al., 2009b). The case when the field drives in the opposite direction with respect to the boundary sources exhibits Lagrangian phase transitions and will be discussed in the following section.
The weakly asymmetric boundary driven simple exclusion process is defined, in appropriate units, by the following choices. The transport coefficient are D = 1 and χ(ρ) = ρ(1 − ρ) so that the specific free energy is f (ρ) = ρ log ρ + (1 − ρ) log(1 − ρ). Observe that the hydrodynamic equation is the viscous Burgers equation. We consider it on the space domain Λ = (−1, 1) with a constant external field E and denote by λ ± the chemical potentials of the boundary reservoirs. We let ρ ± = e λ± /(1 + e λ± ) be the boundary values of the density.
The Hamilton-Jacobi equation for the quasi-potential (2.23) thus reads As in the symmetric case we look for a solution V whose derivative has the form where, for density profiles ρ satisfying the boundary conditions ρ(±1) = ρ ± , we have ϕ(±1, ρ) = λ ± . Few integrations by parts similar to (5.18) show that (5.31) is (5.33) In order to identify the quasi-potential we need show that ϕ is properly defined, namely that (5.33) has a unique solution, and that there exists a functional V with derivative given by (5.32).
Fix ρ − < ρ + and observe that when E = E 0 ≡ [λ + − λ − ]/2 the model describes an inhomogeneous equilibrium state as in Section V.A. We here consider the case in which E < E 0 that corresponds to a negative stationary current. Recalling F (ρ) = Λ dx f (ρ), we introduce the auxiliary functional of two variables which has the property that (5.33) is the stationarity condition δG/δϕ = 0 while δG/δρ = f ′ (ρ) − ϕ is the right hand side of (5.32). The functional G is well defined provided ϕ is increasing and ∇ϕ ≥ E. In (Bertini et al., 2009b) is shown that (5.33) has a unique solution ϕ satisfying these requirements. The quasi-potential, up to an additive constant that is fixed by the normalization V (ρ) = 0, can thus be expressed in terms of the auxiliary functional G as where ϕ(ρ) is the solution to (5.33). Indeed, if ϕ(ρ) solves (5.33) then by chain rule The fact that ϕ solving (5.33) corresponds to a maximum of G follows from the concavity with respect to ϕ of G. We mention that the computation reducing the (infinite dimensional) Hamilton-Jacobi equation (5.31) to the (one dimensional) problem (5.33) can be extended to the models with constant diffusion coefficient, quadratic mobility, and constant external field (Bertini et al., 2005b;Derrida and Gerschenfeld, 2009b).

G. An example of Lagrangian phase transition
As in the previous Section, we consider the onedimensional boundary driven weakly asymmetric exclusion process on the interval (−1, 1) with λ − < λ + . We consider here the case in which the driving from the field is in the opposite direction with respect to the one from the boundary reservoirs and the the stationary current J(ρ) is positive, that is E > E 0 = [λ + − λ − ]/2. We shall show that for E ≫ E 0 this model provides an example of a Lagrangian phase transition, see Section IV.D. This appears to be the first concrete example where this can be rigorously proven (Bertini et al., 2011).
As a first step, we discuss the change of variable (5.32) in the framework of the underlying Hamiltonian structure. Recalling that the Hamiltonian is given in (4.11), we perform the symplectic change of variables where we recall that f (ρ) = ρ log ρ + (1 − ρ) log(1 − ρ) is the specific free energy.
In the new variables the equilibrium position (ρ, 0) becomes (f ′ (ρ),ρ). The associated stable manifold is M s = {(ϕ, ψ) : ϕ = f ′ (ψ)}. As shown in (Bertini et al., 2010) the unstable manifold is given by . (5.37) Note that in the variables (ϕ, ψ) the unstable manifold M u can be described as the graph of a single-valued function while this is not the case in the original variables (ρ, π), recall Fig. 1 (a) of Section IV.D. In view of the expression (5.37) of the unstable manifold, the pre-potential V in (4.17) can be obtained by direct computations using the new variables (ϕ, ψ). Let G be the functional (compare with (5.34)) up to an additive constant fixed by the normalization G(ρ, f ′ (ρ)) = 0. Then the pre-potential (in the original variables) is We deduce that the quasi-potential is given, up to an additive constant, by (5.40) According to the general arguments in Section IV.D the pre-potential is defined on the unstable manifold M u . On the other hand, the right hand side of (5.38) extends to a function defined for all ϕ satisfying 0 < ∇ϕ < E. By denoting still with G this extension we realize that the condition (ϕ, ρ) ∈ M u is equivalent to δG(ρ, ϕ)/δϕ = 0. We conclude that (5.40) still holds if the constraint between ρ and ϕ is dropped. When the external field E is large enough, the weakly asymmetric exclusion process exhibits Lagrangian phase transitions. Namely the variational problem in (5.40) admits more than a single critical point or equivalently the equation on the second line of (5.37) has multiple solutions. We argue as follows. Consider first the limiting case E = ∞ in which the hydrodynamic equation becomes the inviscid Burgers equation and corresponds to the asymmetric simple exclusion process examined in . The functional G becomes In this limit the variational problem (5.40) becomes a one-dimensional problem and it is possible to exhibit explicitly density profiles such that uniqueness fails. For instance this is the case if ρ is of the form drawn in Fig. 2. By a continuity (topological) argument one shows that this phase transition persists also for E finite and large. Comparing the formula (5.34) of the previous section with (5.38) we obtain easily, by inserting the absolute value inside the argument of the logarithm, an expression for G that covers both cases. On the other hand, if E < E 0 the function ϕ → G(ρ, ϕ) has a unique critical point which corresponds to a maximum, while for E > E 0 it may have more critical points and the quasi-potential is obtained in correspondence to the global minimum.
The analysis of the weakly asymmetric exclusion process has been further developed, by considering density profiles ρ with more critical points, in (Aminov et al., 2014), see also references therein.

H. Reaction-diffusion dynamics
In this Section we discuss the case in which the macroscopic dynamic is not a conservation law but there is a reaction term allowing creation/destruction of particles in the bulk. This class of models, with added random forces, has been investigated in the literature, e.g. (Täuber, 2014) for a recent reference. Here we just show, in a specific example, how the basic principles of the MFT need to be modified to cover these processes.
The macroscopic evolution has the form where b and d are respectively the creation and destruction rates. For simplicity we restrict to the case Λ = (−1, 1) d with periodic boundary conditions. This evolution can be derived as the typical behavior of some underlying stochastic microscopic dynamics in which particles can jump on the lattice and be created or destroyed. For instance, as shown in (De Masi et al., 1986), it can be derived from the socalled Glauber+Kawasaki process that we describe in Section VIII.C.
The associated large deviation functional for the density trajectories was first calculated in (Jona-Lasinio et al., 1993) (5.43) where the external potential H is connected to the fluctuation ρ by The structure of the functional I reflects the Poissonian nature of the underlying microscopic dynamics. The Hamiltonian associated to the large deviation functional (5.43)-(5.44) for this model is (5.45) where π is the conjugate momentum. Observe that while I has an implicit expression, since H has to be expressed in terms of ρ by solving (5.44), the Hamiltonian H has a closed form.
As H is not quadratic, the Hamilton-Jacobi equation is very complicated but can be solved in some special cases. This happens when b(ρ) = c 1 (1 − ρ)h(ρ) and d(ρ) = c 2 ρh(ρ) where c i are positive constants and h(ρ) is a positive function. In this case (Gabrielli et al., 1997) , (5.47) wherec = c 1 /(c 1 + c 2 ). This corresponds to the situation that we call macroscopic reversibility of which the validity of microscopic detailed balance (see (8.17)) is a special case.
In the general case equation (5.46) can be solved by successive approximations using as an expansion parameter ρ −ρ whereρ is a solution of B(ρ) = D(ρ) that is a stationary solution of hydrodynamics. More precisely we look for an approximate solution of (5.46) of the form (5.48) By inserting (5.48) in (5.46) one can show that k(x, y) satisfies the following equation If V is a local functional of the density, k(x, y) must be of the form k(x, y) = g(ρ)δ(x − y) which inserted in Here ρ, j and k are connected by the equation The rate function (5.43) can be recovered from (5.52) by optimizing with respect to j and k. For driven diffusive systems, we have shown that long range correlations of the density are a generic feature of non-equilibrium states. If b(ρ) = d(ρ) the reaction diffusion dynamics does not exhibit a macroscopic current and, in this respect, may be regarded as an equilibrium state. On the other hand, the previous discussion implies that long range correlations do appear if (5.51) is violated. From the point of view of the MFT, violation of (5.51) corresponds to a breaking of macroscopic reversibility. We refer to (Basile and Jona-Lasinio, 2004;Bertini et al., 2007) for more details.

I. Mean field models
The macroscopic fluctuation theory can be applied to diffusion processes coupled via a mean field interaction, (Bouchet et al., 2013). A prototype of such systems is the Kuramoto model with noise. This is a system of N coupled planar rotators described by the phases θ i in a rotating magnetic field with amplitude H and frequency F . In the frame comoving with the rotators, the evolution is given by the Langevin equationṡ where J is the coupling constant, κ the Boltzmann constant T the temperature, and α i independent white noises.
If the frequency F vanishes this is an equilibrium model and the stationary ensemble has a Gibbsian description with a mean field interaction that undergoes a phase transition. On the other hand for F = 0 it is a nonequilibrium model. With the proper definition of the current J(ρ), the fundamental formula of the macroscopic fluctuation theory holds and thus allows an analysis of the asymptotic properties of this model. In particular, the quasi-potential can be computed perturbatively. Moreover, the current fluctuations exhibit rich and interesting phenomena of the type of the dynamical phase transition that will be discussed in Section VI.A.

J. Models with several conservation laws
So far we have considered for simplicity conservative models with only one conservation law. The theory however is not limited by this restriction and models with more than one thermodynamic variable have been considered.
We mention in particular the work (Bernardin, 2008). It deals with a stochastic heat conduction model for solids. The system is in contact with two heat baths at different temperatures. There are two conserved quantities: the energy and the deformation between atoms. The author establishes the hydrodynamic limit for the two conserved quantities and calculates a large deviation functional analogous to (4.6) for the joint fluctuations of the energy and the deformation. From this formula he obtains the quasi-potential for temperature fluctuations which is the same as for the KMP model (5.29).
In this case there are three conserved quantities but only two are independent. The hydrodynamic equations are not of the standard form (2.2) but the quasi-potential can be calculated exactly when the total densities of the the three species are equal. It is non local but this is not in contradiction with our previous statements due to the non standard form of the hydrodynamics. It satisfies the Hamilton-Jacobi equation which in this case is equivalent to (5.6) due to reversibility. If the total densities are not equal the MFT has been used in (Bodineau et al., 2008b) to compute perturbatively the quasi-potential.

VI. THERMODYNAMICS OF CURRENTS
The study of current fluctuations is one of the most interesting topic that can be developed within the MFT and has received a considerable attention in the literature. In this section we first discuss a striking prediction of the theory on the possibility of dynamical phase transitions in current fluctuations leading to a state of the system spontaneously breaking time translation invariance (Bertini et al., 2005a(Bertini et al., , 2006. We then show that universal properties of the cumulants of the time averaged current can be obtained both in stationary and non stationary states.

A. Examples of dynamical phase transition
Recalling the discussion in Section IV.F, we first show that, under some structural conditions on the transport coefficients, the identity Φ = U holds. In this case the additivity principle in (Bodineau and Derrida, 2004) is satisfied and there are no dynamical phase transitions. The computation of Φ is simpler as we have to solve a time independent variational problem.
We assume that the matrices D(ρ) and χ(ρ) are multiples of the identity. In the case with no external field, E = 0, if D(ρ)χ ′′ (ρ) ≤ D ′ (ρ)χ ′ (ρ) for any ρ (6.1) then Φ = U , which implies also that U is convex. Moreover if D(ρ)χ ′′ (ρ) = D ′ (ρ)χ ′ (ρ) for any ρ (6.2) then Φ = U for any external field E. For the proof of these statements we refer to (Bertini et al., 2006) where we also discuss the case with periodic boundary conditions which requires the further restriction that D is constant. Condition (6.1) is satisfied e.g., for the symmetric simple exclusion process, where D = 1 and χ(ρ) = ρ(1 − ρ), ρ ∈ [0, 1]. We recall that, as shown in Section V.C, condition (6.2) implies the locality of the quasi potential and is satisfied by the zero range and the Ginzburg Landau processes.
To exemplify situations in which Φ < U , that is the presence of a dynamical phase transition, consider the fluctuations of the time averaged current in the one dimensional case with periodic boundary conditions. Two models have been discussed so far, the KMP model and the exclusion process with an external field.
In (Bertini et al., 2006) by simple arguments (Jensen inequality and convexity properties of the transport coefficients), we find sufficient conditions on D, χ, E and J implying that the optimal profile for the variational problem (4.32) defining the functional U is the constant one. More precisely we show that if D is constant and J 2 /χ(ρ) + E 2 χ(ρ) is a convex function in ρ then Under suitable conditions, we shall exhibit a timedependent path for which (1/T )I [0,T ] (ρ, j) is strictly less then U . This implies the inequality Φ < U . Let Λ = (0, 1) and (ρ(t), j(t)) be a periodic trajectory, with time averaged current J, in the form of a traveling wave of velocity v, where ρ 0 is an arbitrary periodic function with period one such that 1 0 dx ρ 0 (x) =ρ. As functions of t, ρ and j are periodic with period 1/v. It is easy to verify that the continuity equation holds and that the time average of j over the time interval v −1 is equal to J. For this choice we have As shown in (Bertini et al., 2006) under the condition for J large enough it is possible to find ρ 0 and v such that the right hand side of (6.5) is less then (6.3).
Consider the KMP model. Since χ ′′ > 0 condition (6.6) is satisfied when E is small enough, in particular in the case of no external field, that is for an equilibrium state. The above argument thus provides a complete analytic proof of the strict inequality Φ < U . The existence of this dynamical phase transition has been also observed in simulations in ). An open problem is whether the phase transition exists in the case of a boundary driven model. At the numerical level so far the answer has been negative (Hurtado and Garrido, 2009).
In the case of the exclusion process, since χ ′′ < 0, in order to have a dynamical phase transition we need an external field. This case has been discussed in (Bodineau and Derrida, 2005). When E and J are small, Φ = U and the optimal density profile for the variational problem (4.32) defining U is constant. These authors perform a linear stability analysis showing, in particular, that the constant profile becomes unstable for sufficiently large external fields and currents and conclude the existence of a dynamical phase transition. By a numerical computation, they also show that the traveling wave path is the optimal one for the variational problem (4.30) defining Φ.

B. Cumulants of the current and their universality properties
We define the average total current as whose relationship with the microscopic dynamics will be detailed in section VIII.F. In the limit ε → 0 and T → ∞ Q ε,T converges to Λ dx J(ρ), where J(ρ) is the hydrodynamic current corresponding to the stationary density profileρ. The MFT allows to describe the asymptotic behavior of the cumulants of Q ε,T . We present in this section some results obtained in (Akkermans et al., 2013;Appert et al., 2008;Bodineau and Derrida, 2004;Derrida et al., 2004). We assume throughout this section that there is no external field, E = 0. We start with the case of a onedimensional boundary driven system and choose Λ = (0, 1). Since in one space dimension the only divergencefree vector fields are the constant fields, the analysis of the asymptotic behavior of Q ε,T is equivalent to (4.26). Assume that ρ 0 < ρ 1 so that the stationary current is negative. The asymptotics of the cumulants of Q ε,T can be deduced from the general formulas (4.34), (4.35) by computing the derivatives of Φ ♯ at 0. Note that the behavior of Φ ♯ in a neighborhood of 0 corresponds to the behavior of Φ in a neighborhood of the stationary current J(ρ). In view of the continuity argument given in the paragraph before (4.34), we can compute the cumulants analyzing the time-independent variational problem (4.32). The same continuity argument implies that, in a neighborhood of J(ρ), the optimal ρ for (4.32) is increasing.
In the case where D is constant and χ(ρ) = ρ(1 − ρ), which corresponds to the case of the simple exclusion process, condition (6.1) holds. By the results of section VI.A we get that Φ(J) = U (J) for all J. The optimal solution ρ of the variational problem (4.32) for U has been computed in (Bodineau and Derrida, 2004). For any value of θ one then gets the closed form where ω = ρ 0 (e θ − 1) + ρ 1 (e −θ − 1) + ρ 0 ρ 1 (e θ − 1)(e −θ − 1) . (6.13) The computation of the Legendre transform has been extended to higher dimensions in (Akkermans et al., 2013). Consider a domain Λ in dimension d > 1 and assume that there are two external reservoirs, at densities ρ A and ρ B , in the regions A, B ⊂ Λ. For J close to the stationary value or globally under the assumption (6.1) we have that Φ is equal to U . The fluctuations of the net flow between A and B are analyzed in (Akkermans et al., 2013) where it is shown that where Φ ♯ 1 is computed for a one-dimensional system on the interval (0, 1) with boundary densities ρ A , ρ B , and Cap Λ A, B is the capacity, that depends only on the geometry, of a condenser formed by A and B in Λ. From (6.14) it follows in particular that the ratio between any pair of cumulants is the same as in one dimension.
As Φ ♯ is quadratic, in view of (6.12), the limiting variance of ε −1 T Q ε,T is equal to 2χ(ρ) while the remaining cumulants vanish as ε → 0 and T → ∞. The finite size corrections to this Gaussian behavior are studied in (Appert et al., 2008). The relationship between the variable Q t used in this reference and (6.7) is In our notation, the finite size correction to the function Φ(J) is In this formula, D = D(ρ), χ = χ(ρ), χ ′′ = χ ′′ (ρ), and where B n are the Bernoulli numbers, the coefficients of the expansion x(e x − 1) −1 = n≥0 B n x n /n!. Accordingly, the finite size correction to Φ ♯ up to first order in ε is From this expansion we derive the asymptotic for the cumulants of the integrated current. More precisely, recalling (6.7) the variance of Q ε,T (including the first order correction) is while the cumulant of order 2k, k ≥ 2, is

C. Current fluctuations for non stationary infinite systems
The MFT has been applied also to study current fluctuations for diffusive infinite systems in non stationary states. More precisely, in (Derrida and Gerschenfeld, 2009b) the authors consider a diffusive stochastic lattice gas on the infinite lattice with step initial condition. This means that at the initial time the particles are distributed in a non steady state having density ρ a at the left of the origin and density ρ b at the right. Let Q τ be the net flow of particles across the origin up to time τ and let be the corresponding generating function of the cumulants. The appearance of the √ τ in this formula is due to the fact that a law of large numbers holds for Q τ / √ τ for large τ . In (6.15) the expected value can be interpreted in two different ways depending on whether we consider fluctuations of the initial condition (annealed case) or not (quenched case). In the annealed case Φ ♯ (θ) satisfies a relationship reminiscent of the Gallavotti-Cohen symmetry. In (Derrida and Gerschenfeld, 2009b) the authors argue that Φ ♯ (θ) in (6.15) can be computed using MFT. The correct asymptotic behavior is obtained considering the scaling parameter ε = ( √ τ ) −1 and letting the macroscopic time T vary on the finite window [0, 1]. Since there is conservation of the mass and the system is one dimensional the net flow Q τ in this approximation will coincide with √ τ +∞ 0 (ρ ε (x, 1) − ρ ε (x, 0)) dx . (6.16) By (2.7) and (2.8), in the annealed regime Φ ♯ (θ) can be obtained as where the infimum is carried out over all (ρ, j) satisfying the continuity equation. The term V in is due to fluctuations of the initial condition. This is a product of Bernoulli distributions of parameter ρ a in the negative axis and ρ b in the positive one. The functional V in coincides with (2.25) withρ(x) substituted by where θ(x) is the Heaviside function. In the quenched case there is an expression similar to (6.17) but without the term V in and the minimization has to be done over all the (ρ, j) such that ρ(x, 0) coincides with (6.18). The variational problem (6.17) and the corresponding one for the quenched case cannot be solved explicitly in general. An exact solution is possible for free particles (Derrida and Gerschenfeld, 2009b) and in some cases for the symmetric exclusion process (Meerson and Sasorov, 2014). In the annealed case for the symmetric exclusion process it is possible to apply some symmetry argument to (6.17) showing that the dependence of Φ ♯ (θ) on the parameters ρ a , ρ b and θ is only through their combination ω as in (6.13) (with ρ 0 and ρ 1 replaced by ρ a and ρ b ). This means that Φ ♯ (θ) = F (ω) for a suitable function F whose explicit expression has been obtained in (Derrida and Gerschenfeld, 2009a) using microscopic combinatorial arguments. An open problem is to recover such an expression using instead (6.17). Still a symmetry argument for (6.17) shows that, in the annealed case, from the exact expression for the symmetric simple exclusion it is possible to obtain the expression of Φ ♯ (θ) for other models, like the KMP model, having constant diffusion matrix and quadratic mobility.
Another result that can be deduced from (6.17) is a non-Gaussian decay of the distribution of the net flow Q τ . This holds under some conditions on the transport coefficients both in the annealed and in the quenched regime. More precisely, under some conditions that hold e.g., for the exclusion process, for large τ and large q the net flow Q τ has the super-Gaussian statistics for a suitable positive constant α. On the other hand, in (Meerson and Sasorov, 2013) it is shown that the KMP model in the quenched regime exhibits instead a sub-Gaussian statistics.

VII. HYPERBOLIC CONSERVATION LAWS
The MFT for hyperbolic conservation laws is less developed than the case of driven diffusive systems. In this section we show however how some results can be obtained by taking the formal limit of vanishing viscosity. We restrict the discussion to the one-dimensional inviscid Burgers equation (Burgers, 1974), which is a simple model for a compressible fluid. It can be obtained as hydrodynamic limit of the asymmetric exclusion process under Eulerian rescaling of space-time, that is keeping x/t fixed.

A. Hydrodynamics
The hydrodynamic equation is where χ(ρ) = ρ(1−ρ) is the mobility of the exclusion process (called flow in the context of hyperbolic conservation laws) and we consider an external field toward the right with unit strength. The standard inviscid Burgers equation, that is usually written in the form ∂ t u + ∇u 2 = 0, can be obtained from (7.1) by a simple change of variables. According to the interpretation in terms of the exclusion process, we shall however consider 0 ≤ ρ ≤ 1. An important difference between the evolution (7.1) and the driven diffusive (parabolic) equations considered before is that, even if the initial condition is smooth, the solution to (7.1) may develop singularities, called shocks, after a finite time. This is easily seen by the method of characteristics. Indeed, in the Lagrangian coordinates, an element of the "fluid" at local density ρ has a velocity v ρ = χ ′ (ρ) = 1 − 2ρ. In particular, low density regions ρ ≪ 1 will overtake the regions of intermediate density ρ ≈ 1/2 resulting in the formation of a singularity.
Let us discuss these shock solutions to (7.1) in more detail. Consider the function then it is not difficult to check that ϕ(x − vt) solves (7.1) in the sense of distributions. Observe that as ρ + −ρ − → 0 the shock velocity v ρ−,ρ+ approaches the velocity of the characteristics. As far as the hydrodynamic equation (7.1) is concerned, both ρ − < ρ + and ρ − > ρ + are allowed. These cases correspond to quite different situations from a physical point of view. Recalling that we have chosen an external field toward the right, the case ρ − < ρ + corresponds to a low density region at the left blocked by a high density region (a pile of particles in the microscopic picture) at the right and appears a natural feature of the system. On the other hand, the case ρ − > ρ + does not have a natural interpretation and should be regarded as unphysical.
The hyperbolic evolution (7.1) can be obtained from the driven diffusive equation in the limit of vanishing viscosity. Namely, by considering ∂ t ρ + ∇χ(ρ) = ν∇ D(ρ)∇ρ (7.4) and taking the formal limit ν → 0. For the exclusion process D is constant but for a while we consider arbitrary diffusion coefficient. By setting ν = 0 we recover the evolution (7.1), but as we next show there is another condition from (7.4) that survives in the limit ν → 0 and rules out the unphysical decreasing shocks. Let h(ρ) be a convex function (an entropy in the terminology of hyperbolic conservation laws) and let g(ρ) be the function defined by h ′ (ρ)χ ′ (ρ) = g ′ (ρ). (7.5) In the terminology of hyperbolic conservation laws g is called the entropy flow associated to h. Multiplying (7.4) by h ′ (ρ) we deduce Since the last term is a total derivative and h ′′ (ρ) ≥ 0, by taking the limit ν → 0, we deduce the inequality ∂ t h(ρ) + ∇g(ρ) ≤ 0. We conclude that the appropriate formulation of (7.4) in the vanishing viscosity limit is where h is an arbitrary convex function and g is defined by (7.5). In view of the specific form of the flow χ(ρ) (more precisely in view of its concavity), it is simple to check that increasing shocks, i.e. ϕ ρ−,ρ+ (x−v ρ−,ρ+ t) with ρ − < ρ + solve (7.6) while decreasing shocks do not.
Observe that while (7.1) in invariant under time and space reflection the entropy condition in (7.6) is not and implies a time arrow. The initial value problem corresponding to (7.6) on the whole line is well posed (Serre, 1999), while uniqueness fails for (7.1).
As we would like to include boundary reservoirs in the model, we need to discuss the role of boundary conditions when the hyperbolic evolution (7.6) is considered on the interval Λ = (0, 1). More precisely, we consider boundary reservoirs with chemical potentials λ 0 , λ 1 at the endpoints of Λ and denote by ρ 0 , ρ 1 the corresponding values of the density, i.e., λ i = f ′ (ρ i ). While for driven diffusive systems the effect of the boundary reservoirs is to fix the value of the density, for hyperbolic conservation laws the situation is more subtle. As we have discussed above, the hyperbolic evolution develops shocks which may occur also at the boundary. In this case the value of the density at the boundary will not be fixed by the reservoirs but rather constrained by the admissibility of the shock. The boundary conditions will thus be given in terms of inequalities and not of identities.

B. Large fluctuations
We discuss first the case of periodic boundary conditions. As for the case of driven diffusive system, we want to compute the probability of a space-time fluctuation of the density and current. Due to the singular behavior of the hyperbolic evolution, there are two different large deviations regimes. In order to violate the continuity equation in (7.6) we need to apply an external field over a macroscopic part of the system. On the other hand if we consider a solution to (7.1) with shocks, we can violate the entropy condition in (7.6) (which allows only increasing shocks) by applying a field localized on the shocks. In terms of the microscopic dynamics, consider a high density region We describe only the probability of fluctuations violating the entropy condition in (7.6) which are, so to speak, much less improbable and the relevant ones for the computation of the quasi-potential. For such fluctuations the density and current are directly related. Since we do not violate the continuity equation (7.1), once we specify the fluctuation ρ of the density the current will be given by χ(ρ). The corresponding action functional has been derived in (Jensen, 2000;Varadhan, 2004b). The answer is amazingly simple: in order to violate the entropy condition we need only to pay the corresponding entropy cost. The subtle point is to decide which is the correct entropy to use. Note in fact that the entropy condition in (7.6) does not depend on the function h: if it holds for some convex h (g is then given by (7.5)) then it holds for all convex h. In order to find the correct choice of h we need to go back to the small viscosity approximation (7.4). At this level the physical entropy h is selected by the Einstein condition h ′′ (ρ) = D(ρ)/χ(ρ). For the exclusion process D = 1 so that h is the equilibrium free energy f , i.e., (7.7) The Jensen-Varadhan large deviation formula for this inviscid Burgers equation then reads with I(ρ) finite only for ρ satisfying (7.1) and for such ρ given by where [a] + = max{0, a} is the positive part of a, f as in (7.7), and g satisfies (7.5). As discussed in (Bodineau and Derrida, 2006) the expression (7.8) can be derived from (4.6) by considering the limit of vanishing viscosity. While the structure of the functional I in (7.8) is very different from the case of driven diffusive systems of Section IV, the time reversal symmetry of Section II.C holds also in this case. Since we are considering periodic boundary conditions, the total mass m = 1 0 dxρ(x) is conserved. The quasi-potential is then Since the time reversed dynamics can be realized by inverting the external field, the adjoint hydrodynamics is obtained by replacing χ(ρ) with −χ(ρ) so that It is now simple to check that (2.15) holds also in the hyperbolic regime, i.e., We now discuss the large deviations asymptotics in the presence of boundary reservoirs. Since the boundary condition for the hyperbolic evolution (7.6) discussed in the previous Section can be in formulated as entropic conditions at the boundary, we need to add to the Jensen-Varadhan functional (7.8) the boundary terms that take into account the total entropy production at the boundary. For the exclusion process, these terms have been computed in (Bodineau and Derrida, 2006) by considering the limit of vanishing viscosity. They have the form where ρ 0 , ρ 1 are the densities of the boundary reservoirs and the functions s (0) , s (1) are explicitly given in (Bodineau and Derrida, 2006). Accordingly, the full rate function is with I bulk given by (7.8).
By considering the variational problem (4.8), i.e., V (ρ) = inf I (−∞,0] (ρ), with the constraintρ(0) = ρ, for the action functional (7.9), the formulas for the quasipotential of the boundary driven asymmetric exclusion process derived in (Derrida et al., 2001) by exact computations on the microscopic ensembles can be obtained within the MFT formalism. We refer to (Bahadoran, 2012b), for the details of such computations that, as there discussed, can be generalized to higher space dimensions and to the models satisfying the symmetry χ(ρ) = χ(ψ(ρ)) for some decreasing ψ.

VIII. MICROSCOPIC MODELS
Models have played a fundamental role in equilibrium statistical mechanics. The Ising model provided the first proof that statistical mechanics can explain the existence of phase transitions and was a main guide in the study of critical behavior. A reason for this effectiveness is the circumstance that the macroscopic behavior is, to a considerable extent, independent of the microscopic details. Hence different systems exhibit qualitatively the same phenomenology at large scales. This section requires some basic notions on probability theory and Markov processes, see e.g., (Brémaud, 1999).
Stochastic lattice gases are a collection of particles performing random walks on a lattice in continuous time and interacting with each other. These particles are to be considered indistinguishable. Accordingly, the microscopic state is specified by giving the occupation number in each site of the lattice. The effect of the interaction is that the jump rates depend on the local configuration of the particles, i.e., on the occupation numbers of the nearby sites. For non-isolated systems we model the effect of the reservoirs by adding creation/annihilation of particles at the boundary. The effect of an external field is modeled by perturbing the rates and giving a net drift toward a specified direction.
As basic microscopic model we consider a stochastic lattice gas in a finite domain, with an external field, and either with periodic boundary conditions or with particle reservoirs at the boundary. The dynamics can be informally described as follows. Associated to each lattice site there is an independent Poisson clock of parameter depending on the local configuration. When the clock rings, a particle jumps from this site to a neighboring site. In the case of particle reservoirs, superimposed to this dynamics, at the boundary particles are created and annihilated at exponential times.
Fix Λ ⊂ R d and, given ε > 0, let Λ ε = Λ ∩ εZ d its discrete approximation. The microscopic configuration is given by the collection of occupation variables η(i), i ∈ Λ ε , representing the number of particles at the site i. We denote by Ω ε the space of all possible configurations. The microscopic dynamics {η t } t∈R of the configuration of the system is formally specified in terms of its infinitesimal generator L, defined as follows. Let f : Ω ε → R be an observable, then Recall that E denotes the expectation over trajectories on the configuration space. The transition probability of the Markov process η t is then given by the kernel of the semi-group generated by L, i.e.
We can rewrite the full generator L as follows where σ ij η is the configuration obtained from η letting one particle jump from i to j, σ i ± η are the configurations associated to the creation or annihilation of a particle in site i, and c i,j (η), c ± i (η) are the corresponding jump rates. We denote by ∂Λ ε the interior boundary of Λ ε , i.e. the collection of sites i ∈ Λ ε at distance ε from εZ d \Λ ε . The cases when the rates c ± i (η) are zero except for i ∈ ∂Λ ε correspond to conservative bulk dynamics, with a hydrodynamic equation as in (2.1). In these cases, creation and annihilation of particles at the boundary describe the interaction with the external reservoirs. Models with non-zero creation/annihilation rates c ± i (η) also in the bulk correspond to reaction-diffusion equations, an example being (5.42).
A physical state of the system corresponds to a probability distribution P (ensemble) on the configuration space Ω ε . A state is invariant (stationary) under the dynamics if η∈Ωε P (η) e tL (η, η ′ ) = P (η ′ ).
( 8.4) Namely, if we distribute the initial condition η according to P , then the distribution of η t , at any later time t ≥ 0, is again P . A necessary and sufficient condition for a state P to be invariant is (8.5) where E P denotes the expectation with respect to P . All the models that we consider are irreducible, i.e. there is a strictly positive probability to go from any configuration to any other. In this case, according to general results on Markov processes, the invariant state is unique and it coincides with the limiting distribution of the system when t → ∞.
If the generator L satisfies the detailed balance condition with respect to some distribution P , namely for all observables f, g, then P is necessarily an invariant state. In such a case the process is said to be time reversal invariant. This terminology is due to the following fact. Let P η be the probability distribution on the space of paths {η t } t≥0 with initial condition η 0 = η, and let P be the stationary process, i.e., the distribution on the space of paths with initial configuration η 0 distributed according to the invariant state P . Since P is invariant, the distribution P is invariant with respect to time shifts. We can thus regard P as a distribution on paths defined also for t ≤ 0. This probability distribution is invariant under time reversal if and only if the detailed balance condition (8.6) holds. Indeed, if ϑ is the time reversal, i.e., (ϑη) t := η −t , we have that P • ϑ is the stationary Markov process with generator L * , the adjoint of L with respect to P , and condition (8.6) is precisely the condition that L * = L. An equivalent form of the detailed balance condition (8.6) is as follows for all configurations η, η ′ ∈ Ω ε . In this equation c(η, η ′ ) is the transition rate from the configuration η to η ′ , which can be either a jump rate c ij (η), if η ′ = σ ij η, or a creation/annihilation rate c ± i (η), if η ′ = σ i ± η. When the unique invariant state does not satisfy the detailed balance condition (8.7), the corresponding process is not time reversal invariant. Time reversal invariant processes correspond to equilibrium thermodynamic states. The converse is not necessarily true: there can be microscopic models not invariant under time reversal corresponding to equilibrium macroscopic states (Basile and Jona-Lasinio, 2004;Gabrielli et al., 1996Gabrielli et al., , 1999Gabrielli et al., , 1997. This is not surprising: going from the microscopic to the macroscopic description there is loss of information.
Next, we describe in some detail some of the most studied microscopic models, which allow a detailed mathematical analysis. They are microscopic counterparts of the macroscopic models discussed in Section V.

A. The simple exclusion process
The boundary driven simple exclusion process, on a domain Λ ⊂ R d , is defined letting particles move according to independent simple random walks, with the exclusion rule that there cannot be more than one particle in a single lattice site (hard core interaction). This gives a kind of classical Pauli principle. It is appropriate to remark that the simple exclusion process is a special case of the Kawasaki spin dynamics (Kawasaki, 1966). This is a conservative dynamics that satisfies detailed balance with respect to a Gibbs distribution. The simple exclusion process corresponds to the case of a constant Hamiltonian.
According to the exclusion rule, the space of all possible configurations of the system is Ω ε = {0, 1} Λε . In terms of the generator (8.3) this corresponds to the following choice of the bulk jump rates: The interaction with the boundary reservoirs is described by creation and annihilation rates c ± i (η) for i ∈ ∂Λ ε . Let λ(x) be the chemical potential of the boundary reservoirs (it is a continuous function on a neighborhood of ∂Λ). The corresponding creation/annihilation rates are as follows 9) where ∂Λ o ε (i) denotes the set of all sites at distance ε from i outside of Λ ε . Observe that the rates at the corners of Λ ε differ as there are more neighbors.
The model is clearly irreducible, hence, as explained above, there is a unique invariant state P satisfying (8.5), corresponding to the limiting distribution of the system. When the chemical potential of the boundary reservoirs is constant, λ(i) = λ for all i ∈ Λ ε , the detailed balance condition (8.7) holds. The corresponding stationary state is given by the product distribution P (η) = i∈Λε e λη(i) 1 + e λ . (8.10) On the other hand, when the chemical potential λ(i) at the boundary is not constant, the model is not time reversal invariant and the stationary ensemble is not product.

B. The zero range model
In the zero range model there is no bound on the number of particles which can occupy the same site, hence the space of all possible configurations of the system is Ω ε = N Λε . The dynamics is defined letting a particle interact only with the other particles present in the same lattice site. The interaction can be either attractive or repulsive. The bulk jump rates are: where g : N → R + is a function such that g(0) = 0 and g(k) > 0, k ≥ 1, describing the type of interaction. In particular, the choice of linear function g(k) = αk corresponds to the ideal gas (independent random walks). Also in this model the boundary creation and annihilation rates are associated to the chemical potential λ(x) of the reservoirs, which, as before, is a continuous function on a neighborhood of ∂Λ. The boundary rates are where |∂Λ o ε (i)| denotes the cardinality of the set ∂Λ o ε (i), recall (8.9).
If the function g grows fast enough, there is a unique invariant state P satisfying (8.5). The peculiarity of this model is that, for arbitrary chemical potential λ(x), the invariant distribution is a product distribution. It has the following form: where g(k)! = g(k)g(k − 1) . . . g(1), and Z(ϕ) = k∈N ϕ k g(k)! . The function ϕ : Λ ε → R + solves the dis-crete Laplace equation (8.14) with boundary condition ϕ(i) = e λ(i) for lattice sites i immediately outside of the boundary. Also in this case, when the boundary chemical potential is constant λ(i) = λ for all i ∈ ∂Λ o ε , the detailed balance condition (8.7) holds, the solution to (8.14) is constant ϕ = e λ , and (8.13) describes an equilibrium state.

C. The Glauber+Kawasaki model
We consider here a Glauber+Kawasaki model for which the conservative part of the dynamics is given by the same rates (8.8) as in the exclusion process, while the non conservative part of the dynamics (8.3), associated to the creation and annihilation rates c ± i (η), extends over all sites i of the domain Λ ε . In general, the creation and annihilation rates c ± i (η) : Ω ε → R + are functions, translation invariant, depending only on the value of the configuration η on sites j = i at distance at most kε form i (k is a fixed positive integer). When the site i is near the boundary, the rates c ± i (η) will also depend on the value of the chemical potential of the reservoirs.
For simplicity, we write an explicit formula for the creation and annihilation rates only on the torus, i.e. when Λ = [0, 1] d with periodic boundary conditions. Let τ i be the shift operator on the configuration space Ω ε , defined by [τ i η] (j) = η(j − i). Then where the functions b(η) and d(η), associated to the "birth" and "death" of particles, only depend on the occupation numbers η(j) for sites j at distance at most kε from the origin. Recall that any product Bernoulli distribution (cf. (8.10)) is time reversal invariant for the conservative part of the dynamics. Hence, P p will be time reversal invariant with respect to the full dynamics provided that for all η ∈ Ω ε . Indeed, (8.17) guarantees that the detailed balance condition (8.7) holds also for the non conservative part of the dynamics. Therefore, if d(η)/b(η) is constant in η, the stationary state P is as in (8.16), where p is uniquely determined by (8.17). When d(η)/b(η) is not constant, the corresponding stationary state P is, in general, not invariant under time reversal and not product.

D. The Kipnis-Marchioro-Presutti model
The Kipnis-Marchioro-Presutti (KMP) model (Kipnis et al., 1982), originally proposed as a simple solvable model of heat conduction, does not fit exactly in the general framework outlined above and we need to modify the notation accordingly. We discuss this model only in the one-dimensional case.
This model describes a linear chain of harmonic oscillators with a random exchanges of energy between nearest neighbors and possibly heat baths at the boundary sites. As usual, let Λ = (0, 1) be the macroscopic domain and Λ ε = Λ ∩ εZ be the corresponding discrete chain. In each lattice site i ∈ Λ ε there is an harmonic oscillator and we call (q(i), p(i)) its canonical coordinates so that its energy is H i (q(i), p(i)) = q(i) 2 + p(i) 2 . The oscillators are mechanically uncoupled, i.e. the total energy is H = i H i , but the dynamics has a stochastic term which induces an interaction. More precisely, on the bonds (i, i + ε) there are independent Poissonian clocks. When the clock across the bond (i, i + ε) rings, we compute the energy E = H i (q(i), p(i)) + H i+ε (q(i + ε), p(i + ε)) and redistribute the canonical coordinates of the two oscillators uniformly to new values (q ′ (i), p ′ (i)), (q ′ (i + ε), p ′ (i + ε)) chosen uniformly on the surface H i (q ′ (i), p ′ (i)) + H i+ε (q ′ (i + ε), p ′ (i + ε)) = E. On the boundary sites there are other two independent Poissonian clocks. When a clock rings at a boundary site i ∈ ∂Λ ε , choose the new value of the coordinates (q ′ (i), p ′ (i)) according to the following rules forgetting the old configuration (q(i), p(i)). Sample a value of the energy E according to an exponential distribution of parameter λ(i) and let (q ′ (i), p ′ (i)) be uniformly distributed on the surface H i (q ′ (i), p ′ (i)) = E.
A peculiar feature of this model is that the local energies H i have a closed Markovian evolution. In the sequel, we shall denote by η(i) ∈ R + the energy of the oscillator at site i ∈ Λ ε and describe formally their evolution. Observe that from a statistical mechanics viewpoint these are indeed the relevant quantities. Let us define for p ∈ [0, 1] For this model the general formula (8.3) has to be substituted by where λ(i) are the temperatures of the boundary thermostats. The generator in (8.18) describes a stochastic evolution in which every pair of nearest neighbor sites after an exponential time redistribute the sum of their energies between the two sites in a uniform way. This mechanism preserves the total energy of the system. At a boundary site i after an exponential time the energy is replaced by the value of an exponential random variable of parameter λ(i).
If λ(i) = λ for both boundary sites, then the model is time reversal invariant. The corresponding equilibrium state P is given by the following product distribution on (R + ) Λε dP (η) = i∈Λε λe −λη(i) dη(i).
( 8.19) On the other hand when λ(i) is not constant the model is not time reversal invariant, the invariant state is not product, and an explicit representation is not known (except for the case of a single oscillator (Bertini et al., 2007)). We refer to (Hurtado et al., 2013) for a variant of this model in which part of the energy is dissipated.

E. Weakly asymmetric models
We now show how to modify the stochastic models described above in order to take into account the action of an external vector field. Let F : Λ → R d be a vector field, describing the force acting on the particles of the system. When the system goes from the configuration η to the configuration σ i,j η, the work done by the force field F is (8.20) where [i, j] is the oriented segment from i to j (which has length of order ε). The perturbed rates are defined by When |i − j| is of order ε, then the work (8.20) is of order ε and we have If F = −∇H is a gradient vector field, then F i,j = H(i)− H(j), and equation (8.21) becomes For the KMP model the net amount of energy flown across the bond (i, j) when the configuration η is transformed into σ i,j p η is given by (1 − p)η(i) − pη(j). The perturbed dynamics on the bond (i, j) is defined by (8.23) where in this case F i,j is the work done per unit energy. Observe that F i,j in (8.20) is of order ε. Namely, on the microscopic scale the external field is small with the scaling parameter. This is the reason for the name weakly asymmetric. The case in which F i,j in (8.21) is of order one corresponds to asymmetric models. In this case the hydrodynamics is given by hyperbolic conservation laws and not by driven diffusive equations. We refer to (Kipnis and Landim, 1999) for periodic boundary conditions and to (Bahadoran, 2012a) for the case of models with reservoirs.

F. Empirical density and current
In order to pass from a microscopic model to the corresponding macroscopic system, it is convenient to introduce some intermediate quantities, called the empirical density and the empirical current.
The empirical density associated to the configuration η ∈ Ω ε is defined as where δ(x − i) is the delta distribution concentrated at site i. It gives a positive distribution on the domain Λ, describing the local densities of particles. It is equivalently defined by for a continuous function f : Λ → R. The empirical current is associated to a trajectory η t , t ∈ [0, T ], of the particle system on the configuration space. Denote by N i,j T the number of particles that jump from i to j in the time interval [0, T ]. At the boundary, for i ∈ Λ ε and j ∈ ∂Λ o ε (i), N i,j T is the number of particles leaving the system at i by jumping to j (annihilation), while N j,i T is the number of particles entering the system in i jumping from the reservoir site j (creation). The difference Q i,j T = N i,j T − N j,i T is the net number of particles flowing across the oriented bond (i, j) in the time interval [0, T ]. The instantaneous current dQ i,j t /dt is thus a sum of δ-functions localized at the jump times across the unoriented bond {i, j} with weight +1, respectively −1, if a particle jumps from i to j, respectively from j to i. The empirical current is defined as where the sum is over unoriented bonds {i, j} such that |i − j| = ε. Note indeed that the product (j − i) dQ i,j t dt is symmetric with respect to the exchange of i and j. The empirical currents j ε is a distribution on Λ × [0, T ] with values in R d , describing the local flux of particles. It is equivalently defined by for a continuous vector field F : Λ × [0, T ] → R d . In the above equation τ i,j k , k = 1, . . . , N i,j T , denote the times at which particles jump from site i to site j. In (8.27) the sum is over oriented bonds (i, j) such that |i − j| = ε.
In the one-dimensional case, recalling the definition (6.7) of the average total current Q ε,T , by choosing F = 1, we get From the previous formula one can deduce the relationship between Q ε,T and analogous quantities considered in (Akkermans et al., 2013;Appert et al., 2008;Bodineau and Derrida, 2004;Derrida et al., 2004).

G. Hydrodynamic limits
The models introduced in the previous subsections have a non trivial scaling limit under a diffusive rescaling. Since the lattice size is ε this corresponds to speed up the dynamics multiplying the transition rates by ε −2 . The basic formula we will use is (8.28) Formula (8.28) is derived by classic arguments in the theory of Markov processes, see e.g. (Brémaud, 1981). Given the configuration η t at time t, the expected value of the increment N i,j t+dt − N i,j t is ε −2 c i,j (η t )dt. The last term M i,j t thus describes the microscopic fluctuation (in probabilistic language, it is a martingale). From (8.28) we get where is the mean instantaneous current across the bond (i, j), andM i,j t is a fluctuation term, which plays the same role as M i,j t does in (8.28). The models we introduced in the previous sections are of gradient type. This means that there exists a function h(η), depending on the configuration η only through a finite number of lattice sites, such that where, as before, τ i denotes the shift on Ω ε . For the simple exclusion process we have h(η) = η(0), while for the zero range model we have h(η) = g(η(0)). The construction for the KMP model is slightly different and Q i,j t represents the net amount of energy flowing across the bond (i, j) in the time interval [0, t]. The mean instantaneous current appearing in formula (8.29) in this case becomes q i,j (η) = 1 0 dp σ i,j p η (j)+ σ j,i p η (j)−2η(j) . (8.32) From (8.32) we deduce that (8.31) still holds with h(η) = η(0). In order to discuss the hydrodynamic behavior, we first observe that the definition of Q i,j t implies the discrete continuity equation In view of (8.29), we can rewrite this equation as Consider now a test function ψ : Λ → R. By integrating (8.34) in space we deduce where we used (8.31) and a discrete integration by parts. The term o(1) represent the space integral of the fluctuation in (8.34). It vanishes as ε → 0 as the random variables M i,j t have mean zero and are almost independent for different bonds. Observe that the term inside square brackets in (8.35) is a discrete version of the Laplacian of ψ; namely, As already mentioned, both for the exclusion and the KMP processes condition (8.31) holds with h(η) = η(0). In these cases, by taking the limit ε → 0 and denoting by ρ(t, x) the limit of ρ ε (η t , x), (8.35) yields directly which is the weak formulation of the heat equation This is the hydrodynamic equation for both the simple exclusion and the KMP processes. Namely, for these models D(ρ) = 1.
For the zero range process we have instead h(η) = g(η(0)). Therefore, (8.35) yields directly a closed equation for the density only in the case g(k) = k, corresponding to independent particles. In order to derive the hydrodynamic equation we need a mathematical formulation of the local equilibrium assumption. The basic idea is the following. Fix a point i ∈ Λ ε and consider a macroscopically small, but microscopically large, neighborhood B(i) of i. Since the total number of particles is locally conserved, on the macroscopic time scale, the system in B(i) is essentially in the homogeneous equilibrium state corresponding to the average density in B(i). Therefore, we can replace h(η) with the corresponding ensemble average.
In order to compute this average, we describe the equilibrium states P ρ of the zero range process. These are product distributions of the form (8.13) with ϕ(i) constant and equal to the solution of ρ = ϕ Z ′ (ϕ) Z(ϕ) .
In view of the previous discussion, in (8.35) we can replace where |B(i)| denotes the volume of B(i). We refer to (Kipnis and Landim, 1999;Spohn, 1991) for the (quite technical) proof of this statement. Since B(i) is macroscopically infinitesimal, by taking the limit ε → 0 in (8.35), we derive the weak formulation of the non-linear diffusion equation which is the hydrodynamic equation for the zero range process. We conclude that for the zero range process D(ρ) = Φ ′ (ρ).
When the condition (8.31) does not hold, the model is called non gradient. In this case the deduction of the hydrodynamic equation is more complicated. Referring to (Kipnis and Landim, 1999) for the detail of this derivation, we mention that in the general case the diffusion coefficient is linked to the microscopic dynamics by a Green-Kubo formula, see (Spohn, 1991, II.2.2).
We discussed the hydrodynamic limit without considering the boundary terms. At the boundary there is a Glauber dynamics speeded up by a factor ε −2 that keeps fixed the density at a value determined by the local chemical potential of the external reservoirs (Eyink et al., 1990).

H. Large fluctuations
In this section we derive, for models satisfying the gradient condition (8.31), the fundamental formula (2.7). For simplicity, we restrict to models without external field.
We need an expression for the relative distribution of two stochastic particle systems. Since these processes can be constructed using independent Poisson processes, we start by giving the relative distribution of two Poisson processes. More precisely, consider two Poisson processes with parameters depending on the value N t of the process. The first one has parameter c(N t ) and the second one is obtained from the first with a time dependent perturbation and has parameter c(N t )e F (t)/2 . Then the ratio between the two ensembles on the time window [0, t] is, see (Bertini et al., 2002, App. A), where the τ k are the jump times. Consider a macroscopic fluctuation (ρ(s), j(s)) in the time window [0, t] of the empirical density and current satisfying the continuity equation. In order to estimate the probability of this fluctuation we introduce an external field F such that (ρ(s), j(s)) becomes typical, that is its probability is close to one as ε → 0. The external field F that we need to introduce is obtained solving the equation − D(ρ)∇ρ + χ(ρ)F = j. (8.49) The ratio between the distributions of the original particle system and the one obtained with the perturbation F in the time window [0, t] can be computed by using (8.48 F i,j (τ i,j k ) . (8.50) Recalling (8.27), the second term at the exponent above is equal to ε −d 1 2 t 0 ds Λ dx j ε · F . By expanding up to second order e Fi,j (s)/2 , using the antisymmetry of F i,j (s) with respect to i, j and the gradient condition (8.31), we rewrite the first term as where we used local equilibrium as in the previous section, see in particular (8.46) for the microscopic definition of the transport coefficients. Since F satisfies (8.49) we finally deduce that (8.51) We now estimate the probability of the fluctuation (ρ(s), j(s)), s ∈ [0, t]. We write where 1 A denotes the indicator of the set A. By using (8.51) and the fact that under the perturbed distribution (ρ ε , j ε ) ≈ (ρ, j) we finally get P (ρ ε , j ε ) ∼ (ρ, j) ≈ exp − ε −d 1 4 t 0 ds Λ dx F · χ(ρ)F (8.53) which, in view of (8.49), concludes the proof of the fundamental formula.
In the case in which one considers only the fluctuations of the density, as in Section IV.A, formula (8.53) has been first obtained in (Kipnis et al., 1989) for the exclusion process.
As for the hydrodynamic limit, we discussed the large deviation asymptotic without considering the boundary terms. At the boundary there are independent Glauber dynamics speeded up by ε −2 so that the asymptotic probability to observe a density fluctuation on a region Γ ⊆ ∂Λ of the boundary is of the order e −ε −(d+1) |Γ| which is much smaller than e −ε −d . The fluctuations whose probability is exponentially small in ε −d have therefore the values of the density at the boundary fixed by the reservoirs.

I. Quasi-potential and relative entropy
We consider two states of a system and establish a connection between the quasi-potential V and the relative entropy between the corresponding ensembles.
This connection is readily established in equilibrium. For simplicity, consider the case of lattice gases without external field and constant chemical potential, i.e. the case of homogeneous equilibrium states. The Gibbs distribution on the volume Λ is where H Λ (η) is the energy of the configuration η, λ is the chemical potential, and Z Λ (λ) is the grand-canonical partition function. Recall that we have included the dependence on the temperature in the Hamiltonian. According to the standard postulates of statistical mechanics, the pressure p is given by (8.55) and the free energy per unit volume f is obtained as the Legendre transform of p, f (ρ) = sup λ ρλ − p(λ) .
The relative entropy S(ν|µ) of the probability ν with respect to µ is defined by S(ν|µ) = dP dν dµ log dν dµ . (8.56) Observe that if we choose µ as the uniform probability then S(ν|µ) is the Gibbs entropy. Fix two chemical potentials λ 0 and λ 1 . We claim that whereρ 0 andρ 1 are the densities associated to λ 0 and λ 1 . In view of (5.1) this implies that in the thermodynamic limit the relative entropy per unit volume is proportional to the function V λ1,0 (ρ 0 ) per unit volume.
To prove (8.57), observe that in view of (8.56) and the Gibbsian form (8.54), By definition of the pressure, the first term converges to [p(λ 1 ) − p(λ 0 )], while the second one converges to (λ 0 − λ 1 )ρ 0 . The identity (8.57) then follows by Legendre duality. The relationship (8.57) between the relative entropy and the quasi-potential extends, exactly with the same formulation, to non-equilibrium states. Recall that Λ ⊂ R d is the macroscopic volume, and denote by Λ ε the corresponding subset of the lattice with spacing ε, so that the number of sites in Λ ε is approximately ε −d |Λ|. Given the chemical potential λ of the boundary reservoirs and the external field E, let P λ,E Λε be the stationary distribution of a driven stochastic lattice gas.
Given (λ 0 , E 0 ) and (λ 1 , E 1 ), we claim that lim ε→0 ε d S P λ0,E0 whereρ 0 is the stationary profile corresponding to (λ 0 , E 0 ). In the case of the zero-range processes, as discussed before, the stationary ensemble has an explicit form. It is thus possible to prove (8.58) by direct computation as in the equilibrium case. For other models, (8.58) has been derived in (Bertini et al., 2012) under the assumptions that the stationary ensembles satisfy a strong form of local equilibrium that holds for the boundary driven symmetric simple exclusion process (Bernardin et al., 2014;Bernardin and Landim, 2010). For this model, in the special situation in which P λ1,E1 Λε is an equilibrium ensemble, the finite size corrections to the identity (8.58) have been analyzed in .
The connections between equilibrium statistical mechanics and classical thermodynamics can be expressed in many ways. The argument of this section for equilibrium states shows that the identity (8.57) between the relative entropy per unit volume and the availability is another possibility. In view of (8.58), if we take such a relationship as a general statement, it applies also to non-equilibrium states provided we replace the availability with the quasi-potential.

IX. CONCLUSIONS AND OUTLOOK
The MFT provides a unified treatment of the thermodynamics of driven diffusive systems and their fluctuations. Its formulation has required an adroit balancing of thermodynamic and statistical mechanics arguments. The outcome is a purely macroscopic theory which can be used as a phenomenological description requiring as input only the transport coefficients which are measurable. New variational principles are naturally formulated within the MFT. These principles allow to solve concrete problems as shown by the various applications of the theory discussed in this article.
While the MFT has been developed for driven diffusive systems, the case of hyperbolic systems can be recovered by considering the formal limit of strong driving field.
The early derivation and development of the Macroscopic Fluctuation Theory benefited from the explicit microscopic computations in (De Masi and Ferrari, 1984;Derrida et al., 2001Derrida et al., , 2002b. In particular, the result in (Derrida et al., 2001(Derrida et al., , 2002b for the boundary driven symmetric simple exclusion process has been obtained, in a rather straightforward way, from the Hamilton-Jacobi equation for quasi-potential in (Bertini et al., 2002). It is remarkable that such a perfect agreement has been always found between the results obtained by the MFT and by exact microscopic computations.
As the Boltzmann-Einstein formula, the MFT provides an interface between thermodynamics and the underlying microscopic world. It can thus be used in different ways. At the level of continuum mechanics it introduces, for non-equilibrium states, the orthogonal splitting of the current that is realized through the introduction of the quasi-potential. With respect to Onsager theory, this is a further step in the formulation of a non-equilibrium thermodynamics for stationary states. At the level of microscopic ensembles, the fundamental formula gives the asymptotic probability for fluctuations of the density and current. It has been used to predict the asymptotics of the current cumulants (Akkermans et al., 2013;Bodineau and Derrida, 2004;Derrida et al., 2004). and -quite surprisingly -also their finite size corrections (Appert et al., 2008). The analysis of the macroscopic variational principles introduced in the MFT has revealed the occurrence of phase transitions peculiar of non-equilibrium states (Bertini et al., 2005a(Bertini et al., , 2010Bodineau and Derrida, 2005). Among the most recent developments we mention (Krapivsky et al., 2014a,b; The fundamental formula is not restricted to the stationary ensembles, it has indeed been applied also to nonstationary infinite systems (Derrida and Gerschenfeld, 2009a,b;Sasorov, 2013, 2014).
The MFT so far has been supported by the analysis of stochastic lattice gases and by numerical simulations. It is clear that the next stage should be an experimental test of its predictions. This appears a rather challenging task as fluctuations of thermodynamic system are very improbable and the experimenter has to circumvent this difficulty. One possibility is to rely on an active interpretation of the fluctuation formulas: among the external fields that produce the given fluctuation, choose the one which minimize the energy dissipated. Another possibil-ity is to measure higher order correlations of the thermodynamic variables in the stationary regime. While the two-point correlations, as already mentioned, have been measured (Dorfman et al., 1994) and correspond to not too large (Gaussian) fluctuations, for higher order correlation the MFT gives new predictions.
A fundamental problem in non-equilibrium physics is the turbulent behavior of viscous fluids. Natural approaches to the problem of fully developed turbulence lie within the broad topics of statistical physics. Most of the attempts in this direction borrow basic concepts from dynamical systems and equilibrium statistical mechanics. Recently, Ruelle proposed a view of turbulence which appear to fit well within the class of systems analyzed by the MFT (Ruelle, 2012). The implementation of Ruelle's ideas is an important problem for the future.
Most challenging potential applications of the Macroscopic Fluctuation Theory may lie in biology. Indeed, many of the processes in living beings can be described as diffusive systems in stationary or quasi stationary states depending on the time scales considered. On the other hand, the understanding of the full biological significance of these physical processes would require a formulation in mathematical language of the main properties of living systems. In the words of a well-known mathematician (Gromov, 2012), "You feel there must be a new world of mathematical structures shadowing what we see in Life, a new language we do not know yet, something in the spirit of the language of calculus we use when describing physical systems."