\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mu PT$$\end{document}μPT statistical ensemble: systems with fluctuating energy, particle number, and volume

Within the theory of statistical ensemble, the so-called \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mu PT$$\end{document}μPT ensemble describes equilibrium systems that exchange energy, particles, and volume with the surrounding. General, model-independent features of volume and particle number statistics are derived. Non-analytic points of the partition function are discussed in connection with divergent fluctuations and ensemble equivalence. Quantum and classical ideal gases, and a model of Bose gas with mean-field interactions are discussed as examples of the above considerations.

where V 0 is a constant with the dimension of a volume in order Z µPT to be dimensionless, but does not affect physical quantities. The logarithms of the partition function of statistical ensembles give thermodynamic potentials. These thermodynamic potentials, summarised in Table 1, are defined by means of thermal averages of extensive quantities, and can also be expressed as linear homogeneous functions of fixed extensive parameters using the Euler's theorem 5 . In the µPT ensemble however, all possible Legendre transforms have been performed, such that thermal properties only depend on intensive parameters which gauge the extensive thermal averages. Without additional statistically conjugated couples, the intensive µPT thermodynamic potential is connected to finitesize effects 9,11 . Legendre transform of the µVT ensemble. The µVT partition function is where P c is the pressure derived in the µVT ensemble. It is crucial to note that P c depends only on the free parameters of the µVT ensemble, namely the chemical potential µ , the temperature T and the volume V, as all other physical quantities are functions of these parameters. Requiring that P c , µ , and T, are all intensive quantities, and that the µVT thermodynamic potential, i.e. −P c V , is extensive implies that P c is a non-increasing function of V. In particular, the leading contribution to P c for large volume does not depend on V.
The µPT partition function is thus where the volume fluctuates in the interval [V 1 , V 2 ] . The thermodynamic potential is Z µVT = e βP c V , e −βPV Z µVT = e βV 2 (P c −P) − e βV 1 (P c −P) βV 0 (P c − P) , Notice that P = P c is a non-analytic point of the thermodynamic potential when V 2 → ∞ , which shall be characterised in the following.
Volume statistics. General features of the volume statistics are derived from pressure derivatives of (7). The average volume is with the following asymptotic behaviours Therefore, the average volume has a discontinuity when V 2 → ∞ , as depicted in Fig. 1a.
The variance of the volume is proportional to the isothermal compressibility κ T :

