Nearest neighbour analysis as a new probe for fuzzy dark matter

Fuzzy dark matter (FDM) is a promising candidate for dark matter, characterized by its ultra-light mass, which gives rise to wave effects at astrophysical scales. These effects offer potential solutions to the small-scale issues encountered within the standard cold dark matter (CDM) paradigm. In this paper, we investigate the large-scale structure of the cosmic web using FDM simulations, comparing them to CDM-only simulations and a simulation incorporating baryonic effects. Our study employs the nearest neighbor (NN) analysis as a new statistical tool for examining the structure and statistics of the cosmic web in an FDM universe. This analysis could capture the information absent in the two-point correlation functions. In particular, we analyze data related to the spherical contact, nearest neighbor distances, and the angle between the first and second nearest neighbors of halos. Specifically, we utilize probability distribution functions, statistical moments, and fitting parameters, as well as G(x), F(x), and J(x) functions to analyze the above data. Remarkably, the results from the FDM simulations differ significantly from the others across these analyses, while no noticeable distinction is observed between the baryonic and CDM-only simulations. Moreover, the lower FDM mass leads to more significant deviations from the CDM simulations. These compelling results highlight the efficiency of the NN analysis - mainly through the use of the J(x) function, $s_3$, $l_{3}$ and $a_4$ parameters - as a prominent new tool for investigating FDM on large scales and making observational predictions.

Moreover, recently some authors showed that ULSFs could help to resolve both  0 and  8 tensions (Allali et al. 2021; Blum & Teodori ★ E-mail: hamed.manouchehri@physics.sharif.edu2021; Ye et al. 2023).Fuzzy dark matter (FDM) is the simplest subclass of the ULSFs, which has no self-interactions.As is usual in the literature, we continue specifically with the FDM scenario, while the main results are almost the same for all ULSFs.
For most FDM models, the significant wave effects only appear on the galactic scales -while there might be little effects on cosmological scales.For instance, "the quantum pressure" suppresses the matter power spectrum above some scale, e.g., that happens in  ∼ O (1 h/Mpc) for an FDM mass of about ∼ 10 −23 eV (Li et al. 2019).
The Lyman-alpha forest's constraints on the matter power spectrum have been used to constrain the FDM mass (Armengaud et al. 2017;Irš ič et al. 2017;Nori et al. 2018).The sub-galactic matter power spectrum has also been proposed to constrain FDM mass using future high-resolution observations of strong lens systems (Kawai et al. 2022).Nevertheless, the highly non-linear dynamics in the small scales at low redshifts leads to the non-Gaussian matter density distribution.As a result, the statistical tools based on the two-point correlation function, such as the matter power spectrum, cannot fully extract the information in these scales due to the wave effects of FDM.
To constrain the FDM mass, people also have used many other cosmological and astrophysical observations, including the cosmic microwave background's (CMB) temperature, E-mode polarization and weak gravitational lensing power spectra and cross-correlations (Hlozek et al. 2015;Hložek et al. 2018), quadruple-image strong gravitational lenses (Laroche et al. 2022), the rotation curve of Milky Way (Maleki et al. 2020), the dynamical friction (Lancaster et al. 2020), the velocity dispersion of Milky Way disk stars (Church et al. 2019), internal dynamics and the constant-density cores of dwarf spheroidal galaxies (Gonzá lez-Morales et al. 2017;Chen et al. 2017), FDM solitonic cores near the supermassive black holes (Davies & Mocz 2020; Bar et al. 2019), ultra-faint dwarf galaxies (Hayashi et al. 2021;Dalal & Kravtsov 2022), Milky Way's dwarf satellites (Safarzadeh & Spergel 2020), and stellar streams (Amorisco & Loeb 2018).The upcoming 21 cm absorption line data can also constrain the FDM mass (Jones et al. 2021;Schneider 2018;Lidz & Hui 2018).Although these constraints combined, in nearly all mass ranges, disfavor the non-interacting FDM as the predominant ingredient of DM, most of them suffer from some uncertainties due to the poor star formation modeling, simple models of reionization, approximate and simplified numerical and analytical approaches (May & Springel 2023; Dome et al. 2022).However, even if we ignore these uncertainties, FDM particles with a mass of around ∼ 10 −22 eV could still comprise a large portion of the total DM energy density (see, Dome et al. 2022).Hence, finding new ways to constrain the FDM mass would be beneficial.In this paper, we propose the nearest neighbor analysis as a new probe for FDM.As usual in the literature, for the sake of simplicity, we denote the FDM masses by the parameter  22 ≡ /10 −22 eV.
The nearest neighbor analysis is an appropriate way to explore non-linear regimes since it is sensitive to higher-order correlation functions (White 1979).Several new quantities can be proposed within the nearest neighbor scheme.The most well-known quantity in the literature is the Void probability (VP) function.It is the probability that a spherical region with volume  is empty; in other words, the nearest data point from the sphere's center is outside the region.Several authors have studied the VP function and its features (White 1979;Balian & Schaeffer 1989;Szapudi & Szalay 1993).An extension to the VP function, which considers the other neighbors, is called kNN-CDF; which is twice more efficient than the two-point correlation function in constraining some cosmological parameters in the non-linear scales (Banerjee & Abel 2021a,b).In this direction, we work with three other quantities based on the nearest neighbor analysis: the spherical contact, the nearest neighbor's distance, and the angle between the first and second nearest neighbors (Ansarifard et al. 2022).The probability distribution functions for these three quantities, which we will describe in detail in the next section, probe the cosmic web on large and small scales.
This paper is organized as follows: In Sec. 2, we review the basic concepts and formulas related to fuzzy dark matter and the nearest neighbor analysis.In this section, we introduce the functions and statistical parameters that we use in our analysis.Sec. 3, describes the various simulations we employ in this paper.Then, in Sec. 4, we utilize the nearest neighbor analysis to investigate the simulations and compute and compare for them the various functions and moments described in Sec. 2. Finally, in Sec. 5, after summarizing our key findings, we conclude by offering some additional remarks.Supplementary material, in particular, some plots are put in Appendix B.

