1 Introduction

The clustering of galaxies is the main mechanism to address the large scale structure of the Universe. Such clustering mechanism can be studied confronting numerical simulations [1, 2] with observations [3, 4], using the local matter distributions of galaxies organized in groups, filaments and clusters. However, to analyze numerically the large scale structure formation, it is possible to approximate galaxies as point-like particles, and then study the clustering adopting the standard formalism of statistical mechanics. This approximation is valid because the distance between galaxies is much larger than their proper size. In fact, it has been demonstrated that the clustering mechanism can be studied considering a quasi-equilibrium description because the macroscopic quantities change very slowly as compared with the local relaxation time scales [5,6,7,8]. Pressure, average density and average temperature of clusters are the macroscopic quantities to be taken into account. Here the temperature is the effective one obtained by the kinetic theory of gases, for a gas of galaxies (each galaxy being approximated as a point particle). So, by this quasi-equilibrium description, the clustering of galaxies can be dealt as a thermodynamic system [9, 10]. Specifically, one has to adopt a gravitational partition function [10, 11] where point-like galaxies gravitationally interact. Such a partition function can be also used to study phase transitions for systems of interacting galaxies [12,13,14].

It has to be pointed out that such a gravitational partition function diverges because the extended structure of galaxies has been neglected in this approximation. However, these divergences can be removed by adding a softening parameter, which accounts for the extended structure of galaxies as reported in [15]. In a recent study it has also been proved that the nonlocal gravity is divergence free [16]. Thermodynamics for systems of galaxies is obtained from the partition function (regularized with a softening parameter), and this can in turn be used to study the clustering properties [17]. It has been observed that any modification of gravitational partition function by a softening parameter, in turn, modifies the thermodynamic quantities of a given system. Vice versa, because these thermodynamic quantities are related to the clustering parameter, it also changes the clustering parameter itself. In fact, it can be demonstrated that the modification to the skewness and kurtosis of clustering systems occur due to such a softening parameter [18]. This formalism has also been used to demonstrated that galaxy clusters are surrounded by halos, and this has been done adopting a wide range of samples [8, 19]. Furthermore the isothermal compressibility gives also information on the clustering of galaxies [20].

Specifically, the clustering of galaxies occurs due to the gravitational force between them. However, it is now well-known by a wide range of cosmological observations (e.g. Type Ia Supernovae, Baryon Acoustic Oscillations and Cosmic Microwave Background) that the Universe is undergoing an accelerating expansion [21,22,23]. This cosmic expansion is pulling the galaxies away from each other. So, the cosmic expansion seems to oppose the gravitational force, and thus it is important to include its effect in the gravitational partition function. It has been argued that the cosmological constant related to the accelerated expansion can produce important local effects on the scale of galaxy clusters [24,25,26,27,28]. These effects can be investigated using model of interacting dark matter and dark energy [24, 25]. It is also possible to constrain the dark energy from the clustering of galaxies [29]. The cosmic expansion can also change the dynamics at the scale of galaxy clusters [30]. Such a modification of cluster dynamics has also been investigated using different groups of galaxies [31]. Finally, one can state that the cosmological constant has consequences for the formation of galaxy clusters [32]. In summary, it is important to study the effects of cosmic expansion at the scale of clusters. From a more technical point of view, it has to be noted that the Fisher matrix formalism has been used to analyze the effects of cosmic expansion on clusters [33].

Thus, it is possible to obtain information about the cosmological constant, and, in general, about dark energy dynamics, from the local clustering of galaxies. So, it is important to incorporate the effects of cosmic expansion in the statistical mechanical description of the clustering of galaxies. In fact, an accurate measurement of the statistics of galaxies can be used to constraint the value of the cosmological constant [34], and the distribution function of galaxies can be used to constraint the amount of the dark energy [35].

As such a statistical distribution function can be obtained from the gravitational partition function [9, 10], it is important to incorporate the effects of cosmic expansion in the partition function. So, the modification of the gravitational partition function by the cosmological constant term has also to be considered, and this modified gravitational partition function can be used to study the clustering process in an expanding Universe [36]. This can be technically done by first analyzing the Helmholtz free energy and entropy for a system of galaxies. Then the clustering parameter for this system can be obtained, and it has been observed that this clustering parameter depends on the value of the cosmological constant. The modification of the gravitational partition function with a time dependent cosmological constant can be also used to study the effects of dynamical dark energy on clustering of galaxies [37]. It has been observed that the correlation function for this system are consistent with observations.

However, it is possible to obtain cosmic expansion without considering dark energy related to some new fundamental particle. In fact, large scale nonlocality related to some effective gravitational potential seems a realistic effect of gravitational field at infrared scales as recently reported in several papers, see for example [38,39,40,41,42]. It has been argued that such nonlocalities can occur due to some quantum gravitational effects [38, 39, 43]. They can be relevant also in gravitational waves modes and polarizations [44, 45]. It has been demonstrated that string field theory produces nonlocal actions for the component fields, and these nonlocal actions can also be used to construct nonlocal cosmological models [46, 47]. It is also possible to construct models of nonlocal cosmology from loop quantum gravity [48, 49]. This can be done adopting a sort of condensation of states in loop quantum gravity. In summary, it is possible to obtain nonlocal cosmologies using quantum gravitational effects at ultraviolet scales that propagate up to infrared scales.

In other words, as nonlocal cosmology can explain the cosmic expansion without dark energy [38,39,40,41,42], such nonlocal corrections can also be used to incorporate the effects of cosmic expansion in the gravitational partition function. This one can then be used to analyze the effects of nonlocality on clustering of galaxies. It may be noted that even though general relativity is strongly constrained at the Solar System scales by several experiments and observations [50,51,52], nonlocal modification to general relativity can occur at large scales starting from galactic one [53]. At the same time, nonlocal gravity is safe from possible issues related to oscillating features on small scales, falling in the regime where such oscillations are subdominant [54]. It has also been proposed that such nonlocality could be constrained from the clustering of galaxies [55]. Thus, it is important to analyze the effect of nonlocal modification of gravity on the gravitational partition function and point out how it affects the clustering process. Such a modification can be analyzed using nonlocal corrections to the gravitational potential [53, 56,57,58,59]. In general, the nonlocal gravitational partition function can be used to analyze the effects of nonlocality on clustering of galaxies. Although our main motivation for such a study is related to testing nonlocal gravity, we must note here that the logarithmic correction induced by such a theory is shared also by other alternative models of gravity, e.g. MOND [60, 61], Randall–Sundrum brane scenario [62], or other string-theoretical motivations [63] which have been also tested with internal dynamics of spiral galaxies [64]. It may be noted that there is an intrinsic non-locality in string theory [65, 66]. Furthermore, even MOND has been related to nonlocality [67,68,69,70,71]. This could be due to the fact that nonlocality [38, 39], and several of these modifications, are motivated from quantum corrections to the original Einstein–Hilbert action. Even MOND can be obtained as a quantum correction in the Verlinde formalism [72]. Thus, we expect some kind of universal form of correction to occur in most of them. In this perspective, our results will be more general and not strictly related to one particular scenario.