Figure 1.
Semi-log plot of the rescaled average volume βP c V , the rescaled volume fluctuations β 2 P 2 c � 2 V , and the rescaled density fluctuations � 2 ρ P c ∂ 2 µ P c as a function of the rescaled pressure P/P c . The condition βP c V 1 = 10 has been set in the plot of βP c V and � 2 ρ  Fig. 1b, whose asymptotic behaviours are Thus, the variance of the volume is superextensive around P = P c and intensive away from P = P c , as shown in Fig. 1b.
Particle number statistics. The general relation between the average volume and the average particle number is straightforwardly derived: Recalling the definition (6), the latter is the same equation as in the µVT ensemble with the volume, that is a fixed parameter in the grandcanonical ensemble, replaced by the average volume. The general relation between the particle number and the volume fluctuations is where the first term in the right-hand-side equals the variance of the particle number in the µVT ensemble with the volume replaced by the average volume V .
Density statistics. Since both particle number and volume are fluctuating quantities, also the density ρ = N/V fluctuates. The average density is and equals the density in the µVT ensemble. Equation (18) shows that there is no ambiguity to define the average density as the average of N V or as the ratio of averages N V . The variance of the density is with Ei(x) = − ∞ −x dt e −t t being the exponential integral 22 , and is sketched in Fig. 1c. The asymptotic limits of the density fluctuations are recalling the series 23 Ei(x) = γ + ln |x| + ∞ k=1 x k k·k! with γ the Euler-Mascheroni constant, while, using instead the asymptotic series 24 Ei Therefore, the variance of the density � 2 ρ = O 1/�V � , for β(V 2 − V 1 )|P c − P| ≫ 1 , satisfies the so-called shot-noise limit, i.e. scales as the inverse of the system size as in the central limit theorem. The variance � 2 ρ for βV 1,2 |P c − P| ≪ 1 exhibits shot-noise limit with multiplicative logarithmic corrections.
Energy statistics. The average energy is (14) Ei(βV 2 (P c − P)) − Ei(βV 1 (P c − P)) e βV 2 (P c −P) − e βV 1 (P c −P) Legendre transform of the NPT ensemble. The NPT partition function is where µ c is the chemical potential derived in the NPT ensemble. In analogy to the discussion after Eq. (6), note that µ c depends only on the free parameters of the NPT ensemble, namely the pressure P, the temperature T and the particle number N. Given that µ c , P, and T, are intensive, and that the NPT thermodynamic potential, i.e. µ c N , is extensive, µ c is a non-increasing function of N. In particular, the leading contribution to µ c for large volume does not depend on N.
The µPT partition function is where the number of particles fluctuates in the interval [N 1 , N 2 ] . The thermodynamic potential is with the following asymptotic limit Therefore, µ = µ c is a non-analytic point of the thermodynamic potential when N 2 → ∞.
Particle number statistics. General features of the particle number statistics are derived from derivatives of (27) with respect to the chemical potential. The average number of particles is with the following asymptotic behaviours www.nature.com/scientificreports/ As for the average volume, the number of particles has a discontinuity when N 2 → ∞ , as depicted in Fig. 2a. The variance of the particle number is plotted in Fig. 2b, whose asymptotic behaviours are Thus, the variance of the particle number is superextensive around µ = µ c and intensive away from µ = µ c , as shown in Fig. 2b.
Volume statistics. The general relation between the average particle number and the average volume is again straightforwardly derived: Recalling the definition (26), the latter is the same equation as in the NPT ensemble with the particle number, that is a fixed parameter in the isothermal-isobaric ensemble, replaced by the average particle number. The general relation between the particle number and the volume fluctuations is where the first term of Eq. (37) equals the variance of the volume in the NPT ensemble with the particle number replaced by the average particle number N .
Energy statistics. The average energy is which again equals the expression of the NPT ensemble with the particle number replaced by the average particle number.
From the derivative of the averages of energy, volume and particle number, heat capacities at constant volume and at constant pressure are computed: to other statistical ensembles stem from the fact that all possible Legendre transforms with respect to internal quantities have been computed. The µPT partition function thus depends only on intensive parameters unless other internal quantities {X l } l , even though fixed, contribute to energy, particles, and volume exchanges. One peculiarity of the µPT ensemble is that the above analysis of the volume statistics and of the particle number statistics is general, and does not rely upon the specific model. The reason for such generality is the dependence of the µVT thermodynamic potential and of the NPT thermodynamic potential on a single extensive parameter, i.e. V and N respectively. The same general behaviour does not hold for other statistical ensemble where the thermodynamic potential depends on more that one extensive quantity.
For instance, both the µVT ensemble and the NPT ensemble are derived from Legendre transforms of the NVT ensemble which, together with its thermodynamic potential F = −pV + µN , depends on two extensive, fixed quantities, e.g. N and V. Thus, the intensive quantities P and µ can depend on the ratio N/V, resulting in a non-linear dependence on N and yet an extensive Helmholtz free energy. An example is the ideal homogeneous classical gas in d dimensions, whose NVT partition function is 5 where T = 2πh 2 β/m is the thermal wavelength, and with the Helmholtz free energy where the Stirling's approximation ln N! = N ln(N/e) + O(ln N) has been used. The pressure and the chemical potential are derivatives of the Helmholtz free energy: The possible non-linear dependence of the NVT thermodynamic parameter on N and on V, although F is extensive, results in model-dependent particle number statistics of the µVT ensemble and volume statistics of the NPT ensemble, after the respective Legendre transforms. This is not the case for volume statistics and particle number statistics in the µPT ensemble, because they are derived from Legendre transforms of the µVT ensemble and of the NPT ensemble respectively, which depend only on a single extensive, fixed parameter, namely V and N respectively. Thus, the µVT and the NPT thermodynamic potentials, in order to be extensive, can only have a linear dependence on V and N respectively. This implies simple and general volume and particle number statistics in the µPT ensemble.
Another difference between the µPT ensemble and others deals with the structure of Legendre transforms. When Legendre transforms are applied to derive statistical ensembles from others, e.g. NVT from NVE, µVT from NVT, or NPT from NVT, there are intensive quantities of the original ensemble that are not control parameters, but can be derived from derivatives of thermodynamic potentials (see the last column of Table 1, Eq. (43)). These intensive parameters depend on the control parameters that define the ensemble (as the ensemble names denote): among these control parameters there are also extensive quantities statistically conjugated to intensive parameters that are not control parameters. After a Legendre transform, an extensive, previously fixed, quantity becomes a stochastic variable and the dependence of its expectation value from the control parameters is the inverse function of its intensive statistically conjugated variable before the Legendre transform.
The aforementioned construction is not straightforward in the Legendre transform of the µVT ensemble with respect to the volume and in the Legendre transform of the NPT ensemble with respect to the particle number, both leading to the µPT ensemble. The reason is that pressure in the µVT ensemble and chemical potential in the NPT ensemble only depend on other intensive parameters and not on the volume or on the particle number respectively. This is the only way the thermodynamic potentials of the µVT and NPT ensembles, i.e. PV and −µN respectively, can be extensive. Nevertheless, the pressure and the chemical potential in the µPT ensemble are independent parameters. It is therefore natural to expect the emergence of a relation constraining the intensive parameters of the µPT ensemble from ensemble equivalence, as argued in "Discussion".