Fuzzy Dark Matter
To get the dynamical equations of FDM particles, we begin with the action for a free real scalar field with the canonical kinetic term, minimally coupled to gravity (Hui et al. 2017) where  is the determinant of the metric,  is the FDM particle mass, and  is the FDM field whose dynamics are governed by the Klein-Gordon equation, In the non-relativistic limit, one can rewrite  in terms of a complex field  as in which  is slowly-varying, i.e. | | ≪  2 ||/ℏ and | | ≪  2 | |/ℏ.In the weak-field limit Φ ≪  2 , which is a very good approximation for the study of structure formation, the perturbed Friedmann-Robertson-Walker metric in the Newtonian gauge takes the form (4) Substituting Eqs. 3 and 4 in the Klein-Gordon equation, Eq. 2, and considering the slow-varying limit, leads to the Schrodinger equation in an expanding universe which, combined with the Poisson equation determines the evolution of the FDM particles.That is sometimes called the wave or Schrodinger formulation for studying FDM dynamics.Alternatively, another formulation, namely the fluid formulation, is intuitively more insightful and computationally more affordable in some senses.To get the dynamical equations of FDM in the fluid formulation, one should use the Madelung transformations, where  is simply the phase of  as a complex scalar,  is the mass density of the FDM fluid and  is its velocity.Using this transformation, the imaginary and real parts of the Schrodinger equation take the form of the Euler and continuity equations, respectively where is the so-called "quantum pressure" (QP).
The QP shows up in the extended Euler equation due to the quantum nature of FDM, while it is absent in the ordinary Euler equation.QP is generally repulsive and suppresses small-scale structures below the de-Broglie wavelength scale.It could also reproduce the quantum interference patterns (Li et al. 2019).It must be noted that the fluid formulation breaks down in some small-scale regions where the multi-streaming and the destructive interference occur (Uhlemann et al. 2014;Mocz et al. 2018); it is a very good approximation for studying large-scale structures.
In the linear limit, a transfer function can characterize the suppression of the FDM power spectrum to the CDM one (10) The transfer function T (, ) can be well approximated by the redshift-independent expression: in which the parameter   = 9 × (/10 −22 ev)1/2 Mpc −1 is the critical scale of Jean's wavenumber at the matter-radiation equality.

Nearest Neighbor Analysis
In large scales, where the matter perturbations are small, the twopoint correlation function describes the matter density statistics well.However, non-Gaussianities emerge in small scales, and higher-order n-point correlation functions become non-trivial.As a result, the two-point correlation function cannot capture all the underlying information, so new quantities must be used.
The nearest neighbor analysis is a statistical method for analyzing the data containing information about particular objects' positions (like galaxies, halos, and simulation particles).In this method, one can define quantities that could capture some of the information absent in the two-point correlation function.