In Sect. 2, we discuss the clustering mechanism. After defining the nonlocal gravitational partition function, we consider the related thermodynamics and spatial correlation function. Observational data analysis is described in detail in Sect. 3. Specifically, we take into account data from galaxies and clusters and study the effects of nonlocality on the clustering mechanism. Conclusions are drawn in Sect. 4.

2 Modeling clusters of galaxies

In general, a nonlocal modification of the Hilbert–Einstein action can have the following form [38, 39]

$$\begin{aligned} {\mathcal {S}} =\frac{1}{2 \kappa ^2} \int d^4 x \sqrt{-g} \left[ R \left( 1 + f(\square ^{-1} R) \right) \right] , \end{aligned}$$
(1)

where R is the Ricci scalar and \(f(\square ^{-1}R)\) is an arbitrary function, called distortion function, of the nonlocal term \(\square ^{-1}R\), which is explicitly given by the retarder Green’s function

$$\begin{aligned} {\mathcal {G}}[f](x)=(\square ^{-1}f)(x) = \int d^4x' \sqrt{-g(x')}f(x')G(x,x').\nonumber \\ \end{aligned}$$
(2)

Setting \(f(\square ^{-1}R)=0\), the above action is equivalent to the Einstein–Hilbert one. The nonlocality is introduced by the inverse of the d’Alembert operator. In order to “localize” the action, an auxiliary scalar field can be introduced so that \(\square ^{-1}R=\phi \) and then formally \(\square \phi =R\). As a consequence, characteristic lengths related to the nonlocal terms naturally come out [53].

The weak-field limit of such a dynamics gives rise to corrections to the Newtonian potential which are interesting at large scales. These corrections can be polynomial or logarithmic and, in general, introduce characteristic scales. For a detailed discussion on this point see [53].

In the framework of this theory, let us now model the clustering of galaxies using the gravitational partition function which we are going to define. We will explicitly adopt the nonlocal gravity, as discussed in [57,58,59], to obtain the corrections to such a gravitational partition function. After analyzing the effects of nonlocality, the nonlocal gravitational partition function will be used to analyze the clustering of galaxies. This can be done by considering the thermodynamics of this system, and then relating it to the clustering parameter. Then we will calculate the spatial correlation function.

2.1 Nonlocal gravitational partition function

Let us take into account a system with a large number of galaxies. This system can be analyzed using a quasi-equilibrium description, where the change in macroscopic quantities is slower than the local relaxation time scales [5,6,7,8]. It is possible analyze such a system adopting an ensemble of cells, with same volume V, or radius \(R_1\) and average density\(\rho \). As the number of galaxies and their total energy can vary between these cells, the system can be analyzed in the framework of the grand canonical ensemble. Thus, it is possible to define a gravitational partition function. In this picture, a system of N galaxies of mass m interacting with a nonlocal gravitational potential can be written as [10, 11]

$$\begin{aligned} Z(T,V)= & {} \frac{1}{\lambda ^{3N}N!}\int d^{3N}pd^{3N}r \nonumber \\&\times \exp \left( -\left[ \sum _{i=1}^{N}\frac{p_{i}^2}{2M}+\varPhi _{nl}(r)\right] T^{-1}\right) , \end{aligned}$$
(3)

where \(p_{i}\) are the momenta of different galaxies and \(\varPhi _{nl}\) is the nonlocal gravitational potential energy. Here T is the average temperature, which is obtained from the kinetic theory of gases where each particle is represented by a galaxy. Now integrating on the momentum space, we can write this gravitational partition function as

$$\begin{aligned} Z_N(T,V)=\frac{1}{N!}\left( \frac{2\pi mT}{\varLambda ^2}\right) ^{3N/2}Q_N(T,V), \end{aligned}$$
(4)

where \(Q_{N}(T,V)\), the configuration integral, can be expressed as

$$\begin{aligned} Q_{N}(T,V)=\int \dots \int \prod _{1\le i<j\le N} \exp \left[ -\frac{\varPhi _{nl}(r_{ij})}{T}\right] d^{3N}r. \end{aligned}$$
(5)

The nonlocal gravitational potential energy \(\varPhi _{nl}(r_{1}, \ldots , r_{N})\) is a function of the relative position vector \(r_{ij}=|r_{i}-r_{j}|\), as both the local and nonlocal terms represent central forces. The total potential energy can be obtained by summing up the potential energies. So, we can write the total nonlocal potential energy \(\varPhi _{nl}(r_{1}, r_{2}, \ldots , r_{N})\) as

$$\begin{aligned} \varPhi _{nl}(r_{1}, \ldots , r_{N})=\sum _{1\le i<j\le N}\varPhi _{nl}(r_{ij})=\sum _{1\le i<j\le N}\varPhi _{nl}(r). \end{aligned}$$
(6)

We can write such a nonlocal gravitational potential energy for galaxies as [57,58,59]

$$\begin{aligned} (\varPhi _{i,j})_{nl}=-\frac{Gm^2}{r_{ij}}+\frac{Gm^2}{\lambda }ln\left( \frac{r_{ij}}{\lambda }\right) . \end{aligned}$$
(7)

Since galaxies have an extended structure, we need to modify the gravitational potential energy by a softening parameter \(\epsilon \) [15, 20]. Thus, we can write

$$\begin{aligned} (\varPhi _{i,j})_{nl}=-\frac{Gm^2}{(r_{ij}^2+\epsilon ^2)^{1/2}}+\frac{Gm^2}{\lambda }ln\left( \frac{(r_{ij}^2+\epsilon ^2)^{1/2}}{\lambda }\right) . \end{aligned}$$
(8)

