{'fraction_non_alphanumeric': 0.04116333135797967, 'fraction_numerical': 0.012444728084970597, 'mean_word_length': 4.35857352222765, '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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Fisher-based thermodynamics for scale-invariant systems: Zipf's Law as an equilibrium state of a scale-free ideal gas

We present a thermodynamic formulation for scale-invariant systems based on the principle of extreme information. We create an analogy between these systems and the well-known thermodynamics of gases and fluids, and study as a compelling case the non-interacting system -the scale-free ideal gas- presenting some empirical evidences of electoral results, city population and total cites of Physics journals that confirm its existence. The empirical class of universality known as Zipf's law is derived from first principles: we show that this special class of power law can be understood as the density distribution of an equilibrium state of the scale-free ideal gas, whereas power laws of different exponent arise from equilibrium and non-equilibrium states. We also predict the appearance of the log-normal distribution as the equilibrium density of a harmonically constrained system, and finally derive an equivalent microscopic description of these systems.


Introduction
The study of scale-invariant phenomena has unravelled interesting and somewhat unexpected behaviours in systems belonging to disciplines of different nature, from physical and biological to technological and social sciences [1]. Indeed, empirical data from percolation theory and nuclear multifragmentation [2] reflect scale-invariant behaviour, and so do the abundances of genes in various organisms and tissues [3], the frequency of words in natural languages [4], scientific collaboration networks [5], the Internet traffic [6], Linux packages links [7], as well as electoral results [8], urban agglomerations [9] and firm sizes all over the world [10].
The common feature in these systems is the lack of a characteristic size, length or frequency for an observable k at study. This lack generally leads to a power law distribution p(k), valid in most of the domain of definition of k, with γ ≥ 0. Special attention has been paid to the class of universality defined by γ = 1, which corresponds to Zipf's law in the cumulative distribution or the rank-size distribution [2,3,4,6,7,9,10,11]. Recently, Maillart et al. [7] have studied the evolution of the number of links to open source software projects in Linux packages, and have found that the link distribution follows Zipf's law as a consequence of stochastic proportional growth. In its simplest formulation, the stochastic proportional growth model, or namely the geometric Brownian motion, assumes the growth of an element of the system to be proportional to its size k, and to be governed by a stochastic Wiener process. The class γ = 1 emerges from the condition of stationarity, i.e., when the system reaches a dynamic equilibrium [11].
There is a variety of models arising in different fields that yield Zipf's law and other power laws on a case-by-case basis [9,11,12]. In the context of complex networks, proportional growth processes known as preferential attachment [6] and competitive cluster growth [13] have been used to explain many of the properties of natural networks, from social to biological. The emergence of power laws in all these models is explained by W. J. Redd and B. D. Hughes [14], which have shown analytically that models based on stochastic processes with exponential growth -as the geometric Brownian motion, discrete multiplicative process, the birth-and-death process, or the Galton-Watson branching process-generate power laws in one of both tails of the statistical distributions. However, in spite of the success of these models, the intrinsic complexity involved makes the study at a macroscopic level difficult since a general formulation of the thermodynamics of scale-invariant physics is not established yet.
Frieden et al. [15] have shown that equilibrium and non-equilibrium thermodynamics can be derived from the principle of extreme Fisher information. The information measure is done for the particular case of translation families, i.e., distribution functions whose form does not change under translational transformations. In this case, Fisher measure becomes shift-invariant [16], what yields most of the canonical Hamiltonians of theoretical physics [17]. Variations of the information measure lead to a Schrödinger equation [18] for the probability amplitude, where the ground state describes equilibrium physics and the excited states account for non-equilibrium physics. As for Hamiltonian systems [19], it has been recently shown that the principle of extreme physical information allows to describe the behaviour of complex systems, as the allometric or power laws found in biological sciences [20].
In this work we present a theoretical framework based on the principle of extreme physical information that aims to describe scale-invariant systems at a macroscopic level. We show that the thermodynamics for such systems can be formulated when the information measure is taken on distributions that do not change under scale transformations. We show that proportional growth is intrinsic to this symmetry, and the processes that describe Zipf's law, as the geometrical Brownian motion, are the equivalent microscopic description of these systems.
This work is organized as follows. In Sec. 2 we present the Fisher information measure for a scale-invariant system. In Sec. 3 we derive the equilibrium state and nonequilibrium states of the most general case of non-interacting scale-invariant system: the scale-free ideal gas (SFIG), and present some empirical evidences of its existence in electoral results and city population. In Sec. 4 we derive from first principles the special case of Zipf's law, what we call the Zipf regime of the SFIG, and study empirical data of the total number of cites of Physics journals to understand the conditions leading to its appearance. In Sec. 5 we constrain the system harmonically, finding that the equilibrium density follows a log-normal distribution. In Sec. 6 we derive from the SFIG the microscopic stochastic equation of motion, showing that the system can be described by geometrical Brownian walkers. Finally, in Sec. 7 we summarize our results and discuss some aspects of our work. In the Appendix we derive from the Fisher information the equations of the well-known translational-invariant ideal gas, which we use as analogy in the derivation of the SFIG.

The principle of extreme information for a scale-invariant system
The Fisher information measure I for a system of N elements, described by a set of coordinates q and physical parameters θ, has the form [17] where F (q|θ) is the density distribution in configuration space (q) conditioned by the physical parameters (θ). The constants c ij account for dimensionality, and take the form c ij = c i δ ij if q i and q j are uncorrelated. Following the principle of extreme information (PEI), the state of the system extremizes I subject to prior conditions, as the normalization of F or any constraint on the mean value of an observable A i . The PEI is then written as a variation problem of the form where µ i are the Lagrange multipliers. In the Appendix, we derive from the PEI the density distribution in configuration space and the entropy equation of state for the well-known translational invariant ideal gas (IG) [21]. In analogy with this derivation, we follow here the same steps to obtain the SFIG density distributions and entropy equations of state.
We consider a one-dimensional system with dynamical coordinates q = (k, v) where dk/dt = v. We define k as a discrete variable, i.e. k = k 1 , k 2 , . . . , k M , where k i = i∆k and M , assumed to be large, is the total number of bins of width ∆k. In order to address the scale-invariance behaviour of k in the Fisher formulation, we change to the new coordinates u = ln k and w = du/dt, and assume that u and w are canonical [22] and uncorrelated. This assumption leads to the proportional growth For constant w this equation yields an exponential growth k = k 0 e wt , which is a uniform linear motion for u: u = wt + u 0 , with u 0 = ln k 0 ‡. It is easy to check that the scale transformation k ′ = k/θ k leaves invariant the coordinate w, whereas the coordinate u transforms translationally If physics does not depend on scale, i.e., the system is translationally invariant with respect to the coordinates u and w, the distribution of physical elements can be described by the monoparametric translation families F (u, w|Θ k , Θ w ) = f (u ′ , w ′ ). By analogy with the IG, we define the SFIG as a system of N non-interacting elements for which the density distribution can be factorized as f (u, w) = g(u)h(w). Taking into account that u and w are canonical and uncorrelated (c ii = c i = 0 and c uw = c wu = 0), and that the Jacobian for the change of variables is dkdv = e 2u dudw, the information measure I = I u + I w can be obtained in the continuous limit as The constraints to the given observables A i in the extremization problem determine the behaviour of the system. In the next sections we study three different cases: the general case of the scale-free ideal gas -the step-by-step analogy of the ideal gas-, a un-constrained gas or what we call the Zipf regime, and the harmonically constrained gas.

The scale-free ideal gas
For the general case, in the extremization of Fisher information we constrain the normalization of g(u) and h(w) to the total number of particles N and to 1, respectively In addition, we penalize infinite values for w with a constraint on the variance of h(w) to a given measured value where w is the average growth. The variation yields and ‡ This exponential growth allows to recognize the systems that we study in this work at the macroscopic level with those studied in [14].
where µ, λ and ν are Lagrange multipliers. Introducing g(u) = e −2u Ψ * (u)Ψ(u), and varying (8) with respect to Ψ * leads to the Schrödinger equation where µ ′ = µ/c u . Analogously to the IG, we impose solutions compatible with a finite normalization of g in the thermodynamic limit N, Ω → ∞ with N/Ω = ρ 0 finite, where Ω = ln(k M /k 1 ) = ln M is the volume in u space and ρ 0 is defined as the bulk density. Solutions compatible with the normalization of (6) are given by Ψ(u) = A α e −αu/2 , where A α is the normalization constant and α = √ 4 + µ ′ . In this general case, the density distribution as a function of k takes the form of a power law: g α (ln k) = A 2 /k 2+α . The equilibrium is defined by the ground state solution, which correspond the lowest allowed value α = 0. It can be show that it is just a uniform density distribution in u space at the bulk density: g(u)e 2u du = N/Ωdu = ρ 0 du.
Introducing h(w) = Φ * (w)Φ(w) and varying (9) with respect to Φ * leads to the quantum harmonic oscillator equation [18] −4 where λ ′ = λ/c w and ν ′ = ν/c w . The equilibrium configuration corresponds to the ground state solution, which is now a Gaussian distribution. Using (7) to identify The density distribution in configuration space If we define H = ∆k 2 /∆τ as the elementary volume in phase space, where ∆τ is the time element, the total number of microstates is where f 1 = f /N is the monoparticular distribution function and N ! counts all possible permutations for distinguishable elements. The entropy equation of state S = −κ ln Z reads where κ is a constant that accounts for dimensionality and H ′ = H/(k M k 1 ) = H/(M ∆k 2 ) = 1/(M ∆τ ). Remarkably, this expression has the same form as the onedimensional IG (D = 1 in (A.9)); instead of the thermodynamical variables (N, V, T ), here we deal with the variables (N, Ω, σ w ), which make the entropy scale-invariant. The total density distribution for k is obtained integrating for all v the density distribution in configuration space. Integrating (13) we get which corresponds for large N to an exponential rank-size distribution where r is the rank. This behaviour, which corresponds to the class of universality γ = 0 in (1), has been empirically found by Costa Filho et al. [8] in the distribution of votes in the Brazilian electoral results. We have found such a behaviour in the city-size distribution of small regions and electoral results, like the province of Huelva (Spain) [23], and the 2008 Spanish General Elections results [24], respectively. We show in figure 1a and 1b their rank-size distribution in semi-logarithmic scale, where a straight line corresponds to a distribution of type (16). Most of the distribution can be linearly fitted, with a correlation coefficient of 0.994 and 0.998 respectively. From these fits we have obtain a bulk density of ρ 0 = 0.058 for the General Elections results, and in the case of Huelva ρ 0 = 17.1 (N = 77, Ω = 4.5). Using historical data for the latter [23], we have used the backward differentiation formula to calculate the relative growth rate of the i-th city as where k  1c). In both cases, the competition between parties seems to play an important role, and the assumption of non-interacting elements can be unrealistic §.

