Freddy Bouchet

Krzysztof Gawȩdzki

Cesare Nardini
email: cesare.nardini@gmail.com

Perturbative calculation of quasi-potential in non-equilibrium diffusions: a mean-field example

. This is one of few systems for which non-equilibrium free energies can be computed and analyzed in an effective way, at least perturbatively.

Introduction

Large deviations theory studies the exponential decay of probabilities of large fluctuations in stochastic systems. Such probabilities are important in many fields, including physics, statistics, finance or engineering, as they often yield valuable information about extreme events far from the most probable state or trajectory of the system. [START_REF] Touchette | The large deviation approach to statistical mechanics[END_REF][START_REF] Dembo | Large Deviations Techniques and Applications[END_REF][START_REF] Ellis | Entropy, Large Deviations, and Statistical Mechanics[END_REF].

Weak noise large deviation theory has been developed in the 70s by Freidlin and Wentzell [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF] in a mathematical framework and by Graham and collaborators [START_REF] Graham | Macroscopic potentials, bifurcations and noise in dissipative systems[END_REF] with physicists' perspective. It concerns the study of large fluctuations in dynamical systems subject to weak random noise. In this framework, the stationary probability to observe some state x of the system obeys a large deviation asymptotics

P ∞ (x) exp - F (x) , (1.1)
where denotes the noise strength squared. The function F is called the quasi-potential. It generalizes the notion of (free) energy to general finite-dimensional systems where detailed balance does not hold.but noise is weak. If known, the quasi-potential permits to calculate, at leading order in , important statistical quantities such as the probability to observe an arbitrary large fluctuation of the system or the mean residence time that the system spends close a metastable state.

In the last 15 years, Jona-Lasinio and collaborators developed a framework to study large deviations of macroscopic quantities (like particle density or current) in a class of many-body systems. Their approach, known as the Macroscopic Fluctuation Theory, was mainly applied to stochastic lattice gases, see [START_REF] Bertini | Macroscopic fluctuation theory[END_REF] for a recent review. Without stress on mathematical rigor, the MFT can be understood as a generalization of the Freidlin-Wentzell theory to the fluctuating diffusive hydrodynamics where a weak noise is added to non-linear diffusion equations. Indeed, it is easily obtained by employing a saddle-point approximation in a path integral formalism. Even if this approach is only formal because a mathematical meaning of non-linear fluctuating hydrodynamics is still lacking, the results obtained are in complete agreement with the ones obtained through rigorous probabilistic methods in all cases where a comparison is possible. In this paper, a further example of such an agreement will be discussed in chapter [START_REF] Ben Arous | Large deviations for langevin spin glass dynamics[END_REF].

The Freidlin-Wentzell theory provides a variational characterization of the quasi-potential through dynamical large deviations. However, its explicit computation is typically very difficult and this strongly restricts the practical applicability of the theory. This is true both for finite-dimensional and infinite-dimensional systems. Only in few cases the quasi-potential can be evaluated analytically, the most important one being, of course, the case where detailed balance holds.

The main focus of the present paper is to answer a very natural but still open question. Let us consider a system depending on a control parameter λ and suppose that we are able to calculate the quasi-potential for λ = 0. Can we build a perturbation theory to calculate the quasi-potential for small but finite λ? Surprisingly, only few works in the literature discuss this question [START_REF] Graham | Non-equilibrium potentials and stationary probability distributions of some dissipative models without manifest detailed balance[END_REF][START_REF] Graham | Existence of a potential for dissipative dynamical systems[END_REF][START_REF] Graham | On the weak-noise limit of Fokker-Planck models[END_REF][START_REF] Graham | Integrability of Hamiltonians associated with Fokker-Planck equations[END_REF][START_REF] Jauslin | Melnikov's criterion for nondifferentiable weak-noise potentials[END_REF][START_REF] Gang | Polynomial expansion of the potential of Fokker-Planck equations with a noninvertible diffusion matrix[END_REF][START_REF] Maier | Escape problem for irreversible systems[END_REF][START_REF] Tél | Nonequilibrium potentials and their power-series expansions[END_REF][START_REF] Dykman | Large fluctuations and fluctuational transitions in systems driven by colored Gaussian noise: A high-frequency noise[END_REF][START_REF] Poquet | Phase reduction in the noise induced escape problem for systems close to reversibility[END_REF]. All of them focus on specific examples, perform only the 1 st -order analysis and most of them consider only finite-dimensional dynamical systems (see however [START_REF] Smelyanskiy | Fluctuations, escape, and nucleation in driven systems: logarithmic susceptibility[END_REF] for an example where an infinite dimensional system is analyzed, and the case of transition rates between two basins of attraction is studied). We obtain here a precise answer to the above question, giving an explicit iterative formula for computing each order in the power series expansion of the quasi-potential in λ.

We first analyze the perturbation theory for finite dimensional systems, where the discussion can be made quite precise. It is well known that, given the quasi-potential function, one can deduce a simple 1 st -order equation for the instanton (the corresponding variational problem minimizer). The converse is also obviously true: the values of the quasi-potential (the minima) can be easily computed from the minimizers. It is however often difficult to compute either the instantons or the quasi-potential without the knowledge of the other. We show that this loop can be broken in a perturbative setting: the quasi-potential at any order may be computed just from the knowledge of the instanton dynamics of the unperturbed problem and the quasi-potential at previous orders. This gives a very natural iterative procedure. We also explain that an equivalent simple recursive scheme appears when starting from the perturbative expansion for solutions of the Hamilton-Jacobi equation. A key point is to prove that solvability conditions hold at each order, assuring the existence of the perturbative expansion to all orders. We show that such conditions are related to the behavior close to the attractor, which gives a simple proof that they are satisfied at all orders.

In the second part of the paper, we consider a particular class of non-equilibrium many-body systems described by the Macroscopic Fluctuation Theory [START_REF] Bertini | Macroscopic fluctuation theory[END_REF], namely diffusive particles interacting through meanfield potential and driven by an external non-conservative force. Our approach is based on the fact that for such diffusions, it is possible to derive a fluctuating hydrodynamics describing the evolution of the empirical density for large but finite number of particles N . This evolution equation was first obtained by Dean in [START_REF] Dean | Langevin equation for the density of a system of interacting Langevin processes[END_REF] and it was thereafter called the Dean equation. Although its mathematical status is uncertain, the Dean equation allows to treat the mean-field diffusions, at least at a formal level, as a dynamical system in an infinite dimensional space perturbed by a weak noise whose strength is proportional to 1/ √ N . In the N → ∞ limit, similarly to the law of large numbers, the dynamical system becomes a deterministic equation known under the name of the McKean-Vlasov or the Vlasov-Fokker-Planck one, as was proven together with the propagation of chaos in [START_REF] Mckean | A class of Markov processes associated with nonlinear parabolic equations[END_REF][START_REF] Sznitman | Topics in propagation of chaos[END_REF][START_REF] Méléard | Asymptotic behaviour of some interacting particle systems; McKean-Vlasov and Boltzmann models[END_REF].

We subsequently move our attention to the large deviations around the N → ∞ behavior. The Dean equation is a formal random dynamical system to which we apply the Martin-Siggia-Rose formalism [START_REF] Martin | Statistical dynamics of classical systems[END_REF]. Using the saddle point approximation we then end up with an infinite-dimensional generalization of the Freidlin-Wentzell theory. This result has been previously obtained rigorously in the mathematical literature by Dawson and Gartner [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF]. The formal approach based on the Dean equation makes an explicit connection with the Macroscopic Fluctuation Theory and adds another class of systems to the ones covered by the latter theory.

Explicit results, original to the best of our knowledge, are discussed in the case of the Shinomoto-Kuramoto model, a specific stochastic system describing coupled planar rotators [START_REF] Shinomoto | Phase transitions in active rotator systems[END_REF]. This model may be also viewed as a non-equilibrium version of the dynamical mean-field XY model. We discuss in detail both its N → ∞ behavior and the large deviations around it. For what concern the N → ∞ limit, we are able to fully describe analytically the phase diagram of the Shinomoto-Kuramoto model, deriving self-consistent equations for the stationary states that are easily solved numerically.

The perturbation theory developed in the first part of the paper is subsequently applied to the Dean equation corresponding to the Shinomoto-Kuramoto model, resulting in an explicit calculation of the quasipotential close to the known cases: around the free particle dynamics and in the vicinity of stationary states of the N = ∞ theory. This turns out to be a rather simple numerical task. We show that explicit results could be obtained to any order but, for the sake of brevity, we only present, the 1 st order calculations of the quasi-potential.

The paper is organized as follows. After Introduction, we begin with a review of Freidlin-Wentzell theory results in Sec. 2. Our aim is to present the known results that can be found in [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF] with a physicist perspective, but nevertheless being precise on many important points that are typically overlooked in the physics literature. In particular, we discuss under which hypothesis the quasi-potential can be seen as a solution of the Hamilton-Jacobi equation that forms the basis for the perturbative treatment that is developed in Sec. 3. In the context of finite-dimensional systems, the discussion of the perturbation theory for quasi-potential is made quite precise. We also show that the Taylor expansion of the quasi-potential close to an attractor of the deterministic dynamics is a particular case of our perturbative analysis. We conclude the section by observing that close to a codimension-one bifurcation of the deterministic dynamics, fluctuations diverge with the meanfield critical exponent. Final Sec. 4 is about N -body systems and is central to this paper. It concentrates on the case of overdamped diffusions with mean-field interaction that are introduced in Sec. 4.1. In Sec. 4.2, we discuss the fluctuating hydrodynamics for such diffusions, deriving the Dean equation making the original argument [START_REF] Dean | Langevin equation for the density of a system of interacting Langevin processes[END_REF] more precise. The McKean-Vlasov equation is described as the limit of the Dean equation when N → ∞. In Sec. 4.3, we introduce the Shinomoto-Kuramoto model [START_REF] Shinomoto | Phase transitions in active rotator systems[END_REF] as a particular example of the mean-field diffusions and we analyze its McKean-Vlasov limit and the corresponding phase diagram. Sec. 4.4 derives formally, starting from the Dean equation, an extension of the Freidlin-Wentzell theory to the case of mean-field diffusions, and discusses the infinite-dimensional version of the Hamilton-Jacobi equation for the quasi-potential and, briefly, the large deviations for empirical currents. In Sec. 4.5, we adapt the perturbative approach developed for finite dimensional systems to the diffusions with mean-field interaction, concentrating on the power series in the mean-field coupling constant and the Taylor expansion close to stationary solutions of the McKean-Vlasov dynamics. A discussion of explicit results for the Shinomoto-Kuramoto model obtained by combining analytical and numerical treatments is presented. Sec. 5 summarizes the results and discusses the perspectives for future work. Two Appendices contain some additional material.

Freidlin-Wentzell theory: a brief summary

We consider in this section a finite dimensional random dynamical system defined by the Ito stochastic differential equation

1 ẋ = K(x) + √ 2 g(x) η t , (2.1)
where x ∈ R d , g is a d × m matrix and η t ∈ R m is a vector of white in time Gaussian noises η i t with zero mean and covariance

E[η i t η j t ] = δ ij δ(t -t ) . (2.2)
Throughout the paper it is supposed that K and g are smooth and the Ito stochastic convention is employed, if not stated otherwise. We use the notation Q(x) = g(x) g T (x) with the superscript T indicating the matrix transposition and we demand that Q(x) be positive definite for all x. Generalizations to the case in which Q is semi-positive definite are possible but we do not consider this situation here.

We assume that the stochastic process solving Eq. (2.1) has a unique invariant measure. Then its density P ∞ (x) is smooth and solves the stationary Fokker-Planck equation

d i=1 ∂ ∂x i -K i (x) + d j=1 ∂ ∂x j Q ij P ∞ (x) = 0 . (2.3)
We are interested in the behavior of the above stochastic dynamical system in the small noise limit 1. In this limit, the stationary measure obeys the large deviation principle (1.1) [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF], where the symbol stands for the asymptotic logarithmic equivalence:

F (x) = -lim →0 ln P ∞ (x) .
(2.4)

The rate function F (x) is called quasi-potential associated to the random dynamical system (2.1). It is of central importance to this paper that F , under suitable hypothesis that will be specified in Sec. 2.3, is the unique solution of the Hamilton-Jacobi equation

∇F • [Q • ∇F + K] (x) = 0 . (2.5)
At an informal level, this can be guessed by looking for solutions of the stationary Fokker-Planck equation (2.3) obeying Ansatz

P ∞ (x) exp - F (x) + Z(x) + . . . (2.6)
and retaining only terms of order 1/ . The reader may consult [START_REF] Graham | Macroscopic potentials, bifurcations and noise in dissipative systems[END_REF] where also the lower-order equation for Z(x) is derived. The present introductory section is devoted to an informal discussion of the Freidlin-Wentzell theory, with the particular emphasis on how the quasi-potential can be described from different points of view. This knowledge will be used in the subsequent section. We refer the reader to [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF] for a mathematical presentation, to Chapter 6 of [START_REF] Graham | Macroscopic potentials, bifurcations and noise in dissipative systems[END_REF] for a treatment more oriented towards the physics community and to [START_REF] Heymann | The geometric minimum action method: A least action principle on the space of curves[END_REF] for a general review oriented to computational aspects. In Sec. 2.1, we discuss dynamical large deviations, that is, the probability that a solution of Eq. (2.1) is close to a given path in the limit → 0. This permits to define quasi-potential F A relative to an attractor A of the deterministic dynamics ẋ = K(x). In Sec. 2.2, we describe the properties of solutions of the Hamilton-Jacobi equation (2.5) that we denote F HJ . The connection between F HJ , F A , and F and the conditions under which they coincide are discussed in Sec. 2.3, concentrating on the case of attractive points. A proof of the local existence and uniqueness of F HJ around a stable fixed point of the deterministic dynamics ẋ = K(r), and of its local regularity, is sketched in Sec. 2.4.

Freidlin-Wentzell action and quasi-potential relative to an attractor

Freidlin and Wentzell considered the probability for a trajectory of the stochastic process x(•) defined by Eq. (2.1) to be arbitrarily close to a given continuous path x(•) on the time interval [t i , t f ]. They showed rigorously that lim δ↓0 lim inf

↓0 ln P sup ti≤t≤t f |x(t) -x(t)| < δ = lim δ↓0 lim sup ↓0 ln P sup ti≤t≤t f |x(t) -x(t)| < δ = -A[x(•)], (2.7)
where | • | denotes the norm of a vector in R d and

A[x(•)] = 1 4 t f ti [ ẋ(t) -K(x(t))] • Q(x(t)) -1 [ ẋ(t) -K(x(t))] dt (2.8)
is the so-called Freidlin-Wentzell action functional, see Theorem 2.3 in Chapter 3 of [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF]. Observe that such a functional vanishes on solutions of the deterministic equation ẋ = K(x) .

(2.9)

It measures the difficulty for a trajectory to deviate, due to a weak noise, from the deterministic behavior.

The above result may be elucidated in the framework of the formal path-integral approach going back to Onsager and Machlup [START_REF] Machlup | Fluctuations and irreversible process. II. Systems with kinetic energy[END_REF][START_REF] Stratonovič | On the probability functional of diffusion processes[END_REF][START_REF] Martin | Statistical dynamics of classical systems[END_REF][START_REF] Dykman | Theory of fluctuational transitions between stable states of nonlinear oscillators[END_REF][START_REF] Zinn-Justin | Quantum Field Theory and Critical Phenomena[END_REF]. In this approach, the transition probability from a state x i at time t = t i to a state x f at time t = t f is written as the path integral

P[x i , t i ; x f , t f ] 1 Z A exp - A[x(•)] D[x(•)], (2.10)
where the functional integration is restricted to the paths [t i , t f ] t → x(t) such that x(t i ) = x i and

x(t f ) = x f . Z A is the normalization factor. The exponential factor exp -A[x(•)] plays then for small the role of the probability density in the space of paths.

Let us now consider an attractor A of the deterministic dynamical system (2.9) and a point x 0 ∈ A. The quasi-potential relative to x 0 is defined as

F x0 (x) = min {x(•) | x(-∞)=x0 , x(0)=x} A[x(•)] , (2.11)
where the minimum is over all absolutely continuous paths starting from x 0 at time t = -∞ and ending in x at time t = 0. The choice of the time interval [-∞, 0] is arbitrary and any semi-infinite interval [-∞, t f ] would give the same result. It is easy to see that F x0 does not depend on the choice of x 0 ∈ A and is constant on attractors. Indeed, given two points on the attractor, one can always find trajectories starting and ending arbitrarily close to them on which the action is arbitrarily small. As an example, the reader may consider a limit cycle where any two points of the attractor can be connected by a solution of the deterministic evolution ẋ = K(x). For an attractor A, we shall denote by F A the quasi-potential relative to any x 0 ∈ A. For the sake of simplicity, we shall mainly consider in this paper single point attractors referring the reader to [START_REF] Graham | Macroscopic potentials, bifurcations and noise in dissipative systems[END_REF] and references therein for explicit calculations of quasi-potentials with respect to non-trivial attractors, for example, limit cycles or the Lorentz attractor.

The quasi-potential F can be built from the quasi-potentials relative to the attractors of ẋ = K(x). In the case where a fixed point x is the only attractor of the deterministic dynamics ẋ = K(x) for any initial condition, F x coincides with the quasi-potential F defined through the invariant measure in (2.4). Formally, this may be understood by observing that P[x i , t i ; x f , t f ] is actually independent of x i in the t f → ∞ limit and thus P ∞ (x) = P[x i , t i ; x, ∞]. Then, one obtains the stated result by applying the saddle point approximation to the right hand side of (2.10). The reader may consult Theorem 4.3 in Chapter 4 of [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF] for the rigorous result.

If more attractors {A i } 1≤i≤I are present then the quasi-potential F may still be constructed once the quasi-potentials relative to each attractor F Ai is known. One has

F (x) = min i (F Ai (x) + C i ) -min i C i (2.12)
where constants C i describe the "height" of each attractor A i . More precisely, one has to consider the igraphs G(i) on the set {A 1 , . . . , A I } of attractors composed of arrows j → k such that j = i, from every A j = A i starts exactly one arrow and there are no closed cycles. Constants C i are then defined as

C i = min G(i) {j→k} F Aj (A k ) , (2.13)
where the minimum is over all i-graphs and the sum over all the arrows of an i-graph and F Aj (A k ) = F Aj (x) for any x ∈ A k . This rigorous result is discussed in detail in Chapter 6 of [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF]. Eq. (2.12) balances the contributions from different attractors with the use of the invariant measure of the Markov chain with transition probabilities describing the passages between different attractors. This point was discussed in [START_REF] Graham | Nonequilibrium potential for coexisting attractors[END_REF] from physicist's perspective. In that reference, a computation of constants C i for few explicit examples was also carried out. In the present paper, we concentrate on the calculation of quasi-potentials F x relative to attractive points x and thus we do not enter into further details on how the heights C i may be practically found.