Now we can use a nonlocal two-point interaction function for galaxies \(f_{ij}=e^{-(\varPhi _{ij})_{nl}/T}-1\) to analyze this system. It vanishes in absence of interactions, and it is non-zero only for interacting galaxies. Thus, we can now express the nonlocal configuration integral as

$$\begin{aligned} Q_{N}(T,V)= & {} \int \dots \int \biggl [(1+f_{12})(1+f_{13})(1+f_{23})\nonumber \\&\ldots (1+f_{N-1,N}) \biggr ]d^{3}r_{1}d^{3}r_{2}\ldots d^{3}r_{N}, \end{aligned}$$
(9)

where we can express the nonlocal two-point interaction Mayer function as

$$\begin{aligned} f_{ij}=\left( \frac{(r_{ij}^2+\epsilon ^2)^{1/2}}{\lambda }\right) ^{\frac{Gm^2}{T\lambda }}\exp \left( \frac{Gm^2}{T(r_{ij}^2+\epsilon ^2)^{1/2}}\right) -1. \end{aligned}$$
(10)

It is worth noticing that such an expression for clustering integral has been discussed for local gravitational interactions [18, 20]. Here we have obtained the contributions to such Mayer function from nonlocal gravitational interactions [57,58,59]. We can expand this nonlocal two-point interaction Mayer function as a power series. So, we can write \(f_{ij}\) as

$$\begin{aligned} f_{ij}&=-1+\left( \frac{(r_{ij}^2+\epsilon ^2)^{1/2}}{\lambda }\right) ^{\frac{Gm^2}{T\lambda }} \nonumber \\&\quad \cdot \sum _{n=0}^{\infty }\frac{1}{n!}\left( \frac{Gm^2}{T}\right) ^n\frac{1}{(r_{ij}^2+\epsilon ^2)^{n/2}} \end{aligned}$$
(11)

Now using \(l={Gm^2}/({T\lambda })\), we can write \(Q_{2}(T,V)\) as

$$\begin{aligned} Q_{2}(T,V)= & {} V^2\sum _{n=0}^{\infty }\frac{1}{n!}\left( \frac{3Gm^2}{2R_{1}T}\right) ^n\left( \frac{\epsilon }{\lambda }\right) ^l\left( \frac{2R_{1}}{3\epsilon }\right) ^n \nonumber \\&\cdots 2F1\left( \frac{3}{2},\frac{n+l}{2};\frac{5}{2};-\left( \frac{R}{\epsilon }\right) ^2\right) \nonumber \\= & {} V^2\left( \sum _{n=0}^{\infty }\alpha _{nl}x^{n}\right) , \end{aligned}$$
(12)

where \(\alpha _{nl}\) is given by

$$\begin{aligned} \alpha _{nl}= \frac{1}{n!}\biggl (\frac{\epsilon }{\lambda }\biggr )^l\biggl (\frac{2R_{1}}{3\epsilon }\biggr )^{n} F \biggl (\frac{3}{2},\frac{n+l}{2};\frac{5}{2};-\frac{R_{1}^2}{\epsilon ^2}\biggr ). \end{aligned}$$
(13)

It may be noted here that \( F ({3}/{2},{n+l}/{2};{5}/{2};-{R_{1}^2}/{\epsilon ^2})\) is the hypergeometric function. Now using \(R_{1}\sim \rho ^{-1/3}\), we observe that \({3Gm^{2}}/{2R_{1}T}={3Gm^{2}}/{2\rho ^{-1/3}T}={3}Gm^{2}\rho ^{1/3}T^{-1}/2. \) So, using the scale invariance, \(\rho \rightarrow \lambda ^{-3}\rho \), \(T\rightarrow \lambda ^{-1}T\) and \(r\rightarrow \lambda r\), we can define x as

$$\begin{aligned} x = \frac{3}{2}(Gm^2)^{3}\rho T^{-3}=\beta \rho T^{-3}, \end{aligned}$$
(14)

where \(\beta = {3}(Gm^{2})^{3}/2 \). From this expression for x, we can obtain any general configuration integral. Using the so called dilute approximation, we can assume \({(\varPhi _{i,j})_{nl}}/{T}\) very small and take only the first term of the exponential expansion,

$$\begin{aligned} f_{ij}=\frac{Gm^2}{T\sqrt{r_{ij}^2+\epsilon ^2}}-\frac{Gm^2}{T\lambda }\ln {\sqrt{r_{ij}^2+\epsilon ^2}}+\frac{Gm^2}{T\lambda }\ln {\lambda }. \end{aligned}$$
(15)

Thus, calculating the general configuration integral, we obtain

$$\begin{aligned} Q_{N}(T,V)=V^N\left( 1+\alpha x\right) ^{N-1} \end{aligned}$$
(16)

where

$$\begin{aligned} \alpha= & {} \frac{2R}{3\lambda }\left( \ln \frac{\lambda }{R}+ \frac{3\lambda }{2R}\sqrt{\frac{\epsilon ^2}{R^2}+1}+ \frac{\epsilon ^3}{R^3}\tan ^{-1} \frac{R}{\epsilon }\right. \nonumber \\&-\left. \frac{3\lambda \epsilon ^2}{2R^3} \ln \frac{\sqrt{\frac{\epsilon ^2}{R^2}+1}+1}{\frac{\epsilon }{R}}- \frac{1}{2}\ln \left( \frac{\epsilon ^2}{R^2}+1\right) -\frac{\epsilon ^2}{R^2}+\frac{1}{3}\right) \nonumber \\ \end{aligned}$$
(17)

Now the gravitational partition function for this dilute gravitating system can be written as

$$\begin{aligned} Z_N(T,V)=\frac{1}{N!}\left( \frac{2\pi m T}{\varLambda ^2}\right) ^{3N/2}V^{N}\big (1+\alpha x\big )^{N-1}. \end{aligned}$$
(18)

This expression for the gravitational partition function can be used to analyze the effects of nonlocality on the clustering of galaxies.

2.2 Thermodynamics

It has to be noted that the gravitational partition function has already been used to study the thermodynamics of systems of galaxies, see [9, 10]. We can thus adopt the nonlocal gravitational partition function to analyze the thermodynamics of this nonlocal system. The Helmholtz free energy \(F=-T\ln Z_{N}(T,V)\) is