SC-CDF/PDF & NN-CDF/PDF
One example of such quantities is the spherical contact probability distribution function (SC-PDF).As a function of , the SC-PDF is the probability that the distance between a random point and its nearest data point is between  and  +  1 .One can also define the spherical contact cumulative distribution function (SC-CDF) as the probability that the above distance will be smaller than .Similarly, one can define the nearest neighbor probability (cumulative) distribution function (NN-PDF/ NN-CDF).In NN-PDF, instead of choosing a random point as in the SC-PDF, one chooses one of the data points and calculates the probability that the distance between it and its nearest data point is between  and  + .Accordingly, the NN-CDF is the probability that the distance from a data point to its nearest neighbor is smaller than  (Ansarifard et al. 2022). 2  Since the under-dense regions in the universe (voids) are significantly larger than overdense regions (e.g., filaments, halos, and others.)(see,e.g., Dome et al. 2023), the random points chosen to calculate the SC-CDF (or SC-PDF) are most likely to be located in the voids, and the distance to their neighbors mainly depends on the size and the shape of the large-scale voids.So, the SC-CDF/PDF is a function that mainly probes the large scales and the general shape of the cosmic web.In contrast, the NN-CDF/PDF probes the small scales since the points and their nearest neighbors are chosen from the primary data points (e.g., halos), generally placed relatively close distances in the dense structures.So, it is more sensitive to the clustering of structures.As we will see shortly, all n-point correlation functions influence SC-CDF/PDF and NN-CDF/PDF; as a result, they have information beyond the two-point correlation function.In this paper, the SC-CDF is denoted by  () while the NN-CDF is shown by  ().We also use another appropriate function called -function, defined as (Kerscher et al. 1999): For a purely random set of points with no correlations between them, we have  () =  (), resulting in a J-function value of unity.However, in the presence of a positive correlation, the J-function drops below unity,  () < 1, indicating clustering tendencies.Conversely, in cases of negative correlation, the J-function yields values above unity  () > 1 (Ansarifard et al. 2022).Therefore, the J-function is a reliable indicator of the degree of clustering.The relation between these functions and the n-point correlation functions, can be expressed via defining the conditional correlation functions (White 1979) where the integrals are taken in the volume ,  is the average number density, and  n (r 1 , . . ., r n ) are the n-point correlation functions.We have by definition  0 = 0 and  1 = 1, and the two-point correlation function takes the form where n(r) is the number density at the point r.The higher-order correlation functions are defined similarly (White 1979).It can be shown that (Ansarifard et al. 2022) F(r) is related to the zeroth-order conditional correlation function as and  () could be obtained by the zeroth-and first-order conditional correlation functions as in which r 0 is the center of the sphere with the volume  ().So, from the definition of the  (), 12, and the Eqs.15 and 16 we obtain After some straightforward algebra, we arrive at and where the dots denote the terms corresponding to the higher-order correlation functions and r 0 is the position vector of the sphere's center.
We employ the NN analysis to compare the clustering properties of different simulations.To avoid the artificial effect due to the total number density, we normalize the length-scales of each sample by the mean NN distance between data points if they were randomly distributed, namely the cube root of the total number density.Thus, in our analysis, we use the dimensionless parameter in which  is the comoving length in mega-parsecs and  is the total number density  =  tot / tot .
We can parameterize the statistical behavior of SC-PDF and NN-PDF using their moments.On the non-linear scales, the SC-PDF and NN-PDF roughly follow a skew-normal and logarithmic-normal distribution, respectively (Ansarifard et al. 2022).As a result, we use ordinary moments for the SC-PDF, while for the NN-PDF, we use logarithmic moments.Those moments for SC-PDF are defined as where  () represents the SC-PDF, and the mean of the distribution is denoted by .So,  0 = 1, and  1 = 0 by definition.We then define the distribution's mean and standard deviation by  1 =  and  2 = √  2 .The skewness and the kurtosis of distribution are defined as  3 =  3 / 3 2 and  4 =  4 / 4 2 , respectively, and show how well a distribution can be approximated with a normal distribution.We have  3 = 0 for a normal distribution and  4 = 3.
Because the NN-PDF follows a logarithmic-normal distribution, we define its moments as where () is the NN-PDF and  ′ is the logarithmic mean of the distribution.Again, the first two moments are trivial:  0 = 1 and  1 = 0. Similarly, we define the logarithmic mean, the standard deviation, the skewness, and the kurtosis by 2 and  4 =  4 / 4 2 , respectively.If the logarithmic skewness of a distribution is zero and its kurtosis is 3, the distribution is logarithmic normal.Hereafter, we briefly call   's the moments and   s the logarithmic moments of a distribution.

NNA
We introduce the probability distribution function of the angular distance between the first and second neighbors as a novel quantity to probe the cosmic web.This function is sensitive to the shape of the cosmic web and can be used to compare the predictions of different models of the LSS and DM (Ansarifard 2024).As the first step, we must identify a data point's first and second neighbors to estimate this function.Then, we calculate the angle  between the two lines emanating from a data point to its nearest neighbors and call it NN-angle (NNA, see Fig. 1).Finally, we will repeat it for all data points to find the probability distribution function of angle separation of nearest neighbors.Notably, the NNA analysis probes the cosmic web's shape, insensitive to conformal transformation or rescaling length scales.figureb For a set of-statistically-uniform distribution of particles, in three dimensions, the probability of finding the second neighbor between  and  + , denoted by (), is equal to the ratio of the solid angle Ω to the total solid angle, so Upon noting that () = (cos ) cos , we find that the probability distribution of cos  is uniform over [−1, 1], with (cos ) = 0.5.As discussed in Section 4, the probability distribution function (PDF) of NNA deviates from the uniform distribution once structures are formed.In this sense, the probability distribution function of cos  is a much better indicator of clustering than the ().We will show that a quartic function can well fit this distribution function As matter clustering becomes stronger, the PDF of NNA near the two extremes, where cos  ≃ ±1, increases.This results in a larger  4 in the fitting formula.As a result, during the NNA analysis, we will focus on the  4 parameter in addition to the mean and standard deviation of the PDF of NNA with respect to .

