Main

Figure 1 illustrates our simulation scheme. The top left panel shows the present-day distribution of dark matter in a slab cut from a large cosmological simulation (L0) identical to the 2005 Millennium Simulation6, except that cosmological parameters are updated to reflect recent analyses of cosmic microwave background data from the Planck satellite. The total mass in this simulation is about 1019 solar masses (M). The circle outlines a spherical region chosen to avoid any of the more massive structures. The material in this region was traced back to the initial time and used to define a Lagrangian volume within which the particle count was increased by a factor of about 2,000, the particle mass was decreased by the same factor, and the representation of the linear cosmological fluctuation field was extended to ~10 times smaller scale while retaining all structure present in the original simulation. The mass outside this ‘zoomed’ region was consolidated into a smaller number of particles whose individual masses increased with distance from its centre. These new initial conditions were then integrated down to the present day. The top middle panel of Fig. 1 shows a projection of the mass within the largest sphere enclosed in the high-resolution region. It has resolution 2,000 times better in mass and ~10 times better in length than the first panel but contains a comparable number of well resolved haloes (that is, made up of 104 or more simulation particles).

Fig. 1: Projected dark matter density maps at each simulation level.
figure 1

Images of the dark matter distribution in a slice 30 Mpc thick through the base level of our simulation (L0) and in spheres almost entirely contained within the higher-resolution region of each of the eight successive levels of zoom (L1 to L8c). The zoom sequence is indicated by arrows between the panels, and a circle in each of the first eight panels indicates the zoom region shown in the next panel. Bars give a length scale for each plot. In the first panel, the largest haloes have a mass similar to that of a rich galaxy cluster, whereas in the last panel the smallest clearly visible haloes have a mass comparable to that of the Earth.

The small circle in this panel outlines a spherical subregion of this first level zoom (L1) that avoids any larger structures. It was again traced back to the initial conditions, refined by another factor of 500 in mass, and re-simulated to give a second-level zoom (L2) for which the final structure within the high-resolution region is shown in the top right panel of Fig. 1. This whole process was repeated eight times, each revealing ever-smaller structures, to give a final simulation (L8c) with eight levels of refinement and a high-resolution particle mass of ~10−11 M, hence a dynamic range of 30 orders of magnitude. The final mass distributions in the high-resolution regions at each stage are shown in the remaining panels of Fig. 1. Their initial conditions were set by using second-order Lagrangian perturbation theory with an initial power spectrum with Planck parameters together with a free-streaming cut-off at small spatial scales corresponding to a thermal weakly interacting massive particle (WIMP), which, for illustrative purposes, we assume to have mass 100 GeV. One of the zooms (L7c) was repeated without this cut-off (giving L7) in order to understand its effects on halo structure (see the Methods section for further details).

Considerable effort was needed to ensure that the initial conditions procedure, the force calculation accuracy and the time integration scheme of the simulation code were adequate to give reliable results over such a large dynamic range. In the Methods section we describe some of these improvements, and we present convergence tests that demonstrate that they were successful. The more massive haloes in the high-resolution region at each level can all be individually identified in the ‘parent’ level, making it possible to check that the masses agree in the two cases. For the most massive haloes, the resolution of the parent level is sufficient to test that their radial density profiles also agree. The plots in the Methods section show that both these tests are passed for all adjacent level pairs, giving us confidence that our results for the internal structure of dark matter haloes are reliable for 10−6 < Mhalo/M < 1015, the entire halo mass range that should be populated if the dark matter consists of 100-GeV WIMPs.

Figure 2 shows the first major result of this article. At each level of our simulation we identify a sample of a few tens of well resolved, quasi-equilibrium haloes of similar mass. For these, we construct a mean, spherically averaged mass density profile which we compare with two well known two-parameter fitting formulae, the NFW profile7,

$$\rho (r)={\rho }_{{\rm{s}}}{r}_{{\rm{s}}}^{3}/r{(r+{r}_{{\rm{s}}})}^{2},$$
(1)

where ρs and rs are the characteristic density and scale radius respectively, and the Einasto profile5,8,

$$\rho (r)={\rho }_{-2}\exp [-2{\alpha }^{-1}({(r/{r}_{-2})}^{\alpha }-1)],$$
(2)