$$\begin{aligned} F= -T\ln \left( \frac{1}{N!}\left( \frac{2\pi mT}{\varLambda ^2}\right) ^{3N/2}V^N\big (1+\alpha x\big )^{N-1}\right) . \end{aligned}$$
(19)
Fig. 1
figure 1

Helmholtz free energy dependence on: a x with: \(T=1\), \(N=50\), \(\lambda =2/3\) (solid green), \(\lambda =1\) (dashed red), \(\lambda =\infty \) (dotted blue); b \(\lambda \) with: \(x=1\), \(N=50\), \(T=0.6\) (solid green), \(T=0.4\) (dashed red), \(T=0.2\) (dotted blue); c T with: \(x=1\), \(N=60\) (solid green), \(N=40\) (dashed red), \(N=20\) (dotted blue); d N with: \(T=1\), \(\lambda =0.5\); \(x=1\) (solid green), \(x=0.5\) (dashed red), \(x=0\) (dotted blue). We have assumed unit values for all the other parameters

In the plots of Fig. 1, we analyze the dependence of the Helmholtz free energy on various parameters. The dependence of Helmholtz free energy on x is represented in Fig. 1a. We can observe that the Helmholtz free energy is a decreasing function of x for large value of the nonlocality parameter \(\lambda \) and an increasing function of x for smaller value of the nonlocality parameter \(\lambda \). So, the value of nonlocality parameter changes the dependence of the Helmholtz free energy on x. In Fig. 1b, the Helmholtz free energy is plotted in terms of \(\lambda \). We can see how there is a minimum for the Helmholtz free energy, and this minimum seems to occur at a specific value of \(\lambda \). This minimum does not seem to change with the temperatures of the system. This observation can explain the change in the behavior of the Helmholtz free energy with the change in the value of \(\lambda \), as was observed in Fig. 1a. In Fig. 1c, we plot the dependence of the Helmholtz free energy on the temperature of the system. Here the temperature corresponds to the temperature of a gas of galaxies, with each galaxy acting as a particle analog. We observe that generally the Helmholtz free energy increases with the temperature, but the rate of this increase depends on the number of galaxies. As we have plotted the dependence on temperature by considering the system as a gas of galaxies, we also analyze the dependence of the Helmholtz free energy on the number of galaxies in Fig. 1d. We observe that the Helmholtz free energy first decreases for a relatively small number of galaxies, becoming negative, and then increases as the number of galaxies becomes more than a certain value.

The entropy S can now be calculated from this Helmholtz free energy, as

$$\begin{aligned} S&= -\biggl (\frac{\partial F}{\partial T}\biggr )_{N,V}\nonumber \\&= N\ln (\rho ^{-1}T^{3/2})+(N-1)\ln \big (1+\alpha x\big ) \nonumber \\&\quad -3N \frac{\alpha x}{1+\alpha x} +\frac{5}{2}N+\frac{3}{2}N\ln \left( \frac{2\pi m}{\varLambda ^2}\right) . \end{aligned}$$
(20)

Now, for large N, using \(N-1\approx N\), we obtain

$$\begin{aligned} \frac{S}{N}=\ln (\rho ^{-1}T^{3/2})+\ln \big (1+\alpha x\big )-3B_l+\frac{S_{0}}{N}, \end{aligned}$$
(21)

where \(S_{0}=\frac{5}{2}N+\frac{3}{2}N\ln \big (\frac{2\pi m}{\varLambda ^2}\big )\). where

$$\begin{aligned} B_l=\frac{\alpha x}{1+\alpha x}. \end{aligned}$$
(22)

This is the general clustering parameter for a system of galaxies interacting in presence of nonlocal gravity. The internal energy \(U = F+TS\) of a system of galaxies can now be written as

$$\begin{aligned} U = \frac{3}{2}NT\big (1-2B_l\big ). \end{aligned}$$
(23)
Fig. 2
figure 2

Internal energy dependence on: a x with: \(T=1\), \(N=50\), \(\lambda =2/3\) (solid green), \(\lambda =1\) (dashed red), \(\lambda =0\) (dotted blue); b \(\lambda \) with: \(x=1\), \(N=50\), \(T=0.6\) (solid green), \(T=0.4\) (dashed red), \(T=0.2\) (dotted blue); c T with: \(x=1\), \(N=60\) (solid green), \(N=40\) (dashed red), \(N=20\) (dotted blue); d N with: \(T=1\), \(\lambda =0.5\); \(x=1\) (solid green), \(x=0.5\) (dashed red), \(x=0\) (dotted blue). We have assumed unit values for all the other parameters

We have plotted the internal energy of a system of galaxies in Fig. 2. Its behavior is analyzed by investigating its dependence on various parameters. In Fig. 2a, we investigate how the internal energy of the system varies with x. We observe that it is an increasing function of x for smaller values of \(\lambda \), and a decreasing function of x for larger values of \(\lambda \). In Fig. 2b, we analyze the dependence of the internal energy on the nonlocality parameter \(\lambda \). We observe that there is a minimum for internal energy, and again this minimum does not seem to depend on the temperature of the system. We also investigate the dependence of the internal energy on the temperate of the system in Fig. 2c. It is observed that there is a discontinuity in the dependence of internal energy on temperature, which occurs independently of the number of galaxies. In Fig. 2d, the dependence of internal energy on the number of galaxies is plotted. It is observed that internal energy increases with the increase in the number of galaxies. However, the rate of increase is larger for larger values of x.

Similarly, we can write the pressure P and chemical potential \(\mu \) for galaxies interacting through a nonlocal gravitational potential as

$$\begin{aligned} P&= -\biggl (\frac{\partial F}{\partial V}\biggr )_{N,T} = \frac{NT}{V}\big (1-B_l\big ),\nonumber \\ \mu&= \biggl (\frac{\partial F}{\partial N}\biggr )_{V,T} = T \ln (\rho T^{-3/2}) \nonumber \\&\quad - T \ln \big (1+\alpha x\big ) - T \frac{3}{2}\ln \left( \frac{2\pi m}{\varLambda ^2}\right) - T B_l. \end{aligned}$$
(24)

The probability of finding N galaxies can be written as