Discussion
The following discussion summarizes general and model independent features of the µPT ensemble, based on derivations from the Legendre transform of the µVT ensemble with respect to the volume and from the Legendre transform of the NPT ensemble with respect to the particle number.
(40)  Fig. 1a) and the average number of particles computed from the Legendre transform of the NPT ensemble (see Eq. (32), Fig. 2a) resemble step functions. When V 2 ( N 2 ) diverges, the average volume (average number of particles) becomes discontinuous at the critical pressure P c (critical chemical potential µ c ), with a divergent plateau at small pressures P < P c (large chemical potentials µ > µ c ). Such discontinuous behaviours resemble a first-order phase transition: e.g. the function V (P) , or its inverse P( V ) , is qualitatively similar to the gas-liquid phase transition, and a similar behaviour for N (µ) and µ( N ) . The critical point is also characterised by variances of the volume and of the particle number diverging, respectively, as (V 2 − V 1 ) 2 /12 at P = P c (see Eq. (15), Fig. 1b) and as (N 2 − N 1 ) 2 /12 at µ = µ c (see Eq. (35) and Fig. 2b) for infinitely large V 2 and N 2 , while they are intensive away from the critical values P = P c and µ = µ c .
Fluctuations of the volume are related to fluctuations of the pressure, while fluctuations of the particle number are related to fluctuations of the chemical potential, through uncertainty relations that hold for statistically conjugated variables [25][26][27][28] . Even though pressure and chemical potential are fixed parameters, they can be seen as external fields subject to noise, e.g. experimental preparations or thermalisation processes affected by small imprecisions may lead to thermal states whose parameters have finite accuracy. Within estimation theory, the variance of pressure and chemical potential estimations, δ 2 P and δ 2 µ , are related to volume and particle number fluctuations by means of the Cramér-Rao bound [29][30][31] where M is the number of measurements. Similar relations can also be derived within the mathematical theory of Legendre transforms 6 . The Cramér-Rao bound is formulated using the Fisher information, which is a metric of states (or probability distributions) when they differ by an infinitesimally small parameter change. The Fisher information of the µPT ensemble equals β 2 � 2 V when pressure is changed and β 2 � 2 N when chemical potential is changed. Indeed, the estimation of intensive parameters of equilibrium ensembles are related to variances of statistically conjugated extensive variables: β 2 � 2 Xδ 2 ξ ≥ 1/M , e.g. with (ξ , X) = (P, V ) or (ξ , X) = (µ, N) , and � 2 Hδ 2 β ≥ 1/M . The connection between the Cramér-Rao bound, thermodynamic state geometry, and susceptibilities is discussed in Refs.  . For thermodynamic states away from critical points, variances of extensive variables X are extensive, implying fluctuations �X/ X vanishing as the inverse of the square root of the system size; the same scaling, known as shot-noise limit in metrology, holds for the sensitivity δξ of the intensive parameters ξ.
Close to the critical pressure P = P c and for large V 2 , the pressure is very close to the pressure in the µVT ensemble with a superextensive volume variance 2 V = O �V � 2 . This implies low, i.e. sub-shot-noise, uncertainty for the pressure, δP = O 1/�V � . On the other hand, away from the critical pressure and for large V 2 , the variance of the volume is intensive, implying a large variance for the pressure δP = O(1) , and sub-shot-noise scaling for the relative error of the volume �V /�V � = O 1/�V � . Moreover, when the domain of the volume integration is [V 1 , V 2 ] → [0, ∞) , the leftmost plateau in Fig. 1a goes to infinity, and the rightmost one assumes an intensive value. Therefore, the inverse function P V is almost constant, i.e. equals P c up to small deviations as discussed above, except for intensive average volume which is not very relevant for thermodynamic states. In this sense, the pressure in the µPT ensemble agrees with that in the µVT ensemble, namely P c which is determined by β , µ , and V.
A completely similar interpretation holds for the variance of the particle number and to that of the chemical potential. The chemical potential is very close to its value in the NPT ensemble with a superextensive particle number variance 2 N = O �N� 2 , close to the critical chemical potential µ = µ c and for large N 2 . Therefore, the uncertainty for the chemical potential, δµ = O 1/�N� , obeys sub-shot-noise scaling. On the other hand, the intensivity of the particle number variance, away from the critical chemical potential and for large N 2 , implies a large variance for the chemical potential, δµ = O(1) , but sub-shot-noise limited relative error for the number of particles, �N/�N� = O 1/�N� . Furthermore, when the domain of the particle number summation is [N 1 , N 2 ] → [0, ∞] , the rightmost plateau in Fig. 2a goes to infinity, and the leftmost one assumes an intensive value. Therefore, the inverse function µ N almost coincides with µ c , with small deviations δµ , except for intensive average number of particles which is not very relevant for thermodynamic states. In this sense, the chemical potential in the µPT ensemble agrees with that in the NPT ensemble, namely µ c which is determined by β , P, and V.
The thermodynamic equivalence between the µPT and the µVT ensembles require, in particular, that the two ensembles predict the same pressure, namely P = P c . Similarly, thermodynamic equivalence between the µPT and the NPT ensembles require µ = µ c . Relations P = P c and µ = µ c are manifestations of the Gibbs-Duhem equation. The need for relations among intensive quantities β , µ and P can be derived also from requiring equivalence of other thermal quantities when computed from the Legendre transform of the µVT and that of the NPT ensembles.
Consider the density Since P c is derived from the µVT ensemble, it depends only on β and µ and not on P, and therefore the same holds for ∂P C ∂µ . Analogously, µ and ∂µ c ∂P , being derived using the NPT ensemble, are functions of β and P but not of µ . In other words, the left-hand-side of the last equality in (45) is a function only of β and µ , while the right-hand-side is a function only of β and P. Thus, the only possibility to fulfil Eq. (45) for any value of intensive quantities is www.nature.com/scientificreports/ that ∂P C ∂µ does not depend on µ and that ∂µ c ∂P does not depend on P. These conditions are so restrictive that are not met in several statistical models, like those studied below. It follows that intensive quantities β , µ and P cannot be completely independent, but are constrained by the relation (45).
Compare now fluctuations (14) and (17), derived from the Legendre transform of the µVT ensemble, with fluctuations (34) and (37), derived from the Legendre transform of the NPT ensemble. The fluctuation term 2 V of the particle number variance (17) is superextensive close to the critical point P = P c and intensive otherwise, whereas the contribution V is extensive for P P c . Therefore, the particle number variance (17), 2 N , is extensive for P P c . This is in contradiction with the particle number variance (34), derived from the Legendre transform of the NPT ensemble, which is superextensive close to µ = µ c and intensive otherwise.
Similarly, the term 2 N of the volume variance (37) is intensive away from the critical point µ = µ c , whereas the contribution N is extensive for µ ≥ µ c . Therefore, the variance (37), 2 V , is extensive for µ ≥ µ c . On the other hand, the volume variance (14), derived from the Legendre transform of the µVT ensemble, is superextensive close to P = P c and intensive otherwise. In conclusion, fluctuations derived from the Legendre transform of the µVT ensemble agree with those derived from the Legendre transform of the NPT ensemble only if P = P c and µ = µ c .
The reason for these apparent contradictions is that the Legendre transforms with respect to the volume and to the particle number, both needed to derive the µPT ensemble from the NVT ensemble, do not commute. Furthermore, the relations between thermodynamic potentials, −P c V and µ c N , with partition functions in Eqs. (6) and (26), respectively, are the leading orders for large system size 3 . Therefore, the order of the Legendre transforms could be dictated by the relative scaling between the volume range and the particle number range, which depends on the specific physical model or on experimental conditions. The ensemble equivalence can also be checked in specific models, as shall be discussed in the next Section.