where r−2 is the radius at which the logarithmic slope is −2, and α is a shape parameter that we fix to α = 0.16. These formulae were fitted to the mean profiles at each level over the radial range where these are numerically robust. Figure 2 shows differences between the measured profiles and these best fits in two different ways. Figure 2a gives the logarithmic slope of the profiles as a function of r/r−2, where r−2 is the characteristic radius of the best Einasto fit. In such a plot, each fitting formula predicts a universal curve, a Z-shaped transition between values of −1 and −3 on the vertical axis in the NFW case, and a smoother, more gradual change of slope in the Einasto case. Over 20 orders of magnitude in mass, the mean profiles of the simulated haloes are all very similar and are closer to the Einasto case than to the NFW. The only clear exception is that the curve for L0, representing haloes of moderately rich galaxy clusters, is noticeably steeper than the others. Larger values of α have previously been shown to give a better fit to such objects, but the trend in α does not continue to the much lower masses that we have now simulated. Figure 2b and c shows that over the factor of about 104 in density for which these profiles are robustly measured, NFW fits are almost everywhere accurate to better than about 10% and Einasto fits to a few per cent. This universality over 20 orders of magnitude in halo mass is remarkable, not least because reliable simulation data for the nearby Universe (redshift z = 0) have not previously been available for most of this range.

Fig. 2: Density profiles for haloes with mass between that of the Earth and that of a rich galaxy cluster.
figure 2

As described in detail in the Methods section, results for all well resolved equilibrium haloes in a narrow mass bin at each level are averaged together. a, The logarithmic slope d log(ρ)/d log(r) is shown as a function of radius normalized by r−2. The result for each level is represented by a different colour, as indicated in the key. A thicker line is used over the most reliable range between the convergence radius rconv and r200. The number of haloes in each stack is listed in Extended Data Table 1. Predictions for NFW and Einasto profiles are shown as dotted and dashed black curves, respectively. b, The ratio of each stacked profile to the best-fit NFW profile is shown as a function of r/r−2. c, As in b, for the Einasto profile (with α fixed at 0.16).

The mass of a dark matter halo is conventionally taken as that within the virial radius, defined here as r200, the radius enclosing a mean density 200 times the critical value. Mass and concentration, c = r200/rch, can then be used as alternative parameters for the above fitting functions, with rch = rs and r−2, respectively, for the NFW and Einasto cases. Figure 3 shows the mass–concentration relation in our simulation, considering only haloes with enough particles for a reliable concentration measurement (>104 at the higher levels, somewhat fewer in L0, L1 and L2). Each coloured band gives the [10%, 90%] range for haloes at a given level, with a white line indicating the median concentration at each mass. Over the mass range 1015 > M200/M > 1010 relevant for galaxy clusters and for all but the very faintest galaxies, concentration rises fairly rapidly with decreasing mass. The relation becomes shallower for lower-mass haloes, however, and eventually turns down as the free-streaming mass is approached. This turn-down is most clearly seen by comparing results for L7c and L8c, where the initial conditions included a free-streaming cut-off, with those for L7, where they did not. In the Methods section we compare matched objects in L7 and L7c, showing that the cut-off reduces the concentration of individual haloes by an increasing amount as the free-streaming mass (about Earth mass for a 100-GeV WIMP) is approached. Like all N-body simulations of structure formation with a free-streaming cut-off, both L7c and L8c form spurious small-scale clumps. As discussed in the Methods section, this does not affect the results of this article.

Fig. 3: Halo concentration as a function of mass over a mass range of 20 orders of magnitude.
figure 3

The median values of the concentration, cEinasto = r200/r−2 (from the best-fitting Einasto profile), in each mass bin are shown as white curves, with coloured regions showing the range [10%, 90%]. As before, each zoom level is shown with a different colour, and we give results both for L7c, which has a free-streaming cut-off, and for the otherwise identical L7, which does not. Mass–concentration relations from five published models10,18,19,20,21 are shown as smooth dashed lines in different colours: black, ref. 10; dark blue, ref. 18; red, ref. 19; green, ref. 20; light blue, ref. 21. Solid black lines show the fitting formulae given in the Methods section. The pairs of solid and dashed black lines give predictions for the cases with and without a free-streaming cut-off. The vertical dotted lines indicate the limits below which spurious haloes are expected to affect L7c and L8c (see Methods).