$$\begin{aligned} F(N)=\frac{\sum _{i}e^{\frac{N\mu }{T}}e^{\frac{-U_{n}}{T}}}{Z_{G}(T,V,z)}=\frac{e^{\frac{N\mu }{T}}Z_{N}(V,T)}{Z_{G}(T,V,z)}, \end{aligned}$$
(25)

where \(Z_{G}\) is the grand-partition function defined by

$$\begin{aligned} Z_{G}(T,V,z)=\sum _{N=0}^{\infty }z^NZ_{N}(V,T), \end{aligned}$$
(26)

and z is the activity. Thus, for a system of gravitationally interacting galaxies in nonlocal gravity , we can write

$$\begin{aligned} \exp \left[ \frac{N\mu }{T}\right]&=\biggl (\frac{{{\bar{N}}}}{V}T^{-3/2}\biggr )^{N}\biggl (1+\frac{B_l}{(1-B_l)}\biggr )^{-N} \nonumber \\&\quad \cdot \exp \left[ -NB_l\right] \biggl (\frac{2\pi m}{\varLambda ^{2}}\biggr )^{-3N/2}. \end{aligned}$$
(27)

Now the grand-partition function can be written as

$$\begin{aligned} \ln Z_{G}=\frac{PV}{T}={\bar{N}}(1-B_l), \end{aligned}$$
(28)

and the distribution function can be expressed as

$$\begin{aligned} F(N)&= \frac{{\bar{N}}(1-B_l)}{N!}\left( NB_l+{{\bar{N}}}(1-B_l)\right) ^{N-1} \nonumber \\&\quad \cdot \exp \left[ -NB_l-{\bar{N}}(1-B_l)\right] \, . \end{aligned}$$
(29)

In Fig. 3, we analyze the behavior of the distribution function for galaxies, and its dependence on different parameters used here. In general, the distribution function has the universal feature of having a maximum, while its functional shape changes, and depends on the considered parameters.

Fig. 3
figure 3

The distribution function dependence on: a x with: \(N=50\), \({\bar{N}}=10,\) \(\lambda =10\) (solid green), \(\lambda =1\) (dashed red), \(\lambda =0.75\) (dotted blue); b x with: \({\bar{N}}=10,\) \(\lambda =1\), \(N=20\) (solid green), \(N=10\) (dashed red), \(N=5\) (dotted blue); c N with: \(x=1\), \({\bar{N}}=10\), \(\lambda =10\) (solid green), \(\lambda =1\) (dashed red), \(\lambda =0.75\) (dotted blue); d N with: \({\bar{N}}=10\), \(\lambda =1\); \(x=10\) (solid green), \(x=5\) (dashed red), \(x=1\) (dotted blue). We have assumed unit values for all the other parameters

2.3 Spatial correlation function

It is well know that the interaction between different galaxies will cause correlation in their positions. The integral of the correlation function over a certain volume can be expressed in terms of the mean square fluctuation of the total number of galaxies in a given volume. Thus we can write

$$\begin{aligned} \int \xi dV=\frac{\langle (\varDelta N)\rangle ^2}{{\bar{N}}}-1. \end{aligned}$$
(30)

This can be further represented in terms of thermodynamic quantities as

$$\begin{aligned} \int \xi dV=-\frac{NT}{V^2}\left( \frac{\partial V}{\partial P}\right) _T-1. \end{aligned}$$
(31)

Taking the volume derivative and using the equation of state for pressure P, we get

$$\begin{aligned} \xi =\frac{-NT}{V^2}\frac{\partial }{\partial V}\left( \frac{\partial V}{\partial P}\right) _T+2\frac{NT}{V^3}\left( \frac{\partial V}{\partial P}\right) _T. \end{aligned}$$
(32)

The pressure can be written in terms of the clustering parameter as

$$\begin{aligned} P=\frac{NT}{V}\big (1-B_l\big ). \end{aligned}$$
(33)

We can write the change of volume with pressure at constant temperature

$$\begin{aligned} \left( \frac{\partial V}{\partial P}\right) _T=-\frac{V^2}{NT(1-B_l)^2}. \end{aligned}$$
(34)

The expression for \(\xi \) is

$$\begin{aligned} \xi =-2\frac{B_l}{V(1-B_l)^2} \end{aligned}$$
(35)

where \({\partial B_l}/{\partial V}=-({x}/{V})({dB_l}/{dx})=B_l(1-B_l)/{V}\) and \(x=\beta \rho T^{-3}=\beta NT^{-3}/{V}\). Now we can write

$$\begin{aligned} \int \xi dV =\frac{B_l(2-B_l)}{(1-B_l)^2}. \end{aligned}$$
(36)

The volume integral of correlation function is the quantity which can be compared with observational data in order to detect possible effects of nonlocal gravity.

3 Observational data analysis

We will test the nonlocal gravitational clustering with the cluster catalog in [73], containing 132,684 clusters of galaxies in the redshift range \(0.05 \le z < 0.8\) from the Sloan Digital Sky Survey III (SDSS-III). We will take advantage of this catalog because it has all the needed ingredients to analyze clustering properties of both galaxies and clusters (although an alternative more recent version is in [74]), using two different approaches.

3.1 Galaxies

The analysis of the clustering of galaxies will be conducted with a sort of “smart” version of the standard counts-in-cell procedure. In general, one would first need to define cells/volumes with a given size, and then to count the gravitational structures of interest within them. Here, our “smart” volumes will be the clusters identified in the SDSS-III survey, and we will count the galaxies which are within each of them. From this procedure, we will be able to calculate the observed distribution function F(N) and to compare it with the theoretical expectation in nonlocal gravity as given by Eq. (29). The “smartness” in this procedure is that the cells/volumes we are going to analyze are physically realized systems, structures which exist and have been identified, contrarily to the standard way of proceeding, where the existence of clusters and interacting systems of galaxies is not assured neither verified. On the other hand, performing the count in this way, we are going to inevitably miss voids, which instead indirectly retain some information about the clustering properties.

All the needed data are provided by the catalogue in [73]: the volume of the cells or, equivalently, the radius of the clusters, \(r_{200}\) in Mpc, is defined as the radius within which the mean density of a cluster is 200 times the critical density of the Universe at the same redshift and \(N_{200}\) is the number of member galaxy candidates within \(r_{200}\) of each cluster. The only caveat to take in mind is that the radii of the cells we are considering, i.e. the \(r_{200}\), are much smaller than the scales where the quasi-equilibrium clustering should be more effective [75, 76]; we will discuss this point when presenting our results.

