Roger Balian

Patrick Valentin

Hamiltonian structure of thermodynamics with gauge

Denoting by q i (i = 1, ..., n) the set of extensive variables which characterize the state of a thermodynamic system, we write the associated intensive variables γ i , the partial derivatives of the entropy S = S q 1 , ..., q n ≡ q 0 , in the form γ i = -p i /p 0 where p 0 behaves as a gauge factor. When regarded as independent, the variables q i , p i (i = 0, ..., n) define a space T having a canonical symplectic structure where they appear as conjugate. A thermodynamic system is represented by a n + 1-dimensional gauge-invariant Lagrangean submanifold M of T. Any thermodynamic process, even dissipative, taking place on M is represented by a Hamiltonian trajectory in T, governed by a Hamiltonian function which is zero on M. A mapping between the equations of state of different systems is likewise represented by a canonical transformation in T. Moreover a Riemannian metric arises naturally from statistical mechanics for any thermodynamic system, with the differentials dq i as contravariant components of an infinitesimal shift and the dp i 's as covariant ones. Illustrative examples are given.

Introduction and outline

In Callen's formulation of thermodynamics [START_REF] Callen | Thermodynamics and an introduction to Thermostatistics[END_REF], the state of a system is characterized at each time by the values of n independent quantities, usually extensive and conservative, that we shall denote as q i (i = 1, ..., n) . For a single fluid, these variables are the internal energy q 1 ≡ U, the volume q 2 ≡ V and the numbers q k ≡ N k (k = 3, ..., n) of molecules of each type k; for a pure fluid, we have n = 3. For a composite system in local equilibrium, the index i is a compound index which refers both to each such physical quantity and to each subsystem; for continuous media, these subsystems are volume elements with sizes larger than the mean free path. All the equilibrium properties of a given system are embedded in the expression of its entropy S = S q 1 , ..., q n , an additive, extensive and concave function of the state variables q i . In particular, the n intensive variables γ i are defined as the partial derivatives

γ i = ∂ ∂q i S q 1 , ..., q n . (1.1)
For a single fluid, they are expressed in terms of the temperature T, the pressure P and the chemical potentials per particle µ k as

γ 1 = 1 T , γ 2 = P T , γ k = - µ k T (k = 3, ..., n) . (1.2)
The relations (1.1) between the conjugate, extensive and intensive, variables constitute the full set of equations of state.

In non-equilibrium situations, the variables γ i are the local intensive variables. The fluxes which govern the dynamics in sufficiently slow regimes are expressed in terms of differences of variables γ i for neighbouring subsystems. The simplest example is heat transfer across a barrier separating two uniform thermal baths. In this case it is sufficient to introduce n = 2 variables, the energies q 1 ≡ U 1 and q 2 ≡ U 2 of the two baths, together with the associated temperatures γ 1 = 1/T 1 and γ 2 = 1/T 2 . The dynamics is governed by the conservation laws

- dU 1 dt = Φ = dU 2 dt , (1.3)
and by the expression of the heat flux Φ across the barrier in terms of the response coefficient L (γ 1 , γ 2 ) which characterizes the heat transport through this barrier, Φ = L (γ 1 , γ 2 ) (γ 2 -γ 1 ) . (1.4) This formulation of thermodynamics is the one which arises naturally from statistical mechanics [START_REF] Callen | Thermodynamics and an introduction to Thermostatistics[END_REF][START_REF] Balian | From Microphysics to Macrophysics[END_REF], where the entropy S is identified with the missing information, or the disorder at microscopic scale. Equilibrium is then characterized by looking for the largest disorder, subject to constraints on the quantities q i . The variables γ i are the Lagrangean multipliers involved in this search. For non-equilibrium thermodynamics microscopic foundations are also provided by the maximum entropy method which yields the projection method in the limit of negligible retardation effects (see, for instance, the review articles [START_REF] Balian | [END_REF] and [4]).

Although each state is characterized by the n variables q i only, it is convenient for practical purposes and for applications to make use of additional variables. One is thus lead to introduce the 2n-dimensional space T with coordinates q 1 , ..., q n , γ 1 , ..., γ n . A thermodynamic system is represented in this space by a n-dimensional manifold M characterized by the set of n equations of state (1.1); a state of this system is represented by a point in M. For a thermodynamic process, the dynamical equations such as (1.1), (1.3), (1.4) couple the 2n time-dependent variables q i and γ i . It is here again natural to formulate non-equilibrium thermodynamics in the space -T, where a dynamical process is represented by a trajectory which is constrained by the equations of state (1.1) to lie in the manifold M.

Moreover, these equations of state are often written in an alternative form where the entropy and the energy are interchanged. For a single fluid, the function S = S(U, V, N k ) is thus inverted into U = U (S, V, N k ). The quantity S can therefore be regarded as an additional extensive variable, that we shall denote as q 0 so as to set all the variables q 0 , q 1 , ..., q n on the same footing. For a given physical system these n + 1 variables are related to one another by q 0 = S q 1 , ..., q n .