Other points of interest in Fig. 3 are that the scatter in concentration depends very little on halo mass, being about 0.15 dex over the full halo mass range plotted, and that previously published mass–concentration relations, although agreeing roughly for galaxy- and cluster-mass haloes, give wildly divergent results when extrapolated down to the lower halo masses that are simulated here. Only one model9,10 represents our results relatively well, both with and without a free-streaming cut-off. In the Methods section we give a simpler fitting formula that fits our numerical data even better and follows their approach to predict the effects of varying the free-streaming scale.

The concentration–mass relation is of critical importance for predicting WIMP annihilation radiation signals. Previous work implied that these should be dominated by haloes with mass relatively close to the free-streaming limit, but this changes substantially for the reduced concentrations that we find (see the Methods section for details). Structures down to very small scales should also be present in the outer regions of much more massive haloes, resulting in a substantial boost in the total amount (and a flattening of the radial profile) of their annihilation luminosity. Our simulation cannot address these issues directly, but it can be used to inform the further modelling required11.

The high-resolution region of L8c is only about 300 pc across at the final time and contains a total mass that is only about 1% that of the Sun, implying a mean density about 0.3% that of L0. This low value is a consequence of repeatedly choosing to refine regions that avoid any massive nonlinear structure. It is still rather larger than the median z = 0 density of a Universe with Planck cosmology dominated by a 100-GeV WIMP12. One may nevertheless question whether the haloes that we have simulated can be considered representative of the general population of similar-mass objects. In the Methods section, we test this by investigating how the concentration of our haloes depends on the density of their immediate environment, measured in a spherical shell between 5r200 and 10r200. Remarkably, despite the low mean density of the higher refinement levels, the distribution of this environment density is centred just below the cosmic mean for all haloes less massive than about 1010 M, with a spread of at least an order of magnitude. In addition, such haloes show no systematic trend of concentration with local density. This encourages us to believe that the concentration–mass relation of Fig. 3 should be representative of the full halo population. Previous attempts13,14,15,16 to simulate the structure of very-low-mass haloes have failed precisely because they did not take account of the low-density larger-scale environment in which such haloes live at z = 0.

A final related issue is that our simulation follows dark matter only, neglecting the effects of the 16% of cosmic matter which is baryonic. Both relative velocity and pressure effects17 are expected to prevent the gas from following the dark matter on the very small scales that we have simulated. Although accurate treatment of these effects is beyond present capabilities given the dynamic range that we are considering, we may expect that at the higher refinement levels they would increase the mean density (because on average the baryons will be less underdense than the dark matter) but reduce the growth rate of haloes (because this is driven by the dark matter density only, rather than by the total density). Given that halo concentration depends weakly on halo mass and not at all on local environment density, we expect these effects to shift our results by at most small factors, but this will require further work for confirmation.

The universal halo structure that we have demonstrated across 20 orders of magnitude in halo mass and the associated mass–concentration relation differ substantially from previously proposed extrapolations. This affects predictions not only for annihilation signals, which depend strongly on the concentration of the lowest-mass haloes, but also for perturbations of image structure in strong gravitational lenses and for structure in stellar streams in the Galaxy’s halo, both of which aim to constrain the nature of dark matter using haloes of mass 106 M to 109 M.

Methods

Simulations

The hierarchical resimulation strategy that allows us to follow the evolution of haloes over 20 orders of magnitude in mass was described in the main body of this article. The base level (level 0 or L0) is a cube of length 738 Mpc and particle mass 1.55 × 109 M. At subsequent levels (L1–L8c) the mass resolution increases by factors between a few hundred and 2,000, and the volume decreases by similar factors until the particle mass reaches 1.6 × 10−11 M in L8c. At each level, well resolved haloes (that is, with >104 particles within the virial radius) span two to three orders of magnitude in mass, ranging from M200 = 1015 M in L0 to M200 = 10−6 M (the Earth’s mass) in L8c. Here M200 is defined as the mass within a sphere enclosing a mean density 200 times the critical value. The parameters of the various levels of our simulation are listed in Extended Data Table 1. The simulation assumes a ΛCDM cosmology with Planck 2014 parameters22. Specifically, the mean matter density, mean baryon density and cosmological constant, in units of the critical density, have values Ωm = 0.307, Ωb = 0.48 and ΩΛ = 0.693; the present-day Hubble parameter is H0 = 67.77 km s−1 Mpc−1; the power-law index of the power spectrum of primordial adiabatic perturbations is ns = 0.961; and the normalization of the linear power spectrum is σ8 = 0.829.

Linear power spectrum