We have divided the full catalogue in groups by redshift, with bin widths of \(\varDelta z = 0.05\), and by radius, with bin widths of \(\varDelta r_{200} = 0.1\) Mpc, and we have eventually selected only the groups with a sufficiently large number of clusters to enable a strong and reliable statistical analysis. The final groups with which we will work will have radii in the three ranges, \(0.8< r_{200} < 0.9\), \(0.9< r_{200} < 1.0\) and \(1.0< r_{200} < 1.1\) Mpc, and redshifts in the interval \(0.05 \le z \le 0.65\). We need to remind here that the catalogue is complete only up to a redshift \(z \sim 0.42\), for clusters with an estimated mass \(M_{200}> 1 \times 10^{14}\) \(M_{\odot }\); at higher redshift, a bias toward larger clusters (larger masses) and possibly to higher counts-in-cell is possible [73].

In Table 1, we show the results derived from using Eq. (29) with the chosen data. The parameters involved in the analysis of Eq. (29) have been rewritten as:

  • \(R=r_{200}\), the radius of the cell (cluster), which enters Eq. (29) through Eq. (17). We have assumed it to be constant within the three bins we have identified; in the following, it will act as a scaling factor for some parameters;

  • \(N=N_{200}\), the number of galaxies within each cell (cluster);

  • the clustering parameter b, defined as

    $$\begin{aligned} b = \frac{x}{1+x}\, , \end{aligned}$$
    (37)

    and which enters Eq. (29) through:

    $$\begin{aligned} B_{l} = \frac{b\, \alpha }{1+b(\alpha -1)} \; , \end{aligned}$$
    (38)

    with \(\alpha \) given by Eq. (17);

  • the dimensionless softening parameter, \({\tilde{\epsilon }} = \epsilon /R\);

  • the dimensionless nonlocal characteristic length, \({{\tilde{\lambda }}} = \lambda /R\).

The only parameter which fully characterizes the nonlocal gravity model we are focusing on is thus \({\tilde{\lambda }}\). All other parameters are standard in the sense that they would appear also whether standard GR would be considered. In Table 1 we also report the number of clusters in each redshift bin, \(N_{cl}\), although this is not a fitting parameter.

When it comes to fit the data, we have defined and compared results from two different statistical tools. We have performed a least-square minimization using the \(\chi ^2\) defined as

$$\begin{aligned} \chi ^{2}_{ls} = \sum _{i}\left[ F^{theo}(N_{i}) - F^{obs}(N_{i})\right] ^2, \end{aligned}$$
(39)

where \(F^{obs}(N_{i})\) is the real counts-in-cell distribution extracted from the data, and \(F^{theo}(N_{i})\) is the theoretical counts-in-cell calculated from the nonlocal gravity model by using Eq. (29). The index i derives from the fact that in each radius bin, the clusters have a variable amount of galaxies within them, ranging from some minimal number \(N_{min}\) to a maximal one \(N_{max}\). Thus, the index i selects the finite natural values of this range, where we evaluate the distribution function. We have also defined a second \(\chi ^2\) as

$$\begin{aligned} \chi ^{2}_{jk} = \sum _{i} \frac{\left[ F^{theo}(N_{i}) - F^{obs}(N_{i})\right] ^2}{\sigma ^{2}_{i}}, \end{aligned}$$
(40)

where the \(\sigma _i\) are the errors on \(F^{obs}(N_{i})\) which we have derived from a jackknife-like procedure as exposed below.

For each redshift and radius bin:

  1. 1.

    we cut a variable fraction \({\mathcal {F}}\) (randomly selected in the range \([10,90]\%\)) from the total bin population;

  2. 2.

    for each cut sample we derive the counts-in-cell distribution function \(\sim 50\) times;

  3. 3.

    we thus obtain a distribution of \(F^{obs}(N_{i})\) from the \(\sim 50\) sets of \(N_i\);

  4. 4.

    from each distribution, which looks very close to a standard Gaussian, we derive the standard deviation and assume such value as the error \(\sigma _i\).

The data points and the errors on the distribution function \(F^{obs}(N_{i})\) which we finally obtain are shown respectively as black dots and bars in Figs. 5, 6 and 7. The best fitting F(N) distributions obtained from the minimization of \(\chi ^2_{ls}\) are shown in red; those ones derived from \(\chi ^2_{jk}\) are in green.

The minimization of the defined \(\chi ^2\) is performed by using a Monte Carlo Markov Chain (MCMC) approach, running chains with \(10^6\) points and using the uninformative and very general priors: \({\bar{N}}\ge 0\); \(0\le b \le 1\); \(0\le {\tilde{\epsilon }} \le 1\); \({\tilde{\lambda }}>0\).

Fig. 4
figure 4

SDSS survey area. (Top panel) Full clusters catalog in Celestial coordinates, right ascension \(\alpha \) and declination \(\delta \). (Bottom panel) Full clusters catalog in physical distances from three different viewpoints. The different colors represent the three redshift bins we have described in the text, with: \(0.05 \le z < 0.281\) as dark grey; \(0.281 \le z < 0.361\) as middle grey; and \(0.361 \le z < 0.42\) as light grey

3.2 Clusters

Concerning the count-in-cells where the counted objects within volumes are the clusters of galaxies, we follow a procedure which is very similar to what is described in [75]. In order to be as much as clear as possible, we are going to enumerate all the steps in the following list.

Table 1 Galaxies: results from fitting Eq. (29) with data from the cluster catalog from [73]. Data and fits are divided in redshift bins (first column) and cell radius bin (as indicated by R intervals). \(N_{cl}\) is not a fitting parameter, but the number of clusters in each redshift and radius bin. All the fitting parameters are described in the text
Table 2 Clusters: results from fitting Eq. (29) with data from the cluster catalog from [73]. Data and fits are divided in redshift bins (first column) and cell radius bin (as indicated by R intervals). \(N_{cl}\) is not a fitting parameter, but the number of clusters in each redshift and radius bin. All the fitting parameters are described in the text
Fig. 5
figure 5

Comparison between data and theoretical expectation Eq. (29) for cell size bin \(0.8< R < 0.9\) Mpc. Black points: data; black bars: jackknife-like observational errors. Solid red line: best fit from minimization of \(\chi _{ls}^{2}\); solid green line: best fit from minimization of \(\chi _{jk}^{2}\)