Transverse decomposition, fluctuation and relaxation dynamics

In the previous section we saw that the quasi-potential F can be obtained by solving the variational problem given by Eqs. (2.11), (2.12) and (2.13). In this section, we discuss a different approach that will permit to obtain F as a solution of the Hamilton-Jacobi equation (2.5) of Sec. 2.3.

Consider an open set D ⊆ R d and its closure D = D ∪ ∂D, where ∂D denotes the boundary of D assumed to be smooth. We suppose in this section that the vector field K admits a transverse decomposition in D in the following sense: there exists a smooth function F HJ (x) such that

K(x) = -(Q ∇F HJ )(x) + G(x) (2.14)
and

∇F HJ (x) • G(x) = 0 (2.15)
for all x ∈ D. The existence of a transverse decomposition is equivalent to demanding that F HJ solves the Hamilton-Jacobi equation (2.5). Indeed, if K admits a transverse decomposition, then

∇F HJ • K = -∇F HJ •Q ∇F HJ .
Conversely, we can define G = K +Q ∇F HJ and from Eq. (2.5) we obtain the transversality condition. The term Q∇F HJ may be viewed as the gradient of F HJ in the Riemannian metric defined by the matrices Q(x) -1 and then Eq. (2.15) states its orthogonality to G with respect to the corresponding scalar product of the vector fields. Such an interpretation is often employed in the mathematical literature but we shall not pursue it here. The deterministic dynamics (2.9) with

K(x) = -(Q ∇F HJ )(x) + G(x)
is called relaxation dynamics. The reason for this name is that as the Freidlin-Wentzell action vanishes on its trajectories, they are in the small noise limit the most probable trajectories relaxing to an attractor. The presence of a transverse decomposition permits to define the so-called fluctuation or instanton dynamics

ẋ = 2(Q∇F HJ )(x) + K(x) = (Q∇F HJ )(x) + G(x) ≡ K r (x) (2.16)
which plays a fundamental role in what follows. We shall also be interested in the Freidlin-Wentzell action functional corresponding to the stochastic dynamics

ẋ = K r + √ 2 g(x) η t , (2.17)
which is

A r [x(•)] = 1 4 t f ti [ ẋ(t) -K r (x(t))] • Q(x(t)) -1 [ ẋ(t) -K r (x(t))] dt . (2.18)
The fluctuation dynamics is connected to time-reversal of the stochastic equation (2.1). To understand this point, let us consider the diffusion process defined by (2.1) in the time interval [0, T ]. It was shown in [START_REF] Haussmann | Time reversal of diffusions[END_REF] that its time-reversal corresponds to the stochastic dynamics

ẋ = -K(x) + √ 2 g(x) η t , (2.19)
where

K(x) = K(x) -2 P (x, T -t) -1 ∇ • [Q(x)P (x, T -t)
] and P (x, t) is the solution to the time-dependent Fokker-Planck equation associated to (2.1). If we consider Eq. (2.1) with initial condition distributed accordingly to P ∞ (x) then it follows from Eq. (1.1) that lim →0 K(x) = K(x) + 2(Q ∇F )(x). Under suitable hypothesis given in Sec. 2.3, F and F HJ coincide and then lim →0 K(x) = K r (x). We now discuss some properties of F HJ in connection to relaxation and fluctuation dynamics. The stationary points of F HJ correspond to zeros of the vector field K. Indeed

(K • Q -1 K)(x) = (∇F HJ • Q ∇F HJ )(x) + (G • Q -1 G)(x) ≥ 0 , (2.20)
as it can be directly proven by inserting Eq. (2.14) into the left hand side and using the transverse decomposition. Then, if x is such that K(x) = 0, the above expressions imply that ∇F HJ (x) = 0 = G(x). The converse is also true if we suppose that the Hessian matrix of F HJ , denoted by (∇∇F HJ ), is invertible at x. Indeed, by taking the gradient of the transversality condition and evaluating it at x, we infer that

(∇∇F HJ G)(x) = 0 . (2.21)
By invertibility of the Hessian matrix, this implies that G(x) = 0 and hence K(x) = 0. Moreover, F HJ is a Lyapunov function for both the relaxation dynamics and the time-reverse of the fluctuation dynamics ẋ = -K r (x) .

(2.22)

= -K r (x) = -Q ∇F HJ (x) -G(x). Indeed, if ẋ = K(x) then dF HJ (x) dt = -(∇F HJ • Q ∇F HJ )(x) ≤ 0 , (2.23)
and analogously for Eq. (2.22). From the above properties, we conclude that the relaxation and fluctuation dynamics have the same stationary points but attractors are transformed into repellers and vice-versa. Thus the relaxation and the time-reversal of the fluctuation dynamics have the same attractors and F HJ as a Lyapunov function.

One could be led to an incorrect conclusion that basins of attraction of those two dynamics are the same which, however, is not true because the transverse parts of dynamics can push the systems to different attractors. This can be checked, for example, in a very simple two-dimensional bistable system, see Figure 1.

Quasi-Potential as a solution of the Hamilton-Jacobi equation

Let us suppose that F HJ is a smooth solution of the Hamilton-Jacobi equation

∇F HJ • [Q ∇F HJ + K] (x) = 0 , (2.24)
in D = D ∪ ∂D ⊆ R d containing in the interior a fixed point x such that F HJ (x) = 0 and F HJ (x) > 0, ∇F HJ (x) = 0 for x ∈ D, x = x. We shall assume that D is bounded and connected. We want to understand the relation between F x and F HJ , see Theorem 3.1 in Chapter 4 of [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF] for more details.

For any path [-∞, 0] t → x(t) ∈ D subjected to the boundary conditions x(-∞) = x and x(0) = x, a simple manipulation shows that

A[x(•)] = A r [x(•)] + 0 -∞ dx(t) dt • ∇F HJ (x(t)) dt = A r [x(•)] + F HJ (x) ≥ F HJ (x) (2.25)
where A r [x(•)] was defined in (2.18) and we used the transversality condition. The inequality

A[x(•)] ≥ F HJ (x) (2.26)
still holds if we allow the trajectory x(•) to go out of the closed set D provided that x ∈ DHJ , the closure of the open set

D HJ = x ∈ D F HJ (x) < min y∈∂D F HJ (y) . (2.27)
Indeed, writing the inequality (2.25) for the trajectory x(•) restricted to [-∞, τ ], where τ is the first exit time from D, we obtain the lower bounds

A[x(•)] ≥ F HJ (x(τ )) ≥ F HJ (x) (2.28)
with the second one resulting from the condition x ∈ DHJ . Action A r [x(•)] attains its minimum equal to zero on the trajectory of the fluctuation dynamics ẋ = K r (x). It is easy to see that for x ∈ DHJ there exists a unique such trajectory [-∞, 0] t → x(t, x) for which x(-∞, x) = x and x(0, x) = x. Besides, such trajectory lies entirely in DHJ . This follows from the fact, that on each solution of the fluctuation dynamics that ends at x, function F HJ decreases backward in time and such a solution may be infinitely extended in negative time direction until it reaches x at t = -∞. The resulting trajectory saturates the inequality (2.25). One infers that for x ∈ DHJ , We have just obtained two results. First, a smooth solution of the Hamilton-Jacobi equation (2.5) on D, with the properties stated at the beginning of the section, coincides with F x on DHJ where D HJ is the sub-domain of D containing x defined by (2.27). Second, on DHJ ,