(

The dissipation rate is the time-derivative dq 0 /dt. Altogether, the thermodynamic variables q 0 , q 1 , ..., q n , γ 1 , ..., γ n , now appear as the coordinates of a point in a 2n+1-dimensional space ∼ T. In this space, which has a natural contact structure [START_REF] Caratheodory | Calculus of variations and partial differential equations of the first order[END_REF][START_REF] Hermann | Geometry, Physics and Systems[END_REF][START_REF] Arnold | Proceedings of the 150th anniversary Gibbs symposium[END_REF][START_REF] Mrugala | [END_REF], the dynamical equations involve the n + 1 constraints (1.1), (1.5). We have singled out the entropy rather than the energy among the extensive variables because our results have a simpler theoretical interpretation if we work in the entropy representation (1.5). For practical purposes and for applications, it would be easy to transpose the formalism into the energy representation, where q 0 and q 1 are interchanged and where the associated intensive variables are T, -P, µ k instead of (1.2).

The consideration of the space ∼ T instead of the initial n-dimensional configuration space q 1 , ..., q n has the following interest in equilibrium thermodynamics.

A physical system is represented in this space ∼ T by a n-dimensional manifold ∼ M, characterized by the n + 1 relations (1.1), (1.5) or by any other equivalent set of n + 1 equations of state. (Strictly speaking ∼ M should be called a submanifold since it is not defined intrinsically, but as a subset of ∼ T.) However experiments usually give only indirect indications on the fundamental function S q 1 , ..., q n , and are not sufficient to fully determine the thermodynamic manifold ∼ M. Since less than the n + 1 required equations of state are known, the remaining ones should be determined by some phenomenological procedure. To this aim, it has been advocated [START_REF] Mrugala | [END_REF][START_REF] Benayoun | Méthodes géométriques pour l'étude des systèmes thermodynamiques et la génération d'équations d'état[END_REF] to proceed by comparing the physical system under study with some known system having the same degrees of freedom but characterized by a different entropy function, or equivalently, by a different thermodynamic potential. In the 2n + 1-dimensional thermodynamic space The theoretical study of these mappings has already been achieved [START_REF] Mrugala | [END_REF][START_REF] Benayoun | Méthodes géométriques pour l'étude des systèmes thermodynamiques et la génération d'équations d'état[END_REF][START_REF] Mrugala | Thermodynamics of energy conversion and transport[END_REF]. It is based on the remark that the physical manifolds ∼ M are not arbitrary. Although the relation (1.5) changes from one manifold to another, there exists for each one some generating function S which relates the conjugate variables q i and γ i (i = 1, ..., n) according to (1.1). This is expressed in the 2n + 1-dimensional space ∼ T by introducing the 1-form

ω ≡ dq 0 - n i=1 γ i dq i , (1.6)
which is non-degenerate at any point of ∼ T. Thus ∼ T is endowed with a contact structure ( ∼ T, ω) [START_REF] Caratheodory | Calculus of variations and partial differential equations of the first order[END_REF][START_REF] Hermann | Geometry, Physics and Systems[END_REF][START_REF] Arnold | Proceedings of the 150th anniversary Gibbs symposium[END_REF][START_REF] Mrugala | [END_REF]. The existence of some function S q 1 , ..., q n such that all the equations (1.1), (1.5) are satisfied is then equivalent to the vanishing of (1.6). Among all the n-dimensional manifolds embedded in ∼ T, the physical ones

∼ M must fulfil the condition ω = 0 (1.7)
for any infinitesimal variation of a state over ∼ M, an exterior differential equation which defines Legendre submanifolds. We shall call them thermodynamic manifolds to recall that the vanishing of ω ensures the fulfilment of the thermodynamic identities (1.1), (1.5). Further conditions on ∼ M are imposed by the extensivity and the concavity of entropy.

The transformations

∼ M ′ = ϕ ∼ M of interest, which map in ∼ T a physical
manifold either onto itself or onto another, should preserve the condition (1.7) on the considered manifolds. More generally, the transformations ϕ are required to map any thermodynamic manifold onto another thermodynamic manifold, that is, to preserve the condition (1.7) everywhere. This implies that they are contact transformations in ∼ T, which multiply the 1-form (1.6) by some non-vanishing function λ of the coordinates q 0 , q i , γ i . More precisely the push-forward mapping ϕ * = ϕ -1 * which acts on the forms should satisfy ϕ * (ω) = λω.

(1.8)

Applications of such contact transformations to thermodynamics have been worked out [START_REF] Mrugala | [END_REF][START_REF] Benayoun | Méthodes géométriques pour l'étude des systèmes thermodynamiques et la génération d'équations d'état[END_REF][START_REF] Mrugala | Thermodynamics of energy conversion and transport[END_REF][START_REF] Benayoun | [END_REF]. In particular, by means of a continuous set of contact transformations depending on a single deformation parameter τ interpreted as a fictitious time, one can explore the equilibrium thermodynamic properties of a set of physically different systems labelled by τ .

The structure of the resulting equations of motion is somewhat similar with that of Hamiltonian dynamics, though more complicated. However, it differs from a symplectic Poisson structure, so that the extension of the standard techniques of canonical Hamiltonian dynamics to the present problem is not straightforward. The power of such techniques, which for instance readily provide variational approaches, makes it desirable to modify the formulation of thermodynamics so as to cast the equations of motion into a usual Hamiltonian form. We would then benefit both from the flexibility brought in by the idea of regarding the 2n + 1 variables q 0 , q i , γ i as independent, and from the whole machinery of analytical mechanics.

We show below that this is feasible at little cost. We first introduce (Section 2) a non-vanishing gauge variable p 0 , without physical relevance, which multiplies all the intensive variables. A new set of variables p i is thus defined as p i = -p 0 γ i for i = 1, ..., n. The 2n + 1-dimensional space ∼ T is thereby extended into a 2n+2-dimensional thermodynamic space T spanned by the variables q i , p i with i = 0, 1, ..., n. We associate with a physical system a n+1-dimensional manifold M in T, parametrized for instance by the coordinates q 1 , ..., q n and p 0 . A gauge transformation which changes the extra variable p 0 while keeping the ratios p i /p 0 = -γ i invariant is not observable, so that a state of the system is represented by any point of a one-dimensional ray lying in M, along which the physical variables q 0 , q 1 , ..., q n , γ 1 , ..., γ n are fixed.

We wish to study the transformations in the extended thermodynamic space T which map the thermodynamic manifolds M either onto themselves (in nonequilibrium thermodynamics) or onto one another (in the problem of generating equations of state). We show (Section 3) that, within a suitable but irrelevant choice of gauge, these transformations are nothing but canonical transformations of mechanics having some specific features. While the variables q i , γ i (i = 1, ..., n) are conjugate with respect to the entropy in the Legendre sense (1.1) of thermodynamics, the variables q i , p i (i = 0, 1, ..., n) moreover appear as canonically conjugate in the sense of Hamiltonian dynamics. A symplectic structure is thus induced in the space T. An infinitesimal mapping among the manifolds M that preserves the thermodynamic identities is represented by a This relation between contact and canonical transformations is found here as a direct outcome of the gauge invariance that we introduced in thermodynamics. Actually mathematicians have recognized long ago [START_REF] Herglotz | Lectures on Contact Transformations and Hamiltonian systems[END_REF] that a contact structure of the type (1.6) in 2n + 1 dimensions can be embedded into a symplectic structure in 2n + 2 dimensions by means of the adjunction of an extra variable. This procedure, clearly presented by Caratheodory [START_REF] Caratheodory | Calculus of variations and partial differential equations of the first order[END_REF], and later on termed as symplectization [START_REF] Arnold | Mathematical Methods of Classical Mechanics[END_REF], has a geometric interpretation in the theory of fibre bundles.

On the other hand, exterior calculus, a standard technique in thermodynamics [START_REF] Balian | From Microphysics to Macrophysics[END_REF], has suggested to introduce in the 2n-dimensional space of extensive and intensive variables a symplectic structure which establishes a duality between these variables. For instance, in the energy representation [START_REF] Kijowski | A symplectic framework for field theories[END_REF], one currently considers for a fluid the symplectic 2-form dT ∧ dS -dP ∧ dV in the corresponding 4-dimensional space. Likewise, in the entropy representation [START_REF] Omohundro | Geometric Perturbation Theory in Physics[END_REF], the fundamental symplectic 2-form is d (1/T ) ∧ dU + d (P/T ) ∧ dV. More generally, the 2n-dimensional thermodynamics space T can be endowed with a symplectic structure generated by the 2-form T have also be considered [START_REF] Janeczko | [END_REF]. They will be recovered below (see Section 4) from canonical transformations in our 2n + 2-dimensional space T endowed with the symplectic form n i=0 dp i ∧ dq i , as special cases when the entropy variable q 0 may be left aside and when the gauge may be fixed as p 0 = -1. Our Hamiltonian dynamics in T thus generalizes and encompasses both existing formulations in the 2n-and 2n + 1-dimensional spaces -T and ∼ T. The present formalism applies in particular to the dynamical equations in non-equilibrium thermodynamics (Section 4), which can thus be cast into a Hamiltonian form. Given a set of equations of motion, it is usually not obvious to recognize whether they have a Hamiltonian nature. This was done for the hydrodynamics of ideal fluids [17]. Here we find another type of Hamiltonian structure, for any dissipative system in the thermodynamic regime. The existence of this structure is based on the idea that any dynamical system can be embedded into a Hamiltonian system with a double dimension (see ref. [START_REF] Omohundro | Geometric Perturbation Theory in Physics[END_REF], Chap. 10). The remarkable fact in non-equilibrium thermodynamics is the existence of a direct physical interpretation for the additional variables. In case the entropy is left aside, the evolution of the n independent variables q 1 , ..., q n which characterize the state of the system at each time has the same structure as in analytical mechanics in spite of the existence of dissipation. If we regard the set q 1 , ..., q n as position variables, their associated intensive variables γ 1 , ..., γ n appear as their conjugate momenta, and the dynamics is governed by an effective Hamiltonian f in the 2n-dimensional space -T. In case the entropy in included among the dynamical variables, a similar canonical structure is found provided we pay the price of introducing the gauge variable p 0 upon which the effective Hamiltonian h should depend. Whereas the conjugate momentum of each q i is now p i for i = 1, ..., n, the conjugate momentum of the entropy q 0 is p 0 , and the dissipation dS/dt is expressed as ∂h/∂p 0 . The constraints (1.1), (1.5) satisfied at the initial time are conserved by the Hamiltonian flow, which moreover implies that f = 0 or h = 0 along the physical trajectories. The fact that only the part of the Hamiltonian flow located in the manifold (1.1), (1.5) is relevant for physics solves the paradox of the existence of a Hamiltonian for dissipative dynamics. As an illustration we work out in Section 4 Hamiltonian formulations for the equations of motion (1.3), (1.4) describing heat transport. We show moreover that these results are readily extended to any dissipative process in the thermodynamic regime, whether mechanical, thermal, electrical or chemical.

The equations of state for different physical systems are also generated from one another by means of Hamiltonian transformations in the space T. We illustrate this by writing in Section 5 Hamiltonian mappings between different van der Waals fluids.

Finally we recall in Section 6 how quantum statistical mechanics generates [START_REF] Balian | [END_REF] a natural metric structure in thermodynamics [18,19]. The thermodynamic Lagrangean manifolds -M, M or Legendrean manifolds M thus also acquire a structure of Riemannian manifolds. The metric is obtained as

ds 2 = - n i=1 dγ i dq i = 1 p 0 n i=0 dp i dq i , (1.9)
and the thermodynamically conjugate variables now appear as contravariant and covariant coordinates on the manifold. The concavity of the entropy function associated with M is equivalent to the positivity of ds 2 over M. This property may be used to select the physically admissible manifolds, which should not only satisfy the algebraic condition (1.7) but should also have a positive ds 2 so as to describe thermodynamically stable systems.

Thermodynamics as a gauge theory

We start with a remark, drawn from statistical mechanics, about the definition of the intensive variables. Consider, for instance, a fluid in grand canonical equilibrium. In terms of the intensive variables γ i defined by (1.2), its density operator D (in quantum statistical mechanics) is expressed by

D ∝ exp - 1 k B γ 1 Ĥ + n k=3 γ k N k , (2.1)
where Ĥ and N k are the Hamiltonian and particle number operators. The occurrence of Boltzmann's constant k B arises from the choice of the kelvin as the unit of temperature and the joule per kelvin as the unit of entropy. We note from (1.2) that all the γ i 's are inversely proportional to the temperature. Thus, multiplying both k B and the γ i ′ s by a constant does not affect the physics, since it amounts to changing the unit of temperature, or equivalently the irrelevant coefficient in the definition of the von Neumann entropy in quantum statistical mechanics, which is identified at equilibrium with the absolute entropy of thermodynamics within a multiplicative constant. This suggests us, for an arbitrary thermodynamic system, to introduce an additional variable p 0 and to replace the set γ i by the new, intensive, scaled variables

p i = -p 0 γ i (i = 1, ..., n) . (2.2)
In the resulting 2n+2-dimensional space T, a dilation of the variables q i , keeping the variables p i unchanged, is a physical operation which leaves the equations of state (1.1), (1.5) unchanged in case the system is extensive. Symmetrically we introduce a mathematical operation, the dilation of the intensive variables, keeping the extensive ones unchanged,

p i → λp i , q i → q i (i = 0, 1, ..., n) , (2.3)
where λ is a non-zero constant. This operation, which does not affect the physical variables q 0 , ..., q n , γ 1 , ..., γ n , can be regarded as a gauge transformation of the first kind. In the trivial gauge p 0 = -1, we have p i = γ i . A change of gauge which leads to p 0 = -1/k B suppresses Boltzmann's constant from the density operator (2.1) while changing the γ i 's into p i 's. (The macroscopic entropy remains, however, unchanged as its expression in terms of D still contains a factor k B .)

We regard below, more generally, the dummy factor p 0 in (2.2) not as a constant but as an independent variable. We thus allow gauge transformations (2.3) of the second kind, where λ is some function of the 2n + 2 coordinates q i , p i . An illustration will be given by Eq. (2.10), which is obtained from the trivial gauge p 0 = -1 by taking λ = p 0 /p 1 .

In this formulation of thermodynamics as a gauge theory, the variables p 0 , p 1 , ..., p n are not completely meaningful physically, whereas their ratios γ i given by (2.2) remain invariant in a gauge transformation. The situation looks like classical electromagnetism, where the e.m. potential is modified in a gauge transformation and is thus physically unobservable (as the variables p i ), whereas the e.m. field is well-defined (as the physical intensive variables γ i ). We shall work in the 2n + 2-dimensional extended thermodynamic space T with coordinates q i , p i , including the gauge factor p 0 . This is mathematically convenient, and physical interpretation will require to return to the 2n + 1 physical coordinates, namely the entropy q 0 , the n extensive variables q i and the n intensive variables γ i of Callen.

In the extended thermodynamic space T, a state for a system is not represented by a single point, but by any point of a one-dimensional ray characterized by fixed values of the coordinates q 0 , q 1 ..., q n and of the ratios γ i = -p i /p 0 . The points along this line, equivalent for physics, result from one another by a gauge transformation (2.3). A given system is described by a n + 1-dimensional submanifold M, which may be parametrized by the n extensive variables q 1 , ..., q n and by the gauge fixing variable p 0 . The entropy function S(q 1 , ..., q n ) of the system generates the remaining n + 1 variables as q 0 = S(q 1 , ..., q n ),

p i = -p 0 ∂S q 1 , ..., q n ∂q i . (2.4)
We recalled in the introduction that the existence of such a generating function

S characterizes the thermodynamic submanifolds ∼ M in the 2n + 1-dimensional space ∼ T.
It is then expressed by the vanishing (1.7) of the 1-form (1.6). Accordingly, in the extended 2n + 2-dimensional space T, we introduce the 1-form

ω ≡ n i=0 p i dq i , (2.5)
and the n+ 1-dimensional thermodynamic manifolds M are characterized by the vanishing of this form:

ω = 0 over M. (2.6)
The 1-form ω induces a symplectic structure

dω = n i=0 dp i ∧ dq i (2.7)
on T that we denote as (T, dω) . Any thermodynamic manifold M belongs to the set of the so-called Lagrangean manifolds in T, which are the integral submanifolds of dω with maximum dimension (n + 1) . Moreover M is gauge invariant, which is implied by (2.6) but not by dω = 0. When the set q i contains all possible extensive variables, the extensivity of the entropy function S(q 1 , ..., q n ) is expressed by the Gibbs-Duhem relation

S = n i=1 q i ∂S ∂q i . (2.8)
Translating it into the space T by means of Eq.(2.4), we find

n i=0 p i q i = 0. (2.9)
This condition defines the 2n+ 1-dimensional extensivity sheet E in the space T, and the thermodynamic manifolds M should lie in this case within this surface E. However, if the systems are restricted to contain a fixed quantity of matter or to have a fixed volume, the corresponding manifolds M are free from the above constraint. Statistical mechanics exhibits the different nature of the entropy q 0 and of the other extensive variables q 1 , ..., q n . However it is traditional in thermodynamics to introduce a symmetry between all q i 's for i = 0, 1, ..., n. In particular the energy as function of the entropy, rather than the converse, is often used as a thermodynamic potential. This symmetry is conveniently reflected in the present formalism by the use of the gauged intensive variables p 0 , p 1 , ..., p n , as shown in (2.5), (2.6) and (2.9). For instance, for a fluid, with the choice of gauge p 0 = -1, the intensive variables p 1 , ..., p n reduce to the intensive variables γ i arising from the entropy representation, given by Eq. (1.2). However, with the choice of gauge p 1 = -1, the other intensive variables p i , namely

p 0 = 1 γ 1 = T, p 2 = -p 0 γ 2 = -P, p k = -p 0 γ k = µ k (k = 3, ..., n) , (2.10)
are those which arise from the energy representation of thermodynamics, where the relation q 1 = U q 0 , q 2 , ..., q n replaces (1.5). Thus, the gauge transformation (2.3) with λ = p 0 /p 1 = -1/γ 1 amounts to a switch from the entropy to the energy representation.

Canonical transformations in the extended configuration space

We proceed to study the transformations which, in the extended thermodynamic space T, map the thermodynamic manifolds M onto one another. Such a mapping may describe a non-equilibrium thermodynamic process, in which case the initial and the final manifolds are the same, or it may describe a mapping between the equations of state of different physical systems.

The thermodynamic submanifolds M satisfy the condition (2.6). We impose that this condition should be preserved by the considered mappings M ′ = ϕ(M) for any M. We recalled in Eq. (1.8) that, in the 2n + 1-dimensional space

ω ′ = ϕ * (ω) = λω, (3.1)
a property which ensures that ω = 0 implies ω ′ = 0. However, the factor λ in (3.1) can be absorbed by a gauge transformation, since the multiplication of ω by a function λ of the coordinates q i , p i can be achieved by the gauge transformation (2.3) involving the same factor λ. Hence, within an irrelevant change of gauge in M ′ , any mapping M ′ = ϕ(M) which satisfies (3.1) is equivalent to a transformation in T which conserves the 1-form ω. We can therefore take advantage of the gauge invariance and restrict ourselves to the mappings

M ′ = ϕ(M) such that ω ′ = ϕ * (ω) = ω. (3.2)
The condition (3.2) implies that the 2-form (2.7) obtained by taking the exterior derivative of (2.5) is also conserved by the mapping ϕ, that is,

ϕ * (dω) = dω. (3.3)
This means that, if we endow the space T with a symplectic structure with Poisson brackets

q i , p j = δ i j , (3.4)
the considered mappings are canonical transformations of the same type as in analytical mechanics [START_REF] Caratheodory | Calculus of variations and partial differential equations of the first order[END_REF][START_REF] Arnold | Mathematical Methods of Classical Mechanics[END_REF]20]. Not every canonical transformation is admissible, however, since the conservation (3.2) of the 1-form ω is a stronger condition that the conservation (3.3) of the 2-form dω. Consider an infinitesimal canonical transformation, generated by the (possibly time-dependent) Hamiltonian h(q 0 , q 1 , ..., q n , p 0 , p 1 , ..., p n ) :