Fig. 6
figure 6

Comparison between data and theoretical expectation Eq. (29) for cell size bin \(0.9< R < 1.0\) Mpc. Black points: data; black bars: jackknife-like observational errors. Solid red line: best fit from minimization of \(\chi _{ls}^{2}\); solid green line: best fit from minimization of \(\chi _{jk}^{2}\)

Fig. 7
figure 7

Comparison between data and theoretical expectation Eq. (29) for cell size bin \(1.0< R < 1.1\) Mpc. Black points: data; black bars: jackknife-like observational errors. Solid red line: best fit from minimization of \(\chi _{ls}^{2}\); solid green line: best fit from minimization of \(\chi _{jk}^{2}\)

Fig. 8
figure 8

Comparison between data and theoretical expectation Eq. (29) for cell size bin \(1.0< R_{1} < 1.1\) Mpc. Black points: data; black bars: jackknife-like observational errors. Solid red line: best fit from minimization of \(\chi _{ls}^{2}\); solid green line: best fit from minimization of \(\chi _{jk}^{2}\)

The initial set up consists in the coming steps:

  1. (1a)

    we choose the size of the spherical cells/volumes we are going to analyze. We have selected four different physical lengths, \(R=10\), 20, 30, and 40 Mpc;

  2. (2a)

    we divide the clusters in three groups by redshift, \(0.05\le z < 0.281\), \(0.281\le z < 0.361\) and \(0.361\le z < 0.42\). These values have been chosen in order to span approximately the same comoving volume in each group: assuming a baseline Planck cosmology [23], with \(H_0 = 67.51\) km \(\hbox {s}^{-1}\) \(\hbox {Mpc}^{-1}\) and \(\varOmega _m=0.3121\), the volume is \(\approx 6.5 \times 10^9\) \(\hbox {Mpc}^{3}\). The number of clusters from the SDSS catalog falling into each group are, respectively, 37,686, 24,208 and 20,634 (the total sums up to 82,528, because we are taking only clusters with \(z \le 0.42\), for which the catalogue is complete);

  3. (3a)

    all clusters in the catalog are provided with redshift z and celestial coordinates, the J2000.0 right ascension \(\beta \) and declination \(\delta \). These quantities are converted into physical Cartesian coordinates using the standard formulae,

    $$\begin{aligned} \begin{aligned} x&= D_{C}(z) \cos \delta \cos \beta , \\ y&= D_{C}(z) \cos \delta \sin \beta , \\ z&= D_{C}(z) \sin \delta \cos \beta , \end{aligned} \end{aligned}$$
    (41)

    where \(D_{C}\) is the comoving distance calculated assuming the same fiducial cosmology as in the previous step. In Fig. 4 we show both the angular projection of the SDSS survey area (top panel), and the “physical length” distribution of the catalogue, with the three bins shown in different colors (bottom panel);

  4. (4a)

    we define a Cartesian grid covering the SDSS survey area. Each point in this grid will be the center of a cell which will be used for the count-in-cell procedure. In order to guarantee a full coverage of the area, considering that the volumes are spheres, the distance between each point (i.e. each center of each cell) is \(\sqrt{2} R\);

  5. (5a)

    the SDSS survey does not cover the sky in a uniform way; thus, we are not going to include in our analysis all the points from the previously defined Cartesian grid. Actually, converting the Cartesian coordinates of each point back to celestial coordinates, we only select those ones which fall in the range defined by the initial cluster catalog. This step will acquire more significance as further steps in our procedure will be highlighted in the next points.

Having defined this initial set up, we have performed the following operations on/with it:

  1. (1b)

    we randomize the grid defined in the previous point (3a), by shifting its origin by a random number in the interval \([0,\sqrt{2}R]\). Actually, we apply this shift independently to each Cartesian axis of the grid;

  2. (2b)

    after each shift, we only retain cells which satisfy the condition described in the previous point (5a). This assures us that any cell which should fall out of the SDSS survey will not be considered in the following analysis;

  3. (3b)

    additionally, we apply a jackknife cut of \(10\%\) of cells selected randomly;

  4. (4b)

    the previous steps, (1b)–(2b)–(3b), are realized 100 times, each time having a different shift in the origin of the grid system (point (1b)), a possibly different number of cells falling out of the SDSS survey are (point (2b)), and a different set of cells cut from point (3b).

After all these steps are performed, we eventually have at our disposal the grid of centers of cells/volumes, for each cell size R provided at point (1a), and divided in the three subgroups following the redshift criterion described at point (2a), which will serve to perform the count-in-cell with the cluster catalog data. Basically, for each point in the grid, we will retain only the clusters whose distance from a given grid point (i.e. cell center) will be lower than the size R taken into account. Because of point (4b) above, we basically have 100 different grid sets to compare with the original catalogue, namely, we will have 100 F(N) spanning the ranges \([N_{min},N_{max}]\) where, as before, \(N_{min}\) and \(N_{max}\) are the minimum and maximum numbers of objects (clusters) within each cell/volume.

The median of such ensemble of 100 values for F(N) will serve as observational estimation for this quantity in the \(\chi _{ls}\) analysis, as defined in Eq. (39). Instead, the median and the standard deviation, assumed as error \(\sigma _{i}\), will be used when performing the \(\chi _{jk}\) analysis, as defined in Eq. (40).

3.3 Results

The complete outcomes of our statistical analysis are presented in Table 1 for galaxies and Table 2 for clusters of galaxies. As a first comment, valid for both cases, let us notice that the softening parameter \({\tilde{\epsilon }}\) is not present in the tables because it is basically unconstrained, exhibiting a uniform distribution all over the given prior range [0, 1]. Thus, we can infer that its role in the fit is marginal.

3.3.1 Galaxies

For what concerns galaxies, from Table 1 we can see how the parameter \({\bar{N}}\) is very well constrained, and there is no difference between using \(\chi ^2_{ls}\) or \(\chi ^2_{jk}\). This statement is valid whatever radius R and redshift bin is considered. Actually, we must remember that the catalog is complete only up to \(z=0.42\), after which we do have a bias toward smaller clusters, namely, clusters with a lower \({\bar{N}}\). And this is effectively seen in the tables, where \({\bar{N}}\) rises slightly with redshift, becomes practically constant, and then starts to decrease for \(z>0.45\).