To create the displacement field for the initial conditions, a linear power spectrum is required that covers more than nine orders of magnitude from the fundamental modes of the L0 volume to the Nyquist cut-off of the L8c simulation. For relatively large scales, we use the same linear power spectrum as the EAGLE project23. This was computed using the CAMB code24 assuming ΛCDM with the values of the cosmological parameters given previously. As we are only modelling the dominant dark matter component, we use the BBKS fitting formula (equation G3 of ref. 25) to extrapolate the power spectrum to very small scales25. We adopt a similar approach to previous work11,26, creating a composite matter power spectrum that smoothly transitions from the EAGLE matter power spectrum to the BBKS form over wavenumbers 7–70 Mpc−1. We determined by inspection that setting the parameter Γ = 0.1673 in the BBKS transfer function and adopting an effective normalization, σ8 = 0.8811, matches the BBKS power spectrum accurately to the EAGLE power spectrum over the transition wavenumber range; we interpolate linearly in log wavenumber over this range to produce a smooth power spectrum for pure CDM.

We then used the formulae of Green et al.27 to represent the free-streaming cut-off expected for a 100-GeV WIMP. This corresponds to a specific particle physics model, but the corresponding mass scale is close to the peak of the posterior probability for the Constrained Minimal Supersymmetric Standard Model (CMSSM) parameter space28 and can still be considered representative in view of more recent constraints29. We show below how to adapt our results to alternative particle physics models that would predict a free-streaming cut-off on a different scale.

Making the initial conditions

Although the setting up and running of zoom simulations has become commonplace in the field of numerical cosmology, the initial conditions required for the present project are much more extreme in terms of the range of mass and length scales modelled than in previously published simulations. These exceptional demands have driven developments that go beyond the techniques described in previous work11,30,31.

The initial conditions for levels L1 to L8c were created and evolved sequentially in order of increasing mass resolution. After each level was completed, a region avoiding any massive halo was selected from its high-resolution region, and this then became the next level (see Fig. 1). The amplitude and phase of the initial fluctuations present in the initial conditions of all lower levels were retained, but the amplitude and phase of all higher-frequency fluctuations added at the new level were set independently and at random according to the power spectrum. In principle, we could make initial conditions at the resolution of L8c for any Lagrangian region within L0 without running any intermediate levels, but in the great majority of cases this would result in all of the mass being incorporated into a single halo of mass larger than that of the entire high-resolution region of L8c.

The specific features that emerge at any redshift—for example, the positions, masses and orientations of individual haloes or filaments—are a consequence of our particular realization of the linear initial conditions: that is, of our adopted power spectrum together with the specific phases and amplitudes chosen for each wave in a Fourier space representation of the initial Gaussian random field. Our phase information was taken from the Panphasia white-noise field31,32, an extremely large single realization of a Gaussian white-noise field with a hierarchical octree structure. Because the Panphasia field is completely specified ahead of time, all of the structure uncovered at all resolutions is essentially predetermined, as is the similar structure that would be uncovered by a different hierarchical zoom into any other region of the L0 cube.

The creation of initial conditions at each zoom level can be divided into three stages: stage 1 is to specify the region of interest; stage 2 is to build a particle load focusing most of the particles, and therefore most of the computational effort, in the small region of interest, while aggregating particles for lower levels so that the computational time for these regions is reduced while maintaining accurate tidal forces in the high-resolution region; stage 3 is to generate and apply the displacement field to the particle load, and assign velocities to each particle.

For stage 1, we start by selecting a spherical region of interest at redshift zero from a previously completed simulation of the lower level. For L1, this is the cosmological simulation L0, but for all higher levels it is itself a zoom simulation. The region is selected by eye using projections of the density field to avoid large haloes that were previously simulated with good resolution and would be prohibitive to simulate at much higher resolution. At the same time, we avoid regions that are more underdense than necessary, as these would yield few new haloes. The region size is dictated by the cost of resimulating at the resolution desired for the next level, given that we can afford simulations with a few billion high-resolution particles. Having selected a sphere, we then use its particles to determine the location and shape of the corresponding Lagrangian region by binning their high-redshift positions onto a 403 cubic grid just large enough to enclose them all. Within this cube, we define a simply connected region by selecting grid cells that either contain a particle or are adjacent to one that does.