qi = ∂h ∂p i , ṗi = - ∂h ∂q i . (3.5)
The evolution takes place either as function of the physical time t in non-equilibrium thermodynamics, or as function of a fictitious time τ for continuous deformations relating different systems to one another. The conservation of ω reads

0 = n i=0 p i d qi + ṗi dq i = n i=0 p i d ∂h ∂p i - ∂h ∂q i dq i = d n i=0 p i ∂h ∂p i -h , (3.6)
for any variation of the coordinates q i , p i (i = 0, 1, ..., n). As h is defined within an additive constant, we can impose that it satisfies the identity

h ≡ n i=0 p i ∂h ∂p i , (3.7)
or equivalently h q 0 , q 1 , ..., q n , λp 0 , λp 1 , ..., λp n = λh q 0 , q 1 , ..., q n , p 0 , p 1 , ..., p n ,

where λ is a constant or more generally a non-vanishing function. The condition (3.8) also ensures that, if two points are deduced from each other by a gauge transformation (2.3), their images in the evolution remain related by the same transformation. The rays which represent the states in the space T are thus deduced from one another in the Hamiltonian motion, which therefore preserves the gauge invariance of the manifolds M in the dilation (2.3). Actually we have noted that the thermodynamic manifolds M (for which ω = 0) are n + 1-dimensional Lagrangean submanifolds of T (for which dω = 0) which are moreover gauge invariant.