The same consideration is basically true also for the clustering parameter b, even if in this case we can see how there is a trend with varying R, while no peculiar change with redshift z can be detected. In general, this parameter lies in the range [0.3, 0.4] for all cases; however, while for the smaller R we can see how it is very well constrained, for growing R, we are able to put only upper limits on it, which means that also small values of b are compatible with data. As described in [76], we know that smaller values of b correspond to clusters which have not yet fully virialized. It is worth noticing that such trend is on the opposite side with respect to [8, 19, 76] where smaller cells volumes correspond to smaller values of b; although we must also stress that in [8, 19, 76], the considered physical volumes are much larger than those we have defined here as well as the redshift bins, and the number of objects in each bin is much lower. In our case the bins are much finer, both in radius and in redshift.

For what concerns the only fully characterizing parameter of the nonlocal gravitational potential, i.e. \({\tilde{\lambda }}\), we can see how it is remarkably very well constrained in a specific and well defined range. Statistically speaking, we can see how it approximately lies in the range [0.4, 0.5], which, in physical units, corresponds roughly to [0.32, 0.55] Mpc. We can detect a slight decrease for varying redshift, with smaller values at larger z; while it seems to be more pronounced a trend with varying R, with larger \({\tilde{\lambda }}\) for larger clusters. It is quite striking to have such values for this parameter, which are actually totally consistent with the size of gravitational structures/volumes under scrutiny. At the same time, they are also very different from a stable GR limit, which would be achieved when \(\lambda \rightarrow \infty \). Actually, from Eq. 7, one can see how it would be possible to recover an unstable GR-like limit even for \(\lambda \rightarrow r_{ij}\).

Finally, from Figs. 5, 6 and 7, we can also visually check the quality of the fits: the larger is the cell volume, the better is the fit.

We must stress here an important point: these results just show that a logarithmic correction to the Newtonian gravity might be consistent with the clustering of galaxies. But we cannot state at all that this correction is consistent with the full clustering process at these same scales, because, from the catalogue we have used, we have no information on voids, which should be taken into account. This is a further check which should be performed in the future.

3.3.2 Clusters

What we can check is how the full clustering process on larger scales behaves. As we have stated in the previous sections, if we move to consider the clustering of clusters of galaxies, the catalogue in hand does allow us to properly take into account voids. Although, in this case, results are a bit more fuzzy.

First of all, we focus on \({\bar{N}}\). We can see here a trend both in redshift and in volume size R: \({\bar{N}}\) decreases with redshift and increases with R. The latter correspondence is of course expected, as large cells can contain more clusters; the former one is also somehow expected, because we might predict an intrinsic lack of clusters at higher redshifts, as they are caught in an epoch of formation, while a larger number of them is observable at smaller redshifts. Notice that our bins all have the same comoving volumes, so that any geometry-related issue should not be effective in this case.

The behavior of the clustering parameter b is now fully consistent with literature [8, 19, 76], with smaller values for smaller volumes, as well as for higher redshifts.

The nonlocal characteristic length \({\tilde{\lambda }}\), instead, in this case is quite unconstrained. We are unable to put strong boundaries on it and in Table 2 we can only assess upper limits on it. Although we must warn that such results are statistically weak, with the posteriors being quite irregular in most of the cases. This result can only be interpreted as a substantial negligible role of the parameter \(\lambda \) in the fitting procedure. Thus, we should conclude that on such large scales there is no evidence for a detectable logarithmic correction to the standard Newtonian potential (Fig. 8).

4 Discussion and conclusions

Nonlocality effects can occur at large distances as the consequence of modified gravitational potential. Specifically, nonlocal gravity, besides the effects at cosmological scale as a possible engine for accelerated expansion [38, 41], is relevant also for large scale formation. In particular, it is capable of triggering the clustering of galaxies and clusters of galaxies.

In view of this statement, we have analyzed the effects of nonlocal gravitational potential on the structure formation comparing the model with observational data. This has been done by treating both galaxies and clusters of galaxies (in two distinct analysis) as points in a statistical mechanical system, and then analyzing their clustering using a gravitational partition function. This function has been modified according to the nonlocal gravitational potential and its influence on the properties of the gravitational clustering has been scrutinized. Finally, the model has also been compared with observational data, and we have demonstrated that a logarithmic correction to standard gravity seems to be consistent with the observations, at least with those concerning the galactic scale, i.e. within volumes corresponding to clusters of galaxies. Thus, it is possible to conclude that the nonlocal gravitational effects might be revealed at such scales. On the other hand, we must stress that the clustering of larger volumes of space, in which the points are the clusters of galaxies, does not show any evidence in favor of a such modification to gravity so that any inference should be suspended until further (maybe more precise) probes are checked.

For a more general discussion, it has be noted that other modifications of gravitational potential, explaining dark matter or dark energy effects, have been studied considering modifications of the gravitational partition function. For example, it is well-known that f(R) gravity modifies the large distance behavior of gravitational potential [77,78,79,80]. Thus, the clustering of galaxies, interacting through effective potentials derived from f(R) gravity, has also been studied using a modified gravitational partition function, and it has been observed that also these models are consistent with observations for large samples of galaxies and clusters [81, 82], although the corresponding statistical inference is a bit weaker that the nonlocal scenario we have considered here. It is worth noticing that the clustering of galaxies in f(R) gravity is also consistent with the constraints coming from the Planck data [83].

The MOND gravitational partition function has also been used to study the thermodynamics and the clustering properties of systems of galaxies [13, 84].

Furthermore, the gravitational phase transition can also be analyzed using the gravitational partition function for systems of galaxies [14]. In fact, a first order phase transition occurs due to the clustering of galaxies from a homogeneous phase. In this framework, it is possible to take into account the Yang–Lee theory for systems of galaxies, and use the complex fugacity to analyze the phase transition [85]. A forthcoming step will be to extend the Yang-Lee theory for nonlocal gravitational potential, and analyze the phase transition for the related gravitational partition function.

In particular, it has to be noted that the clustering of galaxies has also been investigated using the cosmic energy equation [86]. As the cosmic energy equation is derived by approximating galaxies as points in a statistical mechanical system, a softening parameter can modify the cosmic energy equation [87]. It has been demonstrated that a large scale modification of the gravitational potential also modifies the cosmic energy equation [88].