COSMOLOGICAL SIMULATIONS
We use the Nearest Neighbor analysis, a simple yet powerful tool, to study cosmic structures under different theoretical models; specifically, we compare the above statistical parameters.For this purpose, we utilize data gathered from numerous FDM and CDM simulations.Additionally, we analyze whether the NN analysis can discriminate the influence of FDM's QP and baryonic feedback on the cosmic web by comparing data from a simulation that incorporates baryonic effects and FDM simulations.For the sake of future comparison with observational data, it's better to consider the positions of dark matter halos instead of simulation particles for NN analysis.So, we work with the halo catalogs of desired simulations.The NN-analysis's results slightly depend on the mass ranges of the studied halos (see, Ansarifard et al. 2022).To ensure comparability among the results obtained from various simulations, we only consider halos within the mass range / ⊙ = 7 × 10 7 , 1 × 10 11  ⊙ .
The account of the simulations used is as follows: • FDM: May & Springel (2021, 2023) published the results of a series of large-volume and high-resolution FDM simulations through the newly developed code, AxiREPO.This code, implemented as a module in the original AREPO code, solves the full SP equations using a pseudo-spectral method.They performed their simulations with both CDM and FDM initial conditions (IC).Although the simulations using FDM IC are more reliable, the small size of the sim-ulation box leads to a limited number of halos.Consequently, the error bars of the results of NN analysis may be unsatisfactorily large.So, in this work, we mainly use the simulations with CDM IC.In these simulations, the QP term suppresses the formation of smallmass halos and greatly mimics the statistical properties of the full FDM simulations despite exploiting the initial power spectrum without suppression at small scales.We utilized the halo catalogs from four simulations with CDM/FDM ICs, FDM masses, and number of particles: (i)  22 = 0.7, 86403 and CDM IC, (ii)  22 = 0.7, 3072 3 and CDM IC, (iii)  22 = 0.35, 3072 3 and CDM IC, and (iv)  22 = 0.7, 8640 3 and FDM IC.The FDM simulations in our study were based on the following cosmological parameters: {Ω  , Ω  , Ω Λ , ℎ,  8 } = {0.3,0, 0.7, 0.7, 0.9}.The box size of these simulations was 10 Mpc/ℎ.However, it is important to note that the technical limitations of these simulations and most FDM simulations found in literature make them reliable only down to redshift  = 3.As a result, all the halo catalogs we used for different simulations belong to the same redshift.
• CDM: For comparison, we use data from a CDM simulation by May & Springel (2021) using the original AREPO code, with the same cosmological parameters, particle count, and box size.The IC generator code uses the same number to create random initial seeds for both this and the FDM simulations.Thus, the realizations in these simulations are identical.This approach reduces the error caused by cosmic variance and ensures that any differences between the CDM and FDM simulations are solely due to the distinct dynamical equations and not the result of simulating different parts of the universe.
• TNG50/TNG50-Dark: We use the halo catalogs of the main high-resolution IllustrisTNG50 3 run including the full TNG physics model, and its dark matter only counterpart4 .The full TNG physics model incorporates baryonic effects such as star formation, radiative gas cooling, galactic-scale winds from star formation feedback, and supermassive black hole formation, accretion, and feedback.The cosmological parameters used in these simulations are: {Ω  , Ω  , Ω Λ , ℎ,   ,  8 } = {0.3089,0.0486, 0.6911, 0.6774, 0.9655, 0.829} with 2160 3 dark matter particles and a box of length 35 Mpc/h.

ANALYSIS
Now, we explore and compare cosmic webs in different simulations using statistical tools detailed in Sec.2.2.To determine the positions and distances of the nearest neighbors of each halo or random point, we use the GriSPy 5 package (for NND analysis), and cKDTree class in the SciPy 6 library (for NNA analysis).
As mentioned, this study involves seven simulations, including two CDM simulations, four FDM simulations, and one CDM simulation with baryonic effects.All of the halo catalogs used in this analysis belong to the redshift  = 3 (See, Appendix A for higher redshifts).In this section, we will calculate and list the moments described in Sec 2.2 for all these simulations.To keep things simple, we will only present plots for one of the FDM simulations (simulation 4 in Table 1) and compare it with other simulations, including CDM, TNG50, and TNG50-Dark.The plots for the other three simulations for FDM, CDM, TNG, and TNG-Dark simulations at  = 3, as a function of dimensionless parameter x (defined in Eq. 20), which denotes the normalized scale.As discussed in the text, due to the weakness of correlations in FDM relative to CDM, its SC-PDF in small x-scales is higher than others.
can be found in the Appendix B. Notably, these plots align perfectly with the conclusions drawn from the simulation (4).
In the following, we first conduct the NN distance and angle analyses.

