{'fraction_non_alphanumeric': 0.02890708107858101, 'fraction_numerical': 0.006243929512973498, 'mean_word_length': 4.566941297631308, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Lagrangian Description of Thermodynamics

The fact that a temperature and an entropy may be associated with horizons in semi-classical general relativity has led many to suspect that spacetime has microstructure. If this is indeed the case then its description via Riemannian geometry must be regarded as an effective theory of the aggregate behavior of some more fundamental degrees of freedom that remain unknown, in many ways similar to the treatment of fluid dynamics via the Navier-Stokes equations. This led us to ask how a geometric structure may naturally arise in thermodynamics or statistical mechanics and what evolution may mean in this context. In this article we argue that it is possible to view thermodynamic processes as the evolution of a dynamical system, described by a quadratic Lagrangian and a metric on the thermodynamic configuration space. The Lagrangian is an invariant distance between equilibrium thermodynamic states as defined by the metric, which is straightforwardly obtained from a complete set of equations of state.


I. INTRODUCTION
Research over the past few decades has shown that when the principles of quantum mechanics are combined with a geometric theory of gravity in the presence of horizons, spacetime exhibits thermodynamic behavior [1,2]. Without reference to the gravitational field equations, both a temperature and an entropy can be associated with any horizon in the following sense: whenever a horizon is present there is also a law, similar to the first law of thermodynamics, relating changes in the entropy to changes in the energy and other work terms (when appropriate). One attempts to understand this peculiar result by noting that horizons act as one way screens, causing information from a portion of the spacetime to become inaccessible to an observer on one side of it [3]. For example, an exterior observer cannot "see" what is going on within the event horizon of a black hole and a Rindler observer will never have access to the portion of Minkowski spacetime on the "other side" of her horizon. Notwithstanding this insight, the result itself remains highly non-trivial and intriguing because the appearance of a thermodynamic description suggests the existence of spacetime microstructure [4]. In other words, it is possible that our description of spacetime is actually a description of the aggregate behavior of some as yet undiscovered microscopic degrees of freedom.
This has led some investigators to suggest that gravity and perhaps even a continuum "spacetime" are emergent phenomena [5][6][7][8][9]. However, fundamental to the description of spacetime, at least in the current approaches, is the metric, which is determined by the equations of Einstein's relativity or of some generalization thereof, such as the Lanczos-Lovelock models in higher dimensions [10]. In an emergent picture of spacetime the metric must arise as an effective description, that is, out of the statistical mechanics of the more fundamental degrees of freedom of which it is made. How does this happen and how are its dynamics as encapsulated in, say, Einstein's equations to be reconciled with such a description? This motivates us to take a closer look at the structural relationships between our descriptions of dynamical systems and of thermodynamic systems.
In this paper we ask the simpler question of whether there is anything truly "dynamical" about thermodynamics. That is, we ask if it is possible to describe thermodynamic processes as trajectories in the thermodynamic phase space in a way that is completely analogous to the description of a dynamical system. We argue that every thermodynamic system can be reformulated as a Hamiltonian system, analogous to the one describing a point particle moving in a curved space. The curved space is the configuration space of the thermodynamic system and its local geometry is captured by a matrix of functions, which incorporate all the physical attributes of the substance. If the matrix of functions is invertible, a quadratic Lagrangian description can be obtained. This leads to a natural interpretation of the matrix of functions as a metric on the configuration space: it determines a "distance" between equilibrium thermodynamic states.
More precisely, the first law of Thermodynamics for quasi-static processes can always be written in the form where f represents a thermodynamic potential or the entropy and q µ represent n intensive or extensive variables of the system (including, possibly, the entropy), while each conjugate generalized force, is extensive if q µ is intensive and vice-versa. As a simple example, consider the first law for an ideal gas in the form where u is the specific internal energy, s the specific entropy, v the specific volume of the gas and T, p are its temperature and pressure respectively. In this description the internal energy has the privileged role of f in (1) but an equivalent form sees the specific entropy s playing that role. Therefore there is nothing special about f and the thermodynamic phase space is naturally odd dimensional. The first law can be viewed as the statement that physical thermodynamic processes may only occur on the hypersurface determined by the vanishing of the contact form Rajeev [11] has noted that there are many systems of variables in which the contact form will assume its canonical expression, as above, and all of them will be determined by requiring that for any arbitrary function σ on the 2n + 1 dimensional thermodynamic phase space. Transformations that take (f, p, q) to (f ′ , P, Q) are the Legendre transformations of thermodynamics. Familiar and useful examples of Legendre transformations are transformations to the enthalpy, the Helmholz free energy and the Gibbs free energy.
Here we will consider a restricted set of transformations, namely transformations of the 2n dimensional subspace (q µ , p µ ) → (Q µ , P µ ) that leave the right hand side of (1) form invariant up to the addition of an exact form, i.e., df = p µ dq µ = P µ dQ µ + dσ(p, q) These are canonical transformations, under which f → f ′ = f − σ. In section II we will determine a general equation for the generator of these transformations. Because they are canonical, the characteristic curves of the generating function will satisfy Hamilton's equations. In section III, we confine ourselves to a special subset of these transformations for which an explicit form of the generating function can be obtained. This solution is given in terms of a matrix of functions. If the matrix is invertible it behaves like a metric on the configuration space and we show that there is a Lagrangian description for the evolution. This description is analogous to the Lagrangian description of a particle moving in a curved space defined by the metric. We argue that suitable metrics may be constructed starting from a complete set of equations of state, which in turn may be experimentally determined but are usually derived from a statistical model. Some examples are worked out in section IV and we end with a brief discussion of our aims and conclusions in section V.

II. CANONICAL TRANSFORMATIONS FOR THERMODYNAMICS
Let U be a local patch with coordinates (q µ , p µ ) of a 2n dimensional manifold M on which is defined the contact structure (5). Consider a structure preserving transformation of the 2n coordinates, i.e., consider where σ(q, p) is an arbitrary function of the coordinates, which gives Transformations that satisfy these conditions are canonical transformations. An infinitesimal canonical transformation can be written as where η µ (q, p) and ε µ (q, p) are functions of (q, p) and τ is some parameter. Let σ(q, p) = δτ λ(q, p), then applying the conditions (9) it is easy to see that The solution of these equations can be determined in terms of the function F = p α ε α + λ as so that F is the generating function of the infinitesimal canonical transformations. Finite transformations may be recovered by composing such infinitesimal transformations, that is by determining the integral curves of the vector field Thus the generating function F defines a one parameter family of curves. These are its characteristic curves and, in terms of the mock "time" parameter, τ , introduced in (10), they satisfy the ordinary differential equationṡ where the over dot represents a derivative with respect to τ . We have thus recovered precisely Hamilton's equations giving the classical trajectories of a particle described by the "Hamiltonian" F , If λ = 0 then f does not change during the process and F is extensive in the "momenta", so that the transformations induce a change in f according tȯ Now the physical hypersurface of M is the one on which the contact form vanishes, i.e., by (15) and so it is determined by the condition that F = 0.

III. A RESTRICTED CLASS OF TRANSFORMATIONS
Let us henceforth consider transformations for which λ = λ(q). In that case, the following is a formal solution of (15) for F , where g µν (q) is an n × n dimensional matrix of arbitrary functions on the configuration space. The constraint, F = 0, defining the physical hypersurface translates into and the evolution equations for this system are found from (14) to bė where use has been made of (21). If in addition the matrix of functions g µν (q) is invertible, then it may be thought of as a metric on the configuration space of the thermodynamic system, for one finds that the constraint in (21) turns into the condition and this gives a natural distance between equilibrium states of the system. Furthermore, because τ is an arbitrary parameter, the right hand side of the above equation is invariant under coordinate transformations implying that the metric g µν transforms as a covariant tensor of rank two. Using the first of (22), one has p µ = −λ(q)g µν (q)q ν (25) and the second equation simplifies to where "Γ λ µν " is the Christoffel connection defining parallel transport induced by the metric g. These equations can be recovered by extremizing the reparametrization invariant action where the momentum is defined in the usual way as The action (27) determines the minimum length path between the initial and final states in the thermodynamic configuration space with the conformal metric The mock time parameter, τ , can be related to f by choosing λ. Taking λ = λ 0 (constant) forces τ to be proportional to f according to (18). In this gauge, the action describing the evolution of our thermodynamic system becomes which is precisely the action governing the evolution of a particle of mass λ 0 in a curved space defined by the metric g.
The metric necessarily contains all the information about the substance, so it must be determined from appropriate additional considerations. Once determined, all processes are described by its geodesics. One possible choice of metric, that we will not adhere to in the examples of the next section, is obtained by noting that the quadratic form in (30) must be required to be positive definite. This is guaranteed by the second law of thermodynamics, i.e., by the concavity of the entropy function, s, if we take This metric has been proposed by Ruppeiner [12] as it arises naturally out of classical thermodynamic fluctuation theory. However, it requires a knowledge of the entropy as a function of the extensive variables, which is tantamount to a complete knowledge of the thermodynamics. Likewise, for the Weinhold metric [13], which requires a knowledge of the internal energy.
From a thermodynamic point of view, a substance is characterized by a set of equations of state that are experimentally determined. For example, an ideal gas is completely characterized by the law of Boyle, Charles and Gay-Lussac together with a relationship between its internal energy and its temperature. These relations, although historically experimental, are also obtained directly from statistical models. In the statistical approach, a theoretical model is constructed and a partition function, Z(β, q i ), where β is the inverse temperature, is obtained, from which the internal energy and conjugate forces are determined according to These n equations of state suffice to construct a family of invertible metrics all of which define a quadratic form of the kind g µν p µ p ν , whose value is a constant on the physical hypersurface. More precisely, suppose that we have n independent equations of state in the form f µ n (q)p µ = p n where p n are constant. The matrix f must be invertible so that it is possible to recover the momenta from the equations of state, If we take the p n to define an orthogonal basis in a real vector bundle over the configuration space, with an invertible, constant matrix η mn , then f µ n can be thought of as a vielbein, and one has the natural metric on M. Furthermore, on the physical hypersurface, i.e., when F = 0, is a constant determined by η and p n (we shall henceforth drop the subscript "0"). Taking η to be diagonal, we find that g µν is actually an n parameter family of metrics. As we will see in the following examples, they serve to parameterize the solutions. We assume that a complete characterization of the substance by means of n independent equations of state of the above form is available. Using these equations as our starting point, we assemble a metric according to (35), which automatically gives a constant λ on the physical hypersurface. Below we illustrate the formalism for some common systems.

IV. EXAMPLES
Because the experimentally determined equations of state do not generally include the entropy, we single it out by letting f = s in the following examples. This is not necessary, but it is convenient for our purposes. Further, all of our examples are two dimensional and we will have two independent equations of state, so we take for arbitrary α and β.

A. The ideal gas
Take f = s, the specific entropy of the gas, and the first law in the form In this representation, the coordinates are (u, v), the momenta p u = 1/T , p v = p/T and the ideal gas can be characterized by the two equations of state where k is Boltzmann's constant and g is the number of degrees of freedom per molecule. According to (35) this gives the two parameter family of metrics and, from the on-shell condition, We find the evolution equationsu which will be seen to directly reproduce the equations of state and, furthermore, using the fact that s = −λτ , give the solutions together with corresponding solutions for p u and p v , which follow from (39). They can be inverted and the constants λ, α and β eliminated using (41) to give The solutions in (43) describe a two parameter family of ideal gas processes. For instance the choice α 2 = gk/2, β 2 = k makes (40) equal to the Ruppeiner (entropy) metric and describes a constant pressure process. A constant temperature process can be recovered in the limit as α → ∞ and a constant volume process in the limit as β → ∞. It is worth noting that these trajectories are also recovered as geodesics of the metric in (40), or from the action where x = α ln u, y = β ln v andẋ 2 +ẏ 2 = 1, as indicated earlier, because the metric is flat. This is a consequence of the coordinate invariance of the formalism.

B. The Van der Waals gas
The treatment of the Van der Waals gas in similar, although the evolution equations appear more complicated at first sight. In the representation above, the Van der Waals gas is defined by the equations of state and on the physical hypersurface, F = 0, With this we find the following evolution equationṡ Now, employing the middle two equations, the first and last can be put in the form from which it is clear that (46) is recovered and, furthermore, the solutions which may be inverted to obtain once use is made of (48). As before, (51) can be recovered as geodesics of the metric (47), or from the action in (45) with

C. Paramagnetism
For definiteness consider spin 1 2 paramagnetism for which the first law will read where h = u + mb is the specific enthalpy, m is the magnetization and b is the magnitude of an applied, external magnetic field. In this representation the configuration space is made of the pair (h, m) and the conjugate forces are respectively p h = 1/T and p m = −b/T . A paramagnetic material does not have interactions between its dipoles and its enthalpy is completely independent of the magnetization, depending only on T . The simplest model of this non magnetic contribution would be to imagine that the paramagnetic molecules are oscillators, oscillating about their equilibrium positions. Therefore, if we suppose the enthalpy to be given by the law of equipartition, the material is completely characterized by the relations where µ is the magnetic moment of the particles. We can write these relations in terms of the phase space variables in the form They suggest the family of metrics for which on the physical hypersurface, F = 0. We find the equationṡ from which follow (56) and the solutions The second determines the magnetic contribution to the specific entropy. That the entropy is the sum of the two contributions follows by simply eliminating the arbitrary constants, λ, α and β in the two equations above, using (58). Once again, these solutions are geodesics of (57). They can also be obtained from the action in (45) with

D. Kerr Black Hole
The Kerr black solution is one of four black hole solutions in general relativity and describes a neutral, rotating black hole. It is completely characterized by its axisymmetry and by two parameters, viz., the mass of the black hole, M, and its angular momentum, J. It is described by the spacetime metric (we take c = 1 and G = 1) where r s is the Schwarzschild radius, r s = 2M, and a = J/M ρ 2 = r 2 + a 2 cos 2 θ ∆ = r 2 − r s r + a 2 There are two surfaces of interest: an inner surface (the event horizon) occurring at and an outer surface of infinite redshift at The two horizons meet at θ = 0 and the region between them is called the ergosphere. Within the ergosphere, a test particle must co-rotate with the mass M, with the angular velocity Ω = a r 2 h + a 2 .
A quantum field placed in this background is well known to acquire a temperature. This temperature is proportional to the acceleration of the null Killing vector on the horizon, known as the surface gravity, κ, of the hole, .
The first law of black hole thermodynamics can be written in the form From the thermodynamic point of view, the configuration space is two dimensional, spanned by the Arnowitt-Deser-Misner mass, which plays the role of the internal energy, and the angular momentum. The corresponding conjugate forces are p M = 1/T and p J = −Ω/T . Although these are natural variables for the system, it is convenient to transform to the configuration space (r h , a), writing the first law of black hole thermodynamics in terms of these variables as ds = p h dr h + p a da instead. The equations of state, (66) and (67), are then equivalent to the statements that p h = 2πr h and p a = 2πa and one finds which yields on the physical hypersurface. The evolution equationṡ have the solutions and the black hole entropy s = π(r 2 h + a 2 ) + s 0 is recovered as the simple sum of contributions from r 2 h and a 2 by eliminating the constants using (71). As in our previous examples, these solutions are geodesics of (70) and can also be obtained from the action in (45) with If spacetime is indeed emergent, its microscopic degrees of freedom quite possibly live at scales on the order of the Planck length. Therefore, not only do we presently have no experimental access to to them but we are most likely never to have it. It would seem that the best we could hope to empirically justify is an ever more precise description of the thermodynamics of this microstructure and, in turn, such a sharpened description may eventually lead to a better understanding of the fundamental constituents of spacetime. Progress along these lines can be made only once we have a clearer picture of the connections between our current geometric description of spacetime and thermodynamics. In this paper we have begun to address this issue by taking a closer look at thermodynamics.
We were able to show that at least a subset of the possible transformations on the thermodynamic phase space lead to the description of thermodynamics processes as geodesics of a family of metrics defined by the equations of state of the substance. In the entropy representation, it is the entropy that serves as thermodynamic "time". In general, it is the "preferred" function f that plays this role. Although all the metrics in the examples we have considered are flat there is no reason to expect that this is universally so, particularly in higher dimensional systems, eg., systems with variable contents or charged and rotating black holes. It would be of considerable interest to study the non-trivial geometry of these systems and correlate their geometric properties with their thermodynamic behavior. Such work, based on the Ruppeiner or Weinhold metric, has been attempted [14][15][16] and our work can be seen as providing additional motivation for it.
It is interesting that the family of relevant metrics is completely recovered simply from the equations of state. This is in fact what one should expect in an emergent picture of spacetime: that the geometric formulation is simply a way of specifying the spacetime equations of state. We hope that, with more work, this insight may help to "design" geometric models of emergent gravity that are better behaved in the ultraviolet and perhaps even to eventually