For constructing the particle load in stage 2, we use a set of cubes with a variety of sizes that tesselate the entire simulation volume. In each cube, we place one or more particles of identical mass in an arrangement that ensures that the centre of mass of the particles within every cube is at the cell centre, and we choose the total particle mass in each cell so that it has precisely the mean density of the Universe. We also place the particles as evenly as possible within each cube in the sense that if that cube were tessellated over all space, the gravitational forces on each particle due to all other particles would be essentially zero. For the region outside the high-resolution cube, we lay down a set of ‘tidal’ particles arranged within a series of concentric cubic shells centred on the high-resolution cube. For the initial conditions of the highest level, L8c, more than 47 million tidal cells, each containing a single particle, are used to represent the mass distribution in the lower levels.

The particles within the high-resolution region are the ones that form the structures analysed at each level. In L8c, for example, we place a pre-prepared set of about 50,000 particles with a glass-like structure in each of the retained cells from our 403 mesh. This glass-like arrangement is created in a small periodic cube and results in the net gravitational force on every particle being extremely small. We also enforce the condition that the centre of mass of the glass be exactly at the cell centre. Because the glass is generated using periodic boundary conditions, it is simple to tile the entire high-resolution region with multiple replicas. The number of particles in the glass determines the mass resolution in the high-resolution region.

In stage 3, we generate and apply the displacement field following exactly the method described in previous work31. The displacement field is computed using Fourier methods for a series of concentric meshes centred on the high-resolution cube. The top-level mesh covers the entire domain, and the smallest mesh just covers the high-resolution cube. Each successive mesh is exactly half the linear size of the one above and adds independent information taken from the Panphasia field so as to be able to double the linear resolution of the displacement field. The L8c simulation required 23 levels in total with the smallest mesh being approximately 180 pc on a side.

We have used second-order Lagrangian perturbation theory (2LPT) to create the displacement and velocity fields for most of the initial conditions. In practice, however, we have found that using first-order (Zeldovich) initial conditions instead of 2LPT makes no important difference to the results provided that the starting redshift is high enough. In particular, for our chosen starting redshift of 127 for levels 0–2, and 255 for levels 3–8, there was no important difference in the halo density profile or its concentration between runs using the Zeldovich and 2LPT initial conditions. Nonetheless, we used the 2LPT initial conditions for all but levels 4 and 6.

Simulation code

The simulations were run with GADGET-4, a new version of the well tested GADGET33 cosmological N-body code. Several improvements were implemented in this code to allow the extreme zooms considered here to be executed with the required accuracy. The most relevant is an extension of the hierarchical multipole force computation algorithm to higher expansion order, yielding better force accuracy for given computational cost. A further efficiency gain comes from replacing the one-sided Barnes and Hut tree algorithm34 with a fast multipole method35, where the multipole expansion is carried out symmetrically both at the source and the sink side of two interacting particle groups.

The extreme dynamic range of our zooms revealed two problems that had not shown up in more conventional cosmological simulations with uniform mass resolution. Because the magnitude of the peculiar acceleration vector, a, of particles in the small structures targeted here is typically dominated by matter perturbations on much larger scales, the local timestep criterion most commonly used in cosmological N-body CDM simulations, \(\Delta t\propto {(\varepsilon /|{\bf{a}}|)}^{1/2}\), where ε is the gravitational softening length, often fails to provide a reasonable proxy for the local dynamical time in our smallest dark matter haloes. Rather, it tends to become unrealistically small because |a| remains at the large values characteristic of the resolved cosmic large-scale structures in our 738-Mpc periodic box, whereas ε shrinks to the tiny scales resolved in our calculations. We address this problem by applying a hierarchical time integration algorithm36 in which the Hamiltonian describing the system is recursively split into parts that evolve sufficiently slowly to be treated with a relatively long timestep, and faster parts that require shorter timesteps. This procedure effectively decouples the small-scale dynamics from the large-scale forces. The above canonical timestep criterion then yields a reasonable timestep for the smallest forming structures once it is applied (some steps down the hierarchy) only to the partial accelerations created by the high-resolution region itself.

A more subtle issue that becomes apparent with our very high dynamic range arises from the fact that force errors in our hierarchical multipole algorithm are spatially correlated. As a result, neighbouring particles normally have very similar node interaction lists. Formally, this creates force discontinuities across boundaries of the hierarchically nested cubes of the global octree geometry because the interaction lists and the field expansions (in the case of the fast multipole method) change there. Small haloes, for which internal peculiar accelerations are small compared with that induced by large-scale structure, can be greatly affected by such errors if they are cut by an octree boundary corresponding to a geometrically large node. In such cases, the force error discontinuity can be appreciable relative to the peculiar acceleration. At high redshift, this error can build up over many timesteps if the halo is nearly at rest relative to the octree pattern. To alleviate such effects, we decorrelate these errors in time by translating the whole particle set by a random vector (drawn uniformly from the cubic volume) after every timestep. Physically, this does not change anything as the periodic system is translationally invariant. Numerically, it causes the above errors to average out in time, thereby preventing the build-up of sizeable momentum errors over many steps.