Nearest Neighbor's Distance Analysis
In Section 2.2, we learned that the probability distribution function can be calculated for the distances between randomly distributed points and their nearest data point.This function is called the spherical contact probability distribution function (SC-PDF) and is a crucial statistical tool.Fig. 2 shows the PDFs of SC for the CDM and TNG50/-Dark simulations, as well as one of the FDM simulations which have 8640 3 particles and  22 = 0.7, and uses ordinary CDM IC.In an FDM simulation, the SC-PDF value is higher on smaller scales, indicating that a random point's nearest neighbor occurs at smaller scales.Otherwise, there is no significant distinction in the SC-PDF value between the CDM and TNG50/-Dark simulations.
It might seem perplexing that the random points have closer nearest neighbors (NNs) in the FDM simulation despite the fact that the halos in the CDM simulations are more numerous than those in the FDM simulations.It is important to note that the distances in Fig. 2 are rescaled by a factor of roughly 3  √ , which is lower for the FDM simulation.This explains why a similar physical distance appears smaller in FDM plots.In other words, the scaling factor results in smaller (dimensionless) scales in FDM plots compared to the physical distances, making the FDM plots appear more compressed.Most of the randomly distributed points are located in voids, so suppressing small-scale structures in FDM simulations does not significantly alter the physical distances to their NNs.Therefore, the SC-PDF for FDM is larger at smaller (dimensionless) scales.Simply put, if clustering is weaker, halos in the simulation box for FDM become more evenly distributed.Consequently, the voids are smaller in dimensionless scales, which leads to closer nearest neighbors for randomly distributed points.When we discuss the results for the  () function, we will also provide an analytical justification for this observation.
Fig. 3 shows the probability density function of NND for various simulations, exhibiting log-normal behavior consistent with prior research (Ansarifard et al. 2022).The TNG50-Dark and TNG50 sim-  ulations show no significant difference from the CDM simulation.However, the NN-PDF for the FDM simulation deviates considerably from the others.It is suppressed in smaller (dimensionless) scales, and its maximum occurs in larger scales.This observation is noteworthy.This manifests the suppression of small-scale structure formation in an FDM universe.According to the theories of structure formation and spherical collapse, halos with lower masses can be found closer to each other.So the NN-PDF in small scales mostly belongs to the cases in which at least one of the reference or neighboring halos has a low mass.Due to the decrease in the number of low-mass halos in FDM simulations, the suppression of NN-PDF in small scales is expected.Fig. 4 shows the plots of  (),  (), and  () functions.It is observed that the FDM curves differ significantly from the others.However, there is not much difference between the other curves.The deviation of FDM in  () is less than that in  ().This is because  () primarily probes the voids, whereas the FDM effects majorly influence the structure formation in denser regions like filaments and nodes, where  () is more sensitive.In the FDM simulation, the value of  () is marginally higher than that of CDM.This suggests that the probability of finding at least one halo within a spherical region around a random point with a certain radius  is higher in FDM.In other words, the halos in FDM tend to be located somewhat closer (in dimensionless length scales) to randomly distributed points.This result is in line with Eq. 15.If we use  = 3 √︁   () ∼  3 √  as the dimensionless parameter, we can rewrite the equation as where the  ′ denotes the differential volume element of the -space.
In the FDM simulation, the clustering is not as strong, which results in a smaller value for  2 .This leads to a larger  () for the FDM simulation.
On the other hand, FDM has a lower  () value compared to CDM, indicating a much lower probability of finding the nearest neighbor in a sphere with a specific radius around the halos themselves.This trend suggests that the halos in FDM simulation are more sparsely distributed, which can be attributed to the absence of low-mass halos in this regime, as discussed earlier.Because of two competing factors in Eq. 16, corresponding to Ξ 0 and Ξ 1 , the reduction in  () in the FDM simulations cannot be easily seen by examining this equation.
Fig. 4 shows that, while  () for CDM simulations with or without baryonic effects are almost indistinguishable, that of FDM simulations deviates significantly for a wide range of .This can be attributed to the suppression of the power on small scales due to QP.This demonstrates that  () is a powerful tool for distinguishing baryonic and FDM effects, highlighting its efficacy as a reliable clustering indicator across various datasets.Again, this completely agrees with what is expected from Eq. 12. Rewriting it for the  ∼ 3 √ , we obtain Similar to the  () case, the smallness of  2 leads to the enhancement of  ().
Tables 1-2 represent the values of the moments and the logarithmic moments, described in Sec.2.2, for our different simulations7 .A noticeable difference is observed between the values obtained from the four FDM simulations and the other three simulations in all eight moments.The moments  1 ,  2 , and  3 show significant differences from each other (≳ 20 percent), as do the logarithmic moments  1 ,  2 , and  3 .On the other hand,  4 and  4 are slightly less sensitive to FDM short-scale effects.
Notably, the parameter  3 has a positive value of about 0.4 in CDM, TNG50, and TNG50-Dark simulations, while it is negative in all four FDM simulations.We expect models with lower FDM masses to deviate much more from CDM.The trend in the variation of the  3 parameter across different FDM masses aligns with expectations.Its value for the simulations (4) and (5) with  22 = 0.7 is around −0.1, but for the simulation with the lower mass, i.e.,  22 = 0.35, its value is −0.3.Similar trends can be seen in the values of  4 ,  2 ,  3 and  4 , but without sign changing.Besides,  1 and  1 also obey the same trend-Taking into account the error bars.The only exception is  2 , where there is no monotonic variation with respect to the FDM mass.
Similar trends can be seen for the simulation (7), which uses the suppressed FDM IC and is therefore, expected to have more intense fuzzy effects.The deviation of its moments from the values obtained from the three CDM simulations is larger than for the simulations ( 4) and ( 5), which have similar masses but no FDM initial conditions.However, the logarithmic moments of this simulation, when compared to the others, do not show similar coherent and monotonic trends.However, their error bars are relatively large (due to the relatively low number of halos in this simulation) and overlap with the values obtained from the other FDM simulations.Maybe the absence of smooth trends in the logarithmic moments of this simulation is also the result of the large errors, which should be examined in future studies.
The TNG50 simulation with baryonic effects shows no significant deviation in the moments and logarithmic moments from simulations without baryons ( 2) and ( 3).The inferred moments from these three simulations differ significantly from the FDM simulations.This demonstrates that utilizing NND analysis can differentiate between FDM and baryonic effects.