F HJ (x) = min {x(•) | x(-∞)=x , x(0)=x} A[x(•)] = F x(x) , (2.29
F HJ (x) = F x(x) = A[x(• , x)] , (2.30)
where [-∞, 0] t → x(t, x) ∈ DHJ is the solution to the instanton dynamics, i.e. the unique trajectory joining x to x and satisfying Eq. (2.16).

Hamiltonian picture

Above we have assumed the local existence of a smooth solution of the Hamilton-Jacobi equation around an attractive point x of the relaxation dynamics (2.9). The linearization of such dynamics around x has the form

ẋ = Ax , (2.31)
where A = (∇K(x)) T is the matrix with entries A i j = ∇ j K i (x). We shall assume that all eigenvalues of A have negative real parts, which ensures the exponential convergence to x in the vicinity of the attractor. Such attractive points will be called non-degenerate. We shall sketch below a proof of the fact that around nondegenerate attractive point x there exists a unique local smooth solution of the Hamilton-Jacobi equation, The argument we present here is based on the analysis of the dynamics of extremal trajectories of the Freidlin-Wentzell action functional, see [START_REF] Day | Some regularity results on the Ventcel-Freidlin quasi-potential function[END_REF] for a more global discussion.

Let us start by considering the Hamiltonian H(x, p) related by the Legendre transform to the Lagrangian

L(x, ẋ) = 1 4 ( ẋ -K(x)) • Q(x) -1 ( ẋ -K(x)) (2.32)
appearing in the Freidlin-Wentzell action (2.8). One has

H(x, p) = p • ẋ -L(x, ẋ) = p • Q(x)p + p • K(x) (2.33) for p = 1 2 Q(x) -1 ( ẋ -K(x)
). The Euler-Lagrange equations for the extremal trajectories of the Freidlin-Wentzell action correspond to the Hamilton equations

ẋ = ∇ p H(x, p) = 2Q(x)p + K(x) , ṗ = -∇ x H(x, p) = -∇ x (p • Q(x)p + p • K(x)) .
(2.34)

The dynamical system (2.34) in the phase space R 2d possesses a hyperbolic fixed point with (x, p) = (x, 0). Indeed, the right hand sides of Eqs. (2.34) vanish at this point and the linearization of (2.34) around (x, 0) has the form

ẋ = 2Q(x)p + Ax , ṗ = -A T p . (2.35)
Phase space R 2d may be split in a unique way into as a direct sum V s ⊕V u of the stable and unstable invariant subspaces of the linearized flow (2.35),

V s = {(x, 0) | x ∈ R d } , V u = {(x, Bx) | x ∈ R d } , (2.36)
Figure 2: Hamiltonian flow around (x, 0) with the stable and unstable manifolds where

B -1 = 2 ∞ 0 e tA Q(x) e tA T dt . (2.37)
is the unique positive definite matrix satisfying the relation

BA + A T B = -2B Q(x)B . (2.38)
On V s and V u the linearized flow reduces to

( ẋ, 0) = (Ax, 0) , ( ẋ, B ẋ) = (-B -1 A T Bx, -A T Bx) (2.39)
and is, respectively, exponentially contracting and exponentially expanding (the eigenvalues of -B -1 AB are the negatives of those of A and have positive real parts). The subspaces V s and V u are Lagrangian, i.e. the symplectic form ω = dp • dx vanishes when restricted to each of them. It follows from a general theory of hyperbolic fixed points, see e.g. [START_REF] Teschl | Ordinary Differential Equations and Dynamical Systems[END_REF][START_REF] Irvin | Smooth Dynamical Systems[END_REF], that in the vicinity of (x, 0) there exist unique stable and unstable smooth d-dimensional submanifolds M s and M u composed of close points tending to (x, 0) under, respectively, flow (2.34) and its time-reversal. M s is a local piece of V s around x and M u has V u as the tangent space at (x, 0), see Figure 2. Besides, if K and Q are (real) analytic then the submanifolds M s and M u are also analytic, see Theorem 7.1 in [START_REF] Ilyashenko | Lectures on Analytic Differential Equations[END_REF]. Both M s and M u are Lagrangian submanifolds of the phase space (i.e. 2-form ω vanishes when restricted to their tangent subspaces). This follows from the Hamiltonian nature of the flow (2.34) which preserves ω. Besides the Hamiltonian H (conserved by the flow (2.34)) has to vanish both on M s and on M u since it vanishes at (x, 0). We may now define for x in a small ball D around x

F (x) = x x p • dx (2.40)
with the result independent of the integration path (x(t), p(t)) in M u such that x(t) lies in D. Then M u is given locally by the equation p(x) = ∇F (x), where (x, p(x)) ∈ M u . Clearly, F is a smooth function on D (which is analytic if K and Q are). The vanishing of the Hamiltonian H on M u implies now that F satisfies the Hamilton-Jacobi equation (2.5) so that we may set F HJ = F . Note that for such F HJ , the Hamiltonian dynamics on the stable manifold M s projects to the position space to the relaxation dynamics and the one on the unstable manifold M u to the fluctuation dynamics. F HJ and ∇F HJ vanish at x and the Hessian ∇∇F HJ (x) = B is positive definite. Conversely, if F HJ is a local solution of the Hamilton-Jacobi equation around x with the latter properties then, for a small ball D around x, the sets {(x, 0) | x ∈ D} and {(x, ∇F HJ (x)) | x ∈ D} form, respectively, the local stable and unstable manifolds of the fixed point (x, 0) of the Hamiltonian flow (2.34) so that F HJ = F .

The above argument shows also the local existence of a transverse decomposition (2.14) and (2.15) of the vector field K around its non-degenerate stable zeros x. The decomposition has positive definite Hessian ∇∇F HJ (x) and is uniquely determined by this property.

The results discussed here, together with the local equality F HJ = F x, show that the quasi-potential relative to x is smooth (or analytic for K and Q analytic) in the vicinity of a non-degenerate attractive fixed point x of the deterministic dynamics (2.9). It is however well known that F x does not have to be smooth everywhere, see e.g. [START_REF] Graham | Weak-noise limit of Fokker-Planck models and nondifferentiable potentials for dissipative dynamical systems[END_REF][START_REF] Graham | Fluctuations in the steady state[END_REF][START_REF] Kamenev | Field theory of non-equilibrium systems[END_REF][START_REF] Maier | A scaling theory of bifurcations in the symmetric weak-noise escape problem[END_REF] and references therein. Such non-smoothness occurs if the unstable manifold of the fixed point (x, 0) of the Hamiltonian dynamics (2.34) has tangent vectors perpendicular to V s leading to the caustics in its projection on V s , see Figure 2. In recent literature, such situations were connected to the so called Lagrangian phase transitions [START_REF] Bertini | Macroscopic fluctuation theory[END_REF]. Non-smooth quasi-potentials may be treated using viscous solutions of Hamilton-Jacobi equations [START_REF] Cameron | Finding the quasipotential for nongradient SDEs[END_REF][START_REF] Fleming | Controlled Markov Processes and Viscosity Solutions[END_REF]. We leave such situations to a future investigation.

Perturbative expansions of quasi-potentials

Let us consider a finite-dimensional stochastic dynamics depending smoothly on a real external parameter λ,

ẋ = K λ (x) + √ 2 g λ (x) η t . (3.1)
We shall use the notation Q λ = g λ (g λ ) T for the noise covariance and F λ for the quasi-potential relative to the attractor xλ of the dynamics ẋ = K λ (x) (dropping the subscript indicating the attractor). For simplicity, we only consider fixed points as attractors, even if all the results in this section can be generalized to other kinds of attractors. An explicit calculation of the quasi-potentials F λ for the dynamics of the form (3.1) is usually an impossible task. However, it is feasible in particular situations, as for example in the cases when (3.1) respects detailed balance. It is thus very natural to ask the following question. Supposing that we are able to calculate the quasi-potential for a given value of λ, say λ = 0, can we perturbatively calculate F λ for small λ? Some works are available in the literature containing the first-order analysis [START_REF] Graham | Non-equilibrium potentials and stationary probability distributions of some dissipative models without manifest detailed balance[END_REF][START_REF] Graham | Existence of a potential for dissipative dynamical systems[END_REF][START_REF] Graham | On the weak-noise limit of Fokker-Planck models[END_REF][START_REF] Graham | Integrability of Hamiltonians associated with Fokker-Planck equations[END_REF][START_REF] Jauslin | Melnikov's criterion for nondifferentiable weak-noise potentials[END_REF][START_REF] Gang | Polynomial expansion of the potential of Fokker-Planck equations with a noninvertible diffusion matrix[END_REF][START_REF] Maier | Escape problem for irreversible systems[END_REF] and concentrating mainly on specific examples. In [START_REF] Tél | Nonequilibrium potentials and their power-series expansions[END_REF], the first-order theory is presented in a general fashion and, recently, a rigorous 1 st order analysis has been obtained in [START_REF] Poquet | Phase reduction in the noise induced escape problem for systems close to reversibility[END_REF]. We extend here the approach of [START_REF] Tél | Nonequilibrium potentials and their power-series expansions[END_REF] to any order.

Before discussing in details how the perturbative approach is built in the rest of the section, we first summarize the main ideas. The strategy is to consider the quasi-potential as a solution to the Hamilton-Jacobi equation

∇F λ • Q λ ∇F λ + K λ (x) = 0 , (3.2)
which holds under the hypotheses discussed in Sec. 2.3. In particular, we shall assume that the vector field K 0 has a non-degenerate stable zero x0 . From the Implicit Function Theorem, it follows that for sufficiently small |λ| there exists a smooth family xλ of non-degenerate zeros of K λ . By a slight modification of the arguments in Secs. 2.3 and 2.4, invoking the dependence on a parameter of the unstable manifold of a hyperbolic fixed point, we infer that there exists a smooth family of solutions F λ HJ (x) of the Hamilton-Jacobi equation (3.2) defined in a neighborhood of λ = 0 and x0 and that those solutions coincide with the quasi-potentials F λ for the stochastic dynamics (3.1) relative to the attractors xλ on the set D 0 HJ for a sufficiently small neighborhood D of x0 . D 0 HJ is given by Eq. (2.27) for λ = 0. Besides F λ (x λ ) = 0, ∇F λ (x λ ) = 0 and the Hessians ∇∇F λ (x λ ) are positive definite. For K λ (x) and Q λ (x) analytic in λ and x, both xλ and F λ HJ (x) will be analytic for sufficiently small |λ|.

For x0 + y ∈ D 0 HJ , we shall expand the function λ → F λ (x λ + y), well defined and smooth for sufficiently small |λ|, into the infinite Taylor series around λ = 0, writing

F λ (x λ + y) = ∞ n=0 λ n F (n) (y) . (3.3)
Such a Taylor expansion is asymptotic in the smooth case but has a finite radius of convergence in the analytic case. An analogous notation will be used for the expansions of K λ and Q λ centered at xλ . We suppose that F (0) is explicitly known and attempt to calculate the perturbative coefficients F (n) (y). Inserting the above expansion into the Hamilton-Jacobi equation (3.2), one obtains a hierarchy of equations expressing F (n) in terms of functions F (k) with k < n so that they may be solved iteratively. We stress that in Eq. ( 3.3) we have moved attractors xλ to the origin. This may seem just a detail but it is important in order to get a simple proof that the equations for F (n) admit a unique solution for x0 + y ∈ D 0 HJ . Recall from Sec. 2.3 that x0 may be connected to each x ∈ D 0 HJ by a unique trajectory of the λ = 0 fluctuation dynamics which, after the shift by -x 0 , takes the form

ẏ = K (0) r (y) = 2 Q (0) (y)∇F (0) (y) + K (0) (y) . (3.4)
The solution for each F (n) can be obtained with the method of characteristics by integrating along the trajectories of (3.4), see Eq. (3.16) below for the explicit expression for F (n) . Such observation is of practical importance: to compute F (n) , the only difficulty is to compute solutions of Eq. (3.4). This might not be doable analytically, but it is a simple problem for a numerical treatment.

From the practical point of view it may be more convenient to implement a modified version of perturbative expansion where we replace Eq. (3.3) with a Taylor expansion of the function λ → F λ (x) at λ = 0 for x ∈ D 0 HJ :

F λ (x) = ∞ n=0 λ n F (n) (x) . (3.5)
We shall see an example where expansion (3.5), that we shall call direct, is simpler to implement than Eq. (3.3). The difference between the two expansions comes from the fact that here we do not move the λ-attractors to the origin. In this case, however, the simplest route to prove that functions F (n) may be again found iteratively with the method of characteristics, is to reduce expansion (3.5) to (3.4), see Sec. 3.2.

Finally we shall show in Sec. 3.3 that, for a suitable choice of K λ and Q λ , the expansion of Eq. (3.3) reduces to the Taylor expansion of the quasi-potential F associated to Eq. (2.1) around the attractor x.

Expansion centered on attractors of the perturbed dynamics

This section discusses the perturbative solution of the Hamilton-Jacobi equation (3.2) in the form (3.3). We iteratively construct functions F (n) obtaining, in such a way, two results: first, we prove that the equations obeyed by F (n) admit a unique solution and, second, we give an explicit recursive formula that may be used to practically calculate F (n) .

As already mentioned, we assume that x0 is a non-degenerate fixed point of the relaxation dynamics at λ = 0. This means that K 0 (x 0 ) = 0 and the eigenvalues of ∇K 0 (x 0 ) have negative real parts. The assumption ensures that quasi-potential F 0 relative to x0 (recall that we have dropped the subscript indicating the attractor) is given by the solution to the Hamilton-Jacobi equation in the neighborhood D 0 HJ of x0 , that F 0 (x 0 ) and ∇F 0 (x 0 ) vanish, and that the Hessian ∇∇F 0 (x 0 ) is positive definite and

F 0 (x) > 0 for x ∈ D 0 HJ , x = x0 , see Sec. 2.3.
Let us expand the drift and the noise covariance in powers of λ after shifting the attractor xλ of the perturbed deterministic dynamics to the origin:

K λ (x λ + y) = ∞ n=0 λ n K (n) (y) , Q λ (x λ + y) = ∞ n=0 λ n Q (n) (y) . (3.6)
Several properties that will be used below follow simply. Because xλ is a fixed point for the deterministic dynamics, K (n) (0) = 0. Similarly, since F λ (x λ ) = 0 and ∇F λ (x λ ) = 0, the relations F (n) (0) = 0 and ∇F (n) (0) = 0 must hold for every n. Moreover, the eigenvalues of ∇K (0) (0) have negative real parts and ∇∇F (0) (0) and Q (0) are positive definite.

Inserting expansions (3.3) and (3.6) into the Hamilton-Jacobi equation (3.2), we obtain the power-series identity

∞ n=0 λ n n k=0 n-k l=0 ∇F (n-k-l) • Q (k) ∇F (l) + ∇F (n-k) • K (k) (y) = 0 . (3.7)
Upon equating to zero order by order, this gives a hierarchy of relations

∇F (0) • Q (0) ∇F (0) + K (0) = 0 for n = 0 , (3.8
)

∇F (n) • K (0) r = S (n) [F (0) , . . . , F (n-1) ] for n > 0 , (3.9)
where

K (0) r = 2 Q (0) ∇F (0) + K (0) (3.10)
and S (n) is a functional of F (0) , . . . , F (n-1) given by

S (n) [F (0) , . . . , F (n-1) ] = - n-1 k=1 ∇F (n-k) • Q (0) ∇F (k) + K (k) + n-k l=0 ∇F (n-k-l) • Q (k) ∇F (l) -∇F (0) • Q (n) ∇F (0) + K (n) .
(3.11)

We have arranged Eqs. (3.9) in such a way that F (n) appears only on the left hand side. Eq. (3.8) is nothing else but the Hamilton-Jacobi equation corresponding to the dynamics (3.1) with λ = 0, once we have moved the attractor to the origin. We assumed that its solution F (0) (y) is known. In the following, we prove that solutions to Eqs. (3.9) for n > 0 exist and are unique. An explicit formula will permit to obtain F (n) given F (k) for k < n. We start by looking at the properties of the 0 th order fluctuation dynamics ẏ = K (0) r (y) when the norm |y| is small. These results will be useful to prove the existence of solutions to Eqs. (3.9).

Fluctuation dynamics: exponential escape from attractor

Let us consider Eq. (3.4) describing the 0 th order fluctuation dynamics after the shift of attractor to the origin. From the results of Sec. 2.3 about the trajectories of the fluctuation dynamics it follows that for y ∈ D 0 HJ -x0 ≡ D 0 there exists a unique solution [-∞, 0] t → ỹ(t, y) of Eq. ( 3.4) such that ỹ(-∞, y) = 0 and ỹ(0, y) = y. Besides, ỹ(t, y) belongs to D 0 for all t.

We now show that ỹ(t, y) escapes from the attractor y = 0 exponentially fast. Indeed, we can write for |y| small ỹ(t, y) = e t(2Q (0) B+A) y + o e t(2Q (0) B+A) y .

(3.12)

In the above expressions, A and B are defined through the small |y| expansion of K (0) and F (0) :

K (0) (y) = Ay + o(|y|) , F (0) (y) = 1 2 y • By + o |y| 2 , (3.13)
i.e. A = (∇K (0) (0)) T and B = ∇∇F (0) (0). One should recall from the properties listed above for K (0) and F (0) that the eigenvalues of A have negative real parts and B = B T is positive definite. We have encountered matrices A and B already before when studying the Hamiltonian dynamics in Sec. 2.4. They are related by the identity

BA + A T B + 2B Q (0) B = 0 (3.14)
imposed by the 2 nd order in y contribution to the 0 th order Hamilton-Jacobi equation (3.8). Note that identity (3.14), which implies that

2Q (0) B + A = -B -1 A T B , (3.15)
coincides with Eq. (2.38) solved by (2.37) if we replace in the latter Q(x) by Q (0) (0). Behavior (3.12) is dictated by the spectrum of (2Q (0) B +A). Indeed, as already noticed before, the eigenvalues of -BA T B have positive real parts. Thus the 0 th -order fluctuation dynamics escapes exponentially fast from the attractor. This agrees with the analysis of Sec. 2.4 where we showed that the fluctuation dynamics on the position space corresponds to the Hamiltonian dynamics on the unstable manifold of the hyperbolic fixed point.

Iterative solution

We shall prove that the unique solution of Eqs. (3.9) on

D 0 = D 0 HJ -x0 that satisfies F (n) (0) = 0 is F (n) (y) = 0 -∞ S (n) [F (0) , . . . , F (n-1) ](ỹ(t, y)) dt , (3.16)
where ỹ(t, y) is the trajectory of the 0 th -order fluctuation dynamics (3.4) joining the origin to y that was discussed above. Moreover, the expression (3.16) is well-defined, as we show that the integral in this expression is convergent whenever y belongs to D 0 . Eq. (3.16) gives an iterative solution of (3.9). Let us start by proving that if a solution of Eq. (3.9) such that F (n) (0) = 0 exists, it has to have the form (3.16). This is easily seen by taking the total time derivative of

F (n) (ỹ(t, y)), d dt F (n) (ỹ(t, y)) = ∇F (n) (ỹ(t, y)) • dỹ(t, y) dt = ∇F (n) • K (0) r (ỹ(t, y)) = S (n) [F (0) , . . . , F (n-1) ](ỹ(t, y)) , (3.17)
and by integrating over time.

In the next step, we shall show that, assuming that the integral on the right hand side of (3.16) converges, the latter equation gives a function F (n) (y) that solves Eq. (3.9). Indeed, on the fluctuating dynamics trajectory,

F (n) (ỹ(s, y)) = 0 -∞ S (n) [• • • ](ỹ(t, ỹ(s, y))) dt = 0 -∞ S (n) [• • • ](ỹ(t + s, y)) dt = s -∞ S (n) [• • • ](ỹ(t, y)) dt , (3.18)
where we used the relation ȳ(t, ȳ(s, y)) = ȳ(t + s, y) that holds because of the uniqueness of the solutions of Eq. (3.4). Now, deriving the previous expression with respect to s and evaluating at s = 0, we obtain Eq. (3.9). This means that expression (3.16) solves Eq. (3.9) provided that it is well defined.

To complete the proof, we need to show that the integral appearing in Eq. (3.16) is convergent and vanishes at y = 0. To show this, we have to analyze the behavior of the integrand when t → -∞. This corresponds to studying the behavior of the integrand for small |y|. One completes the prove combining Eq. (3.12) with the observation that the expression S (n) defined in Eq. (3.11) is at least quadratic in y for |y| small if F (k) for k < n have the same property. Under this assumption, that is true for F (0) , the integrand on the right hand side of Eq. (3.16) converges exponentially to zero when t → -∞ so that the time integral converges. Besides, it determines function F (n) (y) that is at least quadratic in y for small |y| so that it may be shown inductively that F (n) starts at worst quadratically.

Let us summarize our results: we described an iterative scheme to calculate perturbatively the quasipotential F λ of Eq. (3.1) as a power series (3.3). Once we know the terms F (k) of that expansion for k < n then F (n) may be obtained using Eq. (3.16). In that formula, S (n) is defined by Eq. (3.11) and ỹ(t, y) is the solution to the 0 th -order fluctuation dynamics (3.4) that starts at the origin at t = -∞ and arrives at y at time zero. Finally, we proved that this procedure is well defined (F (n) are finite quantities and depend smoothly, or analyticaly in the analytic case, on y ∈ D 0 ). More generally, one could define this way F (n) (y) for y belonging to the basin of attraction of the origin for the time-reversal of the fluctuation dynamics (3.4).

Let us conclude this section observing that the procedure described here may be very easily implemented numerically. Indeed, to calculate F (n) at all the orders, one only needs to compute the solution to the 0 th -order fluctuation dynamics (3.4). The scheme just described gives a powerful practical tool to compute quasi-potentials perturbatively.

Direct Expansion

In Sec. 3.1 we have presented an expansion in power of λ centered on the attractors of the perturbed dynamics. We discuss in this section a direct expansion, which does not depend on the knowledge of the attractors of the perturbed dynamics. The main point we want to stress in that case is the appearance of non-trivial solvability conditions.

There are several reason why, in some cases, this new expansion may be simpler or more relevant than the one centered on the attractors. The main one is that the attractors of the perturbed dynamics may not be known explicitly and should then be computed themselves by a perturbative expansion. In that case, as the definition of K (n) and Q (n) given in Eq. (3.6) involves the attractor xλ of the perturbed dynamics ẋ = K λ (x), then matrices Q (n) may be non-zero at all orders even if the covariance Q λ is independent of λ. An example of this kind will be encountered in Sec. 4.5.

We assume power series expansions for K λ and

Q λ K λ (x) = ∞ n=0 λ n K(n) (x) , Q λ (x) = ∞ n=0 λ n Q(n) (x) . (3.19)
Observe that K(0) (x 0 ) = 0 and ∇ F (0) (x 0 ) = 0. By assumption all the eigenvalues of ∇ K(0) (x 0 ) have negative real part, and Q (0) (x 0 ) is a positive definite matrix. This implies that ∇∇F (0) (x 0 ) is a positive definite matrix. As ∇ K(0) (x 0 ) is invertible, the identity K λ (x λ ) = 0 permits to solve iteratively for the coefficients of the Taylor expansion

xλ = ∞ n=0 λ n x(n) . (3.20)
for the perturbed attractor, where x(0) = x0 . Inserting Eq. (3.5) and (3.19) into the Hamilton-Jacobi equation (3.2), we obtain a hierarchy identical to (3.8) and (3.9). The only differences are, of course, that y has to be replaced with x and F (n) , K (n) and Q (n) by F (n) , K(n) and Q(n) . Explicitly, we have

∇ F (0) (x) • Q(0) (x)∇ F (0) (x) + K(0) (x) = 0 for n = 0 , (3.21) ∇ F (n) (x) • K(0) r (x) = Ŝ(n) [ F (0) , . . . , F (n-1) ](x) for n = 0 , (3.22)
where

K(0) r = 2 Q(0) ∇ F (0) + K(0) (3.23)
and Ŝ(n) is the functional of F (0) , . . . , F (n-1) given by Eq. (3.11) with F (n) , K (n) and Q (n) replaced by the hatted quantities.

We first remark that, as

K(0) r (x 0 ) = 0, Eq. (3.22) implies Ŝ(n) [ F (0) , . . . , F (n-1) ] x=x 0 = 0 , (3.24)
which appears as a solvability condition for Eq. (3.22). It is possible to prove directly this solvability condition by induction, however this involves subtle cancellations that are tedious to prove to all orders. In order to bypass this proof, we rather argue that we know a priori that the series expansion exists. Then Eq. (3.22) is a consequence of the existence of the series expansion and this implies that the solvability condition (3.24) is satisfied. The existence of the series expansion follows from the existence of the series expansion around the attractors of the perturbed dynamics, discussed in the previous section. Indeed, F (n) (x) may be directly found using the expansion from the previous section by comparing order by order both sides of the identity

∞ n=0 λ n F (n) (x) = F λ (x) = ∞ n=0 λ n F (n) (x -xλ ) , (3.25)
where on the right hand side one inserts the Taylor expansion (3.20). We now explain how to solve Eq. (3.22) using (3.24). Let us consider the 0 th -order fluctuation dynamics

ẋ = K(0) r (x) , (3.26)
and its trajectory x(t, x) lying in D 0 HJ such that x(-∞, x) = x0 and x(0, x) = x. With the same argument as in Sec. 3.1.2, we can show that

F (n) (x) = C (n) + 0 -∞ Ŝ(n) [ F (0) , . . . , F (n-1) ](x(t, x)) dt . (3.27)
has to hold for a solution of Eq. (3.22), where C (n) are (for the moment arbitrary) constants. This is analogous to Eq. (3.16). To obtain F (n) (x) from this equation, we have to prove the convergence of the integral on the right hand side of (3.27) and to fix the constants C (n) . The first task requires the control of the behavior of Ŝ(n) [ F (0) , . . . , F (n-1) ](x) around x = x0 . It may be achieved by induction using (3.24) and the exponential relaxations of x(t, x) to x 0 when t goes to -∞. The second task is easier and may be accomplished iteratively since the normalization F λ (x λ ) = 0 leads upon Taylor expending to the relations that allow to express

C (n) = F (n) (x 0
) by the values at x0 of functions F (k) and their derivatives and by the coefficients x(k) of the Taylor expansion (3.20), all for k < n. Note, however, that the choice of C (k) for k < n in not relevant for the calculation of F (n) , except when it comes to the choice of C (n) . Indeed, these are the gradients of F (k) for k < n that enter Ŝ(n) .

Taylor expansion of the quasi-potential around the attractor of the unperturbed dynamics

Consider now the stochastic evolution (2.1) without an external parameter. Let x be a non-degenerate attractive point of the deterministic dynamics (2.9). We shall be interested here in the Taylor expansion of the quasi-potential in a neighborhood of x :

F (x + y) = ∞ n=2 ∇ (n) F y (n) , (3.28)
where ∇ (n) F and y (n) are rank-n tensors with the components

∇ (n) F i1•••in = 1 n! ∂ (n) F (x) ∂x i1 • • • ∂x in , (y (n) ) i1•••in = y i1 • • • y in (3.29)
and on the right hand side of (3.28) the contraction of all indices is implied. We shall show here that expansion (3.28) can be viewed as a particular case of the perturbative expansion considered in Sec. 3.1. Then, all the results obtained there may be applied to (3.28) providing a method to calculate tensors ∇ (n) F . With the same notation as in (3.28), we introduce the expansions of K and Q around x :

K(x + y) = ∞ n=1 ∇ (n) K y (n) , Q(x + y) = ∞ n=0 ∇ (n) Q y (n) . (3.30)
Since x is a non-degenerate attractive fixed point of the relaxation dynamics, ∇ (1) K = ∇K(x) has eigenvalues with negative real parts and ∇ (2) F = 1 2 ∇∇F (x) is a positive definite matrix. Let us introduce a new λ-dependent system defined by

K λ (x + y) ≡ 1 λ K (x + λy) , Q λ (x + y) ≡ Q (x + λy) (3.31)
that reduces for λ = 1 to the previous one and depends smoothly on real λ. Note that point x is a nondegenerate stable attractive zero of K λ for all λ and that

F λ (x + y) ≡ 1 λ 2 F (x + λy) (3.32)
satisfies the Hamilton-Jacobi equation (3.2) for all λ including λ = 0. The scaling with λ was introduced in such a way that the λ = 0 case gives a non-trivial contribution. It allows to align the notations to those of Sec. 3.1. With our choice, we indeed have

K 0 (x + y) = (y • ∇)K(x) ≡ Ay , Q 0 (x + y) = Q(x) , (3.33)
F 0 (x + y) = 1 2 (y • ∇) 2 F (x) ≡ 1 2 y • By . (3.34) Moreover K (n) (y) = ∇ (n+1) K y (n+1) , Q (n) (y) = ∇ (n) Q y (n) , F (n) (y) = ∇ (n+2) F y (n+2) (3.35)
in the notation of Eq. (3.6) and (3.3). It is worth stressing that, in this context, the role of the unperturbed λ = 0 stochastic dynamics is played by the linear dynamic

ẏ = Ay + √ 2 g(x) η t (3.36)
with matrix A given by (3.33), for which the unperturbed quasi-potential is the quadratic approximation of F around the attractor. This is not surprising since the stochastic equation (3.36) defines a Gaussian process of the Orstein-Uhlenbeck type whose invariant measure is Gaussian with the covariance equal to B -1 , where B is the Hessian matrix of F at x, see (3.34). The Hamilton-Jacobi equation reduces for λ = 0 to the identity (2.38) with the solution given by (2.37). The relaxation and the fluctuation dynamics are (after the shift of the attractor to the origin), respectively, ẏ = Ay and ẏ = -B -1 A T By .

(3.37)

In particular, for λ = 0 the trajectories of the fluctuation dynamics that start at t = -∞ from the origin have a particularly simple form:

ỹ(t, y) = e -tB -1 A T B y (3.38)
and Eq. (3.16) reduces to the iterative solution

F (n) (y) = 0 -∞ S (n) [F (0) , . . . , F (n-1) ](e -tB -1 A T B y) dt (3.39)
for the Taylor coefficients of F at x with S (n) given Eq. (3.11).

Codimension-one bifurcations: the critical exponent

Let us return to a family of dynamical systems parameterized by λ as in Eq. (3.1) and let us suppose that the deterministic dynamics ẋ = K λ (x) has an attractive fixed point xλ for λ ≤ λ c that is non-degenerate for λ < λ c and undergoes a codimension-one bifurcation at λ = λ c . Large deviations for normal forms corresponding to codimension-one and codimension-two bifurcations were discussed in a series of papers in the '70s and '80s. We refer to [START_REF] Mangel | Uniform treatment of fluctuations at critical points[END_REF][START_REF] Dykman | Theory of fluctuational transitions between stable states of nonlinear oscillators[END_REF][START_REF] Dykman | Fluctuations in nonlinear systems near bifurcations corresponding to the appearance of new stable states[END_REF][START_REF] Knobloch | Bifurcations in fluctuating systems: The center-manifold approach[END_REF][START_REF] Graham | Nonequilibrium potentials for local codimension-2 bifurcations of dissipative flows[END_REF] and to the review [START_REF] Tél | Nonequilibrium potentials and their power-series expansions[END_REF] for a detailed analysis. Here we want only to remark that the critical exponent in this framework is equal to that of the mean-field theory.

The assumed scenario implies that ∇K λ (x λ ) has a simple real eigenvalue α λ that is negative for λ < λ c such that

α λc = 0 and dα λ dλ λ=λc = 0 (3.40)
(the saddle-node bifurcation) or a complex eigenvalue α λ with negative real part for λ < λ c , and its conjugate, such that Re α λc = 0, Im α λc = 0 and dα λ dλ λ=λc = 0 (3.41)

(the Hopf bifurcation). Moreover all the other eigenvalues of ∇K λ (x λ ) have strictly negative real parts for λ ≤ λ c . Let us consider the covariance

(C λ ) ij = x i x j P λ ∞ (x) dx - x i P λ ∞ (x) dx x j P λ ∞ (x) dx (3.42)
of the invariant measure of the stochastic dynamics (3.1). If the minimum of the quasi-potential F λ describing the behavior (1.1) of P λ ∞ in the limit of small noise is attained at xλ then the saddle-point analysis of (3.42) implies that lim

→0 1 C λ = (B λ ) -1 = 2 ∞ 0 e tA λ Q λ (x λ ) e t(A λ ) T dt (3.43)
where B λ is the Hessian matrix of F λ at xλ and the last equality with A λ = (∇K λ (x λ )) T follows from Eq. (2.37). Hence (B λ ) -1 may be viewed as the small-noise limit of the stationary equal-time connected 2-point function of the stochastic process solving Eq. (3.1). Let us examine the behavior of the latter limiting quantity when λ λ c . Any vector y ∈ R d may be decomposed as

y = β λ v λ + β λ v λ + y λ (3.44)
where β λ ∈ C, v λ is the eigenvector of (A λ ) T with the eigenvalue α λ and y λ ∈ R d belongs to the invariant subspace of (A λ ) T corresponding to the other eigenvalues so that

|e t(A λ ) T y λ | ≤ e -δt (3.45)
in the vicinity of λ c for some δ > 0. Then the 2-point function

y • (B λ ) -1 y = -2|β λ | 2 (Re α λ ) -1 v λ • Q λ (x λ ) v λ -2 Re (β λ ) 2 (α λ ) -1 v λ • Q λ (x λ ) v λ + O(1) (3.46)
where O(1) term is regular when λ λ c . Assume that β λc = 0 which holds for generic y. Then, when λ λ c , the first term on the right hand side diverges like (λ c -λ) -1 and the second term is regular if the purely imaginary eigenvalue α λc = 0, and both terms have the same divergence when α λc = 0.

This completes the simple proof that, in the framework of a dynamical systems in the low noise limit undergoing a codimension-one bifurcation, critical exponent for two-points correlator is equal to 1, the mean field theory value of the susceptibility exponent γ. model in this class (the two-body interaction could even be non-potential). However, in order to go beyond formal results, we discuss in detail the example of Shinomoto-Kuramoto system, a simple 1-d model first introduced in [START_REF] Shinomoto | Phase transitions in active rotator systems[END_REF], which has recently attracted some attention in the mathematical literature [START_REF] Luçon | Long time dynamics and disorder-induced traveling waves in the stochastic Kuramoto model[END_REF][START_REF] Giacomin | Transitions in active rotator systems: invariant hyperbolic manifold approach[END_REF][START_REF] Bertini | Macroscopic fluctuation theory[END_REF][START_REF] Giacomin | Noise, interaction, nonlinear dynamics and the origin of rhythmic behaviors[END_REF] as well as in the physical one [START_REF] Ohta | Critical phenomena in globally coupled excitable elements[END_REF][START_REF] Pikovsky | Dynamics of heterogeneous oscillator ensembles in terms of collective variables[END_REF][START_REF] Zaks | Noise-controlled oscillations and their bifurcations in coupled phase oscillators[END_REF].

It is known since the 60s that the evolution of the empirical measure of N diffusions with mean-field interaction is described, for N → ∞, by a non-linear Fokker-Planck equation known in the mathematics literature as the McKean-Vlasov equation [START_REF] Mckean | A class of Markov processes associated with nonlinear parabolic equations[END_REF], see also [START_REF] Sznitman | Topics in propagation of chaos[END_REF][START_REF] Méléard | Asymptotic behaviour of some interacting particle systems; McKean-Vlasov and Boltzmann models[END_REF] for more modern presentations. We refer to this limit as the mean-field behavior of the N particle system. For the Shinomoto-Kuramoto model, the mean-field behavior exhibits a rich phase diagram with stationary and periodic phases separated by bifurcation lines, as first observed in [START_REF] Sakaguchi | Phase transitions and their bifurcation analysis in a large population of active rotators with mean-field coupling[END_REF].

In [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF], Dawson and Gartner studied the large deviations of the empirical measure for the mean-field diffusions through a generalization of the Freidlin-Wentzell theory to such questions. Extensions to cases where quenched disorder is present, as for example in the Kuramoto model [START_REF] Dai Pra | Mckean-Vlasov limit for interacting random processes in random media[END_REF][START_REF] Hollander | Large Deviations[END_REF] or in mean-field spin glasses [START_REF] Grunwald | Sanov results for Glauber spin-glass dynamics[END_REF][START_REF] Ben Arous | Large deviations for langevin spin glass dynamics[END_REF][START_REF] Ben Arous | Symmetric Langevin spin glass dynamics[END_REF], were considered too. Also some large deviation results on a mean-field model for active matter were obtained in the physics literature [START_REF] Barré | Motility-induced phase separation of active particles in the presence of velocity alignment[END_REF].

In this chapter, we first discuss how the mathematical results [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF] can be obtained formally (i.e., without mathematical rigor) by writing an effective evolution for the empirical measure in the form of a stochastic PDE, called the Dean equation [START_REF] Dean | Langevin equation for the density of a system of interacting Langevin processes[END_REF]. The noise term in this equation is proportional to 1/ √ N so that it vanishes as N → ∞. In the latter limit, one recovers the deterministic McKean-Vlasov equation.

The evolution of the empirical measure is thus formally given by a stochastic partial differential equation with weak noise which, at variance with the cases considered in the previous sections, is infinite-dimensional. By applying functional integral techniques from field theory (the Martin-Siggia-Rose formalism, see [START_REF] Martin | Statistical dynamics of classical systems[END_REF]), we can write the infinite-dimensional analogue of the Freidlin-Wentzell theory. In the physics literature, this extension goes under the name of Macroscopic Fluctuation Theory and it has attracted much attention in the statistical mechanics community over last years, see [START_REF] Bertini | Macroscopic fluctuation theory[END_REF] for a review. In the present case, we re-obtain formally the rigorous results by Dawson and Gartner [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF]. We also discuss a more general large deviation result covering current fluctuations.

We then apply the infinite-dimensional analogue of the perturbative scheme discussed in Chapter 3 to obtain explicit results about the quasi-potential for the mean-field diffusions. In particular, we calculate the quasi-potential perturbatively close to the free particle dynamics with no interactions between particles present. This permits also to compute perturbatively the rate function for the fluctuations of some macroscopic observables. For the Shinomoto-Kuramoto model, explicit results obtained by implementing a numerical algorithm to compute the quasi-potential to the 1 st order in the coupling are presented, together with an analysis of the fluctuations of magnetization.

We also discuss how explicit results may be obtained for the Taylor expansion of the quasi-potential around a stationary solution of the McKean-Vlasov equation. Within this analysis, it is clear that the variance of density fluctuations diverges close to bifurcations when external parameters are changed, a result rigorously obtained in [START_REF] Dawson | Critical dynamics and fluctuations for a mean-field model of cooperative behavior[END_REF][START_REF] Ben Arous | Méthode de Laplace : Étude variationnelle des fluctuations de diffusions de type "champ moyen[END_REF]. A numerical algorithm to evaluate explicitly the Taylor expansion is also discussed but we have not implemented it.

The structure of this part of the article is as follows. In Sec. 4.1, we introduce the class of systems that will be considered. Sec. 4.2 derives the Dean equation, formally describing the evolution of the empirical measure for large but finite N . Then, in Sect. 4.3, the particular case of the Shinomoto-Kuramoto model is discussed. We describe the long-time behavior of solutions of the associated McKean-Vlasov equation. Despite its simplicity, the model, which is a kinetic and non-equilibrium version of a mean-field ferromagnet, exhibits a rather complex mean-field behavior that we describe concentrating on the results that can be obtained analytically or semi-analytically. In Sec. 4.4, we discuss how a generalization of the Freidlin-Wentzell theory may be formally obtained by applying the Martin-Siggia-Rose formalism to the Dean equation. Finally, in Sec. 4.5, the perturbative calculation of the quasi-potential is performed and some explicit results for the Shinomoto-Kuramoto model are described.

Mean-field diffusions

Let us consider a system composed of N particles undergoing an over-damped diffusion in R d or in a torus T d and coupled through a mean-field 2-body potential V (x) = V (-x). The equations of motions defining the stochastic evolution are

ẋn = b(x n ) - J N N m=1 (∇V )(x n -x m ) + 2k B T η n , (4.1)
where η n (t) are independent white noises with zero average and covariance E η i n (t) η j m (s) = δ ij δ n,m δ(t -s), T > 0 is the temperature, and k B is the Boltzmann constant.

The quantities which are of central interest for us are the empirical density and the empirical current, defined as

ρ N (t, x) = 1 N N n=1 δ(x -x n (t)) (4.2) j N (t, x) = 1 N N n=1 δ(x -x n (t)) • ẋn (t) (4.3)
where " • " stands for the product in the Stratonovich convention. It is straightforward to show that the following continuity equation holds

∂ t ρ N + ∇ • j N = 0 (4.4)
(this uses the chain rule which imposes the Stratonovich convention in the definition of the empirical current). Moreover, substituting the equation of motion (4.1) into the definition of j N and returning to the Ito convention, we obtain

j N (t, x) = ρ N (t, x) b(x) -J ∇(V * ρ N )(t, x) -k B T ∇ρ N (t, x) + √ 2k B T N N n=1 δ(x -x n (t)) η n (t) , (4.5)
where (V * ρ N ) is the convolution between V and ρ N (t, •) and the term with ∇ρ N was produced by the change of the stochastic convention. Observe that Eq. (4.4) with j N given by (4.5) is not a closed equation for ρ N because the noise term explicitly depends on the particle positions. What we would like to do, instead, is to write a closed evolution equation for ρ N into which the particle positions enter only through ρ N .

Evolution of the empirical density: the Dean equation

A closed equation for the evolution of the empirical density was obtained from Eqs. (4.4) and (4.5) by Dean [START_REF] Dean | Langevin equation for the density of a system of interacting Langevin processes[END_REF]. Dean's argument (somewhat brief in the original paper) can be reformulated in the following way. The last term on the right hand side of (4.5) may be viewed as a white noise in time with values in vector fields on R d ,

√ 2k B T N N n=1 δ(x -x n ) η i n (t) , (4.6)
parameterized by the particle positions (x n ) N n=1 . White noise (4.6) has mean zero and covariance

2k B T N 2 δ ij δ(t -t ) n δ(x -x n ) δ(y -x n ) = 2k B T N δ ij δ(t -t ) δ(x -y) ρ(x) , (4.7)
where the last expression followed by using the distributional identity δ(x-x n ) δ(y -x n ) = δ(x-y) δ(x-x n ) and introducing the particle density ρ(x) = 1 N n δ(x -x n ). Consider now another noise,

2k B T N ρ(x) ξ i (t, x) , (4.8)
where ξ(t, x) stands for the vector-valued white noise in space and time satisfying

E ξ i (t, x) = 0 , E ξ i (t, x) ξ j (s, y) = δ ij δ(t -s) δ(x -y) . (4.9)
Random process (4.8) may again be viewed as a white noise in time with values in vector fields on R d , but now parameterized by densities ρ(x). It has a zero mean and covariance

2k B T N δ ij δ(t -t ) δ(x -y) ρ(x) (4.10)
that coincides with the one of noise (4.6) if ρ is related to particle positions as above. Dean proceeded identifying the two white noises by writing

j N (x, t) = j ρ N (t, x) + 2k B T N ρ N (t, x) ξ(t, x) , (4.11)
upon which the continuity equation (4.4) became a closed stochastic PDE in the space of densities for

ρ(t, x) = ρ N (t, x), ∂ t ρ(t, x) + ∇ • j ρ (t, x) + 2k B T N ∇ • ρ(t, x) ξ(t, x) = 0 , (4.12)
where j ρ is the nonlinear functional of ρ given by

j ρ (t, x) = ρ(t, x) b(x) -J (∇V )(x -y) ρ(t, y) dy -k B T ∇ρ(t, x) . (4.13)
We shall call (4.12) the Dean equation for the empirical density. Dean's substitution is formal in the infinite-dimensional situation involving the space of densities but would be legitimate in a finite-dimensional setup. To explain what we mean, let us consider the backward Kolmogorov equation describing the evolution of averages for functionals of the empirical density S[ρ N (t, •)].

Denoting by E the average with respect to the noises η n and applying the Ito calculus, we infer that2

d dt E S[ρ N (t, •)] = dx δS δρ(x) [ρ N (t, •)] ∇ • ρ N (t, x) -b(x) + J ∇(V * ρ N )(t, x) + k B T ∇ρ N (t, x) + k B T N 2 N n=1 dx dy δ 2 S δρ(x)δρ(y) [ρ N (t, •)] ∇ x • ∇ y δ(x -x n (t)) δ(y -x n (t)) = dx δS δρ(x) [ρ N (t, •)] ∇ • ρ N (t, x) -b(x) + J ∇(V * ρ N )(t, x) + k B T ∇ρ N (t, x) + k B T N dx dy δ 2 S δρ(x)δρ(y) [ρ N (t, •)] ∇ x • ∇ y ρ N (x, t) δ(x -y) , (4.14)
where the last expression was obtained proceeding as in (4.7). We thus obtain for E [S[ρ N (t, •)]] the evolution equation

d dt E S[ρ N (t, •)] = E LS[ρ N (t, •)] , (4.15)
where L is the generator given by

LS[ρ] = dx δS[ρ] δρ(x) ∇ • ρ N (t, x) -b(x) + J ∇(V * ρ N )(t, x) + k B T ∇ρ N (t, x) + k B T N dx dy δ 2 S[ρ] δρ(x)δρ(y) (∇ • ∇ y ) ρ(x, t) δ(x -y) . (4.16)
Observe now that the above evolution for E [S[ρ N ]] is given by the same backward Kolmogorov equation that the one obtained assuming that ρ N solves the Dean stochastic PDE (4.12) anticipated at the beginning of the subsection. In finite dimension, it is not enough to know that E f (X(t)) = E Lf (X(t) for a generator of a diffusion process L and each f to deduce that X(t) has the law of the diffusion process satisfying the corresponding SDE, but this would follow if one showed that f (X(t)) -f (X(0)) -t 0 Lf (X(s)) ds are martingales [START_REF] Stroock | Diffusion processes[END_REF]. A slight extension of the previous calculation shows that the process

S[ρ N (t, •)] -S[ρ N (0, •)]] - t 0 LS[ρ N (s, •)] ds (4.17)
possess this property. Nevertheless, since we are in infinite dimension, the derivation of the Dean equation remains formal.

To complicate things further, the mathematical status of the Dean equation is unclear: it is difficult to give sense to different terms of the equation, including the noisy one, in a function space that would contain the (distributional) empirical densities of coupled diffusions (4.1), not even speaking about a theory of solutions of such a stochastic PDE. Although there is a considerable mathematical literature about non-linear stochastic PDE's with the noise that is delta-correlated in time and space, see [START_REF] Faris | Large fluctuations for a nonlinear heat equation with noise[END_REF][START_REF] Da Prato | Stochastic Equations in Infinite Dimensions[END_REF][START_REF] Hairer | Solving the KPZ equation[END_REF], it does not cover the case of the Dean equation. One may hope, however, that it is possible to give a meaning to this equation at least in the large deviation regime for large N . Although in what follows we completely avoid such rigorous issues and proceed formally, the fact that our results agree with those rigorously obtained by Dawson and Gartner [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF] gives support to this assumption.

Before proceeding further, let us observe that the Dean equation can be recast in a form similar to that of the finite-dimensional SDE considered in the first part of the paper by rewriting it as

∂ t ρ = K[ρ] + 2 N η[ρ] , (4.18)
where

K[ρ](t, x) = -∇ • j ρ (t, x) (4.19)
is the drift and

η[ρ](t, x) = -k B T ∇ • ρ(x) ξ(t, x) (4.20)
is the white noise in time, parameterized by density ρ, with zero mean and covariance

E η[ρ](t, x) η[ρ](s, y) = δ(t -s) Q[ρ](x, y) (4.21)
for

Q[ρ](x, y) = k B T ∇ x • ∇ y ρ(x)δ(x -y) . (4.22)
This form will be useful in the following to formally extend the large deviations results that we described in Sec. 2 to the present case.

In the Dean equation, the noise term becomes small when N becomes large. In particular, in the N → ∞ limit, one obtains the deterministic non-linear Fokker-Planck equation

∂ t ρ(t, x) + ∇ • j ρ (t, x) = 0 (4.23)
known in the mathematical literature as McKean-Vlasov equation [START_REF] Mckean | A class of Markov processes associated with nonlinear parabolic equations[END_REF]. Some authors refer to the above equation as the Vlasov-Fokker-Planck one. In the following, we call the evolution described by this equation the mean-field dynamics.

The above reasoning showed that the McKean-Vlasov equation should describe the evolution of the empirical density in the N → ∞ limit. This is actually corroborated by a number of rigorous results, since the original paper of McKean [START_REF] Mckean | A class of Markov processes associated with nonlinear parabolic equations[END_REF]. More precisely, the property of propagation of chaos was proved under mild hypothesis on the smoothness of the b and V , see [START_REF] Sznitman | Topics in propagation of chaos[END_REF] and references therein. Moreover, a bound on a proper distance between the solution to the McKean-Vlasov equation and the empirical measure at time t, depending on the distance at t = 0 is known. Those results are the analogues in the present context of the more famous ones due to Braun-Hepp [START_REF] Braun | The Vlasov dynamics and its fluctuations in the 1/n limit of interacting classical particles[END_REF] and Dobrushin [START_REF] Dobrushin | Vlasov equations[END_REF] for deterministic particles with mean-field interactions, see also [START_REF] Spohn | Large Scale Dynamics of Interacting Particles[END_REF].

The Dean equation suggests that the evolution of the empirical measure for finite but large N is described by a weak random perturbation (of order 1/ √ N ) of the McKean-Vlasov equation. We are then in a similar context to that of the Freidlin-Wentzell theory discussed in Sec. 2, except for the fact that the stochastic dynamical system is now an infinite dimensional one. We may, nevertheless, hope to obtain large deviation estimates in a similar manner by working at the formal level. This will be done in Sec. 4.4. Before, however, let us further investigate the McKean-Vlasov equation by considering a simple model system.

Shinomoto-Kuramoto model: the mean-field behavior

Models in the class of Eq. (4.1) can display a very rich mean-field dynamics. As a simple example, we consider in this section the Shinomoto-Kuramoto model introduced in [START_REF] Shinomoto | Phase transitions in active rotator systems[END_REF], describing its mean-field behavior by focusing on results that can be obtained analytically or semi-analytically.

The Shinomoto-Kuramoto model is a one-dimensional model where N particles move on a circle of unit radius and are thus identified by their angular coordinate x n = θ n defined modulo 2π, for n = 1, . . . , N . The model is obtained from Eq. (4.1) by setting b(θ) = F -h sin(θ) and V (θ) = (1 -cos θ), where F, h, J are real constants that we shall take non-negative. The equations of motion are

θn = (F -h sin θ n ) - J N N m=1 sin(θ n -θ m ) + 2k B T η n , (4.24)
where η n (t) are independent standard scalar white noises. Observe that negative F is related to positive F and negative h to positive h by the changes of variables θ n → -θ n and θ n → θ n + π, respectively. One of the parameters among F, h, J, T is redundant, as it can be fixed by rescaling the other three and time. We could, for example, fix the coupling strength J. We prefer, however, to leave all the parameters because we shall be interested in limiting cases where one of them vanishes. The Shinomoto-Kuramoto system is related to the more famous Kuramoto model [START_REF] Kuramoto | Self-entrainment of a population of coupled non-linear oscillators[END_REF] of frequency synchronization phenomena in coupled rotators, from which it is obtained by setting all the natural frequencies to the same value F and adding white noises acting on each rotator, see [START_REF] Acebrón | The Kuramoto model: A simple paradigm for synchronization phenomena[END_REF] for a review on Kuramoto and related models.

For general value of the parameters, the Shinomoto-Kuramoto stochastic dynamics (4.24) breaks the detailed balance. This is always true except for F = 0, where the model defines an equilibrium dynamics and reduces to a kinetic version of the mean-field ferromagnetic XY model, with θ n describing the angles of planar spins and h the external magnetic field h in the X direction. For F > 0, the model may be still interpreted within ferromagnetism, except that the planar magnetic field should be taken rotating with angular velocity F and the spin angles described in the frame rotating with it. The case h = 0 is also special since its dynamics only trivially breaks the detailed balance that may be restored by returning to the original frame. Thus, the Shinomoto-Kuramoto model can be seen as a non-equilibrium version of mean-field ferromagnets.

As discussed in Sec. 4.2, for N → ∞, the evolution of the empirical density is described by the McKean-Vlasov equation (4.23) which, in the present case, reads:

∂ t ρ + ∂ θ j ρ = 0 , (4.25)
j ρ (t, θ) = ρ(t, θ) F -h sin θ -J sin(θ -ϑ) ρ(t, ϑ) dϑ -k B T ∂ θ ρ(t, θ) . (4.26)
The mean-field behavior of the Shinomoto-Kuramoto model was first studied in [START_REF] Shinomoto | Phase transitions in active rotator systems[END_REF], focusing on long-time behavior. In this work, the authors expanded in Fourier modes the stationary McKean-Vlasov equation (4.25) and numerically integrated the resulting coupled ordinary differential equations. For F = 0, the system relaxes to a stationary solution that is unique for h > 0 and for h = 0 and k B T ≥ J/2, with ρ flat in θ (unmagnetized state) in the latter case. For h = 0 and k B T < J/2 there is a one-parameter family of stationary solutions differing by rotation, with ρ bumped around some value of θ, a well known picture for equilibrium ferromagnets of a magnetized state spontaneously breaking the planar rotation symmetry. This equilibrium case, also known under the name of Brownian mean field model, is studied in detail in [START_REF] Chavanis | The Brownian mean field model[END_REF][START_REF] Chavanis | Thermodynamics of the HMF model with a magnetic field[END_REF][START_REF] Chavanis | Hamiltonian and Brownian systems with long-range interactions: V. Stochastic kinetic equations and theory of fluctuations[END_REF].

For F > 0, a more complicated phase diagram for the McKean-Vlasov equation emerges, however, see the left part of Figure 3. For sufficiently high h or T , the system relaxes to a stationary solution of Eq. (4.25), which for h = 0 and k B T > J/2 has ρ flat in θ, as before. For sufficiently low values of h and T , the long-time behavior is, instead, periodic. For h = 0, the periodic phase sets in for k B T < J/2, as follows from the relation to the F = 0, h = 0 system mentioned before. The periodic and stationary regions are separated by bifurcations. The rightmost line (blue dots) is a Hopf bifurcation, while the upper line, a saddle-node one. The two bifurcations meet forming a Takens-Bogdanov bifurcation. The careful analysis of bifurcations occurring in this model has been performed in [START_REF] Sakaguchi | Phase transitions and their bifurcation analysis in a large population of active rotators with mean-field coupling[END_REF] and is confirmed here. In particular, a tiny region where the system is bistable is found around the Takens-Bogdanov bifurcation, see the right part of Figure 3. Here the McKean-Vlasov equation admits two stable stationary solutions.

A number of analytical results can be obtained. In particular, we show below that all the stationary solutions (stable and unstable) can be studied analytically. Moreover, analyzing their stability we can trace the bifurcation curves. On the other hand, we were not able to find a closed form for the periodic solutions except for the trivial cases where h = 0 or T = 0.

In Sec. 4.3.1 below, we consider the case where the dynamics respects the detailed balance (F = 0) or trivially breaks it (h = 0). Then, in 4.3.2, we list all the stationary solutions for generic values of the parameters and describe how their stability may be analyzed. Finally, we discuss the special case where the particles do not interact (J = 0), and the singular situation of zero temperature (T = 0) in Secs. 4.3.3 and 4.3.4, respectively.

Equilibrium dynamics (F = 0 or h = 0)

We analyze in this paragraph the long-time behavior of the Shinomoto-Kuramoto model for F = 0 or h = 0. We refer the reader to [START_REF] Chavanis | Thermodynamics of the HMF model with a magnetic field[END_REF] for a more detailed discussion on the case F = 0.

Let us start with the case F = 0, J ≥ 0 and T > 0. Here, the N -body system (4.24) with finite N respects the detailed balance with respect to the invariant measure given by the Boltzmann-Gibbs distribution

f N (θ 1 , . . . , θ N ) = 1 Z exp 1 k B T h N n=1 cos θ n - J 2N N m,n=1 (1 -cos(θ n -θ m )) (4.27)
where Z is the canonical partition function. The system is ergodic and the mean of the empirical density converges to the one in the Gibbs measure that may be easily calculated. Indeed, applying the the Hubbard-Stratonovich transformation to Eq. (4.27), we get the identity

f N (θ 1 , . . . , θ N ) = N e -N J 2k B T 2πJ k B T Z e 1 k B T (mx+h) N n=1 cos θn+my N n=1 sin θn -N 2J (m 2 x +m 2 y ) dm x dm y . (4.28)
The expectation of the empirical density ρ N (θ) in the Gibbs stationary state is equal to the integral of f N (θ, θ 2 , . . . , θ N ) over θ 2 , . . . , θ N that gives

E ρ N (x) = (2π) N -2 N e -N J 2k B T J k B T Z e 1 k B T (mx+h) cos θ+my sin θ -N 2J (m 2 x +m 2 y ) I 0 m(h) k B T N -1 dm x dm y , (4.29)
where m(h) = (m x + h) 2 + m 2 y and

I 0 z 2 1 + z 2 2 = 1 2π
2π 0 e z1 cos θ+z2 sin θ dθ (4.30)

is the Bessel functions of the first kind. From Eq. (4.29), we can obtain the equilibrium stationary density in the N → ∞ limit by the saddle point calculation:

ρ eq inv (θ) = lim N →∞ E ρ N (θ) = e 1 k B T (mx+h) cos θ+my sin θ 2πI 0 m(h) k B T , (4.31)
where (m x , m y ) minimizes

f (m x , m y ) = m 2 x + m 2 y 2Jk B T -ln I 0 m(h) k B T . (4.32)
The corresponding stationarity equations are

m x J = m x + h m(h) I 1 m(h) k B T I 0 m(h) k B T , m y J = m y m(h) I 1 m(h) k B T I 0 m(h) k B T (4.33)
with I 1 = I 0 . They may be rewritten as the self-consistency equations

m x = J 2π 0 cos θ ρ eq inv (θ) dθ , m y = J 2π 0 sin θ ρ eq inv (θ) dθ , (4.34)
so that (m x , m y ) has the interpretation of the magnetization vector (in units of J).

For h > 0, the stationarity equations (4.33) imply that m y = 0 and m x > 0 solves the equation

m x J = I 1 mx+h k B T I 0 mx+h k B T (4.35)
which has a unique solution. In the limit h → 0, one recovers the 2 nd -order phase transition (a pitchfork bifurcation) located at k B T c = J/2. For higher values of T , one has ρ eq inv = 1 2π and the magnetization vanishes (i.e. m x = 0, m y = 0) while for T < T c the stationary state is spontaneously magnetized (m x > 0, m y = 0). Taking h = 0 directly, any rotation of the low temperature solution in θ, with the corresponding rotation of the magnetization vector (m x , m y ), provides a solution of the saddle point equations which minimizes (4.32), whereas m x = 0, m y = 0 corresponding to the flat density gives the maximum of (4.32) instead of the minimum. The same limiting densities will be obtained as the stationary solutions of the McKean-Vlasov equation for F = 0, see below.

Let us now consider the second case, where F, J, T > 0 and h = 0. Strictly speaking, the dynamics does not respect here the detailed balance. However, it can be recast as an equilibrium dynamics performing the change of variables θ n = θ n + F t, which corresponds to sitting on the comoving frame with angular velocity -F . The empirical density in this case can thus be obtained from the equilibrium results. Indicating by ρ eq N the empirical density for F = 0 and given values of T, J and by ρ F N the empirical density for the same values of T and J but with F = 0, we have ρ F N (t, θ) = ρ eq N (t, θ -F t). We conclude that for T > T c , in the limit of long times and large N , the expectation of ρ F N (t, θ) becomes stationary and flat, while for T < T c it becomes periodic. The pitchfork bifurcation at equilibrium is thus modified to a Hopf bifurcation.

Stationary states for generic parameters

We now consider generic values of the parameter h, T, J, F with T > 0. To find stationary densities ρ inv at N = ∞, we consider the McKean-Vlasov equation (4.25) in the stationary form, imposing ∂ t ρ inv = 0. As the Shinomoto-Kuramoto model is one-dimensional, this is equivalent to ask that the mean-field current j ρ given by Eq. (4.26) be a constant, that we shall denote c, for ρ = ρ inv . We infer that for the stationary densities,

j ρinv (θ) = [F -(m x + h) sin θ + m y cos θ] ρ inv (θ) -k B T ∂ θ ρ inv (θ) = c , (4.36)
where m x and m y are given by the equations

m x = J 2π 0 cos θ ρ inv (θ) dθ , m y = J 2π 0 sin θ ρ inv (θ) dθ , (4.37)
so that (m x , m y ) is again the magnetization vector. As the current is constant, j ρinv (θ) = j ρinv (θ + θ 0 ) for any θ 0 implying that

j ρinv (θ) = {F -[(m x + h) cos θ 0 + m y sin θ 0 ] sin θ + [m y cos θ 0 -(m x + h) sin θ 0 ] cos θ} ρ inv (θ + θ 0 ) -k B T ∂ θ ρ inv (θ + θ 0 ) = c . (4.38)
We can now choose θ 0 in such a way that

m y cos θ 0 -(m x + h) sin θ 0 = 0 , (m x + h) cos θ 0 + m y sin θ 0 = y ≥ 0 , (4.39)
so that Eq. (4.38) becomes

j ρinv (θ) = (F -y sin θ) ρ inv (θ + θ 0 ) -k B T ∂ θ ρ inv (θ + θ 0 ) = c . (4.40)
For any y, the solution to this equation can be written as

ρ inv (θ + θ 0 ) = Z -1 e 1 k B T (F θ+y cos θ) θ+2π θ e -1 k B T (F ϑ+y cos ϑ) dϑ (4.41)
with Z the normalization factor. Clearly, for Eq. (4.41) to be a stationary solution, the self-consistency conditions (4.37) have to be satisfied together with Eqs. (4.39). Such self-consistency condition can be made more explicit by introducing

f x (y) ≡ 2π 0 cos θ ρ inv (θ + θ 0 ) dθ = y J - h J cos θ 0 , f y (y) ≡ 2π 0 sin θ ρ inv (θ + θ 0 ) dθ = h J sin θ 0 . (4.42)
from which we can eliminate θ 0 to obtain an equation for y

f x (y) - y J 2 + f y (y) 2 = h J 2 . (4.43)
We have thus showed that, for any T > 0, stationary solutions of the McKean-Vlasov equation associated to the Shinomoto-Kuramoto model (4.25) are given, up to rotation by angle θ 0 , by Eq. (4.41), where y is chosen so that the self-consistency condition (4.43) is satisfied. At the end, angle θ 0 may be found from Eqs. (4.42). The above self-consistency problem can be easily solved numerically. With such procedure, we obtained the curves reported in Fig. 4 for the left hand side of Eq. (4.43) as a function of y. Note that such a function does not depend on h. Two cases are observed. If T > T tr , for any value of h only one value of y satisfies the self-consistency condition (4.43). In this case, whatever the value of h, the McKean-Vlasov equation admits only one stationary solution. For T < T tr , depending on the value of h, one obtains one or three values of y for which the self-consistency is satisfied. Thus, the McKean-Vlasov equation admits one or three stationary solutions. Observe moreover that the maximum and the minimum of the curve defines two values of y where a pair of stationary solutions is created or destroyed. They thus indicate the values of h where saddle-node bifurcations occur. We leave to the reader checking how the self-consistent solutions reduce to the ones obtained in the previous section for the equilibrium case F = 0. Let us just note that in that case, f x (y) = I 1 ( y k B T )/I 0 ( y k B T ) and f y (y) = 0. To finally recover the phase diagram, we must also analyze the stability of the stationary solutions just described. For this, it is enough to look at the linearization of the McKean-Vlasov dynamics around a given ρ inv ,

∂ t δρ = R ρinv δρ(t, •) , (4.44)
R ρinv δρ = -∂ θ δρ(θ) F -h sin θ -J sin(θ -ϑ) ρ inv (ϑ) dϑ (4.45) -ρ inv (θ) J sin(θ -ϑ) δρ(ϑ) dϑ -k B T ∂ θ δρ(θ) .
One should then study the spectra of the linearized Fokker-Planck operator R ρinv . This is possible analytically only in very special case when ρ inv does not depend on θ, which holds for h = 0. We checked the stability of the stationary solutions by passing to the Fourier transformed picture and truncating the resulting system to modes k ≤ K, in which way, R ρinv is reduced to a K × K matrix. It is then a simple numerical task to find the eigenvalues of such a matrix. Only few modes (K ∼ 7) are enough to already obtain very accurate results. The stationary states and their stability are summarized in Fig. 5, from which we reconstruct the phase diagram anticipated in Fig. 3.

We conclude by observing that it is possible to calculate analytically where the shown bifurcation lines end. Indeed, from the equilibrium solution, we know that the Hopf bifurcation crosses the h = 0 axis in T = J/2. Moreover, it is simple to show that for T = 0 the bifurcation occurs at F = h.

Free particles (J = 0)

The stationary solutions for the free particle case (J = 0) can be obtained very easily directly,

ρ inv (θ) = Z -1 e 1 k B T (F θ+h cos θ) θ+2π θ e -1 k B T (F ϑ+h cos ϑ) dϑ , (4.46)
or from Eq. (4.41) since in this case m x = m y = 0 = θ 0 and thus y = h.

Zero temperature

There are two kinds of stationary solutions for T = 0: delta-function-like and smooth solutions. Smooth solutions are physically less relevant because they are linearly unstable in the ferromagnetic model (J > 0) that we consider here. We discuss smooth solutions in Appendix A and consider here only the delta-functionlike ones.

The stationary McKean-Vlasov equation in the form (4.40) for T = 0 is solved by

ρ inv (θ + θ 0 ) = δ(θ -θ 1 ) (4.47)
if θ 1 satisfies F -y sin θ 1 = 0. Clearly, such solutions exist only for y > F . The self-consistency condition (4.42) reduces in this case to the relation

± 1 - F y 2 - y J 2 + F y 2 = h J 2 (4.48)
that has no solutions for y if h < F , one solution if h = F and two solutions for h > F . They are straightforward to understand. Indeed, one may show that at such solutions, F -h sin(θ 0 + θ 1 ) = 0, so that the delta-function stationary states describe a situation where all particles sit in the zero of their drift F -h sin θ, which clearly provides a solution of the equations of motion (4.24) when T = 0. Such solutions exist for all N if and only if h ≥ F . For large N , their stability depends on the sign of h cos(θ 0 + θ 1 ), with the positive one corresponding to stable solutions.

Large deviations for large but finite N

For large but finite N , the dynamics of the empirical density ρ N (t, x) deviates from the mean-field evolution given by the McKean-Vlasov equation (4.23). Formally, ρ N solves the Dean equation (4.12) which is an infinite-dimensional dynamical system perturbed by a weak noise. Below, starting from this equation and employing a functional integral argument, we derive the results obtained rigorously by Dawson and Gartner [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF] that describe the dynamical large deviations of the empirical density for mean-field diffusions. We also formulate the functional Hamilton-Jacobi equation for the quasi-potential describing the asymptotic form of stationary distribution for the empirical densities. Another functional integral argument gives the large deviations asymptotics for the distribution of dynamical fluctuations of the empirical current. A generalization of the Freidlin-Wentzell theory to infinite dimensional dynamical systems whose deterministic part is given by the Fokker-Planck operator with, possibly, non-linear diffusion and drift coefficients is known in the physics literature as the Macroscopic Fluctuation Theory. It has attracted much attention in last years in nonequilibrium statistical mechanics mainly because of its applications to stochastic lattice gases, see [START_REF] Bertini | Macroscopic fluctuation theory[END_REF] for a review. Our results may be viewed as an application of that theory to diffusions with mean-field interactions of the general form (4.1). It will be also straightforward to specify the results that follow to the case of the Shinomoto-Kuramoto model.

Dynamical large deviations for the empirical density

Let us fix two times t i < t f and consider the probability that the empirical density ρ N (t, x) is arbitrarily close to a given trajectory ρ(t, x) for t i ≤ t ≤ t f . In fact we shall be interested only in the large deviations where such probability is described by the rate function A[ρ(•, •)] as in Eq. (2.7) where trajectories x(t) become those in the infinite-dimensional space of densities equipped with an appropriate norm and the limit → 0 is replaced by N → ∞. Informally, We may find the form of A[ρ] by the Martin-Siggia-Rose functional integral argument [START_REF] Martin | Statistical dynamics of classical systems[END_REF]. A similar derivation to the one presented below may be found in [START_REF] Jouvet | Quantum aspects of classical and statistical fields[END_REF]. Assuming the Dean equation, the distribution function P [ρ] is that of its random solutions and may be written in the form

A[ρ(•, •)] = -lim N →∞ 1 N ln P [ρ(•, •)] , ( 4
P [ρ] = E δ ∂ t ρ + ∇ • j ρ + 2k B T N ∇ • ( √ ρ ξ) det δ ∂tρ + ∇•jρ + 2k B T N ∇•( √ ρ ξ) δρ (4.50)
if we fix the initial value ρ(t i , x) ≡ ρ i (x). The Jacobian factor can be dropped, as it will not contribute to the large deviations. Expressing now the delta functional as an oscillatory functional integral in the imaginary directions over fields u(t, x) such that u(t, x)dx = 0, we obtain

P [ρ] E exp N 2k B T t f ti dt ∂ t ρ + ∇ • j ρ + 2k B T N ∇ • ( √ ρ ξ) u dx Du (4.51) = exp N 2k B T t f ti dt (∂ t ρ + ∇ • j ρ ) u + 1 2 ρ (∇u) 2 dx Du , (4.52)
where the last equality was obtained by calculating the Gaussian expectation over the white noise ξ(t, x). The rate function A[ρ] can now be extracted by the saddle point argument:

A[ρ] = -min u 1 2k B T t f ti dt (∂ t ρ + ∇ • j ρ ) u + 1 2 ρ (∇u) 2 dx , (4.53)
where the minimum is taken over all functions u(t, x) with t i ≤ t ≤ t f and spatial mean zero. The minimum is easy to calculate resulting in the formula

A[ρ] = 1 4k B T t f ti dt (∂ t ρ + ∇ • j ρ ) (t, x) (-∇ • ρ(t, •)∇) -1 (x, y) (∂ t ρ + ∇ • j ρ ) (t, y) dx dy , (4.54)
where (-∇•ρ(t, •)∇) -1 (x, y) is the kernel of the inverse of the operator -∇•ρ(t, •)∇ in the action on functions of zero mean. Eq. (4.53) may be also rewritten in the form

A[ρ] = min u t f ti dt (∂ t ρ + ∇ • j ρ ) u dx 2 4k B T t f ti dt ρ(∇u) 2 dx (4.55)
which was rigorously derived for the large deviations rate function A[ρ] by Dawson and Gartner in [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF]. Indeed, Eq. (4.55) results from (4.53) upon substituting u → λu and minimizing over λ ∈ R. On the other hand, expression (4.54) is completely analogous to the Freidlin-Wentzell action (2.8) as it may be rewritten as

A[ρ] = 1 4 t f ti dt (∂ t ρ -K[ρ]) (t, x) Q -1 [ρ(t, •)](x, y) (∂ t ρ -K[ρ]) (t, y) dx dy , (4.56)
where K[ρ] is the drift and Q[ρ] is the noise covariance of the Dean equation that are given by Eqs. (4. [START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF]) and (4.22), respectively.

In our arguments, we ignored the fact that the empirical density ρ N (t, x) defines a genuine stochastic process only after integrating it against a spatial test function. The large deviations for such stochastic processes will, however, be governed by rate functions that are contractions of A[ρ] obtained by minimizing it with imposed integrals against the test functions.

Quasi-potential and Hamilton-Jacobi equation

The functional Fokker-Planck equation associated to the Dean equation (4.12) describes the evolution of the probability distribution function P t [ρ] to observe a density profile ρ(x) at time t and takes the form

∂ t P = L † P , (4.57)
where L + is the adjoint of the generator (4.16) calculated with the rule δ δρ † = -δ δρ . Analogously to the case of finite-dimensional systems, we define the quasi-potential as the functional

F[ρ] = -lim N →∞ 1 N ln P ∞ [ρ] , (4.58)
where P ∞ denotes the stationary solution of the above Fokker-Planck equation. Proceeding formally, all the structure of Freidlin-Wentzell theory generalizes to the present case. We are thus very brief in what follows, as the derivation of the statements below is very similar to the one for finite dimensional systems, albeit only formal here. As in the case of finite dimensional systems, we only consider cases where the attractor of the deterministic evolution ∂ t ρ = K[ρ] is a fixed point ρ inv . The quasi-potential with respect to ρ inv can be obtained from the minimization problem

F[ρ] = min { ρ(t,x) | ρ(-∞,x)= ρinv(x) , ρ(0,x)=ρ(x)} A[ρ] . (4.59)
Alternatively, one can try to solve the Hamilton-Jacobi equation

δF δρ(x) K[ρ](x) dx + δF δρ(x) Q[ρ](x, y) δF δρ(y) dx dy = 0 (4.60)
that can be obtained by inserting Ansatz P ∞ [ρ] ∼ e -N F [ρ] into the functional Fokker-Planck equation (4.57). Equivalently, we can obtain it from the Hamilton-Jacobi equation for finite-dimensional systems (2.24). Finally, with the same argument as in Sec. 2.3, it is simple to show that the minimization in Eq. (4.59) is achieved over the solution of the fluctuation or instanton dynamics

∂ t ρ = K r [ρ] , K r [ρ](x) = K[ρ](x) + 2 Q[ρ](x, y) dy δF δρ(y) = K[ρ](x) + 2k B T (-∇ρ(x) ∇) δF δρ(x) . (4.61)

Dynamical large deviations for the empirical current

Empirical current (4.3) is a more general quantity than empirical density (4.2). Indeed, ρ N and j N satisfy the continuity equation (4.4). Given the empirical current j N in a time interval [t i , t f ] and the initial condition for ρ N (t i , x) = ρ i (x), we can reconstruct the empirical density in the same time interval as ρ N (x, t) = ρ i (x) -t ti ∇ • j N (x, s) ds. The converse is however not true, as two empirical currents that differ by a divergent-free quantity give rise to the same empirical density.

Let us consider the probability distribution function P [j(•, •)] of empirical current j N (t, x) in the time interval t i ≤ t ≤ t f for fixed initial condition for empirical density. The corresponding large deviations rate function will be denoted by A c :

A c [j(•, •)] = -lim N →∞ 1 N ln P[j(•, •)] . (4.62)
It may be found using again the Martin-Siggia-Rose functional integral formalism:

P[j] E δ j -j ρ - 2k B T N ρ ξ (4.63) = E exp - N 2k B T t f ti dt j -j ρ - 2k B T N ρ ξ • A DA = (4.64) = exp N 2k B T t f ti dt -(j -j ρ ) • A + 1 2 ρ A 2 dx DA , (4.65)
where A is vector valued, and evaluating the last functional integral with the saddle point method. This gives:

A c [j] = 1 4k B T t f ti dt (j -j ρ ) 2 ρ dx , (4.66)
where

ρ(t, x) = ρ i (x) - t 0 ∇ • j(x, s) ds.
Eq. (4.66) is known in the literature as the fundamental formula of Macroscopic Fluctuation Theory. It is often viewed as giving the rate function for the joint probability of observing a trajectory of the empirical density and of the empirical current arbitrarily close to ρ(x, t) and to j(x, t), provided that the latter satisfy the continuity equation, and equal to infinity otherwise. This just expresses the fact that density trajectories are completely determined once we chose the current trajectory and the initial condition for the density.

Again, we ignored the fact that these are the integrals of the empirical currents against test functions, now both over time and space, that make sense as random variables. The large deviations for such random variables will, however, be governed by the rate functions obtained by contractions of A c [j] that minimize it with constraints imposed for the space-time integrals of j.

Let us conclude by observing that, to the best of our knowledge, large deviations for currents in diffusions with mean-field interactions have not been discussed in the mathematical literature. We will devote a future publication to the investigation of current fluctuations in the Shinomoto-Kuramoto model.

Perturbative calculation of the quasi-potential

In this final section, we discuss the perturbative calculation of the quasi-potential for the diffusions with mean-field interaction. In Sec. 3, we developed a perturbative scheme to calculate the quasi-potential for finite dimensional systems. The first objective is then to translate that perturbative scheme to the infinitedimensional setting described by the Dean equation (4.18), which we do in Sec. 4.5.1.

It is possible to obtain explicit results in two cases: close to the free-particle dynamics J = 0, see Sec. 4.5.2, and for the Taylor expansion of the quasi-potential around stationary solutions of the McKean-Vlasov equation, see Sec. 4.5.5. We shall see that in these cases the perturbative expansion of the quasipotential reduces to solving partial differential equations instead of functional differential equations.

For the Shinomoto-Kuramoto model, in the case of perturbations close to the free-particle dynamics J = 0, we present explicit results at the 1 st order in J, see Sec. 4.5.3. Interestingly, the quasi-potential that is a local functional of ρ for the unperturbed J = 0 case, is shown to become non-local already at the 1 st order in J. The resulting analytical expression is evaluated with a simple numerical scheme and we also compute the rate function for the fluctuations of single-particle observables such as the magnetization. Moreover, we discuss how the numerical scheme can be generalized to higher orders stressing that this does not increase the computational complexity.

We also discuss the Taylor expansion of the quasi-potential around the fixed points of the McKean-Vlasov dynamics. It would be possible to obtain explicit results also in this case. We detail how an algorithm can be designed for this purpose in Appendix B. We did not, however, perform the corresponding calculations, leaving them to future investigations.

Although the perturbative techniques developed in Sec. 3 in the context of finite-dimensional systems are easily transposable to the infinite-dimensional setup discussed here, we are unable to say anything about the nature of the resulting perturbative expansions (are they convergent? asymptotic?) as, to the best of our knowledges, the techniques used in finite dimensions to settle such questions do not extend in a Banach space setup.

Perturbative schemes in infinite dimensional setting

We generalize here the perturbative schemes for calculating the quasi-potential, developed in Sec. 3, to the case of infinite dimensional systems at hand. This can be done very easily either by starting again from the Hamilton-Jacobi equation, now in the infinite dimensional version (4.60), or by formally taking the limit of infinite dimensions in the expressions of Sec. 3. Such a formal limit transforms derivatives into functional derivatives and finite-dimensional scalar products into L 2 ones.

Both the expansion centered on the attractor ρ λ inv of the perturbed system (a stable fixed point of the McKean-Vlasov dynamics) and the direct one can be easily obtained. We only consider here the second one, as it will be used in the following. We denote the direct expansion of the quasi-potential as

F λ [ρ] = n λ n F (n) [ρ] , (4.67)
dropping the hats of Sec. 3.2, and analogously for

K λ [ρ] and Q λ [ρ].
With the procedures outlined above, the hierarchy (3.21) and (3.22) is now replaced in the infinite dimensional setting by

δF (0) δρ(x) K (0) [ρ](x) + Q (0) [ρ](x, y) δF (0) δρ(y) dy dx = 0 for n = 0 , (4.68)
δF (n) δρ(x) K (0) r [ρ](x) dx = S (n) [F (0) , . . . , F (n-1) ] for n = 0 , (4.69)
where

K (0) r
is the drift of the fluctuation dynamics for the unperturbed problem:

K (0) r [ρ] = K (0) [ρ] + 2Q (0) [ρ] δF (0) δρ (4.70)
and S (n) is given by

S (n) [F (0) , . . . , F (n-1) ] = - n-1 k=1 δF (n-k) δρ(x) K (k) [ρ](x) + Q (0) [ρ](x, y) δF (k) δρ(y) dy dx + n-k l=0 δF (n-k-l) δρ(x) Q (k) [ρ](x, y) δF (l) δρ(y) dx dy - δF (0) δρ(x) K (n) [ρ](x) + Q (n) [ρ](x, y) δF (0) δρ(y) dy dx . (4.71)
As it will be clear, there is a full analogy with finite-dimensional systems and we refer the reader to Sec. 3 for the discussion on the perturbative schemes. In particular, we recall that the solution of these equations obtained with the methods of characteristics is unique and an explicit expression may be written in terms of the solution for the 0 th -order fluctuation dynamics. In the actual infinite dimensional setting, this solution is given by

F (n) [ρ] = C (n) + 0 -∞ S (n) [F (0) , . . . , F (n-1) ][ ρ(t, •)] dt , (4.72)
where ρ(t, x) is the solution of the fluctuation dynamics

∂ t ρ = K (0) r [ρ] (4.73)
starting at t = -∞ at the stable fixed point ρ 0 inv ≡ ρ inv of the unperturbed McKean-Vlasov dynamics and satisfying the final condition ρ(0, x) = ρ(x), compare to Eq. (3.27). It should be clear from the discussion of Sec. 3 that the convergence of the above integral in this infinite-dimensional setting is assured once the unperturbed fluctuation dynamics (4.73) linearized around ρ inv escapes fast enough from ρ inv . This happens, for example, in the typical case in which its generator has a spectral gap. We finally recall from Sec. 3.2 that the constants C (n) may be iteratively fixed but do not enter the expression for S (n) [F (0) , . . . , F (n-1) ] so are largely irrelevant and may be adjusted conveniently.

Expansion around the free particles dynamics (J = 0)

We now consider the perturbative expansion of the quasi-potential F around the independent particle dynamics, choosing the perturbative parameter λ = J. In this case,

K J [ρ](x) = -∇ • ρ(x) b(x) -J (∇V )(x -y) ρ(y) dy -k B T ∇ρ(x) (4.74)
and

Q J [ρ](x, y) = k B T ∇ x • ∇ y ρ(x) δ(x -y) . (4.75)
For J = 0, particles do not interact. Even if for J = 0 the system breaks the detailed balance, the quasipotential F (0) is known here as its explicit form follows from Sanov's theorem:

F (0) [ρ] = ρ(x) ln ρ(x) ρ inv (x) -ρ(x) + ρ inv (x) dx , (4.76)
where ρ inv is the stable stationary solution of McKean-Vlasov's equation which reduces here to the linear Fokker-Planck equation for a single-particle diffusion. Hence ρ inv exists and is unique under simple assumptions about the single-particle drift b(x). In the case of the Shinomoto-Kuramoto model, we have explicitly calculated ρ inv for J = 0, see Eq. (4.46). We observe that, despite the fact that the dynamics breaks in general the detailed balance, the quasi-potential for J = 0 is a local functional of ρ.

As anticipated, it is convenient to perform the direct perturbative expansion, for which we have

K (0) [ρ](x) = ∇ • [ -ρ(x) b(x) + k B T ∇ρ(x)] , (4.77)
K (1) [ρ](x) = ∇ • ρ(x) (∇V )(x -y) ρ(y) dy , (4.78)

K (n) [ρ](x) = 0 for n ≥ 2 (4.79)
and

Q (0) [ρ](x, y) = k B T ∇ x • ∇ y ρ(x) δ(x -y) , (4.80)
Q (n) [ρ](x, y) = 0 for n ≥ 1 . (4.81)
It should be clear now why, from a practical point of view, it is simpler to deal here with the direct expansion than with the expansion centered on the attractor of the perturbed dynamics. Indeed, in the former case, almost all K (n) and Q (n) are zero. This would not be true in the attractor-centered expansion because the attractor of the perturbed dynamics depends on J.

The quasi-potential at the 0 th order F (0) is given by Eq. (4.76). We thus have

δF (0) δρ(x) = ln ρ(x) ρ inv (x) . (4.82)
The 0 th order fluctuation dynamics takes the form

∂ t ρ = K (0) r [ρ],
where

K (0) r [ρ] = -∇ • (ρ b) + 2k B T ∇ • [ρ ∇ ln ρ inv ] -k B T ∇ 2 ρ ≡ K (0) r ρ . (4.83)
Note that K (0) r is a linear operator. When detailed balance is respected (i.e. b = -∇U for some potential U ), one can easily check that

K (0) r [ρ] = -∇ • (ρ∇U ) -k B T ∇ 2 ρ = -K (0) [ρ] , (4.84)
where we have used that ρ inv = (1/Z) exp(-U/k B T ) in this case. The above relation just reflects the fact that the fluctuation dynamics is the time-reversal of the relaxation dynamics for equilibrium problems.

Let us specify the hierarchy (4.69) to the present situation. The left hand side is clearly unchanged, except that K (0) r [ρ] takes the particular form (4.84), while the right hand side becomes equal to S (1) [F (0) ] = -δF (0) δρ(x) K (1) [ρ](x) dx (4.85)

for n = 1, and to

S (n) [F (0) , . . . , F (n-1) ] = - δF (n-1) δρ(x) K (1) [ρ](x) dx - n-1 k=1 δF (n-k) δρ(x) Q (0) [ρ](x, y) δF (k)
δρ(y) dx dy (4.86)

for n > 1. A very important point is that, in this case, the solutions F (n) [ρ] of the hierarchy are for n ≥ 1, homogeneous polynomials of degree (n + 1) (up to constants),

F (n) [ρ] = C (n) + 1 (n + 1)! φ (n) (x 0 , . . . , x n ) ρ(x 0 ) • • • ρ(x n ) dx 0 • • • dx n , (4.87)
where the kernels φ (n) are symmetric in (n + 1) variables and the choice of constants C (n) is essentially irrelevant. Using Eq. (4.87), we infer that the left hand side of the hierarchy (4.69) can be written as

δF (n) δρ(x) K (0) r [ρ](x) dx = 1 n! K (0) † r,x0 φ (n) (x 0 , . . . , x n ) ρ(x 0 ) . . . ρ(x n ) dx 0 . . . dx n = 1 (n + 1)! K (0) † r,n+1 φ (n) (x 0 , . . . , x n ) ρ(x 0 ) . . . ρ(x n ) dx 0 . . . dx n . (4.88)
In the above expressions, K (0) † r,x0 denotes, in a slightly abusive notation, the adjoint operator to K (0) r ,

K (0) † r = b -2k B T (∇ ln ρ inv ) • ∇ x -k B T ∇ 2 x , (4.89)
see Eq. (4.83), in the action on a function of variable x 0 . Similarly, K

† r,n+1 denotes the operator

K (0) † r,n+1 = n m=0 K (0) † r,xm (4.90)
acting on functions of n-tuples (x 0 , . . . , x n ). Note that the differential operator K (0) † r (x) is the generator of a diffusion process with drift -b(x) + 2k B T (∇ ln ρ inv ) which is the time-reversal of the original single particle diffusion. This operator has a one-dimensional kernel composed of constants and a one-dimensional cokernel composed of functions proportional to ρ inv . For the same reasons, the operator K (0) † r,n+1 has also a one dimensional kernel composed of constants and a one dimensional cokernel composed of functions proportional to ρ inv (x 0 ) • • • ρ inv (x n ). We shall use those properties below.

In order to compute the right hand side of the hierarchy, we shall treat separately the cases with n = 1 and with n > 1. For n = 1, we have

S (1) [F (0) ] = - (∇ 2 V )(x -y) + 1 2 (∇V )(x -y) • ∇ ln ρ inv (x) -∇ ln ρ inv (y) ρ(x) ρ(y) dx dy , (4.91)
where we have made the integrand symmetric under the exchange of x and y. Comparing Eqs. (4.88) and (4.91), we obtain a differential equation for φ (1) ,

K (0) † r,2 φ (1) (x, y) = -2(∇ 2 V )(x -y) -(∇V )(x -y) • ∇ ln ρ inv (x) -∇ ln ρ inv (y) . (4.92)
For n > 1, the right hand side of the hierarchy can be written in terms of the kernels φ (k) (x 0 , . . . , x k ) as S (n) [F (1) , . . . ,

F (n-1) ] = 1 n! (∇ x0 V )(x 0 -x n ) • (∇ x0 φ (n-1) )(x 0 , . . . , x n-1 ) ρ(x 0 ) • • • ρ(x n ) dx 0 • • • dx n - n-1 k=1 k B T k!(n -k)! (∇ x k φ (k) )(x 0 , . . . , x k ) • (∇ x k φ (n-k) )(x k , . . . , x n ) ρ(x 0 ) • • • ρ(x n ) dx 0 • • • dx n . (4.93)
Then, for any n > 1, we obtain the differential equations

K (0) † r,n+1 φ (n) (x 0 , . . . , x n ) = (n + 1)! Sym 1 n! (∇ x0 V )(x 0 -x n ) • ∇ x0 φ (n-1) (x 0 , . . . , x n-1 ) -k B T n-1 k=1 1 k!(n-k)! (∇ x k φ (k) )(x 0 , . . . , x k ) • (∇ x k φ (n-k) )(x k , . . . , x n ) , (4.94)
where Sym [ • ] stands for the symmetrization of the argument with respect to variables x 0 , . . . , x n . Eqs. (4.92) and (4.94) may be solved iteratively for the kernels φ (n) (x 0 , . . . , x n ) provided that their right hand sides are orthogonal to the one-dimensional cokernels of operators K (0) † r,n+1 spanned by the product functions ρ inv (x 0 ) • • • ρ inv (x n ). These are the solvability conditions S (n) [ρ inv ] = 0 that were discussed in Sec. 3.2 in the finite-dimensional context, see Eq. (3.24). Such conditions are easy to check in the lower orders but are difficult to prove order by order. They are, however, implied by the existence of the perturbative expansion centered at the attractors, as discussed in Sec. 3.2. Observe finally that φ (n) are defined by the above equations only up to constants that are in the kernel of K (0) † r,n+1 . This ambiguity just leads to shifts in constants C (n) appearing in Eq. (4.87) which are not relevant (remember that densities ρ are normalized).

We have greatly simplified the problem of calculating the quasi-potential perturbatively around the free particles dynamics. Instead of solving the functional differential equations (4.69) we have to solve the partial differential equations for the kernels φ (n) defined by Eq. (4.87). These differential equations are (4.92) for the 1 st order contribution and (4.94) for the higher orders. Solving them is a rather simple numerical problem. In the next section, we discuss the results obtained in the case of the Shinomoto-Kuramoto model. Let us now specify the discussion to the case of the Shinomoto-Kuramoto model introduced in Sec. 4.3 and describe some explicit results. In this case, Eq. (4.92) for the φ (1) reduces to the relation

K (0) † r,2 φ (1) (θ, ϑ) = S (1) (θ, ϑ), (4.95)
where

S (1) (θ, ϑ) = -2 cos(θ -ϑ) -sin(θ -ϑ) • [∂ θ ln ρ inv (θ) -∂ ϑ ln ρ inv (ϑ)] , (4.96)
and

K (0) † r = [F -h sin θ -2k B T (∂ θ ln ρ inv )] ∂ θ -k B T ∂ 2 θ . (4.97)
We observe that identity (4.95) is a Lyapunov equation and several techniques can be employed to solve it, see for example [START_REF] Kitagawa | An algorithm for solving the matrix equation X = F XF T +S[END_REF][START_REF] Bouchet | Kinetic theory of jet dynamics in the stochastic barotropic and 2d Navier-Stokes equations[END_REF][START_REF] Nardini | Kinetic theory of nonequilibrium stochastic long-range systems: phase transition and bistability[END_REF]. The one we have chosen is to perform an expansion on the eigenfunctions of operators K is not self-adjoint with respect to the L 2 scalar product, these eigenfunctions are not connected by complex conjugation but we may assume that the corresponding eigenvalues are:

K (0) r u k = α k u k and K (0) † r v k = α k v k (4.98)
where α k denotes the complex conjugate of α k . K

r is a Fokker-Planck operator. Zero is its simple eigenvalue and ρ inv is the corresponding eigenfunction. We choose it to be equal to u 1 . Other eigenvalues of K

S

(1) kl

α k + α l u k (θ) u l (ϑ) , (4.100)
where

S (1) kl = v k (θ) v l (ϑ) S (1) (θ, ϑ) dθ dϑ (4.101)
(note that α k + α l = 0 for (k, l) = (1, 1)). One has S 11 = 0 and we have chosen φ (1) to be orthogonal to the kernel of K (0) † r,2 composed of the constant functions. The calculation of constant C (1) of Eq. ( 4.87) will be discussed afterwards.

Eq. (4.100) permits to obtain numerically the quasi-potential at the 1 st order in J. One first looks for an approximation of the eigenfunctions and eigenvalues of K (0) r and of K (0) † r by expanding Eqs. (4.98) in the Fourier modes and truncating the hierarchy in order to deal with matrices. The calculation of φ (1) through Eq. (4.100) is then easily performed. We checked that very few Fourier modes have to be retained [START_REF] Dawson | Critical dynamics and fluctuations for a mean-field model of cooperative behavior[END_REF] to obtain an excellent approximation of eigenfunctions and eigenvalues. Even less eigenfunctions ( 5) need to be employed in the calculation in order to obtain quite accurate results.

Although the scheme proposed here is a bit more involved than other methods, such as a direct Fourier expansion of Eq. (4.95), it is much more powerful than the latter. Indeed, in the method proposed here, we only need to diagonalize the matrices that approximate operators K (0) r and K (0) † r that act on the space of functions of one periodic variable. Instead, attempting to directly solve Eq. (4.95) by expanding on Fourier modes results in diagonalizing the operator K (0) † r,2 acting on the space of functions of two variables. Even more important is the fact that the method proposed here is fully generalizable, without increasing the computational complexity to obtain higher perturbative orders (encoded in kernels φ (n) ) for the quasi-potential. In contrast, in the direct Fourier expansion, one needs to diagonalize matrices of dimension (k max ) n where k max is the number of retained Fourier modes, making the problem practically intractable already for small n.

We report the results for the 1 st order correction φ (1) to the quasi-potential in Fig. 6 for some typical choice of parameters for which the McKean-Vlasov equation has a single stationary stable solution (namely F = 0.2, T = 0.3, h = 0.5). A rather non-trivial result emerges. As a check of the accuracy of the perturbative expansion, we also compared the exact stationary state of the system ρ J inv for J > 0 to the one, ρ inv,1 , obtained by imposing that the functional derivative of F (0) + JF (1) + γ ρ(θ) dθ -1 (4.102)

vanishes. This condition implies, with the use of (4.82) and (4.87), that

ρ inv,1 (θ) = 1 Z ρ inv (θ) exp -J ρ inv,1 (ϑ) φ (1) (θ, ϑ) dϑ , (4.103)
where Z = e γ fixes the normalization of ρ inv,1 . Recall that the true mean-field stationary density ρ J inv minimizes the quasi-potential F J [ρ] with the value at the minimum equal to zero. Eq. (4.103) may be very easily solved numerically with an iterative scheme, once φ (1) is known; we have verified that this procedure converges after few iterations. In Fig. 7, we also compare ρ inv,1 with the exact result obtained from Eq. (4.41), which shows that already at the 1 st order the stationary state for the system with J > 0 is much better approximated by ρ inv,1 than by the stationary state at J = 0. As for the constant C (1) from Eq. (4.87) with n = 1, it will be convenient to fix it so that the quasi-potential calculated to the 1 st order F (0) + JF (1) has the minimal value equal to zero, as does the complete quasi-potential. This is achieved by setting

C (1) = -J -1 F (0) [ρ inv,1 ] -F (1) [ρ inv,1 ] , (4.104)
where on the right hand side F (1) is taken homogeneous in ρ (i.e. with C (1) set to zero).

Once the quasi-potential at order J is known, we can also compute the large deviations rate functions for the one-particle observables 1 N N n=1 g(θ n ) where g is a given function. In the following, we consider the particularly relevant examples of the magnetization along x and y axis corresponding, respectively, to g = cos and g = sin. What follows may be straightforwardly generalized to any choice of g. We denote by I x (σ) (resp. I y (σ)) the rate function for the probability of observing a value of magnetization m x ∼ σ (resp. m y ∼ σ). Let us consider I x (the case of I y may be analyzed similarly). To the 1 st order in J, we have

I x (σ) = min ρ F (0) [ρ] + JF (1) [ρ] , (4.105)
where the minimum is taken over all positive functions ρ with unit integral respecting the constraint cos(θ) ρ(θ) dθ = σ. The profile realizing the minimum will be called ρ opt in the following. The minimization problem in Eq. ( 4.105) can be solved introducing two Lagrange multipliers γ 1 and γ 2 associated, respectively, to the total mass and to the magnetization constraints. A simple calculation shows that the minimizing profile satisfies the relation

ρ opt (θ) = 1 Z ρ inv (θ) exp -γ 2 cos θ -J φ (1) (θ, ϑ) ρ opt (ϑ) dϑ , (4.106)
where Z normalizes ρ opt . As for the case of the most probable state, the above self-consistent equation can be solved iteratively. We first fix γ 2 and iteratively solve Eq. (4.106) normalizing the iterated solution to unity at each step. Once the optimal profile has been obtained, we then calculate the corresponding value of m x . As the initial condition we used the optimal profile for J = 0. We have checked that the iterative scheme converges in few steps. The results obtained for I x and I y are plotted in Fig. 8 for the same choice of parameters as those employed in Fig. 7. In the plots, the results obtained at the 1 st order in J are compared with those obtained for J = 0 in the whole range of possible magnetizations. We observe that the 1 st order corrections are significant. Fox example, the probability of fluctuations of m x smaller than the typical value is diminished with respect to the J = 0 case but the probability of very rare fluctuations is instead increased.

We conclude by noting that, as already discussed, it would be simple to extend the calculations of the quasi-potential and of rate functions of observables to higher orders by computing with the method employed in this section the higher kernels φ (n) . We do not pursue, however, this direction here, as our scope was rather to show that the perturbative approach can lead to explicit results than to analyze in details the Shinomoto-Kuramoto model.

Expansion around the equilibrium dynamics (F = 0 or h = 0)

When the drift b(x) may be written as b = -∇U for some U , the quasi-potential can be given explicitly because detailed balance holds. We note that the Dean equation (4.18) corresponding to this case has also been derived in [START_REF] Chavanis | The Brownian mean field model[END_REF][START_REF] Chavanis | Hamiltonian and Brownian systems with long-range interactions: V. Stochastic kinetic equations and theory of fluctuations[END_REF], where it is called stochastic Smoluchowski equation. One has in this case

F[ρ] = 1 k B T ρ(x) U (x) + J 2 V (x -y) ρ(y) dy dx + ρ(x) ln ρ(x) dx . ( 4

.107)

We did not develop the perturbative expansion close to the detailed balance because obtaining explicit results would be quite complex. Indeed, the equations for the quasi-potential at order n are functional differential equations and not, as in the case of a perturbation close to J = 0, ordinary differential equations. Even though results may be explicitly obtained by a discretization, the problem is not computationally straightforward. be viewed as a particular case of the perturbative expansion of the quasi-potential for a parameter-dependent system. In this setting, the role of the unperturbed quasi-potential is played by the quadratic approximation to F that, consistently, will be denoted in the following by F (0) . Then, once F (0) is known, any higher order correction may, in principle, be calculated. After extending here the discussion of Sec. 3.3 to a general diffusion with mean-field interaction (4.1), we discuss in Appendix B how explicit results could be obtained in a similar way as for the perturbative expansion around J = 0. We would like to calculate the quasi-potential F[ρ] for ρ = (ρ inv + ρ) as a power series in ρ. Note ρ has then to have the vanishing integral. In order to use the same notations as in the finite dimensional setting, see Sec. 3.3, we introduce the λ-dependent system defined by

K λ [ρ] = 1 λ K [ρ inv + λρ] (4.108) Q λ [ρ] = Q [ρ inv + λρ] (4.109) F λ [ρ] = 1 λ 2 F [ρ inv + λρ] . (4.110)
For any n we thus have

K (0) [ρ] = -∇ • [ρ b -Jρ inv (∇V * ρ) -Jρ (∇V * ρ inv )] + k B T ∇ 2 ρ , (4.111)
K (1) [ρ] = J∇ • [ρ (∇V * ρ)] , (4.112)
K (n) [ρ] = 0 for n ≥ 2 . (4.113)
Clearly, K (0) [ρ] = R ρinv ρ, where R ρinv denotes the linearized Fokker-Planck operator. Moreover,

Q (0) [ρ] = -k B T ∇ • ρ inv ∇ , (4.114) Q (1) [ρ] = -k B T ∇ • ρ∇ , (4.115) Q (n) [ρ] = 0 for n ≥ 2 . (4.116)
Recall that the computation of the quadratic order of F corresponds, in the above λ-dependent system, to the calculation of F (0) . Moreover, with these notations the hierarchy of equations to solve in order to obtain the Taylor expansion of the quasi-potential close to ρ inv is given precisely by Eqs. (4.68) and (4.69) with K (n) and Q (n) expressed by the above formulae. We shall search for the solution of this hierarchy in the form of homogeneous polynomials

F (n) [ρ] = 1 (n + 2)! ϕ n (x 0 , . . . , x n+1 ) ρ(x 0 ) • • • ρ(x n+1 ) dx 0 • • • dx n+1 , (4.117)
where ϕ n (x 0 , . . . , x n+1 ) are symmetric kernels on which we shall impose the relations ϕ n (x 0 , . . . , x n+1 ) dx 0 = 0 . (4.118)

As in the other cases, once the quadratic order F (0) is known, the higher orders can be obtained by using the general solution to the hierarchy, see Eq. (4.72). We thus concentrate here only on F (0) . We introduce the operator Φ Φ[ρ](x) = ϕ 0 (x, y) ρ(y) dy (4.119) that will be considered as acting in the space H 0 of functions with vanishing integral and L 2 scalar product. Note that Φ is a symmetric operator. From Eq. (4.68), we obtain the operator identity

ΦR ρinv + R † ρinv Φ = 2k B T Φ(∇ • ρ inv ∇)Φ , (4.120)
where R inv is also viewed as an operator in H 0 . Assuming that Φ is invertible, as it must be from the fact that F (0) is positive definite, we infer that

R ρinv Φ -1 + Φ -1 R † ρinv = 2k B T (∇ • ρ inv ∇) , (4.121)
which is the infinite dimensional analogue of Eq. (2.38). Its solution is given by the relation

Φ -1 = -2k B T ∞ 0 e tRρ inv (∇ • ρ inv ∇) e tR + ρ inv dt , (4.122)
see Eq. (2.37). Similarly to the finite-dimensional case, convergence of the integral is assured if ρ inv a nondegenerate stable stationary solution of the McKean-Vlasov equation, i.e. if the spectrum of R ρinv on the space of functions with vanishing integral in contained in the complex half-plane with negative real part.

Once we know the invertible operator Φ -1 , the function ϕ 0 (x 0 , x 1 ) is extracted as the kernel of its inverse. With an argument analogous to the one used in Sec. 3.4 for the finite dimensional systems, one can show that Eq. (4.122) implies that the covariance of density fluctuations diverges with the mean-field exponent.when approaching a codimension-one bifurcations of the McKean-Vlasov dynamics. We note that the latter result was obtained rigorously in [START_REF] Ben Arous | Méthode de Laplace : Étude variationnelle des fluctuations de diffusions de type "champ moyen[END_REF].

Let us now consider the 0 th -order fluctuation dynamics. We have

K (0) r [ρ] = R inv ρ -2k B T ∇ • ρ inv ∇Φρ = -Φ -1 R † inv Φ ρ ≡ K (0) r ρ . (4.123) K (0) r
is again an operator in H 0 that is invertible and has spectrum in the half-plane with positive imaginary part (it should not be confused with K ). Further details are left to the reader, but in Appendix B, we briefly discuss how ϕ 0 , as well as higher order kernels, could be explicitly calculated numerically, leaving out of this work the explicit numerical implementation of the proposed algorithm.

Conclusions

The main aim of this paper was to discuss a perturbative approach to the calculation of the quasi-potential in parameter dependent stochastic dynamical systems. As we have seen, the Taylor expansion of the quasipotential around an attractor of the deterministic dynamics was also covered by our theory.

The approach developed in the paper may be summarized as it was already done in the introduction. The perturbative expansion breaks the loop connecting the quasi-potential and the instanton dynamics, with one needed to obtain the other. At any perturbative order the quasi-potential can be computed just from the knowledge of the instanton dynamics for the unperturbed problem and the lower order results. Indeed, our approach gives explicit formulae that permit to iteratively calculate any order of the power series expansion of the quasi-potential in the perturbative parameter. Explicit results can be obtained once the instanton dynamics for the unperturbed problem may be analytically or numerically solved.

We have first developed the theory for finite dimensional systems, where the mathematical details can be easily handled precisely. Our strategy was to perturbatively solve the Hamilton-Jacobi equation which, as it is well known [START_REF] Freidlin | Random Perturbations of Dynamical Systems[END_REF], has the quasi-potential as the unique non-trivial solution under the hypothesis that the later is smooth enough. It is also known [START_REF] Day | Some regularity results on the Ventcel-Freidlin quasi-potential function[END_REF] that, at least in a neighborhood of the attractor, this is indeed the case, while further away singularities may occur, see for example [START_REF] Jauslin | Nondifferentiable potentials for nonequilibrium steady states[END_REF][START_REF] Day | Some regularity results on the Ventcel-Freidlin quasi-potential function[END_REF][START_REF] Maier | A scaling theory of bifurcations in the symmetric weak-noise escape problem[END_REF][START_REF] Kamenev | Field theory of non-equilibrium systems[END_REF][START_REF] Graham | Weak-noise limit of Fokker-Planck models and nondifferentiable potentials for dissipative dynamical systems[END_REF][START_REF] Graham | Fluctuations in the steady state[END_REF]. An investigation on how to deal practically with singularities of the quasi-potential is left for the future. We also note that the perturbative study of transition rates between basin of attraction requires a specific approach, as was done for instance in the reference [START_REF] Smelyanskiy | Fluctuations, escape, and nucleation in driven systems: logarithmic susceptibility[END_REF], using Melnikov's method for perturbations of Hamiltonian systems.

In the second part of the paper, we moved our attention to many body systems. In particular, we considered N particles that undergo an overdamped diffusion, interact with mean field conservative forces, and are driven out of equilibrium by an external drift, see Eq. (4.1). In this case it was possible to (formally) derive a fluctuating hydrodynamics, with the noise term proportional to 1/ √ N , that describes in a closed way the evolution of the empirical density of particles. This fluctuating hydrodynamics is known in the literature under the name of the Dean equation [START_REF] Dean | Langevin equation for the density of a system of interacting Langevin processes[END_REF]. In the limit when N → ∞, the empirical density obeys then a deterministic PDE, the McKean-Vlasov equation [START_REF] Mckean | A class of Markov processes associated with nonlinear parabolic equations[END_REF]. This provided a formal but quick way to recover the results on propagation of chaos that appeared long ago in the mathematical literature.

In the case of a specific mean-field system, the Shinomoto-Kuramoto model of coupled rotators, we showed that such an approach can be employed to obtain explicit results. We first discussed MacKean-Vlasov's dynamics describing the behavior of the system in the N → ∞ limit, characterizing analytically or semi-analytically all the stationary solutions of the system and their stability. Already this very simple outof-equilibrium mean-field system displays quite a complex phase diagram with bifurcation lines and several attractors (stationary states as well as limit cycles). Albeit the Shinomoto-Kuramoto model has been studied in literature by numerical techniques, our analytical results characterizing all its stationary states are original.

After discussing the N = ∞ limit, we concentrated on large deviations around it. This was done by studying the Dean equation for N large but finite. Applying formal techniques from field theory (the Martin-Siggia-Rose representation and the WKB approximation), we showed that fluctuations of the empirical density are described by a generalization of the Freidlin-Wentzell theory to infinite dimensional systems. This permitted to recover formally rigorous results that already appeared in mathematical literature [START_REF] Dawson | Large deviations from the Mckean-Vlasov limit for weakly interacting diffusions[END_REF][START_REF] Dawson | Long-time fluctuations of weakly interacting diffusions[END_REF] and to make a connection with the Macroscopic Fluctuation Theory [START_REF] Bertini | Macroscopic fluctuation theory[END_REF].

We subsequently generalized our perturbative approach to the calculation of quasi-potential to the case of fluctuating mean-field hydrodynamics. For the Shinomoto-Kuramoto model, we explicitly computed the quasi-potential close to the uncoupled particle dynamics to the 1 st order in the mean-field coupling strength J and found the corresponding rate function for the probability of fluctuations of single-particle observables such as the magnetization. Our results seem to provide the first explicit calculation of the quasi-potential for diffusions with mean field interaction driven out of equilibrium. Higher orders in J could be also computed without much difficulty. As our aim here was mainly to develop the general theory and to illustrate that it can be employed to obtain explicit results, we have not pursed such calculations further but discussed instead how one could similarly obtain explicit results for the Taylor expansion of the quasi-potential around the stationary states.

The perturbative approach developed in the present paper seems quite general and we expect it to be useful in several other problems. For example, it may be employed in the future to study other long-range interacting systems which are driven out of equilibrium by different mechanisms, such as stochastic forces which are spatially correlated. This setting is natural for systems whose constituents exhibit long-range interactions (such as plasmas or gravitational systems) but are exposed to stochastic external fields (electric for example) mainly acting on a given spatial scale. The typical behavior of this class of system was analyzed with kinetic theory in [START_REF] Nardini | Kinetic theory for non-equilibrium stationary states in long-range interacting systems[END_REF][START_REF] Nardini | Kinetic theory of nonequilibrium stochastic long-range systems: phase transition and bistability[END_REF] and numerical simulations have shown how the phase transitions are modified when departing from the detailed balance [START_REF] Nardini | Kinetic theory of nonequilibrium stochastic long-range systems: phase transition and bistability[END_REF]. The perturbative approach exposed here may give an analytical insight to such problems. This direction is presently pursued by one of the authors.

Similarly, applications of such perturbative methods could be found in the study of large deviations for 2d turbulence problems, which are relevant for climate modelling [START_REF] Bouchet | Kinetic theory of jet dynamics in the stochastic barotropic and 2d Navier-Stokes equations[END_REF][START_REF] Bouchet | Stochastic averaging, large deviations and random transitions for the dynamics of 2d and geostrophic turbulent vortices[END_REF][START_REF] Bouchet | Control and instanton trajectories for random transitions in turbulent flows[END_REF][START_REF] Bouchet | Langevin dynamics, large deviations and instantons for the quasi-geostrophic model and two-dimensional Euler equations[END_REF][START_REF] Laurie | Computation of rare transitions in the barotropic quasi-geostrophic equations[END_REF]. Even though these are quite academic questions [START_REF] Bouchet | Langevin dynamics, large deviations and instantons for the quasi-geostrophic model and two-dimensional Euler equations[END_REF] because realistic models of 2d turbulence and those arising from climate models are far from the perturbative regime, this approach can give valuable physical insight as it is difficult to handle the rare events in realistic systems.

Finally, while large deviations for the empirical density of mean-field interacting diffusions appeared in literature long ago, mathematical literature does not cover fluctuations of the empirical current. The formal approach through the Dean equation presented in this paper clearly permits to go in this direction. Some results on the current fluctuations that we have obtained already, as well as further explicit results on the calculation of the quasi-potential for the Shinomoto-Kuramoto model and their comparison with results obtained from direct numerical simulations are left for a future publication.

A Smooth stationary solutions of the Shinomoto-Kuramoto model at T = 0

In Sec. 4.3.4, we have discussed simple delta-like stationary solutions of the McKean-Vlasov dynamics for the Shinomoto-Kuramoto model at T = 0. They described the particles accumulated at the fixed point of single particle drift. These are however not the only stationary solutions for vanishing temperature and also smooth solutions are present, which, however, are linearly unstable in the ferromagnetic model considered in this paper (J > 0). We briefly discuss such smooth stationary solutions at T = 0 and their stability in this appendix.

For T = 0, Eq. The left hand side of the last equation grows monotonically from 0 at y = 0 to (F/J) 2 + 1 at y = F . Hence there is a unique solution for 0 ≤ y < F if and only if F 2 +J 2 > h 2 . We infer that there is a unique stationary smooth solution at T = 0 when the latter constraint holds and none otherwise.

To examine the stability of such solutions, we examine the eigenfunctions δρ µ (θ + θ 0 ) with vanishing integral of the linearized Fokker-Planck operator R ρinv of (4.44) at T = 0. We may write δρ µ (θ + θ 0 ) = ∂ θ δf µ (θ), where δf µ is periodic on [0, 2π]. The eigenequation takes the form The problem is thus reduced to the calculation of Φ kl . Now, from Eq. (4.122), we can easily compute the matrix elements of Φ -1 in the basis u k . Indeed, from Eq. Note, however, that the matrix (Φ -1 ) kl is not the inverse of Φ kl because the basis formed by u k is not orthonormal. This problem can be handled with simple linear algebra. We introduce the matrix of scalar products

P kl = u k |u l (B.5)
whose inverse will be denoted by (P -1 ) kl . Then, we construct another matrix Once Φ kl is known, it is straightforward to write the kernel ϕ 0 in the real space using Eq. (4.126). We conclude by observing that, once ϕ 0 is known, one could also numerically evaluate the higher order kernels ϕ n of the Taylor expansion by solving Eq. (4.126) using the fact that the basis Φv k is composed of eigenstates of operators K

Figure 1 : 2 ,

 12 Figure 1: Example showing a simple case where the basins of attraction of the relaxation and of the timereversal of the fluctuation dynamics do not coincide. Here, F HJ (x 1 , x 2 ) = -x 2 1 2 + x 4 1 4 + x 2 2 2 , Q = I, G = (∂F HJ /∂x 2 , -∂F HJ /∂x 1 ), where I is the 2 × 2 unit matrix. The dashed blue arrows indicate the direction of the relaxation dynamics ẋ = K(x) = -Q ∇F HJ (x) + G(x) and the continuous red lines the direction of the time-reversal of the fluctuation dynamics ẋ = -K r (x) = -Q ∇F HJ (x) -G(x).

Figure 3 :

 3 Figure 3: Phase diagram obtained with our semi-analytical results describing the long-time behavior of the Shinomoto-Kuramoto model for J = 1 and F = 0.2. We have checked that the phase diagram for other values of the parameters is similar. Our results are in agreement with those first obtained numerically in [74, 73]. Qualitatively, the long-time behavior of the Shinomoto-Kuramoto model is very different for high T and/or h and for low T and h. In the first case, the system is stationary at long times and the empirical density converges to the unique stationary stable solution of the McKean-Vlasov equation. This is true except for a very small region where two stationary stable solutions of the McKean-Vlasov equation are present, represented by the shaded region in the inset. For low T and h, no stationary stable solutions of the McKean-Vlasov equation exists and the empirical density converges to a periodic solution. The two regions are separated by two lines corresponding to the Hopf (dots) and saddle-node (blue line) bifurcations. These two lines merge in a Taken-Bodganov bifurcation. Other stationary but unstable states of the McKean-Vlasov equation exist, and will be fully analyzed in the following.

Figure 4 :

 4 Figure 4: We report here the typical curves that are obtained for the left hand side of the self-consistency condition (4.43) that does not depend on h. Two cases are observed. If T > Ttr (on the right), whatever the value of h, only one value of y satisfies the self-consistency condition and the McKean-Vlasov equation admits only one stationary solution. For T < Ttr (on the left), depending on the value of h, one obtains one or three values of y for which the self-consistency is satisfied. Thus, the McKean-Vlasov equation admits one or three stationary solutions. Moreover, the maximum and the minimum of the curve defines two values of y for which a pair of stationary solutions is created or destroyed corresponding to the values of h where saddle-node bifurcations occur.

Figure 5 :

 5 Figure 5: Stationary states in the mean-field limit of the Shinomoto-Kuramoto model along with their stability. In each region, we report which stationary states are present and whether they are stable or unstable, where the letters A, B, C, D indicate from which self-consistent solution the stationary state is obtained, see Fig. 4.

4. 5 . 3

 53 Expansion around J = 0 : results for the Shinomoto-Kuramoto model

.

  Let us first set the notations. For k = 1, . . . , we denote by u k the eigenfunctions of K (0) r and by v k those of K (0) † r . As K (0) r

  parts. Similarly, we choose v 1 = 1. It corresponds to the unique zero mode of K (0) † r . We can also assume that the eigenfunctions are mutually orthonormal 3 in the following senseu k (θ) v l (θ) dθ = δ kl .(4.99)It is then simple to show that φ(1) (θ, ϑ) = (k,l) =(1,1)

Figure 6 :

 6 Figure 6: On the left: the kernel k B T φ (1) (θ, ϑ) that permits to obtain the first-order correction to the quasipotential of the Shinomoto-Kuramoto model in the perturbative expansion around the free particle dynamics with J = 0. The values of parameters are F = 0.2, T = 0.3, h = 0.5. This figure was obtained by numerically solving Eq. (4.95) as detailed in the text. On the right: the same function but in a contour plot.

Figure 7 :

 7 Figure 7: Stationary state of the Shinomoto-Kuramoto model for J = 0.3 obtained from the perturbative expansion of the quasi-potential (blue continuous curve) compared to the exact result (red dashed dotted curve) given by the Eq. (4.41) and to the stationary state for the system with J = 0 (green dashed curve). The values of parameters are F = 0.2, T = 0.3, h = 0.5 on the left and F = 0.2, T = 0.2, h = 0.15 on the right. The plots show that the 1 st order correction to the stationary state strongly improves the prediction.

4. 5 . 5

 55 Taylor expansion close to a stationary state Let us discuss now the Taylor expansion of the quasi-potential F around a stable stationary solution ρ inv of the McKean-Vlasov equation. As we have seen in Sec. 3.3 for finite dimensional systems, this expansion may

Figure 8 :

 8 Figure 8: Rate functions for the probability of fluctuations of the x (on the left) and y (on the right) component of magnetization. The results of our perturbative analysis to the 1 st order in J (blue continuous lines) are compared with those of the unperturbed model with J = 0 (green dashed lines). The value of parameters used are the same as in Fig. 6 in the upper plots while they are set to F = 0.2, T = 0.2, h = 0.15 in the lower plots.

  considered in Sec.4.5.2). With Ansatz (4.117), the left hand side of Eqs. (4.69) takes now the formδF (n) ϕ n (x 0 , . . . , x n+1 ) ρ(x 0 ) • • • ρ(x n+1 ) dx 0 • • • dx n+1 (4.124)in the notation of (4.90). As for their right hand side, it follows from Eq. (4.71) thatS (n) [F (0) , . . . , F (n-1) s n [ϕ 0 , . . . , ϕ n-1 ](x 0 , . . . , x n+1 ) ρ(x 0 ) • • • ρ(x n+1 ) dx 0 • • • dx n+1 ,(4.125)where the symmetric kernels s (n) [ϕ 0 , . . . , ϕ n-1 ](x 0 , . . . , x n+1 ) are expressed in terms of ϕ k with k < n and again satisfy the constraint (4.118). Thus in terms of the kernels, Eqs. (4.69) become the identitiesK (0) † r,n+2 ϕ n (x 0 , . . . , x n+1 ) = s n [ϕ 0 , . . . , ϕ n-1 ](x 0 , . . . ,x n+1 )(x 0 , . . . , x n+1 ) (4.126) which may be solved iteratively since the operators K (0) † r,n+2 are invertible on H ⊗(n+2) 0 (note that the constraint (4.118) characterizes the symmetric functions in H ⊗(n+2) 0

2 + 1

 21 (4.36) implies that ρ inv (θ + θ 0 ≤ y < F and the self-consistency relation (4.43) holds taking now the form y J

R

  ρinv ∂ θ δf µ (θ) = -∂ θ (F -y sin θ) ∂ θ δf µ (θ) -Y 1 ρ inv (θ + θ 0 ) sin θ + Y 2 ρ inv (θ + θ 0 ) cos θ = µ ∂ θ δf µ , θ, ϑ) u l (ϑ) dϑ = u k |Φu l . (B.3)

( 4 .

 4 122), (Φ -1 ) kl ≡ u k |Φ -1 u l = 2k B T α * k + α l dθ (∂ θ u k )(θ) ρ inv (θ) (∂ θ u l )(θ) . (B.4)

(B - 1

 1 ) kl ≡ i (P -1 ) ki (Φ -1 ) il (B.6)with inverse B kl . Finally,Φ kl = i P ki B il . (B.7)

=

  -Φ R ρinv Φ -1 , see Eqs. (4.123) and (B.1).

  ) see(2.11). D HJ is again a bounded open connected neighborhood of x. Its boundary ∂D HJ is composed of points of x ∈ D for which F HJ (x) = min y∈∂D F HJ (y). It is smooth since ∇F HJ = 0 at such points.

  .[START_REF] Ilyashenko | Lectures on Analytic Differential Equations[END_REF] where P [ρ(•, •)] is the probability distribution function(al) describing the distribution of empirical densities in the time interval [t i , t f ]. This rate function A is a functional of the trajectory ρ(•, •) and will provide a generalization of the Freidlin-Wentzell action of Eq. (2.8) to the present infinite-dimensional setup.

Here and below, we use physicists' notation for stochastic equations rather than mathematicians' one with differentials.

Mean-field systems and the Shinomoto-Kuramoto modelWe consider in this section systems composed of many diffusive particles, interacting through a mean-field type two-body potential and driven out of equilibrium by external forces. Most of our analysis is valid for any

Since the densities are normalized, functional derivatives δS/δρ(x) are defined only up to a constant, but such ambiguities drop out in all expressions below where the functional derivatives are integrated against functions with vanishing integral.

This is possible whenever the eigenvalues α k are all distinct. We have checked numerically that this is indeed the case.

Acknowledgments

The authors are grateful to J. Barré, P.-H. Chavanis, R. Chetrite and H. Touchette for useful discussions and for providing numerous references to the literature. The latter were also provided by the anonymous referees whom we thank for that contribution and for critical comments. C. Nardini acknowledges M. Cates for several discussions in the final stage of this work. This research, and the position of C. Nardini, were funded through the ANR grant ANR STOSYMAP (ANR-2011-BS01-015), and partially (C. Nardini) by the EPSRC grant Nr. EP/J007404. F. Bouchet acknowledges funding from the European Research Council under European Union's Seventh Framework Programme (FP7/2007-2013 Grant Agreement no. 616811)

We may now define a new operator S such that

Clearly, the diagonalization of R ρinv on the subspace of functions δg with vanishing integral is equivalent to the diagonalization of S.

A direct calculation shows that the 3-dimensional subspace V 3 spanned by functions

is invariant for S. In particular, the representation of S on such subspace is given by the matrix

A little algebra shows that the above matrix has one zero eigenvalue which corresponds to the eigenvector (-y, 0, F ), i.e. to the constant function

In this case δg = ∂ θ δf = 0. Consequently, the zero eigenvalue does not occur for the operator R ρinv . The other two eigenvalues of the matrix (A.7) are given by

of which at least one has positive real part if J > 0. It follows that for J > 0, the stationary solution (A.1) is linearly unstable.

B Algorithm for the Taylor expansion of the quasi-potential close to a stationary state

We discuss briefly in this Appendix how the Taylor expansion of the quasi-potential of the Shinomoto-Kuramoto model may be numerically calculated. This will be possible, in principle, at all the orders of the Taylor expansion.

Let us first concentrate on the quadratic term F (0) . In order to explicitly calculate kernel ϕ 0 (θ, ϑ), we proceed similarly as in Sec. 4.5.3 and consider the eigenfunctions of operators R † ρinv and R ρinv acting in space H 0 :

Assuming α k to be different, we impose the orthogonality relations (4.99). Eigenfunctions u k form a basis of H 0 but they are not orthogonal. Similarly for v k . The kernel of the quadratic term of the quasi-potential may be represented as