Convergence

A critical test of our numerical techniques is convergence in the properties of our simulations. We first examine maps of the mass distribution in common regions of adjacent zoom levels. As an example, in Extended Data Fig. 1 we compare projected density distributions in L1, L3 and L8c with the corresponding distributions in the same region of the parent level. It is clear that large-scale structure in the simulations is converged.

We next check the convergence properties of the halo mass function, again by comparing results for common regions of adjacent levels. Mass functions of haloes in spherical volumes of radius approximately 90% that of the entire high-resolution region are shown as solid curves in Extended Data Fig. 2, with different levels indicated by different colours. The mass functions of haloes in the same region in the parent simulations are shown as dotted curves.

The convergence of the halo mass functions in adjacent zoom levels is remarkable. Small differences appear at low masses when comparing simulations that resolve the free-streaming cut-off (L7c and L8c). These stem from the presence of spurious haloes that form due to discreteness effects when a cut-off in the power spectrum is resolved37. The two vertical dotted lines in Extended Data Fig. 2 indicate the masses below which the abundance of these spurious haloes becomes important in the high-resolution regions of levels L7c and L8c37. For these cases, convergence can be tested only to the right of the dotted lines and, as the figure shows, in this regime convergence is very good. Here we have only considered haloes in L7c and L8c with mass above these limits.

A convergence test of the internal structure of haloes is shown in Extended Data Fig. 3. Here we compare the density profile of one of the most massive haloes in a given level (solid lines) with the same halo in its parent level (dashed lines). The profiles of haloes from the parent simulation are plotted as thick solid lines in the radial range between the ‘convergence radius’38 and r200. The ratio of the density profiles of the matched pairs is plotted in the bottom panel of the figure. At radii larger than the convergence radius, the profiles agree to within a few per cent.

In summary, Extended Data Figs. 1, 2 and 3 show that in the regime where convergence can be tested, the spatial distribution, the abundance and the density profiles of haloes converge remarkably well over a factor of several hundred in mass resolution for all adjacent pairs of levels in our simulation.

Global properties of our simulation levels

Extended Data Table 1 lists a number of properties of the high-resolution regions at each level of our simulation: np is the number of high-resolution particles and mp is the mass of each one, so that Mtot = npmp is the total mass of the high-resolution region. The r.m.s. linear fluctuation (extrapolated to z = 0) expected in a spherical region that on average contains this mass is given as σ(Mtot, z = 0). For levels 2 and higher, this number exceeds unity, reaching 17.6 in L8c. As a result, the actual z = 0 densities of the high-resolution regions, given as \(\langle \,\rho \rangle /{\rho }_{{\rm{mean}}}\), are small, typically a few per cent. This is expected since most of the mass of the Universe is contained in ‘high-mass’ haloes that have, by construction, been excluded from the higher simulation levels12. The fact that typical present-day haloes of very low mass (for example, Earth mass) form from Lagrangian regions with atypically low (linear) overdensity on larger scales (for example, 1–106 M) explains why previous work has been unable to follow their evolution to low redshift16.

Density profiles

We selected only ‘relaxed’ or ‘equilibrium’ haloes defined as those that satisfy the following two criteria18: (i) the mass fraction in subhaloes within the virial radius is less than 0.1, and (ii) the offset between the centre of mass and the minimum of the potential is less than 0.07r200. As listed in Extended Data Table 1, more than 90% of our well resolved haloes satisfy these conditions at all levels (more than 95% at the highest levels). This can be understood as a result of the relatively high typical formation redshifts of the haloes (also listed in the table), although these are considerably lower than found in earlier work which was unable to follow such low-mass haloes to low redshift. Interestingly, we find the lowest-mass haloes to have lower typical formation redshifts than slightly more massive objects, consistent with the lower concentrations that we find below. We note also that we found no higher-mass particle within 0.95 of the radius of the high-resolution region at any level, and that extremely few well resolved haloes were contaminated by such particles. We excluded from our analysis any halo with such a particle within twice its virial radius, r200.