Nearest Neighbors' Angle Analysis
The Nearest Neighbor's Angle (NNA) is defined as the angular separation (or angular distance) between the first two nearest neighbors as viewed from a reference point.As discussed in Sec.2.2, analyzing this novel distribution provides a powerful measure to quantify how the distribution of matter in the cosmic web halos differs from an isotropic distribution.Fig. 5 shows the probability distribution function (PDF) of NNA as a function of the angular separation in degrees.To provide context for the behavior of this probability distribution without clustering, we generate a sample of randomly distributed points and plot their nearest-neighbor angle probability distribution function (NNA-PDF) alongside the simulations.The number of these random points is chosen to be the same as the maximum number of halos in our simulations, which belongs to the TNG50-Dark simulation.As predicted by the analytic calculations in section 2.2, the probability distribution function for randomly distributed points is approximately proportional to the sine function.
The NNA-PDF of our simulations differs from that of randomly distributed points due to the structure formation.Since the QP smears out the cosmic web on small scales, the PDF of NNA for FDM simulation is closest to that of a random distribution.Simulations of the CDM universe show no significant difference in the PDF of NNA with or without baryonic effects.Although the PDF of NNA for all simulations is more or less similar to a sine function, the maximum, mean, and other statistical quantities vary.Notably, the probability of very low and very high angles is higher in all simulations than in random points.During the formation of structures in the cosmic web, a large fraction of halos (∼ 30 − 50 percent 8 ) reside in elongated, 8 There are discrepancies between studies as they use different criteria to thin regions called filaments (Hahn et al. 2007;Cautun et al. 2014).This increases the chance of a halo and its first and second neighbors aligning in a nearly straight line.As shown in Fig. 5, the PDF of NNA for the FDM simulation is closer to that of random points.This can be attributed to the distinct structure of FDM filaments, which differs significantly from that of CDM simulations.In CDM simulations, filaments consist of many separate (sub-)halos, even on the smallest scales.However, FDM filaments do not break up into small halos.Instead, they form large, thick, and dense structures that connect large halos to each other.(see, e.g., Mocz et al. 2019Mocz et al. , 2020;;May & Springel 2021, 2023).Accordingly, FDM filaments contain fewer halos than CDM filaments (Dome et al. 2023), resulting in a lower probability of three neighboring halos being aligned in a straight line in FDM simulations.
It should be noted that the symmetry of PDF-the sine functionis broken by the formation of structures.This is illustrated in Fig. 5, where the PDF of NNA peaks at approximately 45 • .Additionally, the NNAs are more likely to be separated at nearly zero degrees than being close to 180 • .
This can be explained by the low probability of finding the first two closest neighbors on opposite sides for halos positioned near the boundaries of filaments and nodes.In other words, it indicates the asymmetry of the number density of halos on the boundaries of filaments and nodes.
Fig. 6 displays the PDFs of NNA for the same data sets, but now as a function of cos .As expected, the PDF for random points is roughly flat.Across different simulations, the PDF of the FDM simulation is the most similar to that of random points.For example, consider the probability of finding halos with 0.8 < cos  < 1.This is significantly lower in the FDM than in the other simulations.Again, the explanation is that in the FDM universe, the small-scale structures are smeared out, and the halo formation is suppressed in filaments.As discussed earlier, the filaments contain a large fraction of halos that have NNs in alignment with themselves.So, the probability of finding halos with 0.8 < cos  < 1 is lower in the FDM.
In Fig. 6, it can be observed that the probability density function (cos ) has its highest peak at the two opposite extremes, where cos  is approximately equal to ±1.However, this seems to be inconsistent with Fig. 5, where the lowest probabilities are observed at the two extremes, i.e.,  ≈ 0 • and  ≈ 180 • .This artificial inconsistency is due to the change in variable  to cos .It's important to note that the bins in Fig. 6 are not equivalent to those in Fig. 5 since |Δ cos | ≈ | sin  Δ|.This means that the bins near the extremes, where cos  ≈ ±1, cover a much wider range of angles.It's worth noting that the decrease of () at the two extremes is an artifact that is due to projecting 3-dimensional data onto a 2-dimensional surface parameterized by spherical coordinates.However, the increase segment the cosmic web (see, e.g., Cautun et al. 2014).See also Dome et al. (2023) for a comparison of the relative importance of cosmic nodes, filaments, walls and voids in CDM and FDM simulations.13)) for various simulations at  = 3, with error bars displayed for each.The values of these functions are nearly identical for the CDM, TNG50, and TNG50-Dark simulations, but for the FDM simulation, they exhibit significant deviations from the values for the other simulations.This is due to the suppression in clustering and the subsequent weakness of correlation functions for the FDM simulation, which lead to higher values of  (  ) and  (  ) and a lower value of  (  ) relative to the other three simulations.At large scales, the error bars of  (  ) become very large as the values of  (  ) and  (  ) approach unity due to their particular functionality.
of (cos ) at the two extremes holds physical significance since it directly results from the clustering and formation of the cosmic web.
We see that a quartic function is a good fit to the probability density function (cos ), as demonstrated in Fig. 7.However, due to the flattened shape of the distribution, different models can be for the angular distance of the first and second nearest neighbors (NNAs) of halos is shown for various simulations at  = 3.The PDF of NNA for a set of random points is also depicted for comparison.It behaves like a re-scaled sine function.In the FDM simulation, the probability of this angle being nearly 90 • is higher than the other simulations, while the probabilities for the two opposite extremes (0 • and 180 • ) are lower.Therefore, the PDF for FDM is the most similar to the sine function across different simulations.This is because the filaments in an FDM universe are blurred and contain fewer halos than a CDM universe.) for the cosine of the angle between the first and second nearest neighbors (NNAs) of halos is shown for various simulations at  = 3.The PDF of NNA as a function of cos  for a set of random points is also depicted for comparison, which is nearly flat.The probability of cos  being zero is lower than the two extremes (cos  = ±1).The apparent contradiction between this and what can be seen in Fig. 5 is due to the fact that the bins near the two extremes correspond to a wider range of angles than the other bins.In a FDM universe, the filaments are blurred and contain fewer halos than in a CDM universe.This leads to a more uniform distribution of angles between the NNAs of halos, resulting in a flatter PDF.
distinguished by the fourth-order coefficient  4 .In other words, in our analysis, we see that the curvature of the distribution function is mainly controlled by the fourth-order coefficient, i.e.,  4 (see, Eq. 24).Therefore,  4 proves to be a good measure of clustering.Table 3 presents the mean and standard deviation (st.d.) of NNAs, along with the quartic coefficient  4 .The table also compares these parameters with a sample of randomly distributed points for reference.In the case of a completely random spatial distribution of points, where no clustering is present, we have (cos ) = 1/2 and () ∝ sin .For these random points, as listed in Table 3, in  agreement with simple analytic calculation for a completely random distribution, the average value of  is 90 • , the standard deviation is about 39 • , and  4 ≃ 0.
The first three (CDM) simulations give significantly different results than the subsequent four(FDM) simulations.In the FDM simulations, the NNAs are more closely grouped around the central angle of about 90 degrees(See Fig. 6).As a result, the mean angle is higher and closer to 90 • , and the standard deviation is less.Also, the  4 parameter is lower for the FDM simulations, again indicating that the NNAs for the FDM simulations are more similar to random points.That is because the weaker clustering in the FDM simulations and the lack of halos in the filaments lead to more randomly distributed halos, resulting in significantly lower  4 .This observation supports the choice of  4 as a measure of clustering.
The lower FDM mass leads to a larger de-Broglie wavelength and stronger suppression of the small-scale structures, resulting in fewer halos in filaments.Thus, we expect the NNA statistical parameters for the lower FDM masses to be more similar to the random points.The results in Table 3 are in full agreement with this expectation, as the lowest mass FDM simulation has values for the standard deviation of  and  4 that are closer to the values obtained for the random points sample compared to the other FDM simulations.This suggests that these two parameters are very sensitive to the fuzzy nature of dark matter.
As shown in Table 3, there is no noticeable variation in the average value of  with respect to different FDM masses.This implies that using the mean of  alone may not be a reliable and efficient parameter to differentiate between FDM and CDM physics.
Comparing the values of  4 and the standard deviation of  for simulation (7) with simulations ( 4) and ( 5) as listed in Table .3, reveals that using FDM ICs provides closer values to those obtained for the random points.This, again, highlights the effectiveness of these two parameters for investigating the fuzzy nature of dark matter.However, the  4 parameter is more promising due to larger relative differences observed among the different simulations.Therefore, the NNA analysis captures information about the structures of the cosmic web in an FDM universe, proving a promising probe for FDM.