The Zipf regime
In the previous subsection we considered that N/Ω remains finite even in the thermodynamic limit, i.e., the system reaches the bulk density ρ 0 . However, if N/Ω → 0 as Ω → ∞, i.e., the system is exposed to an empty infinite volume, the normalization can not be achieved and the constraint has to be removed (µ = 0). We call this case the Zipf regime, in order to distinguish it from the general.
Considering only the k coordinate in the domain [k 1 , ∞), the information measure for the total density distribution f (k)dk = f (u)e u du = p(u)du, reads and the extremization problem Introducing f (u) = e −u Ψ * (u)Ψ(u), and varying with respect to Ψ * leads to the Schrödinger equation Taking the boundary conditions lim u→∞ f (u) = 0 and f (u 1 ) = C where u 1 = ln k 1 and C is a constant, the solution to the equation is Ψ(u) = C ′ e −u/2 , where C ′ = √ Ce u1 . It can be shown that this is just an exponential decay in u space f (u)e u du = Ce −u du. This solution leads to the total density distribution with C 2 = N k 1 for a normalized density. It corresponds in the continuous limit to a rank-size distribution of the type which is the Zipf's law (universal class γ = 1) of [2,3,4,6,7,9,10,11]. This result is remarkable: for the first time Zipf 's law is derived from first principles.
In figure 2 we show the known behaviour [11] of the rank size distribution of the top 100 largest cities of the United States [27], which shows an slope near −1 (γ = 1) in the logarithmic representation of the rank-plot.
The appearance of the bulk and the Zipf regime in a SFIG can be understood studying empirical data. We have studied the system formed by all Physics journals [28] (N = 310) using their total number of cites as coordinate k. If a journal receives more cites due to its popularity, it becomes even more popular and therefore it § The effects of interaction are studied in [26], where we go beyond the non-interacting system using a microscopic description based on complex networks. will receive more cites. Under such conditions proportional growth and scale invariance are expected. Since we consider all fields of Physics, correlation effects are much lower than only consider journals of an specific field, so the non-interacting approximation seems realistic in this case. In figure 3 we show the rank-plot of the number of cites of Physic journals, where we have found a slope near −1 for the most-cited journals in the logarithmic representation (figure 3a) and an slope near +1 for the less-cited journals (figure 3b). For the central part of the distribution bulk density reaches a value of ρ 0 ∼ 57 (figure 3c). This distribution shows an extraordinary symmetric behaviour under the change k → 1/k (u → −u). We show in figure 4 the raw empirical data compared with the distribution obtained from the transformation k ′ = c/k (u ′ = −u + ln c), where c = 3.3 × 10 6 . The symmetry of this system is an important clue to understand both regimes, and represents a perfect example of the conditions needed to observe bulk and Zipf regimes in a non-interacting scale-invariant system. The main part of the density distribution reaches the bulk density obeying (15), whereas Zipf's law emerge at the edges, obeying (21): following the analogy with the physics of gases and fluids, we can think of the system as a drop, where the Zipf regime is the sign of a surface since it reproduces how the density exponentially falls from the bulk density to zero in u space when the system is exposed to an infinite empty volume. This effect is clearly visible in figure 5, where the empirical density distribution p(u)du in u space is compared with the fitted density where ρ a = 0.1, ρ 0 = 57, ρ b = 4.3 × 10 5 , u a = 5.2 and u b = 10. These findings lead us to conclude that the system of Physics journals sorted by total number of cites is a perfect example of the scale-free ideal gas at equilibrium.