To make mean mass-density profiles, we averaged binned mass densities in the radial range (0.001–10)r200 for haloes lying between 0.8 and 1.2 times the central mass values listed in Extended Data Table 1. We then fitted NFW7 and Einasto5,8 formulae (equations (1) and (2)) to the stacked profiles using the bins between the ‘convergence’ radius38 and r200 by minimizing the expression18:

$${\varPsi }^{2}=\frac{1}{{N}_{{\rm{b}}{\rm{i}}{\rm{n}}}}\mathop{\sum }\limits_{i=1}^{{N}_{{\rm{b}}{\rm{i}}{\rm{n}}}}{[\mathrm{ln}{\rho }_{{\rm{s}}{\rm{i}}{\rm{m}},i}-\mathrm{ln}{\rho }_{{\rm{f}}{\rm{i}}{\rm{t}},i}]}^{2},$$
(3)

where ρsim,i and ρfit,i are the simulation data and the fitted density profile in radial bin i. For the Einasto fits, the shape parameter α was set to 0.16 (ref. 39) so that only two parameters are varied in both the NFW and Einasto fits.

The logarithmic slopes of the stacked radial density profiles of haloes are plotted in Fig. 2 out to large radii, 10r200. The ratios of the stacked profiles to the best-fit NFW and Einasto formulae are plotted in the lower panels of this figure and show that the NFW fits are almost everywhere accurate to better than 10%, and the Einasto fits to a few per cent.

As may be seen in Fig. 2, although Einasto profiles with α = 0.16 fit the data well overall, for haloes with M200 > 1012 M the fits have relatively large residuals. We therefore carried out Einasto fits to individual haloes with all three parameters free. The resulting median dependence of α on halo mass is well described by:

$$\alpha =0.16+0.0238\times {({M}_{200}/{M}_{* })}^{1/3}$$
(4)

where M⁎ is defined by σ(M⁎) = 1.68, where σ(M) is the r.m.s. linear fluctuation within a sphere that on average contains mass M. This extends previously published formulae39 to much lower halo mass. For the Planck cosmology that we use here, M = 1.14 × 1014 M. We now refit all haloes using for each an α value given by equation (4) and adjusting only the two remaining parameters. In this way, we obtain a robust estimate of the concentration–mass relation over the full halo mass range accessed by our simulation.

The resulting relation between M200 and cEinasto = r200/r−2 is shown in Fig. 3. Simple extrapolations of empirical formulae derived for haloes of mass M ≥ 1010 M overestimate the concentrations of low-mass haloes (M200 < 106 M) by large factors. On the other hand, formulae derived from halo mass accretion histories9,10 match our data better over the entire halo mass range, both with and without a free-streaming cut-off. We fit a simple parametrized form used previously19,40 to the median concentration–mass relation for levels L0 to L7 (that is, with no free-streaming cut-off), namely:

$${c}_{{\rm{E}}{\rm{i}}{\rm{n}}{\rm{a}}{\rm{s}}{\rm{t}}{\rm{o}}}({M}_{200})=\mathop{\sum }\limits_{i=0}^{5}{c}_{i}\,{\left[\mathrm{ln}\frac{{M}_{200}}{{h}^{-1}{M}_{\odot }}\right]}^{i}$$
(5)

When the free-streaming cut-off is important (that is, for L7c and L8c), the concentration drops exponentially at the low-mass end and the relation is well fitted by:

$${c}_{{\rm{E}}{\rm{i}}{\rm{n}}{\rm{a}}{\rm{s}}{\rm{t}}{\rm{o}}}({M}_{200})=\exp \,\left[{c}_{6}\times {\left(\frac{{M}_{{\rm{f}}{\rm{s}}}}{{M}_{200}}\right)}^{1/3}\right]\times \mathop{\sum }\limits_{i=0}^{5}{c}_{i}\,{\left[\mathrm{ln}\frac{{M}_{200}}{{h}^{-1}{M}_{\odot }}\right]}^{i}.$$
(6)