SUMMARY AND CONCLUSION
This paper aims to explore how the small-scale effects of FDM affect the statistical properties of large-scale structures in the universe, which are referred to as the cosmic web.We utilized NN analysis as a probe to compare the results of FDM and CDM simulations for the first time.The NN analysis probes the characteristics of the cosmic web beyond the two-point correlation function.This makes it much better at distinguishing between different small-scale physics of the dark matter.We analyzed halo catalogs from seven simulations at redshift  = 3.These simulations included CDM-and FDM-only simulations and a simulation incorporating baryonic effects.The FDM-only simulations had varying masses and resolutions, with one utilizing FDM initial conditions and the others using standard CDM initial conditions.
In various simulations, we calculated the distances between the halos using the spherical contact (SC) and nearest neighbor (NN) methods.We used these distances to generate probability density functions (PDFs) for both SC and NN distances.It is important to note that the FDM simulation had a more evenly distributed set of halos, leading to higher values in its SC-PDF for smaller scales.On the other hand, the NN-PDF of the FDM simulation encountered significant suppression at small scales due to the suppression of small-mass halos.Additionally, the J-function, which is a measure of clustering strength, was considerably higher and closer to unity in the FDM simulation, indicating weaker clustering than CDM.The deviation of the FDM J-function from the others surpassed the error bars, highlighting the effectiveness of the J-function in distinguishing FDM large-scale statistics from CDM.On the other hand, simulations that included baryonic effects did not display significant deviations from the CDM dark matter-only simulations across several statistical measures, such as SC-PDF, NN-PDF, F(x), G(x), and J(x).This suggests that these statistical measures can differentiate between the impacts of FDM and baryonic effects.
We have computed the moments of SC-PDF and the logarithmic moments of NN-PDF.Tables 1 and 2 present the resulting values for different simulations.As both  3 and  3 are approximately equal to zero, and both  4 and  4 are approximately equal to three, normal distribution for SC and logarithmic normal distribution for NN dis-tances are observed in all simulations, which is consistent with prior research (Ansarifard et al. 2022).However, the  3 and  4 values in FDM simulations are closer to 0 and 3 due to less correlated halo distributions.There were generally differences of around 10% between the FDM simulations and the other simulations across various moments and logarithmic moments.In almost all cases, the discrepancy exceeded the 5 level.The trends for the moment  3 and the logarithmic moment  3 are particularly noteworthy.They demonstrate a significant difference between FDM and CDM, and they are highly sensitive to the FDM mass and initial conditions.Interestingly, the FDM simulations show a sign change for  3 , which emphasizes their potential as indicators of FDM effects.
Then, we proceeded to the NN-angle analysis.We calculated the NNAs for the halos in our different simulations and generated corresponding PDFs as functions of  and cos , as depicted in Figs.5-6, respectively.We have created a graph of probability density functions (PDFs) for a set of randomly distributed points.When plotted as a function of , the graph takes the shape of a scaled sine function.Similarly, when plotted as a function of cos , the graph takes the shape of a flat line.However, for the simulations where the cosmic web structures are formed, the symmetry of the sine-shaped PDF breaks down and tilts towards smaller angles.Also, the flat line becomes U-shaped in the same simulation.The probability density functions (PDFs) in simulations of fuzzy dark matter (FDM) tend to resemble those of random points due to the suppression of small-mass halos and the unique filamentary structure.However, the PDFs in simulations with baryonic effects do not show any significant deviations from the dark matter-only simulations.This demonstrates the effectiveness of NNA analysis in distinguishing the small-scale physics of FDM and baryonic feedback.
We have calculated the mean of , the standard error of , and the parameter  4 defined in Eq. 24.The values obtained are listed in Table .3. We found a significant difference between the values obtained from FDM simulations and the rest of the simulations.In particular,  4 is a reliable and powerful tool to identify FDM effects as it gradually reached the values obtained from random points as the FDM mass decreased or the FDM ICs were used.
We consistently noticed a clear and distinct difference between the FDM simulations and the others during our analysis.The appendix A shows that this is also true at higher redshifts, and becomes even more pronounced.The data in Tables 1-3 and Figs.B1-B6 in Appendix B show that changing the resolution and using the FDM IC does not change this situation.Moreover, in most cases, reducing the FDM mass resulted in a greater deviation from the CDM simulations.The TNG simulation incorporates baryonic effects and its results were compared to other CDM simulations.We found no significant difference between them.So, the NN analysis is also able to distinguish between the statistical properties of FDM and baryonic simulations accurately.This indicates that the NN analysis can serve as a reliable tool for detecting FDM effects and differentiating between baryonic and fuzzy effects.These findings highlight the effectiveness of NN analysis in probing and identifying FDM effects.
We need to acknowledge the limitations of our study.Although we used one of the largest FDM simulations to date, the size of the simulation box (10ℎ −1 Mpc) is still relatively small for precise investigations of the large-scale structures of the universe.As a result, the error bars obtained for many of the (logarithmic) moments are still relatively large, particularly for the simulation with FDM initial conditions.
Furthermore, the chosen mass range for the halos ( 7 × 10 7 , 1 × 10 11  ⊙ ) corresponds to galaxy mass scales for which there is limited observational data available.
With the future availability of larger FDM simulations and more precise observational data on the three-dimensional distribution of large-scale structures, the NN analysis is poised to play a key role in unveiling the nature of dark matter.