Examples
Quantum ideal homogeneous gases. The above general results can be exemplified by specific models, e.g. the quantum ideal homogeneous gas in d dimensions. The Hamiltonian is H = N j=1 p 2 j 2m , with p j the momentum of the j-th particle. The pressure in the µVT ensemble is where T = 2πh 2 β/m is the thermal wavelength, Li s (·) is the polylogarithm 55 of order s, and the upper (lower) sign holds for Bosons (Fermions). Using this expression for P c specifies thermal quantities of the µPT ensemble derived as the Legendre transform of the µVT ensemble (see "Legendre transform of the µVT ensemble "). Recall that the derivative of the polylogarithm satisfies x ∂ ∂x Li s (x) = Li s−1 (x).
Thermal averages and fluctuations. The relation between the average number of particles and the average volume is which is, as the general case (16), the same equation as in the µVT ensemble with the fixed volume replaced by the average volume. In particular, Eq. (47) for the Bose gas implies that the critical temperature for the Bose-Einstein condensation in the µPT ensemble is the same as in the µVT one. In fact, the critical temperature is defined by the particle number reaching its upper bound in the continuum spectrum limit. Thus, when the actual particle number exceeds that bound, low-lying energy levels have macroscopic, and indeed singular in the continuum spectrum limit, occupations. The average energy is The relation between volume and particle number fluctuations is Heat capacities. Heat capacities at constant volume and pressure are  (50) and (51) are different from the standard textbook heat capacities where the particle number is fixed, because they also include contibutions due to fluctuations of particle number and volume. When both volume and particle number are constant, �N� �V � = ∂P c ∂µ is constant as well, resulting in an implicit relation between β and µ . The heat capacity under these conditions is where z = e βµ is the fugacity. From the derivative of Eq. (47) with respect to β , one obtains the derivative of the fugacity: Therefore, the heat capacity at constant volume and particle number is When pressure and particle number are both constant, the heat capacity is The derivative of the average volume is obtained from the following condition and the derivative of the fugacity follows from Using the above relations, we obtain Equation (58) is not an explicit formula, because the constrained derivative dP c dβ P, N has to be determined yet but it vanishes when P = P c .
Classical ideal homogeneous gas. The Legendre transform of the µVT for the classical ideal homogeneous gas is the classical limit of the quantum homogeneous gas, namely the limit of small fugacity e βµ ≪ 1 , which implies 55 Li s ± e βµ ≃ ±e βµ . Therefore, thermal quantities computed in the previous section become (58) → 0 , we derive the standard heat capacities of the classical ideal gas, i.e. C P,N = C V ,N + k B �N� = d 2 + 1 k B �N�. We now focus on the Legendre transform of the NPT ensemble for the classical ideal homogeneous gas. The NPT partition function is 5 with leading to the µPT partition function Note that the critical chemical potential µ c introduced in Eq. (67) is different from that in (26), but their difference is negligible, e.g., if N ≫ 1 , so that Z NPT = e −βµ c N−ln(V 0 βP) ≃ e −βµ c N . In particular the two critical chemical potentials agree in the thermodynamic limit, but also for moderately large particle number, like N ∼ 10 3 as in small thermodynamical systems 9,12,14 . Consequently, also thermal quantities computed from the partition functions (69) and from (27), using the critical chemical potential (68), agree within negligible corrections.
Furthermore, the two equations P = P c and µ = µ c are equivalent. Therefore, as described in section "Discussion", the variances of the volume and of the particle number are both superextensive, in agreement with the linear relations in Eqs. (49) and (62). The equivalence of the two critical conditions P = P c and µ = µ c agrees with our general arguments reported in Discussion, supporting that these conditions are necessary for the equivalence of the µPT ensemble with both the µVT and the NPT ones.
Thermal averages and fluctuations. Averages of particle number and of the volume are related by the following equation Equation (70) agrees with the prediction of the Legendre transform of the µVT ensemble, e.g. Eq. (60), in the thermodynamic limit only if µ = µ c .
The average energy is which agrees with the formula derived from the Legendre transform of the µVT ensemble, i.e. Eq. (61). The variances of the particle number and of the volume fulfil the following relation: Mean-field Bose gas. This section is devoted to the Bose gas with mean-field interactions, namely with the interaction hamiltonian N 2V . The partition function of the µVT ensemble was computed for a class of free Hamiltonians 56 . Consider here the free Hamiltonian of the ideal homogeneous gas in d dimensions for concreteness. The pressure derived in the µVT ensemble is where P (0) c (α) is the critical pressure of the non-interacting gas in Eq. (46) with the upper sign and with µ replaced by α , α is zero is µ ≥ ρ BEC and is the unique solution of α + ∂ α P (0) c (β, α) = µ if µ < ρ BEC , and ρ BEC is the critical density of the Bose-Einstein condensation which coincides with that of the non-interacting gas. We shall focus on the regime µ < ρ BEC , that is above the Bose-Einstein condensation temperature. Using the definition of α , the derivatives of the critical pressure (77) can be expressed as From the definition of α , its derivatives satisfy Using the expression one computes (72) 2 V = �V � 2 �N� + 1 2 2 N + �N� + 1 , (75) (83) www.nature.com/scientificreports/ ddd Plugging these derivatives in the general formulas in section Results, we obtain the thermal quantities of the mean-field Bose gas.
Thermal averages and fluctuations. The average particle number and the average energy are, respectively, The relation between the variance of the particle number and the variance of the volume is Finally, the heat capacity at constant pressure and particle number is All the expressions for the mean field Bose gas recover those for the ideal homogeneous gas, when → 0 , recalling that α → µ and t → z in this limit.