The harmonically constrained system
We now consider a system with a constraint in a given observable A which locally depends on k, A = A(k). The second order Taylor expansion with respect to u = ln k near a minimum is written as 10 100 r (rank) Introducing f (u) = e −u Ψ * (u)Ψ(u), and varying with respect to Ψ * leads to the quantum harmonic oscillator equation where now we have defined λ ′ = (λA 2 )/2c w and ν ′ = (ν + 1 + λA 0 )/c u . The ground state solution is a gaussian distribution, which now yields a total density distribution of the form of a log-normal distribution with |λ ′ | −1/2 = σ 2 u = A − A 0 . Note that if A 0 = 0, the constraint can be also understood as a constraint in the variance of u.
The log-normal distribution has been widely observed in a large number of scaleinvariant systems [29]. In [30] S. Fortunato and C. Castellano found this behaviour in the electoral results of different countries and for different years. We can think of this constraint as the effect of polices or social factors: low popularity candidates are penalized since the party does not present them for the elections, and high popularity candidates are penalized by the competition in campaign. Both effects can be approximated to second order as a harmonic potential, however anharmonic effects are expected in a high order study.
Defining H ′′ = 1/∆τ and k m = ln u m being k m = m∆k, the entropy equation of state reads in this case which maintains scale invariance.