Altogether the mappings in the extended thermodynamic space T which preserve these two properties that characterize the thermodynamic structure of the manifolds M are canonical transformations of analytical mechanics, generated by a Hamiltonian h which is a homogeneous function with degree 1 in the variables p i .

If the set q 0 , q 1 , ..., q n includes all the extensive variables, the mappings should leave the extensivity sheet E defined by (2.9) invariant. Expressing the time-derivative of (2.9) by means of (3.5) and using (3.7), we obtain in this case

h ≡ n i=0 q i ∂h ∂q i . (3.9)
Hence, h should also be a homogeneous function with degree 1 of the variables q i . Note that, in spite of their formal analogy, the identities (3.7) and (3.9) have different status, since dilation of the p i 's is unphysical while dilation of the q i 's is associated with extensivity, and since (3.7) should always be satisified.

A finite canonical transformation may be characterized by its generating function H(q 0 , ..., q n , p ′ 0 , ..., p ′ n ), which produces the mapping q i , p i -→ q ′i , p ′ i as

p i = ∂H ∂q i , q ′i = ∂H ∂p ′i (i = 0, 1, ..., n). (3.10)
(If the Jacobian of this mapping vanishes, one should use other generating functions, where some initial variables q i are replaced by p i 's, and conversely for the final variables; see ref. [START_REF] Arnold | Mathematical Methods of Classical Mechanics[END_REF]; an example will be given by Eq. (5.8) below.) The conservation of the 1-form ω is expressed, through the same calculation as in (3.6), by

H ≡ n i=0 p ′ i ∂H ∂p ′ i , (3.11)
so that H is a homogeneous function of the variables p ′ i with degree 1. Infinitesimal transformations (3.5) are recovered from

H ≈ n i=0 p ′ i q i + εh(q 0 , ..., q n , p ′ 0 , ..., p ′ n ) (3.12)
for ε small. Note that the condition (3.11) results in the vanishing of a Legendre transform of H with respect to the whole set of variables p ′ i . Hence no generating function depending on the variables q i , q ′i can produce here the Hamiltonian mapping. Extensivity implies, as in (3.9), that H is a homogenous function of the variables q i with degree 1. In this case, the identity (3.11) implies that H vanishes when the points (q i , p i ) and (q ′i , p ′ i ) which are in correspondence through (3.10) lie on the extensivity sheet.

We recover contact transformations in the space ∼ T by the projection π which eliminates the gauge factor p 0 from Hamilton's equations, a procedure inverse from symplectization [START_REF] Caratheodory | Calculus of variations and partial differential equations of the first order[END_REF][START_REF] Arnold | Mathematical Methods of Classical Mechanics[END_REF]. Indeed, the time-dependence of any function g q 0 , ..., q n , γ 1 , ..., γ n , where the γ i 's are expressed in terms of the canonical variables by (2.2), is given, according to Hamilton's equations (3.5), by the usual Poisson bracket

ġ = {g, h} = n i=0 ∂g ∂q i ∂h ∂p i - ∂h ∂q i ∂g ∂p i , (3.13)
generated by (3.4) in the space T. We can calculate it by using the fact that f (q 0 , ..., q n , γ 1 , ..., γ n ) ≡ -1 p 0 h q 0 , ..., q n , p 0 , ..., p n that we have introduced for the gauge variable, which allowed us to get rid of the factor λ in (3.1), whereas contact transformations should manage with this factor in (1.8). We can thus regard a contact transformation in ∼ T as a Hamiltonian transformation in T followed by the gauge transformation which brings p 0 to its initial value -1. However, the latter gauge transformation (2.3) cannot in general be generated by a Poisson structure, so that this structure is lost in the elimination of p 0 . As it often occurs in gauge theories, the equations become more complicated when the gauge is fixed without care.

Note that the antisymmetry of the Poisson bracket (3.13), which generates the motion in the 2n + 2-dimensional space T, is lost when this motion is projected as (3.15) on the 2n + 1-dimensional space ∼ T. Indeed the first term -(∂g/∂q 0 ) f of (3.15) has no counterpart. We can trace back this lack of symmetry to a hidden difference which already existed between g and h in the Poisson bracket (3.13). Being a physical quantity, g is a homogeneous function of the variables p i with degree 0. However, h, the generator of the motion in the space T, is not a function of the physical variables q i , γ i only, but it includes p 0 and is homogeneous in the p i 's with degree 1. The first term of (3.15) arises from this difference of behaviour of g and h in a gauge transformation.

We can represent the relations between the contact space ( ∼ T, ω) and the symplectic space (T, dω) by the following diagram:

(T, dω) symplectic transformation, h --------------------------------→ (T, dω)

Symplectization ↑ ↓ Projection, π ( ∼ T, ω) -------------------------------→ contact transformation, f ( ∼ T, ω)
The symplectization, usually performed [START_REF] Arnold | Mathematical Methods of Classical Mechanics[END_REF] by constructing T as a fibre bundle associated with the configuration space q 0 , ..., q n , amounts here to the introduction of a gauge structure in the space of intensive variables γ i = -p i /p 0 , whereas the projection π amounts to the fixation of the gauge through p 0 = -1.

The Hamiltonians h which are equivalent to contact transformations f are constrained by the homogeneity condition (3.8), which ensures that the gauge invariance of the Lagrangean manifolds M is preserved.

Hamiltonian equations for dissipative dynamics and quasi-static processes

The above formalism holds in particular for a continuous mapping which leaves some physical manifold M 0 invariant. The equations of motion (3.5) can thus describe non-equilibrium thermodynamic processes which take place in a given system characterized by M 0 , and which are represented by the motion of a point in M 0 . In these dynamics, the other thermodynamic manifolds M are not kept invariant but are transformed into one another, contrary to M 0 . The effective Hamiltonian h will therefore depend on the equations of state (2.4) which parametrize M 0 (or equivalently on the entropy function S of the system), as well as on the transport coefficients. This effective Hamiltonian h should not be confused with the microscopic Hamiltonian Ĥ which governs the dynamics in statistical mechanics. Apart from its general property (3.8), h should here be such that the Hamiltonian flow that it generates through (3.5) lies, for any point of M 0 , in M 0 itself. In particular, the relation q 0 = S(q 1 , ..., q n ) should be conserved, which is expressed by writing its time-derivative as

∂h ∂p 0 = n i=1 ∂S ∂q i ∂h ∂p i = - 1 p 0 n i=1 p i ∂h ∂p i . (4.1)
Together with (3.7), this implies that

h = 0 over M 0 . (4.2)
Conversely, the general homogeneity property (3.8) of h and the vanishing of h on the manifold M 0 which represents the given system in the extended thermodynamic space T are sufficient to ensure that the equations of state (2.4) remain satisfied at all times provided they are satisfied at the initial time. This is readily checked by regarding the set (2.4) as a parametrization of M in terms of the independent variables q 1 , ..., q n , p 0 . This can also be seen as a consequence of (4.2) and of the conservation, along the motion, of the 1-form ω which thus remains zero. The vanishing of h over M 0 is the counterpart of the vanishing of f in the corresponding contact transformation in ∼ T that keeps ∼ M 0 invariant, a property rigorously proven in ref. [START_REF] Mrugala | [END_REF].

One among the equations of motion,

q0 = ∂h ∂p 0 , (4.3)
describes the rate of change of the entropy, which for an isolated system is the dissipation. Thus, although the variable p 0 has in itself no physical meaning, its occurrence in the effective Hamiltonian is essential to deal with dissipative processes. It would clearly not have been possible to assign to an irreversible process Hamiltonian equations including the time-derivative q0 of entropy without introducing such an extra variable. Dynamical features which apparently contradict usual properties of Hamiltonian motions, such as the fact that the dissipation (4.3) cannot be negative, or the convergence at large times of the trajectories towards a fixed point which describes global equilibrium of the system, arise from a special choice of the initial point, which should always lie on M 0 . In particular, the Liouville theorem is compatible with the convergence of physical trajectories towards a fixed point, because there exist neighbouring unphysical trajectories, close to M 0 but outside it, which diverge away from this fixed point. We shall illustrate this fact in Eq. (4.13) below.

Since the Hamiltonian equations (3.5) are here physically meaningful only for the flow in M 0 , the Hamiltonian h is not defined in a unique fashion for a given physical process. Changes of h which do not modify its value (h = 0) on M 0 and its first-order derivatives on M 0 are irrelevant for physics.

As an illustrative example, let us consider heat transfer between two thermal baths. We assume the thermal conductivity of each bath to be much larger than that of the barrier, so that their two energies U 1 and U 2 are sufficient to characterize at each time the state of the system. The entropy S is the sum of the entropies S 1 U 1 and S 2 U 2 of the two baths. We recalled in the introduction the equations of motion (1.3), (1.4) for this model. In the 6dimensional extended thermodynamic space T, the manifold M 0 , parametrized by q 1 = U 1 , q 2 = U 2 and the gauge variable p 0 , is characterized by the equations q 0 = S 1 (q 1 ) + S 2 (q 2 ), p 1 = -p 0 β 1 (q 1 ), p 2 = -p 0 β 2 (q 2 ), (

where we denote as

β 1 (U 1 ) = dS 1 (U 1 ) dU 1 , β 2 (U 2 ) = dS 2 (U 2 ) dU 2 (4.5)
the inverse temperatures of the baths regarded as functions of their energies. We readily check that on the manifold (4.4) the equations of motion (1.3),(1.4), rewritten in terms of q i , p i (i = 0, 1, ..., n), can be generated through (3.5) from the Hamiltonian

h = L(β 1 , β 2 ) - 1 2p 0 (p 1 -p 2 ) 2 + p 0 2 (β 1 -β 2 ) 2 , (4.6)
which depends on q 1 and q 2 through β 1 (q 1 ) and β 2 (q 2 ). As it should, h vanishes on the physical manifold (4.4), and is of degree 1 in the variables p i . The latter property ensures that the dissipation (4.

3) is the one, n i=1 γ i qi , associated with the flux (1.4). The conservation of energy is reflected by the fact that h depends on p 1 and p 2 only through their difference.

As noted above, we can alternatively use for h any Hamiltonian equivalent to (4.6) to first-order in the variables p 1 +p 0 β 1 (q 1 ), p 2 +p 0 β 2 (q 2 ) and q 0 -S(q 1 , q 2 ) which vanish on the manifold M 0 . For instance, we can take, in terms of the flux Φ(γ 1 , γ 2 ) = L(γ 1 , γ 2 ) (γ 2 -γ 1 ) of energy escaping from the bath 1, which is a function of the intensive variables, the Hamiltonian

h = Φ(- p 1 p 0 , - p 2 p 0 ) [(p 1 + p 0 β 1 ) -(p 2 + p 0 β 2 )] . (4.7)
The Hamiltonians (4.6) or (4.7) do not depend on the entropy variable q 0 , so that the time-derivative ṗ0 = -∂h ∂q 0 (4.8)

of the gauge variable p 0 vanishes. The elimination of the gauge is trivial in such a situation. By fixing the gauge so that p 0 = -1 at all times, and by keeping aside the entropy variable q 0 , we can then regard the 2n-dimensional space -T spanned by q 1 , ..., q n , γ 1 , ..., γ n as a mechanical phase space in which the extensive and intensive variables q i and γ i (i = 1, ..., n) appear as canonically conjugate. Their dynamics are generated by the Hamiltonian p 0 f = -f defined by (3.14) T, but the absence of q 0 allows us to regard f as an ordinary

Hamiltonian in the 2n-dimensional symplectic space -T, in the special case when the effective Hamiltonian in the space T does not depend on the entropy variable q 0 . For the heat transfer problem, the Hamiltonian f which arises from (3.14) and (4.6) is, in terms of the "position" variables q 1 , q 2 and their conjugate "momenta"

γ 1 , γ 2 , f = 1 2 L (β 1 , β 2 ) (γ 1 -γ 2 ) 2 -(β 1 -β 2 ) 2 . (4.10)
Equivalently as regards the physical dynamics, we get from (4.7)

f = Φ (γ 1 , γ 2 ) [(γ 1 -β 1 ) -(γ 2 -β 2 )] . (4.11)
The Hamiltonians (4.6) in T or (4.10) in -T involve two terms, the first one of "kinetic" type, the second one of "potential" type. These two terms occur with opposite signs, in contrast to what usually happens in mechanics. For the motions in which we are interested, they exactly cancel out at the initial time, and hence at all times. As indicated above, the special choice of an initial point in M 0 prevents the divergence of trajectories which is expected from the wrong sign of the potential term. We illustrate this point by fully solving the equations (4.9) in the whole space T for a model where L is a constant and where the entropies are quadratic functions of the energies:

S i U i = a i U i -1 2 b i U i 2 , (i = 1, 2) . (4.12)
(The Gibbs-Duhem homogeneity condition (2.8) is not satisfied here because only one extensive variable, q i = U i , has been introduced for each subsystem; hence b -1 i is an extensive quantity.) The Hamiltonian (4.10) is that of a two-dimensional harmonic oscillator in which the sign of the potential

-1 2 L (β 1 -β 2 ) 2 = -1 2 L a 1 -b 1 q 1 -a 2 + b 2 q 2 2
has been inverted. Its general flow is

γ 1 -γ 2 = Ae Γt + Be -Γt , β 1 -β 2 = -Ae Γt + Be -Γt , (4.13)
where Γ ≡ (b 1 + b 2 ) L, with the total energy q 1 +q 2 and the quantity b 2 γ 1 +b 1 γ 2 as constants of the motion. The concavity of the entropy functions (4.12) implies b i > 0, and the positivity of the response coefficient L then implies Γ > 0. The arbitrary constants A and B are determined by the initial conditions, which for a physical process entail γ 1 -γ 2 = β 1 -β 2 and hence A = 0. Thus only the decaying terms Be -Γt occur in (4.13) for physical processes, although the diverging terms Ae Γt are present for non-physical trajectories which lie outside the manifold M 0 . Likewise the dissipation evaluated from (4.12) and (4.13), Ṡ = L B 2 e -2Γt -A 2 e 2Γt , remains positive at all times only on M 0 . It is therefore important, in order to use Hamilton's equations (3.5) or (4.9) for a numerical solution of dissipative motions, to enforce the constraints (2.4) which characterize M 0 , although these constraints are conserved along the motion, because small errors may produce increasing spurious effects.

In spite of its simplicity, the heat transfer problem considered above is a prototype for any process of non-equilibrium thermodynamics, describing transfer of heat, of momentum, of particles, or chemical reactions. In any such case, the time-derivative of each extensive variable q i , where the compound index i = k, α refers both to the nature k of the quantity transferred and to the considered subsystem α, is expressed as a sum of outgoing fluxes -Φ i β (γ 1 , ..., γ n ) , which depend on the intensive variables γ i and which involve the subsystems β that interact with α. The conservation laws are expressed by Φ kα β = -Φ kβ α . If we keep aside the entropy variable q 0 and fix the gauge as p 0 = -1, we can generate the dynamics in the 2n-dimensional space -T from the effective Hamiltonian

f = i,β Φ i β (γ 1 , ..., γ n ) ∂S q 1 , ..., q n ∂q i -γ i . (4.14)
This expression generalizes (4.11), which involved only two opposite fluxes

Φ 1 = Φ = -Φ 2 .
It also applies to non-isolated systems, in which case some fluxes are imposed by external sources. Since the trajectories of interest satisfy the constraints γ i = ∂S/∂q i , the Hamiltonian flow in the whole space can be stabilized around those constraints by adding to (4.14) terms proportional to

∂S q 1 , ..., q n ∂q i -γ i 2 , (4.15)
which do not affect the dynamics on the physical manifold M. Effective Hamiltonians such as (4.14) are not arbitrary. They should satisfy several properties imposed by the theory of non-equilibrium thermodynamics [START_REF] Callen | Thermodynamics and an introduction to Thermostatistics[END_REF][START_REF] Balian | From Microphysics to Macrophysics[END_REF]. The entropy function S q 1 , ..., q n should be concave, expressing stability of matter. The fluxes should be two by two opposite, so as to ensure the conservation laws. The matrix of response coefficients L should be positive so as to ensure that the dissipation is not negative. Finally the symmetry and invariance laws should be reflected in the form of the functions S and Φ.

In the special case of quasi-static processes, there is no dissipation. Such processes are usually considered for a non-isolated system which remains nearly in equilibrium at each time under the effect of external sources. If it does not interact with a heat source, its entropy remains constant, so that the effective Hamiltonian h should not depend on p 0 . Consider, for instance, a fluid in adiabatic expansion. Its instantaneous state is characterized, for a fixed particle number, by the two variables q 1 ≡ U and q 2 ≡ V, and its equilibrium properties by the entropy q 0 = S (U, V ) . The intensive variables are γ 1 = -p 1 /p 0 = 1/T, γ 2 = -p 2 /p 0 = P/T. If the motion of a piston changes the volume sufficiently slowly, according to V ≡ Φ, the flux of energy is U = -P Φ and the resulting quasi-static dynamics of the fluid in the 6-dimensional space T can be generated by the effective Hamiltonian

h = Φ p 1 ∂S ∂V ∂S ∂U -p 2 (4.16)
(which possibly depends on time through Φ). The constancy of entropy is obvious from ∂h/∂p 0 = 0. In the 4-dimensional symplectic space

- T = U, V, γ 1 , γ 2 , the resulting effective Hamiltonian is f = Φ γ 2 -γ 1 ∂S ∂V ∂S ∂U , (4.17)
a simplified form of (4.14).

For continuous media, the index i in q i and γ i for i = 0 not only refers to the nature of the variable but also labels the volume elements. This index thus includes the coordinates in ordinary space, so that the variables q i and γ i constitute fields (such as the energy density or the local velocity). The expression (4.14) becomes the effective Hamiltonian for a canonical field theory. Moreover, in hydrodynamics, the fluxes need not vanish with the gradients of the intensive variables.

We have noted that, under the condition (4.2), the dynamics generated by the Hamiltonian h (or f ) preserve the constraints (2.4) which express the equations of state, provided they are satisfied at the initial time. One could take advantage of these constraints so as to reduce the number of variables, or to obtain by standard techniques non-canonical though Hamiltonian dynamics in terms of reduced Poisson structures [START_REF] Marsden | Fluids and plasmas : Geometry and dynamics[END_REF].

Generation of equations of state

We have written the equations of state which determine a thermodynamic manifold M in the specific form (2.4). In practice a thermodynamical system is characterized in the 2n + 2-dimensional space T by generalized equations of state, which constitute a set of n + 1 equations equivalent to the set (2.4). As a consequence of gauge invariance, each of them is homogeneous in the p i 's. These equations of state are not always well known, and the missing ones may be determined phenomenologically by comparison with known similar systems.

To this aim, contact transformations in the space ∼ T have been used [START_REF] Mrugala | [END_REF][START_REF] Benayoun | Méthodes géométriques pour l'étude des systèmes thermodynamiques et la génération d'équations d'état[END_REF][START_REF] Mrugala | Thermodynamics of energy conversion and transport[END_REF][START_REF] Benayoun | [END_REF]. We suggest here to rely on canonical mappings or Hamiltonian flows in the space T in order to transform the sets of equations of state of different system into one another.

As an illustration, let us consider two systems characterized by their entropy functions S q 1 , ..., q n and S ′ q 1 , ..., q n , respectively. We wish to map their associated thermodynamic manifolds M and M ′ onto each other in T. For simplicity, we consider a mapping which does not affect the coordinates q 1 , ..., q n . The generating function H which achieves the canonical mapping through Eqs. (3.10) is not defined in a unique fashion, since its action on manifolds other than M and M ′ is not specified. We can readily check that the following choice is suitable:

H = n i=0 p ′ i q i + p ′ 0 S ′ q 1 , .
.., q n -S q 1 , ..., q n . (

Indeed, Eqs.(3.10) yield

p 0 = p ′ 0 , p i + p 0 ∂S ∂q i = p ′ i + p ′ 0 ∂S ′ ∂q i , q ′ 0 -S ′ = q 0 -S, q ′i = q i (i = 1, ..., n) , (5.2)
which are obviously satisfied for a pair of points located on M and M ′ and having the same coordinates p 0 , q 1 , ..., q n . Eq.(5.1) exhibits the occurrence of a thermodynamic potential, here the entropy, in the expression of the generating function H. Such an occurrence was already recognized for contact transformations in

∼ T [9-11].
For a continuous set of hypothetical systems labelled by a deformation parameter τ regarded as a mock time, the representative manifolds M(τ ) in T can be parametrized according to (2.4) by means of the family S τ q 1 , ..., q n of entropy functions. The flow which transforms them into one another without changing the coordinates p 0 , q 1 , ..., q n is generated, according to (3.12) and (5.1), by the time-dependent Hamiltonian h = p 0 ∂ ∂τ S τ q 1 , ..., q n . (

More general flows transforming continuously the manifolds M (τ ) into one another can be generated by Hamiltonians, obtained by adding to (5.3) some τ -dependent function which vanishes on M (τ ) and is homogeneous with degree 1 in the p i 's. Indeed, as shown in Section 4, this additional term lets the coordinates p 0 , q 1 , ..., q n change in time without modifying M (τ ) .

In the above example, we have assumed the entropy to be given as a thermodynamic potential. For application purposes we can take advantage of the geometric nature of the formalism, which allows us to parametrize the thermodynamic manifolds with variables other than q 1 , ..., q n , p 0 and accordingly to use different thermodynamic potentials. As an example, let us reconsider transformations which map a van der Waals fluid onto another one or onto a perfect gas, a problem already studied in the framework of contact transformations [START_REF] Benayoun | Méthodes géométriques pour l'étude des systèmes thermodynamiques et la génération d'équations d'état[END_REF][START_REF] Benayoun | [END_REF]. We keep here the particle number fixed: we shall take for it the Avogadro number N A . The space T has thus 6 dimensions. The practical variables, namely, the molar entropy, energy and volume, the temperature, the pressure and the single-particle chemical potential µ obtained from (2.8) are identified as

S = q 0 , U = q 1 , V = q 2 , T = - p 0 p 1 , P = p 2 p 1 , µN A = U -T S + P V = 1 p 1 p 0 q 0 + p 1 q 1 + p 2 q 2 .
(5.4)

The occurrence of the gauge factor p 1 in the denominators of the intensive variables instead of p 0 is related to the use of the energy representation, more convenient here than the entropy representation. In fact, if we take the free energy F (T, V ) as a thermodynamic potential instead of S (U, V ) , we find the generalized equations of state for a manifold M in the form

q 0 ≡ S = - ∂F ∂T , q 1 + p 0 p 1 q 0 ≡ U -T S = F, p 2 p 1 ≡ P = - ∂F ∂V , (5.5)
where the arguments in F and its derivatives are replaced by -p 0 /p 1 ≡ T and q 2 ≡ V. Here, M is thus parametrized in terms of q 2 , p 0 and p 1 .

A van der Waals fluid is characterized by its molar free energy

F (T, V ) = -RT ln (V -b) - a V + Ψ (T ) , (5.6)
where R = N A k B and where the constants a, b and the function Ψ (T ) depend on the fluid. An ideal gas of structureless particles with mass m corresponds to the special case

a = b = 0, Ψ (T ) = RT ln N A e 2πℏ 2 mk B T 3/2 . ( 5.7)
We wish to map this van der Waals fluid onto another one (or onto an ideal gas), characterized by its free energy F ′ (T, V ) of the form (5.6) where a, b, Ψ (T ) are replaced by a ′ , b ′ , Ψ ′ (T ) . We consider in T a mapping of M onto M ′ for which the coordinates q 2 , p 0 and p 1 , that is, T and V, remain unchanged. This is achieved by introducing a generating function K, the Legendre transform of H with respect to p ′ 1 and q 1 , due to the choice of variables T and V in the thermodynamic potential. Transposing Eq.(5.1) yields

K q 0 , p 1 , q 2 , p ′ 0 , q ′1 , p ′ 2 = p ′ 0 q 0 -p 1 q ′1 +p ′ 2 q 2 +p 1 F ′ - p ′ 0 p 1 , q 2 -F - p ′ 0 p 1 , q 2 , (5.8)
where F and F ′ have the form (5.6) or (5.7). We readily check that the mapping provided by the partial derivatives of K in the full space T reads:

p 0 = p ′ 0 , p ′ 1 = p 1 , p 2 + p 1 ∂F ∂V = p ′ 2 + p ′ 1 ∂F ′ ∂V , q ′2 = q 2 , q 0 + ∂F ∂T = q ′0 + ∂F ′ ∂T , q 1 - p 0 p 1 ∂F ∂T -F = q ′1 - p ′ 0 p ′ 1 ∂F ′ ∂T -F ′ .
(5.9)

Hence the equations of state (5.5) for M imply the corresponding ones for M ′ , and K therefore maps as expected these manifolds onto each other. If a, b, Ψ (T ) depend continuously on a mock time τ , the free energy (5.6) depends on τ , what we denote by F τ . The generating function K of (5.8) taken between the times τ and dτ yields a time-dependent Hamiltonian, as H does in (3.12). The family of manifolds M (τ ) is then obtained from the Hamiltonian flow produced by

h = p 1 ∂ ∂τ F - p 0 p 1 , q 2 .
(5.10)

The explicit form of h follows from (5.6).

In the above mappings through (5.8) or (5.10) the variables q 2 , p 0 , p 1 and accordingly V, T are taken as constants of the motion. We can also build Hamiltonian mappings which modify V or T. As a simple example, let us construct a transformation among the set of van der Waals equations which will make the law of corresponding states obvious. The critical point is given by

V c = 3b, P c = a 27b 2 , T c = 8a 27b , (5.11)
and the P, V, T equation of state depends only on the reduced variables V /V c , P/ P c , T /T c . We look for a mapping which leaves these reduced variables invariant.

If moreover we wish T ≡ -p 0 /p 1 and hence T c to remain constant in time, we should find that the variables V ≡ q 2 and P -1 ≡ p 1 /p 2 as well as the parameters a and b in the equation of state vary proportionally to one another. On the other hand, the variations of V and b entail that the contribution R ln (V -b) to the entropy S ≡ q 0 depends on the time τ . If we assume this dependence to be linear, in -Rτ , common dependence of V = q 2 , b, and P -1 = p 1 /p 2 should be exponential, in e -τ . The simplest Hamiltonian which achieves these goals is h = -Rp 0 -p 2 q 2 , (5.12)

since it provides the equations of motion

dp 0 dτ = dp 1 dτ = 0, dp 2 dτ = p 2 , dq 0 dτ = -R, dq 1 dτ = 0, dq 2 dτ = -q 2 , (5.13)
implying V ∝ P -1 ∝ e -τ and constant T. The left-hand side of the P, V, T equation of state, which is at the initial time

P + a V 2 (V -b) -RT = 0, (5.14)
retains as expected its form in this motion of P and V, with a and b changed into ae -τ and be -τ . The remaining two equations of state (5.5), which involve S ≡ q 0 and U ≡ q 1 , also retain their form, and the choice (5.12) for the Hamiltonian entails that the function Ψ (T ) does not depend on τ . Adding to the Hamiltonian (5.12) a homogeneous function of p 0 and p 1 with degree 1 would result in a change of Ψ (T ) in the free energy (5.6).

The molar chemical potential µN A obtained from (5.4) and (5.13) varies linearly as RT τ along the trajectories. If we consider the two end points of the plateau in the isotherms which describes liquid-vapour equilibrium, the equality of the intensive variables T, P, µ at these points is maintained along the trajectories, so that the flow maps the saturation curve into that of the transformed fluid. This is consistent with Maxwell's construction and with the conservation of areas in the P, V plane in a symplectic flow with constant T. Note finally that the ideal gas equation of state remains unchanged in the mock dynamics generated by (5.12), and that a van der Waals fluid is changed into an ideal gas by this dynamics in the large τ limit.

Metric structure

We have not yet dealt with the concavity of the entropy S q 1 , ..., q n as function of the extensive variables, which expresses the stability of equilibrium states. This property produces constraints on the physical manifolds M in the 2n + 2dimensional space, that we wish to express. It entails the positivity of the matrix -∂ 2 S/∂q i ∂q j , or equivalently the existence of a metric structure in the n-dimensional space q i relying on the quadratic form

ds 2 = -d 2 S = - n i,j=1 ∂ 2 S ∂q i ∂q j dq i dq j , (6.1)
which defines a distance between two neighbouring thermodynamic states. The possibility of endowing equilibrium thermodynamics with some Riemannian structure is known since a long time [18,19], but the metric (6.1) is not the only possible one in the framework of macroscopic thermodynamics. For instance, ds 2 = d 2 U also appears acceptable, although ds 2 = -d 2 S is preferable in the framework of thermodynamic fluctuation theory [19].

This arbitrariness can be lifted by resorting to statistical mechanics. The problem there is to find a physically meaningful distance [START_REF] Balian | [END_REF] this metric to the subset of the space D constituted by the Gibbsian density operators, which have a form of the type (2.1) and which represent at the microscopic scale the local equilibrium states of thermodynamics. These density operators are in one-to-one correspondence with the points q 1 , ..., q n and their von Neumann entropy (6.2) is identified with the entropy S q 1 , ..., q n of thermodynamics. The reduction of the metric (6.3) to this n-dimensional subset of the space D is identical with the metric (6.1), which thus arises as the only natural metric inferred on equilibrium or non-equilibrium thermodynamics by the unique metric of quantum statistical physics.

In this microscopic approach the volume of the system is regarded as fixed. It is not included in the variables q i which characterize the state of the system. If the set q i contains all the extensive variables, including the volume, an eigenvalue 0 appears in the metric tensor (6.1), since the extensivity of S then implies n j=1 ∂ 2 S ∂q i ∂q j q j = 0.

(6.4)

The distance (6.1) between two states also vanishes in the thermodynamic limit in a phase equilibrium situation, when these two states differ only through the proportion of the phases. Distances are always positive between two states having different intensive variables, and they thus characterize their qualitative differences.

The condition ds 2 ≥ 0 expresses one of the Laws of thermodynamics, the concavity of the entropy function. In order to complete the formulation or thermodynamics in the spaces T by means of the coordinates q 1 , ..., q n , the metric (6.1) takes a simple form: An infinitesimal shift of the state can be represented either by the set of variations dq 1 , ..., dq n which can be regarded as its contravariant components, or by the set -dγ 1 , ..., -dγ n which according to Eq. (6.5), appear as its covariant ones. The distance between two states of any given physical system takes, for infinitesimal variations on M, the form

ds 2 = - n i=1 dγ i dq i , (6.6)
which does not depend explicitly on the entropy function of the system. The specificity of this system is reflected by the curvature of the manifold -M, itself resulting from the metric tensor given by (6.5).

Considered in the whole space -T, the expression (6.6), which equivalently reads The factor 1/p 0 ensures gauge invariance, and apart from it ds 2 is symmetric with respect to i = 0, 1, ..., n. The restriction of (6.7) to a n + 1-dimensional Lagrangean manifold M where ω ≡ n i=0 p i dq i = 0 (which ensures the existence of S and the gauge invariance) yields again the metric (6.1) on M. However, there are here n + 1 contravariant coordinates dq 0 , dq 1 , ..., dq n for a shift in M, which are not independent since ω = 0. The independent variables on M being taken, for instance, as q 1 , ..., q n , p 0 , the covariant coordinates of a shift are dp i /p 0 (i = 0, 1, ..., n). The distance between two points describing the same state, which are deduced from each other through a gauge transformation (2.3), vanishes. More generally two different states with the same intensive variables γ 1 , ..., γ n lie at a vanishing distance, as obvious from (6.6) for -M or ∼ M and from (6.7) in a gauge with constant p 0 for M; this expresses that the metric characterizes the nature of the independent phases of the system, not their sizes.

ds 2 = n i=1 1 2 dq i -dγ i 2 - 1 2 dq i + dγ i 2
Altogether the physical manifolds M in T should not only satisfy the condition ω = 0, which ensures that the thermodynamic identities are satisfied, but should also be such that the bilinear differential form (6.7) induces on them a non-negative Riemannian metric ds 2 , which ensures thermodynamic stability.

Accordingly, canonical transformations H which map M onto M ′ in T preserve thermodynamic stability only if they satisfy some inequalities. Using Eqs. ( The mapping should be such that, if the points q i , p i and q ′i , p ′ i (i = 0, 1, ..., n) and their variations lie on the manifolds M and M ′ , respectively, both ds 2 and ds ′2 are positive. In a continuous transformation generated by h, the metric evolves according to ∂ 2 h ∂q i ∂p j dp i dp j -∂ 2 h ∂q i ∂q j dq i dq j . (6.9) A control of the sign of the metric through Eqs. (6.8) or (6.9) sets up conditions on H or h. The occurrence of a zero eigenvalue in the metric tensor during the evolution in terms of the mock time τ indicates the appearance of a critical point in the equations of state thus generated.

Conclusion

The extension of the n-dimensional configuration space q 1 , ..., q n associated with a thermodynamic system, successively to the 2n-dimensional space -T including the intensive variables γ 1 , ..., γ n , then to the 2n+1-dimensional space -T including in addition the entropy q 0 , finally to the 2n + 2-dimensional space T where the γ i 's are replaced by the variables p 0 , p 1 , ..., p n including a gauge arbitrariness, presents practical advantages. It is adapted to changes of variables among the various physical quantities. It sets into the same framework all the systems which have the same degrees of freedom q 1 , ..., q n but different equations of state. Moreover it discloses a rich mathematical structure that characterizes the geometry of the spaces dp i ∧ dq i , where the variables q i and p i appear as conjugate in the sense of analytical mechanics. Such mappings are then canonical, and can be generated by Hamiltonian flows. The quantities q i play the rôle of position variables, the quantities p i or γ i that of momentum variables. The Hamiltonians involved should be homogeneous with degree 1 in the variables p i so as to preserve the gauge invariance of the manifolds M. The mappings such that the trajectory issued from any point of some given manifold M 0 lies in M 0 are those for which the Hamiltonian vanishes over M 0 . Finally the stability of thermodynamic states is reflected in the fact that the bilinear forms - We have shown how Hamiltonians can be constructed, either for real motions in thermodynamic processes, even when they are dissipative, or in fictitious dynamics which consistently generate equations of state for different systems.

The above considerations should have more than a formal value. We have worked out a few elementary examples for the sole purpose of illustration. More realistic problems should benefit from the existence of an ordinary Hamiltonian structure, which for instance readily generates variational techniques, and which anyhow is formally simpler than the currently used contact structure.

∼T

  this system of reference is described by a known manifold ∼ M 0 . The incompletely known manifold ∼ M to be determined is then deduced from ∼ M 0 by setting up a correspondence between the two systems, represented by some mapping ϕ in ∼ T. The missing equations of state for ∼ M follow from the corresponding ones for ∼ M 0 . This mapping can be constructed by means of a continuous deformation scheme. It is then generated through infinitesimal transformations in ∼ T. We shall regard the resulting motion as mock dynamics, and shall interpret the deformation parameter as a fictitious time τ . The method can be used to extrapolate, for instance, thermal properties from the knowledge of the P, V, T equation of state. In such problems we are interested in the structure of a an imaginary dynamical flow which would lead from ∼ M 0 to ∼ M, while the physical flow of non-equilibrium thermodynamics considered above maps ∼ M onto itself.

(

  possibility time-dependent) Hamiltonian, which generates a flow in T in terms of either the real or the fictitious time, depending on the problem. The contact transformations in ∼ T which relate the physical thermodynamic manifolds ∼ M to one another are recovered by elimination of the gauge variable p 0 .

  dq i . The vanishing of this form is known to characterize the surface -M of -T which describes the equations of state (1.1) of any given thermodynamic system, so that -M is a Lagrangean submanifold of -T. Deformations which map thermodynamic systems onto one another in the 2n-dimensional space -

  satisfy ω′ = ϕ * (ω) = λω where λ is some non-vanishing function of the coordinates. Likewise the mappings M ′ = ϕ(M) in the 2n + 2-dimensional space T that preserve the thermodynamic identities should satisfy

  ) is a function of the variables γ i ≡ -p i /p 0 only, as a consequence of the homogeneity condition(3.8). The result, contact flow[START_REF] Mrugala | [END_REF] in the thermodynamic space ∼ T. The greater simplicity of the canonical flow in the extended space T arises from the mock dynamics ṗ0 = -∂h ∂q 0 (3.16)

  between two arbitrary neigbouring density operators D and D + d D. To this aim one should rely on the formal structure of quantum statistical mechanics. The essential fact is that the only quantities which behave as scalars in a change of representation and which have physical relevance at a givent time are (i) the expectation values A = Tr D  of the Hermitean operators  in Hilbert space which represent any physical variable, and (ii) the von Neumann entropy S vN = -k B Tr D ln D. (6.2) Hence the operators D on the one hand and  or ln D on the other hand can be regarded as belonging to two dual vector spaces. From the above considerations one can show [3] that the only quadratic form in d D which has physical meaning is, within a multiplicative constant, ds 2 = -d 2 S vN = k B Tr d D d ln D . (6.3) It is positive owing to the concavity of the von Neumann entropy and therefore defines a natural Riemannian metric in the space of density operators D. The matrix elements of d D and k B d ln D appear as the contravariant and the covariant coordinates of a shift. Returning to thermodynamics, we can restrict

T

  or T, we therefore have to rewrite(6.1) in terms of points on a manifold -M, ∼ M or M. We first note that, for a given manifold -M, the definition (1.1) of the intensive variables γ i impliesdγ i = n j=1 ∂ 2 S ∂q i ∂q j dq j . (6.5)Thus, if we parametrize the n-dimensional manifold -M associated with a given system in the 2n-dimensional configuration space -

,

  defines a pseudo-Euclidean metric with signature (n, n) . It may have either sign between two neighbouring points of -T which correspond to different physical systems. However, the restriction of (6.6) to a thermodynamic manifold -M defines the positive Riemannian metric (6.1). Conversely, the submanifolds -M of -T which can be thermodynamically admissible are the Lagrangean manifolds over which (6.6) moreover induces a positive Riemannian metric. The first condition ensures the existence of a function S which generates the equations of -M in the form (1.1), and the second one ensures the concavity of this function. The pseudo-Euclidean metric (6.6) also holds for the 2n + 1-dimensional thermodynamic space ∼ T. The positivity of the metric that it induces on a ndimensional Legendrean submanifold ∼ M of ∼ T now ensures that this manifold may represent a thermodynamically stable physical system.Similar features occur in the 2n+2-dimensional space T. The pseudo-Euclidean metric (6.6) can be rewritten as

M

  or M which represent a thermodynamic system. The existence of thermodynamic identities is reflected in the Legendre structure of any ∼ M, characterized by the identity ω ≡ dq 0 -n i=1 γ i dq i = 0, or equivalently in the Lagrange structure of any -M or M characterized by the more symmetric identity ω ≡ n i=0 p i dq i = 0. The conservation of ω in transformations which map the manifolds M onto one another induces for T a symplectic structure based on the 2-form dω = n i=0

  n i=1 dγ i dq i or p -1 0 n i=0 dp i dq i should induce on -M, ∼ M or M a Riemannian structure with a non-negative metric.

  3.8), we can compare the metrics at corresponding points through∂ 2 H ∂q i ∂q j dq i dq j ,

	ds 2 =	∂H ∂q 0	-1 n i,j=0	∂ 2 H ∂p ′ i ∂q j dp ′ i dq j +
	ds ′2 =	1 p ′ 0	n i,j=0	∂ 2 H ∂p ′ i ∂q j dp ′ i dq j +	∂ 2 H ∂p ′ i ∂p ′ j	dp ′ i dp ′j .	(6.8)

We wish to thank the Total Fina Elf group for support and permission to publish. We are also grateful to the referee for his thorough screening of the manuscript.r