{'fraction_non_alphanumeric': 0.027971780054596378, 'fraction_numerical': 0.006806821001878966, 'mean_word_length': 4.70896579639749, '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}}
Fundamentals of Geometrothermodynamics

We present the basic mathematical elements of geometrothermodynamics which is a formalism developed to describe in an invariant way the thermodynamic properties of a given thermodynamic system in terms of geometric structures. First, in order to represent the first law of thermodynamics and the general Legendre transformations in an invariant way, we define the phase manifold as a Legendre invariant Riemannian manifold with a contact structure. The equilibrium manifold is defined by using a harmonic map which includes the specification of the fundamental equation of the thermodynamic system. Quasi-static thermodynamic processes are shown to correspond to geodesics of the equilibrium manifold which preserve the laws of thermodynamics. We study in detail the equilibrium manifold of the ideal gas and the van der Waals gas as concrete examples of the application of geometrothermodynamics.


I. INTRODUCTION
Differential geometry is a very important tool of mathematical physics with many applications in physics, chemistry and engineering. As an example, one can mention the case of the four known interactions of nature which can be described in terms of geometrical concepts.
Indeed, Einstein proposed in 1915 the astonishing principle "field strength = curvature" to understand the physics of the gravitational field (see, for instance, Ref. [1]). In an attempt to associate a geometric structure to the electromagnetic field, Yang and Mills [2] used in 1953 the concept of a principal fiber bundle with the Minkowski spacetime as the base manifold and the symmetry group U(1) as the standard fiber to demonstrate that the Faraday tensor can be interpreted as the curvature of this particular fiber bundle. Today, it is well known [1] that the weak interaction and the strong interaction can be represented as the curvature of a principal fiber bundle with a Minkowski base manifold and the standard fiber SU(2) and SU (3), respectively. In this work, we will show that it is possible to interpret the thermodynamic interaction as the curvature of a Legendre invariant Riemannian manifold.
It should be mentioned that our interpretation of the thermodynamic interaction is based upon the standard statistical approach to thermodynamics in which all the properties of the system can be derived from the explicit form of the corresponding Hamiltonian and partition function [3], and in which the interaction between the particles of the system is described by the potential part of the Hamiltonian. Consequently, if the potential vanishes, we say that the system has a zero thermodynamic interaction.
In very broad terms, one can say that in a thermodynamic system, all the known forces act among the particles that constitute the system. Due to the large number of particles involved in the system, only a statistical approach is possible, from which average values for the physical quantities of interest are derived. Although the laws of thermodynamics are based entirely upon empirical results which are satisfied under certain conditions in almost any macroscopic system, the geometric approach to thermodynamics has proved to be very useful. One can say that the following three branches of geometry have found sound applications in equilibrium thermodynamics: analytic geometry, Riemannian geometry, and contact geometry.
Probably, one of the most important contributions of analytic geometry to the understanding of thermodynamics is the identification of points of phase transitions with extremal points of the surface determined by the corresponding state equation. For a more detailed description of these contributions see, for instance, [4,5]. Riemannian geometry was first introduced in statistical physics and thermodynamics by Rao [6], in 1945, by means of a metric whose components in local coordinates coincide with Fisher's information matrix.
Rao's original work has been followed up and extended by a number of authors (see, e.g., [7] for a review). On the other hand, Riemannian geometry in the space of equilibrium states was introduced by Weinhold [8] and Ruppeiner [9,10], who defined metric structures as the Hessian of the internal energy and the entropy, respectively. Both metrics have been used intensively to study the geometry of the thermodynamics of ordinary systems and black holes; however, several inconsistencies and contradictions have been found [11][12][13][14][15][16][17][18][19]. It is now well established that these puzzling results are a consequence of the fact that Weinhold and Ruppeiner metrics are not invariant with respect to Legendre transformations [20].
Furthermore, contact geometry was introduced by Hermann [21] into the thermodynamic phase space in order to formulate in a consistent manner the geometric version of the laws of thermodynamics.
In order to incorporate Legendre invariance in Riemannian structures at the level of the phase space and the equilibrium space, the formalism of geometrothermodynamics (GTD) was recently proposed by Quevedo [20]. The main motivation for introducing the formalism of GTD was to formulate a geometric approach which takes into account the fact that in ordinary thermodynamics the description of a system does not depend on the choice of the thermodynamic potential, i. e., it is invariant with respect to Legendre transformations.
One of the main goals of GTD has been to interpret in an invariant manner the curvature of the equilibrium space as a manifestation of the thermodynamic interaction. This would imply that an ideal gas and its generalizations with no mechanic interaction correspond to a Riemannian manifold with vanishing curvature. Moreover, in the case of interacting systems with non-trivial structure of phase transitions, the curvature should be non-vanishing and reproduce the behavior near the points where phase transitions occur. These intuitive statements represent concrete mathematical conditions for the metric structures of the phase and equilibrium spaces. In the present work, we present geometric structures which satisfy these conditions for systems with no thermodynamic interaction as well as for systems characterized by interaction with first and second order phase transitions.
In this work, we present the formalism of GTD by using Riemannian contact geometry for the definition of the thermodynamical phase manifold and harmonic maps for the definition of the equilibrium manifold. We will see that this approach allows us to interpret any thermodynamic system as a hypersurface in the equilibrium space completely determined by the field theoretical approach of harmonic maps. This paper is organized as follows: In Section II, we introduce the main concepts of Riemannian contact geometry that are necessary to define the phase manifold. Section III is dedicated to the description of the equilibrium manifold as resulting from a harmonic map in which the target space is the phase manifold. Section IV contains a discussion of the quasi-static thermodynamic processes which are interpreted as geodesics preserving the laws of thermodynamics. In Section V, we present the main geometric properties of the ideal and the van der Waals gas. Finally, Section VI is devoted to discussions of our results and suggestions for further research.
Throughout this paper, we use units in which G = c = k B = = 1.

II. THE THERMODYNAMIC PHASE MANIFOLD
Consider a (2n + 1)−dimensional differential manifold T and its tangent manifold T (T ).
Let V ⊂ T (T ) be an arbitrary field of hyperplanes on T . It can be shown that there exists a non-vanishing differential 1-form Θ on the cotangent manifold T * (T ) such that the field V can be associated with the kernel of Θ, i. e., V = ker Θ. If the Frobenius integrability condition Θ ∧ dΘ = 0 is satisfied, the hyperplane field V is completely integrable. On the contrary, if Θ ∧ dΘ = 0, then V is non-integrable. In the limiting case Θ ∧ (dΘ) n = 0, the hyperplane field V becomes maximally non-integrable and is said to define a contact structure on T . The pair (T , V) determines a contact manifold [22] and is sometimes denoted as (T , Θ) to emphasize the role of the contact form Θ. Consider G as a non-degenerate metric on T . The set (T , Θ, G) defines a Riemannian contact manifold. It should be noted that the condition Θ∧(dΘ) n = 0 is independent of Θ; in fact, it is a property of V = ker Θ. If another 1-form Θ ′ generates the same V, it must be of the form Θ ′ = f Θ, where f : T → R is a smooth non-vanishing function. This implies that the contact manifold (T , Θ) is uniquely defined up to a smooth function f : T → R.
Let us choose a particular set of coordinates of T as Z A = {Φ, E a , I a } with a = 1, ..., n, and A = 0, 1, ..., 2n. Here, Φ represents the thermodynamic potential used to describe the system whereas the coordinates E a correspond to the extensive variables and I a to the intensive variables. Notice that since in the phase manifold T all the coordinates Φ, E a and I a must be completely independent, it is not possible to describe thermodynamic systems in T which are usually defined in terms of equations of state that relate different thermodynamic variables. An important ingredient of GTD is the concept of Legendre transformations that in general are defined as [23] where i ∪ j is any disjoint decomposition of the set of indices {1, ..., n}, and k, l = 1, ..., i.
In particular, for i = {1, ..., n} and i = ∅, we obtain the total Legendre transformation and the identity, respectively.
In the particular coordinates Z A = {Φ, E a , I a }, the contact 1-form can be written as where we assume the convention of summation over repeated indices. This expression for We would like to emphasize the fact that Legendre invariance is an important condition that guarantees that the description does not depend on the choice of the thermodynamic potential, a property that is essential in ordinary thermodynamics.
From the above description if follows that the only freedom in the construction of the phase manifold is in the choice of the metric G. Although Legendre invariance implies a series of algebraic conditions for the metric components G AB [20], and it can be shown that these conditions are not trivially satisfied, the metric G cannot be fixed uniquely. It is important to mention that a straightforward computation shows that the flat metric is not invariant with respect to the Legendre transformations given in detailed analysis of the Legendre invariance conditions and found as a solution the metric where Λ is an arbitrary Legendre invariant real function of E a and I a , and k is an integer.
To our knowledge, this is the most general metric satisfying the conditions of Legendre invariance.
If we limit ourselves to the case of total Legendre transformations, we find that there exists a class of metrics, parametrized by the diagonal constant tensors ξ ab and χ ab , which is invariant for several choices of these free tensors. In fact, since ξ ab and χ ab must be constant and diagonal it seems reasonable to express them in terms of the usual Euclidean and pseudo-Euclidean metrics δ ab = diag(1, ..., 1) and η ab = diag(−1, 1, ..., 1), respectively. Then, for instance, the choice ξ ab = δ ab , χ ab = δ ab (6) corresponds to a Legendre invariant metric which has been used to describe the geometric properties of systems with first order phase transitions [20,24]. Moreover, the choice turned out to describe correctly second order phase transitions especially in black hole thermodynamics [24][25][26][27]. The additional choice can be used to handle in a geometric manner second order phase transitions and also the thermodynamic limit T → 0. Obviously, for a given thermodynamic system it is very important to choose the appropriate metric in order to describe correctly the thermodynamic properties in terms of the geometric properties in GTD.

III. THE EQUILIBRIUM MANIFOLD
Consider the (smooth) harmonic map ϕ : E → T , where E is a subspace of the phase manifold (T , Θ, G) and dim(E) = n, where n is the number of independent degrees of freedom of the thermodynamic system, i. e., the number of independent thermodynamic variables which are necessary to describe a thermodynamic system. Let us assume that the extensive variables {E a } can be used as the coordinates of the base space E. Then, in terms of coordinates, the harmonic embedding map reads ϕ : Since the phase manifold is endowed with a Legendre invariant nondegenerate metric G, the pullback ϕ * of the harmonic map induces canonically a thermodynamic metric g on E by means of If we assume that the metric of the base manifold coincides with the induced metric g = ϕ * (G), the action of the harmonic map [28] can be expressed as and turns out to correspond to the volume element of the submanifold E ⊂ T . Consequently, according to the definition of harmonic maps [28], the variation δS = 0, i. e., the field represent the condition for E to be an extremal hypersurface in the phase manifold T [26].
Here, the symbols Γ A BC represent the Christoffel symbols associated with the metric G AB of the phase manifold, i. e., The pair (E, g) is called equilibrium manifold if the harmonic map ϕ : E → T satisfies the condition The last condition implies that The first of these equations corresponds to the first law of thermodynamics whereas the second one is usually known as the condition for thermodynamic equilibrium [5].
We see that the harmonic map ϕ : E → T defines the equilibrium manifold (E, g) as an extremal submanifold of the phase manifold (T , Θ, G) in which the first law of thermodynamics and the equilibrium conditions hold. This means that the thermodynamic systems are represented through the equilibrium manifold and that the phase manifold is an auxiliary geometric structure that allows us to handle correctly the Legendre transformations and to define the equilibrium manifold in an invariant manner. The harmonic map ϕ demands the existence of the function Φ = Φ(E a ) that is known in ordinary thermodynamics as the fundamental equation from which all the equations of state can be obtained [5]. The second law of thermodynamics implies that the fundamental equation satisfies the condition where the sign depends on the thermodynamic potential. For instance, if Φ is identified as the entropy, the sign must be positive whereas it is negative if Φ is the internal energy of the system [5].
The metric g of the equilibrium manifold is determined uniquely from the metric G by means of g = ϕ * (G). Therefore, the invariance of G under Legendre transformations implies the invariance of g. However, as mentioned above, Legendre transformations act only on the phase manifold and so to investigate the invariance of g it is necessary to apply Legendre transformations on the metric G in T that generates g. The pullback ϕ * of the Legendre invariant metric (4) generates the following thermodynamic metric where which can be shown to be invariant with respect to arbitrary (partial and total) Legendre transformations. On the other hand, the metric (5) of the phase manifold generates the thermodynamic metric where which is invariant with respect to total Legendre transformations. Notice that the explicit components of the thermodynamic metric g can be calculated in a straightforward manner once the fundamental equation Φ(E a ) is explicitly given.

IV. QUASI-STATIC THERMODYNAMIC PROCESSES
In ordinary thermodynamics, a quasi-static process is a thermodynamic process that happens infinitely slowly so that it can be ensured that the system will pass through a sequence of states that are infinitesimally close to equilibrium and, consequently, the system remains in quasi-static equilibrium. Since each point of the manifold E represents an equilibrium state, a quasi-static process can be interpreted as a sequence of points, i. e., as a curve in E. In particular, the geodesic curves of E can represent quasi-static processes under certain conditions. A geodesic curve can be interpreted as a harmonic map from a 1-dimensional base space to the equilibrium manifold (E, g). The corresponding action represents a distance in E that we denote as the thermodynamic length S = ds with ds 2 = g ab dE a dE b .
Then, the variation of the thermodynamic length leads to the geodesic equation where Γ a bc are the Christoffel symbols of the thermodynamic metric g, and τ is an arbitrary affine parameter along the geodesic.
One can expect that not all the solutions of the geodesic equations must be physically realistic. Indeed, there could be geodesic curves connecting equilibrium states that are not compatible with the laws of thermodynamics. In particular, one would expect that the second law of thermodynamics imposes strong requirements on the solutions. In ordinary thermodynamics two equilibrium states are related to each other only if they can be connected by means of quasi-static process. Then, a geodesic that connects two physically meaningful states can be interpreted as representing a quasi-static process. Since a geodesic curve is a dense succession of points, we conclude that a quasi-static process can be seen as a dense succession of equilibrium states, a statement which coincides with the definition of quasi-static processes in equilibrium thermodynamics [5]. Furthermore, the affine parameter τ can be used to label all equilibrium states which belong to a geodesic. Since the affine parameter is defined up to a linear transformation, it should be possible to choose it in such a way that it increases as the entropy of a quasi-static process increases. This opens the possibility of interpreting the affine parameter as a "time" parameter with a specific direction which coincides with the direction of entropy increase.

V. ORDINARY THERMODYNAMIC SYSTEMS
The mathematical tools presented in the last sections allow us to define geometric structures in an invariant way. In particular, the curvature of the thermodynamic metric g should represent the thermodynamic interaction independently of the thermodynamic potential. In fact, this is not a trivial condition from a geometric point of view. For instance, a geometric analysis of black hole thermodynamics by using metrics introduced ad hoc in the equilibrium manifold leads to contradictory results [11][12][13][14][15][16][17][18][19]. Using the induced thermodynamic metric g as defined in Section III for systems with second order phase transitions, the results are consistent and invariant. To illustrate the formalism of GTD we now investigate the geometric representation of some ordinary thermodynamic systems.

A. The ideal gas
As a concrete example of the application of GTD, we consider a mono-component ideal gas. This corresponds to the particular case n = 2 of the metrics given in the last section.
and the Riemannian metric (4) takes the form Moreover, the explicit form of the Riemannian metric for the equilibrium manifold can be derived from Eq. (16). Then It should be mentioned that this form of the thermodynamic metric is valid for any thermodynamic system with two degrees of freedom represented by the extensive variables U and V . It is only necessary to specify the fundamental equation S = S(U, V ) in order to completely determine the form of the metric. In the specific case of an ideal gas, the fundamental equation can be expressed as A straightforward computation leads to the metric All the geometrothermodynamical information about the ideal gas must be contained in the metric (25). First, we must show that the subspace of equilibrium states (E, g) determines and extremal hypersurface in the phase manifold (T , G). The identification of the coordinates in T is as given in Eq. (21) so that the Christoffel symbols Γ A BC for the metric components G AB can be computed in a straightforward way. Then, the field equations can be reduced to These are the conditions for the space of equilibrium states of the ideal gas to be an extremal hypersurface of the thermodynamic phase space. Clearly, the arbitrariness contained in the conformal factor Λ allows us to find many solutions to the above equation. For instance, if we choose Λ = const. and k = −1, we obtain a particular solution which is probably the simplest one. This shows that the geometry of the ideal gas is a solution to the motion equations of GTD. This special choice leads to the metric whose curvature scalar vanishes identically. This result agrees with our intuitive expectation that a thermodynamic metric with zero curvature should describe a system in which no thermodynamic interaction is present.
To continue the analysis of the geometry of the ideal gas we now investigate the geodesic equations. By means of the transformation ξ = ln U, η = ln V , the metric (28) takes the where for simplicity we set the additive constants of integration such that ξ, η ≥ 0. The solutions of the geodesic equations are then found as ξ = ξ 1 λ + ξ 0 and η = η 1 λ + η 0 , where  Fig.1 where the arrows indicate the direction in which a quasistatic process can take place. A quasi-static process connecting states in the inverse direction is not allowed by the second law of thermodynamics. Consequently, the affine parameter τ along the geodesics can actually be interpreted as a time parameter and the direction of the geodesics indicates the "arrow of time". If the initial state is not at the origin of the ξη−plane, the second law permits the existence of geodesics for which one of the coordinates, say η, can decrease as long as the other coordinate ξ increases in such a way that the entropy increases or remains constant. This is schematically depicted in Fig.1 which also contains the region that cannot be reached by geodesics. The shadow region contains all the states that due to the second law cannot be reached by geodesics with the fixed initial state. In all the geodesics the "arrow of time" is a consequence of the second law.

B. The van der Waals gas
A more realistic model of a gas, which takes into account the size of the particles and a pairwise attractive force between the particles of the gas, is based upon the van der Waals fundamental equation where a and b are constants. Usually, a is interpreted as being responsible for the thermodynamic interaction, whereas b plays a more qualitative role in the description of the interaction [5].
The Riemannian structure of the manifold T is as before determined by the metric (4).
For the sake of simplicity, we limit ourselves to the case with k = −1. Then, introducing the fundamental equation (30) into the metric (16) with k = −1, the Riemannian structure of the manifold E is described by the metric The curvature of this thermodynamic metric is in general non-zero, reflecting the fact that the thermodynamic interaction of the van der Waals gas is non-trivial. Furthermore, the scalar curvature of the above metric can be written in the form where N vdW is a function of U, and V that is well-behaved at the points where the denominator vanishes. We see that the scalar curvature diverges at the critical points determined by the algebraic equation P V 3 − aV + 2ab = 0. This is exactly the equation that determines the location of first order phase transitions of the van der Waals gas [5]. Consequently, a first order phase transition can be interpreted geometrically as a curvature singularity. This is in accordance with our intuitive interpretation of thermodynamic curvature.
The motion equations (11) can be derived explicitly for this case by using the phase manifold metric (4), with k = −1, and the metric (16) for the equilibrium manifold. It turns out that the motions equations reduce to only two first order partial differential equations that can be expressed as where F 0 , F 3 , F 4 , G 0 , G 3 , and G 4 are fixed rational functions of U and V . Because of the arbitrariness of the conformal factor Λ it is possible to find solutions to the above system of partial differential equations. We conclude that a family of non-flat thermodynamic metrics can be found that determines an extremal hypersurface in the phase space, and can be used to describe the geometry of the van der Waals gas.
The geodesic equations in the manifold described by the van der Waals metric (31) are highly non-trivial and require a numerical analysis [29]. The results are illustrated in Fig.2.
The main observation is that the geodesics are incomplete, i.e, there exist a maximum value of the affine parameter τ max for which the numerical integration delivers an end value of U(τ max ) and V (τ max ). We analyzed numerically the end points U(τ max ) and V (τ max ) and fount that at those points the relationship P V 3 −aV +2ab = 0 is satisfied. We conclude that the geodesic incompleteness is due to the appearance of first order phase transitions. Since geodesic incompleteness is usually associated with the existence of curvature singularities (see, for instance, [30]) the above result result corroborates the fact that phase transitions correspond curvature singularities in the equilibrium space.

VI. CONCLUSIONS
In this paper, we presented the most important mathematical elements of geometrothermodynamics (GTD), a formalism whose main goal is to describe in an invariant manner the properties of thermodynamic systems by using geometric concepts. We use the concepts of contact geometry to define the thermodynamic phase manifold and to handle correctly the first law of thermodynamics and the Legendre transformations. The phase manifold must be endowed with a Legendre invariant metric. We present the most general metric which is invariant with respect to partial and total Legendre transformations. If we limit ourselves to the case of total Legendre transformations there are several metrics that preserve this symmetry. It turns out that it is necessary to use different metrics to describe thermodynamic systems with either first order or second order phase transitions. We expect to explore in the near feature the cause of this difference.
The equilibrium manifold is defined by means of a harmonic map in which the target space is the phase manifold. In this context, the equilibrium manifold turns out to be an extreme submanifold of the phase manifold endowed with a Riemannian thermodynamic metric which is determined uniquely in terms of the Legendre invariant metric introduced ad hoc in the phase manifold. The construction is such that only the fundamental equation of the thermodynamic system is necessary in order to completely construct the geometry of the equilibrium manifold whose geometric properties are related to thermodynamic properties of the system. In particular, the thermodynamic interaction is described by means of the curvature, and phase transitions of the thermodynamic system correspond to true curvature singularities of the equilibrium manifold. In this work, it was shown explicitly that the curvature is a measure of the thermodynamic interaction in the case of the ideal gas and the van der Waals gas. This statement has been confirmed in all the cases in which GTD has been applied so far [25,[31][32][33][34][35][36].
As concrete examples of the application of GTD, we present the thermodynamic metric of the ideal gas and the van der Waals gas. In the case of the ideal gas, the metric is flat as a result of the lack of thermodynamic interaction. In a particular coordinate system, the geodesics are represented as straight lines. Those geodesics which are in accordance with the laws of thermodynamics turn out to represent quasi-static processes. In the case of the van der Waals gas, the metric is curved, indicating the presence of mechanical thermodynamic interaction between the constituents of the gas. True curvature singularities are found at those points where the gas undergoes a first order phase transition. The geodesics of the equilibrium manifold of the van der Waals gas are shown to be incomplete at those points where phase transitions occur. This could be used as an alternative method to find critical points where phase transitions take place and curvature singularities exist.