Figure 1 .
Figure 1.This schematic figure illustrates how we define the angle  between the first and second nearest neighbors.

Figure 2 .
Figure2.The probability distribution functions of spherical contact (or SC-PDF) for FDM, CDM, TNG, and TNG-Dark simulations at  = 3, as a function of dimensionless parameter x (defined in Eq. 20), which denotes the normalized scale.As discussed in the text, due to the weakness of correlations in FDM relative to CDM, its SC-PDF in small x-scales is higher than others.

Figure 3 .
Figure3.Probability distribution functions of nearest neighbor distances (or NN-PDF) for FDM, CDM, TNG, and TNG-Dark simulations at  = 3, as a function of dimensionless parameter .The suppression in small x-scales can be seen for FDM.This is related to suppressing the formation of smaller halos, generally located closer to other halos.

Figure 4 .
Figure 4. Functions  (  ),  (  ), and  (  ) against the dimensionless  parameter (defined in Eq. (13)) for various simulations at  = 3, with error bars displayed for each.The values of these functions are nearly identical for the CDM, TNG50, and TNG50-Dark simulations, but for the FDM simulation, they exhibit significant deviations from the values for the other simulations.This is due to the suppression in clustering and the subsequent weakness of correlation functions for the FDM simulation, which lead to higher values of  (  ) and  (  ) and a lower value of  (  ) relative to the other three simulations.At large scales, the error bars of  (  ) become very large as the values of  (  ) and  (  ) approach unity due to their particular functionality.

Figure 5 .
Figure5.The probability distribution function (PDF) for the angular distance of the first and second nearest neighbors (NNAs) of halos is shown for various simulations at  = 3.The PDF of NNA for a set of random points is also depicted for comparison.It behaves like a re-scaled sine function.In the FDM simulation, the probability of this angle being nearly 90 • is higher than the other simulations, while the probabilities for the two opposite extremes (0 • and 180 • ) are lower.Therefore, the PDF for FDM is the most similar to the sine function across different simulations.This is because the filaments in an FDM universe are blurred and contain fewer halos than a CDM universe.

Figure 6 .
Figure6.The probability distribution function (PDF) for the cosine of the angle between the first and second nearest neighbors (NNAs) of halos is shown for various simulations at  = 3.The PDF of NNA as a function of cos  for a set of random points is also depicted for comparison, which is nearly flat.The probability of cos  being zero is lower than the two extremes (cos  = ±1).The apparent contradiction between this and what can be seen in Fig.5is due to the fact that the bins near the two extremes correspond to a wider range of angles than the other bins.In a FDM universe, the filaments are blurred and contain fewer halos than in a CDM universe.This leads to a more uniform distribution of angles between the NNAs of halos, resulting in a flatter PDF.

Figure 7 .
Figure 7. Same as Fig. 6 with the corresponding quartic fitting functions also shown.The plots for random points and TNG50-Dark simulation are not shown to avoid clutter.

Figure B5 .
Figure B5.The probability distribution function for the angle between the first and second nearest neighbors of the halos.Comparison of (a) FDM and TNG/-Dark simulations (same as Fig.5), (b) a simulation which has the ordinary CDM initial conditions but having the FDM dynamics (QP turned on), with a simulation which has both FDM IC and dynamics, (c) FDM simulations with different masses, and (d) FDM simulations with different resolutions.The figure (c) is particularly interesting as the plot for the simulation with lower mass exhibits more deviation from the CDM one and is closer to the sine-shape curve corresponding to the random points.

Table 1 .
Moments of SC-PDF at  = 3

Table 2 .
Logarithmic moments of NN-PDF at  = 3

Table A2 .
Logarithmic moments of NN-PDF at different redshifts