Conclusions
In conclusion, the µPT statistical ensemble, analysed here, describes equilibrium systems which exchange energy, particles, and volume with the surrounding. This ensemble finds applications in the thermodynamics of small systems, like nanothermodynamics, systems with long-range interactions, and systems confined within porous and elastic membranes. The statistics of the volume and of the particle number do not depend on the specific model, i.e. on the Hamiltonian, as a consequence of the Legendre transforms performed on all the extensive quantities. Another peculiarity of the µPT ensemble is that values of pressure and chemical potential agree with µVT and NPT ensembles only around non-analytic points P = P c and µ = µ c at which, however, fluctuations of volume and particle number are superextensive. The constraint on intensive parameters, in agreement with the thermodynamical Gibbs-Duhem equation, also emerges from the requirement that the order of the Legendre transforms with respect to the volume and to the particle number do not alter thermodynamic relations in the µPT ensemble. Therefore, the breakdown of the Gibbs-Duhem equation is related to the non-commutativity of Legendre transforms for large system size. The order of the Legendre transforms could be indicated by the specific model or by experimental conditions. Quantum and classical ideal gases, and a quantum mean-field Bose gas exemplify the general features of the µPT ensemble. In particular, ensemble properties of the classical ideal gas can be derived both from the Legendre transform of the µVT ensemble and from the Legendre transform of the NPT ensemble. Therefore, this model shows a specific instance of the non-commutativity of the Legendre transforms and of the need of the self-consistency conditions P = P c and µ = µ c , described in full generality in section "Discussion".