In these relations, the ci are dimensionless constants and the free-streaming mass scale is given by \({M}_{{\rm{f}}{\rm{s}}}={\textstyle \tfrac{4{\rm{\pi }}}{3}}\times {\left({\textstyle \tfrac{2{\rm{\pi }}}{{k}_{{\rm{f}}s}}}\right)}^{3}\times {\rho }_{{\rm{m}}{\rm{e}}{\rm{a}}{\rm{n}}}\), where kfs is the free-streaming wave number defined by equation (3) of ref. 27. For a thermal WIMP of mass 100 GeV, Mfs = 7.3 × 10−6 M and kfs = 1.77 pc−1. We find the following best-fit values for the other parameters: ci = [27.112, −0.381, −1.853 × 10−3, −4.141 × 10−4, −4.334 × 10−6, 3.208 × 10−7, −0.529] for i ∈ {0, …, 6}.

Environmental dependence

Our strategy for simulating haloes over the entire mass range expected in a ΛCDM universe relies on successive resimulation of low-density regions. An important question is then whether the structure of these haloes is typical of the overall population. We can address this by examining how the concentration of haloes of a given mass varies with environment. We characterize the local environment of each halo by the mean density, ⟨ρ⟩, averaged over a surrounding shell with inner and outer radii 5 and 10 times the halo’s virial radius, r200.

In Extended Data Fig. 4 we plot halo concentration as a function of ⟨ρ⟩/ρcrit for haloes averaged over mass bins in the range (0.5–2) Mchar, where Mchar, listed in Extended Data Table 1, is the typical mass of equilibrium haloes at each level. The white curves show median values and the surrounding shaded regions the r.m.s. scatter. Even though we focus on underdense regions, the density around haloes of mass below 1010 M is centred just below the mean density and that around more massive haloes is centred just above the mean density. Furthermore, the value of the environment density spans at least an order of magnitude, two orders of magnitude in the case of smaller mass haloes. Concentrations show no monotonic trend over this range, suggesting that the concentration–mass relation of Fig. 3 is representative of the halo population as a whole.

Impact of the free-streaming cut-off on halo structure

We can assess the effect of the free-streaming cut-off on the internal structure of individual haloes by comparing levels 7 and 7c. We do this in Extended Data Fig. 5, which shows density profiles for matched halo pairs in the two simulations. The haloes are matched by mass (mass difference less than 10%) and separation (offset less than 10% of the radius of the high-resolution region). Matched pairs were stacked in four different bins of L7 mass: m200 = 5 × 10−5 M; 10−4 M; 5 × 10−4 M; and 10−3 M. The numbers of halo pairs in these bins are 152, 132, 40 and 24, respectively.

The effect of the free-streaming cut-off is to reduce the inner density (with a corresponding slight increase in the outer density) by an amount that grows as the free-streaming mass is approached. The net result is a progressive reduction in the concentration of haloes with decreasing mass, as may also be seen by comparing concentrations for haloes in levels L7 and L7c in Fig. 3. This effect reflects the later formation of haloes in L7c relative to their counterparts in L7.

Impact of the concentration–mass relation on annihilation luminosities

The annihilation luminosity from a dark matter halo scales as the square of the local dark matter density integrated over its volume. For smooth profiles of the kind that we fit to our simulation, almost all the luminosity comes from well inside the characteristic radius (rs or r−2) and scales with the characteristic parameters of the halo as \({V}_{{\rm{\max }}}^{4}/{r}_{{\rm{\max }}}\) where Vmax and rmax are the maximum circular velocity of the halo and the radius at which this is attained. The luminosity per unit mass of a halo thus scales as \({V}_{{\rm{\max }}}^{4}/({r}_{{\rm{\max }}}{M}_{200})\)  which, at given redshift, depends only on halo concentration, c = r−2/r200, for Einasto haloes with constant α (= 0.16 in our case).

For the well resolved haloes at each level of our simulation, we can measure Vmax and rmax directly and so estimate their light-to-mass ratios. Averaging over all haloes of given mass and multiplying by their contribution to the mass density of the Universe according to some halo mass function (for illustration we here use the analytic Sheth–Tormen function41), we can construct Extended Data Fig. 6 which shows how the total annihilation luminosity of the present Universe is distributed over halo mass. Remarkably, we find the contribution per unit logarithmic halo mass interval to be almost constant over the range −3 ≤ ln M200/M ≤ 11. This is considerably less weighted towards low-mass haloes than estimates based on previously published extrapolations of the concentration–mass relation, and the total luminosity density is lower by factors ranging up to 103. Thus, the importance of very small structures for annihilation luminosities has been overestimated in the past, often by substantial factors. Note that this observation is likely to apply to substructure within haloes as well as to emission from the main (smooth) halo, even though we have not considered such subhalo contributions here.