The microscopic description
The dynamics of the system can be microscopically described as a stochastic process using (4) and the density distribution (12). Treating w as a random variable, the stochastic equation of motion is written as a geometrical Brownian motion where dW is a Wiener process. In the u space, this equation reads which describes the well-known Brownian motion. (28) exactly describes the dynamical condition found empirically in [7] and also the stochastic proportional growth model used in [11] to obtain Zipf's law. We can think of this sort of simulations as the equivalent of molecular dynamics simulations for gases and liquids [31]. Effectively, (29) implies that a uniform density in u space of N Brownian walkers moving in a fixed volume Ω -a model used in the literature to describe the IG [31]describes the SFIG when we represent the system with the coordinates (k, v). In figure 1a we show the rank-plot for a system of N = 78 geometrical Brownian walkers with σ w = 0.029 in a volume of Ω = 4.5 and k 1 = 200 in reduced units, which nearly describes the distribution of the population of the province of Huelva.

Summary and Discussion
We have shown that a thermodynamic description of scale-invariant systems can be formulated from the principle of extreme information, finding an analogy with the thermodynamics of gases and fluids. We have derived the density distribution in configuration space and the entropy equation of state of the scale-free ideal gas in the thermodynamic limit, and have found empirical evidences of its existence in city population, electoral results and cites to Physics journals. In this context, Zipf's law emerges naturally as the equilibrium density of the non-interacting system when the volume grows to infinity, what we call the Zipf regime. Using empirical data we have seen that this regime can be understood as the density fall of a surface between the bulk and an empty volume. We have also studied the effect of a harmonic constraint, finding that in this case the density of the system follows a log-normal distribution, which has been empirically observed in electoral results and in many other scaleinvariant systems [29]. Finally we have shown with a simulation of city population that a geometrical Brownian motion can describe the system at a microscopic level.
It is well known that in real gases the most interesting situations emerge when interactions between particles become relevant, originating deviations from the equation of state of the IG, and making room for the appearance of, e.g., phase transitions [21]. Analogously, one should also expect this rich phenomenology to show up in scale-invariant real systems, which may explain deviations from Zipf's law in empirical distributions. A study beyond the ideal gas is in progress, and further results will be reported [26].
|λ ′ | −1/2 = σ 2 p we get the Boltzmann distribution, which leads to a density distribution in configuration space of the form If H is the elementary volume in phase space, the total number of microstates is where f 1 = f /N is the monoparticular distribution and N ! counts all possible permutations for distinguishable particles. The entropy S = −k B ln Z is written as where we have used the Stirling approximation for N !. This expression is in exact accordance with the known value of the entropy for the IG [21], which shows the predictive power of the Fisher formulation.