Full length article
TheHaloMod: An online calculator for the halo model

https://doi.org/10.1016/j.ascom.2021.100487Get rights and content

Abstract

The halo model is a successful framework for describing the distribution of matter in the Universe — from weak lensing observables to galaxy n-point correlation functions. We review the basic formulation of the halo model and several of its components in the context of galaxy 2-point statistics, developing a coherent framework for its application.

We use this framework to motivate the presentation of a new python tool for simple and efficient calculation of halo model quantities, and their extension to galaxy statistics via a halo occupation distribution, called halomod. This tool is efficient, simple to use, comprehensive and importantly provides a great deal of flexibility in terms of custom extensions. This python tool is complemented by a new web-application at https://thehalomod.app that supports the generation of many halo model quantities directly from the browser — useful for educators, students, theorists and observers.

Introduction

The halo model (Neyman et al., 1953, Scherrer and Bertschinger, 1991, Peacock and Smith, 2000, Seljak, 2000, Ma and Fry, 2000, Cooray and Sheth, 2002) is an enormously successful analytical description of the large-scale distribution of matter in our Universe. It describes the statistics of the dark matter density field well into the nonlinear regime, beyond the reach of perturbation theory. It does so by combining linear theory predictions with empirical properties of dark matter halos, via the assumption that the sum total of dark matter resides in these clumps, and that a handful of simple functions based on the mass of these halos – such as their radial density profile and clustering bias – can universally describe them.

In combination with a halo occupation distribution (HOD) model (Kauffmann et al., 1997, Scoccimarro et al., 2001, Berlind et al., 2003, Zheng et al., 2005), the predictions of the halo model can be extended to galaxy populations, and therefore used to model clustering in large galaxy surveys. One of the key advantages of halo model and HOD formalism is that they can predict any clustering statistic on any scale (Zehavi et al., 2011), from real-space or projected 2-point correlation functions (2PCFs), to galaxy–galaxy lensing, to higher-order correlations.

In practice, the HOD formalism has been widely used in the interpretation of galaxy populations in the past decade. Most of these studies have focused on determining the parameters of the HOD (i.e. the galaxy-halo connection) from the 2PCF of galaxies (e.g. Moustakas and Somerville, 2002, Bullock et al., 2002, Zheng, 2004, Zehavi et al., 2005, Blake et al., 2008, Zehavi et al., 2011, Beutler et al., 2013, a. Skibba et al., 2015, Rodríguez-Torres et al., 2016, Nicola et al., 2020, Zhou et al., 2021, Ishikawa et al., 2021) using the analytical framework that we present in this paper. However, other observables such as galaxy–galaxy lensing (Mandelbaum et al., 2006, Cacciato et al., 2012, Clampitt et al., 2017, Dvornik et al., 2018), the 2PCF of radio galaxies (Wake et al., 2008, Kim et al., 2011, Nusser and Tiwari, 2015), galaxy-quasar cross-correlations (Shen et al., 2013), near-UV cross-correlations (Krause et al., 2012), Fast Radio Bursts (FRBs; Rafiei-Ravandi et al., 2020) and Hi intensity map cross-correlations (Padmanabhan et al., 2017, Wolz et al., 2019, Chen et al., 2021) and auto-correlations (Schneider et al., 2021, Umeh et al., 2021) have also received application through the same framework. Furthermore, several studies have successfully combined observables (either in cross-correlation or via joint likelihoods) to break degeneracies (e.g. Leauthaud et al., 2011, Leauthaud et al., 2012, More, 2013, Schaan and White, 2021). Finally, the combination of the galaxy 2PCF with other statistics, e.g. weak-lensing (More et al., 2015, Miyatake et al., 2020), cluster counts and auto-correlations (To et al., 2021), or both (To et al., 2021), stellar mass functions (Coupon et al., 2015) and group mass-to-number ratios (Reddick et al., 2014) has resulted in the ability to simultaneously constrain cosmological parameters along with those of the HOD.

Clearly, the halo model (hereafter HM) framework, complemented by an HOD or comparable mechanism, can be of wide utility in the interpretation of large surveys. Increasingly, observational studies are employing a non-analytic incarnation of the HM, in which simulated halos are “painted” with a particular galaxy sample, given detailed semi-analytic models of the galaxy-halo connection (e.g. Carretero et al., 2015). In particular, the halotools1 library has become a popular implementation of this approach. Nevertheless, a purely analytic construction of the HM is still of great importance and utility: it is our best fundamental model of the non-linear scales of the matter distribution.

The HM is a complex framework as it synthesises many related sub-components (e.g. halo profiles, mass functions, bias models, spatial filters, halo exclusion models, concentration–mass relations) to produce spatial statistics. These sub-components can often be modelled independently via simulations, and new more accurate models are being produced regularly by the community. This highlights the need for an implementation of the HM framework that has the flexibility and modularity to enable easy switching between models for the various sub-components, and rapid development of new models to incorporate into the framework.

There are a few publicly available implementations of the analytic HM, many of which were used in the testing of our code (e.g., chomp,2 HMcode,3 CCL4 and AUM5). In addition, methods of computing HM quantities based on emulation from simulations are becoming available (e.g. DarkQuest6 and CosmicEmu7 — though the latter only supports matter correlations). However, it is our experience from that a remarkable number of practitioners develop their own tools — whether based heavily on existing (public or private) code or from the ground up. Additionally, existing codes – where still in active development – do not tend to offer a great deal of flexibility in the composition and extension of the various components and models involved in the halo model, rather focusing on a limited set of well-honed models and tuned for maximum performance.

This paper presents a robust new implementation of the analytic HM, called halomod,8 that aims to fill this important gap, and be as generally useful as possible by adhering to the following principles:

  • Intuitive. The API is well-specified and intuitive for the user, and exhaustively documented. We illustrate the simplicity of the usage of halomod in Section 4.1.1 and note that full online documentation is available at https://halomod.readthedocs.io, including API specifications and examples/tutorials. In addition, installing halomod is as simple as running pip install halomod.

  • Simple. Though many aspects of the calculations are unavoidably non-trivial, a simple layout of the code within a highly structured framework is important. We lay out halomod’s simple code framework in Section 4.1.2. This promotes future development, and usage by a broad cross-section of researchers.

  • Efficient. Though not as immediately important as flexibility, it is important that the code be efficient. This includes both algorithmic and numerical efficiency, but also efficiency of the writing of user-side code. We outline our strategies for efficiency in Section 4.1.3.

  • Flexible/Extendible. The HM is a rapidly evolving framework, with individual components constantly improving, and the framework itself being extended. Building a static implementation is therefore non-conducive to the development of the field. Components need to be as plug-and-play as possible, with new models easily created and inserted on the fly. Our implementation of such a plug-and-play system is outlined in Section 4.1.4.

  • Comprehensive. halomod acts as an archive for all the modelling that has been done by the community. It collates and compiles the various models and extensions in a cohesive way so that new models can be quickly compared, and insights gained. Our efforts towards this in halomod are evidenced by the numerous tables of models throughout Section 4.3.

  • Open. halomod is open-source, not simply in the sense that it is publicly available. It is developed with many open-source best-practices, such as continuous integration, high test coverage, automated code linting/formatting, formal software versioning, modern version control practices and online documentation.

Both philosophically and technically, halomod inherits from the hmf halo mass function package9 which was first presented in Murray et al. (2013b). Many developments have occurred in hmf since its first publication, and the technical framework of halomod presented in this paper is essentially inherited from the updates in hmf. Thus, this paper can also secondarily be considered an update of hmf.

Our vision is for halomod to be useful as (i) a baseline standard for user-specific private codes, (ii) a simple interface for those not actively researching in the field, but who may wish to calculate clustering statistics for their data, (iii) a tool for fast exploratory analysis, and comparison between models and (iv) a stable framework for more rapid development of theoretical extensions to the HM, and modelling of its various components.

In addition to halomod and hmf package, we also present a new web-application, TheHaloMod,10 which is able to generate full halo model quantities (e.g. 2-point correlation functions and galaxy power spectra) without ever having to install the python package. It is a successor to the popular HMFcalc (Murray et al., 2013b) web-application, and includes the full range of functionality of HMFcalc. The presentation of TheHaloMod completes our vision for halomod with (v) a tool for educators to easily and interactively present cosmologically relevant quantities graphically.

This paper is structured as follows: Section 2 details the theory of the HM particularly in the context of dark matter 2-point statistics, collating the various components involved in a manner consistent with our implementation. Following this, we describe how to extend the halo model to tracer populations in Section 3. Then, we describe our code and its usage in Section 4, and in Section 6 we present an illustrative example. In Section 7 we define a prospectus for the future, before summarising and concluding in Section 8.

Note that the code to produce all figures of different component models in this paper, as well as the example application, are available publicly as examples in halomod’s documentation.11 This paper refers to hmf version 3.4.1 and halomod version 2.1.0.

Section snippets

The dark matter halo model

The broad assumption underpinning the HM is that in hierarchical structure formation scenarios, all mass is expected to be bound to halos at some scale.12 If this is the case, then the entire nonlinear density field may be reconstructed by summing contributions from the individual halos.

HOD models

Before we can extend the previous theory to a treatment of tracers (e.g. optical galaxies), we must have a model for the expected occupation of the tracer within a given halo, P(T|m), termed the halo occupation distribution (for discrete tracers such as galaxy counts, this is typically written P(N|m) and must be a discrete distribution). Note that this model is assumed to depend solely on the halo mass, which perhaps surprisingly captures the majority of the behaviour of interest. There is a

The halomod library

In this section we present our new implementation of the HM, halomod. Our intention is first to give an overview of the philosophy behind, and general characteristics and features of the code. From there, we describe in detail various parts of the code, beginning in Section 4.2 with the “frameworks” which tie together the various components, and then the individual components themselves in Section 4.3. These sections have a pragmatic focus, introducing any pertinent numerical techniques, and

TheHaloMod web-application

Murray et al. (2013b) presented HMFcalc, an online HMF calculator that has since been widely used in the community. Web-applications can be useful, as they circumvent the overhead of installing custom software and using a command-line or interpreter interface. As such, they are more readily employed by researchers seeking to obtain a single model to corroborate the output of a simulation or observation. Perhaps more interestingly, the intuitive and graphical nature of web-apps make them

Example application

To illustrate the utility of halomod in semi-realistic applications, we here present a worked example of fitting parameters to mock galaxy data.48 We do not use real data, but instead create some simplistic mock data using halomod itself.

We note that we do not include native fitting capabilities in halomod. The reason for this is that applications in constraining parameters, and their

Future development

The current implementation of halomod (likewise hmf) forms a solid framework for evaluating halo model quantities. Its flexible and extendable architecture enables user-side development with updated components and paradigms (e.g. warm dark matter, or alternate dark energy scenarios). However, several features considered for future versions are worth mentioning:

Summary

We have presented a new code, halomod, accompanied by a web-application, TheHaloMod, for the calculation of quantities within the halo model framework. This code aims to satisfy six principles: simple, intuitive, flexible/extendible, comprehensive, efficient and open; we have shown how these criteria have shaped the architecture of the library.

halomod is designed to be a valuable resource for the community. To this end, we have presented an illustrative application which helps to get a flavour

CRediT authorship contribution statement

S.G. Murray: Conceptualization, Methodology, Software, Writing – original draft, Writing – review & editing, Visualization, Supervision, Project administration. B. Diemer: Software, Writing – review & editing, Methodology. Z. Chen: Software, Writing – review & editing. A.G. Neuhold Jr.: Software. M.A. Schnapp: Software. T. Peruzzi: Software. D. Blevins: Software. T. Engelman: Software.

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgements

SGM acknowledges many useful discussions with colleagues that formed the basis of this paper, including Chris Power, Aaron Robotham, Chris Blake, Florian Beutler and David Palomara. SGM was funded through NSF grants AST-1836019, AST-1813850 and AST-1636646 throughout the production of this work. Many thanks to the Low-frequency Cosmology (LoCo) lab at Arizona State University whose cluster, pleiades, hosts the server on which TheHaloMod runs. In particular thanks go to Matt Kolopanis, who

References (162)

  • CoorayA. et al.

    Halo models of large scale structure

    Phys. Rep.

    (2002)
  • MurrayS.G. et al.

    HMFcalc: An online tool for calculating dark matter halo mass functions

    Astron. Comput.

    (2013)
  • BardeenJ.M. et al.

    The statistics of peaks of Gaussian random fields

    Astrophys. J.

    (1986)
  • BehrooziP.S. et al.

    The average star formation Histories of galaxies in dark matter halos from z= 0-8

    Astrophys. J.

    (2013)
  • BensonA.J. et al.

    Dark matter halo merger histories beyond cold dark matter - I. Methods and application to warm dark matter

    Mon. Not. R. Astron. Soc.

    (2012)
  • BerlindA.A. et al.

    The halo occupation distribution and the physics of galaxy formation

    Astrophys. J.

    (2003)
  • BeutlerF. et al.

    The 6dF Galaxy Survey: Dependence of halo occupation on stellar mass

    Mon. Not. R. Astron. Soc.

    (2013)
  • BhattacharyaS. et al.

    Dark matter halo profiles of massive clusters: Theory versus observations

    Astrophys. J.

    (2013)
  • BhattacharyaS. et al.

    Mass function Predictions beyond ΛCDM

    Astrophys. J.

    (2011)
  • BlakeC. et al.

    Halo-model signatures from 380 000 Sloan Digital Sky Survey luminous red galaxies with photometric redshifts

    Mon. Not. R. Astron. Soc.

    (2008)
  • BlasD. et al.

    The cosmic linear anisotropy solving system (CLASS). Part II: approximation schemes

    J. Cosmol. Astropart. Phys.

    (2011)
  • BocquetS. et al.

    Halo mass function: Baryon impact, fitting formulae, and implications for cluster cosmology

    Mon. Not. R. Astron. Soc.

    (2016)
  • BondJ.R. et al.

    Excursion set mass functions for hierarchical Gaussian fluctuations

    Astrophys. J.

    (1991)
  • BondJ.R. et al.

    Cosmic background radiation anisotropies in universes dominated by nonbaryonic dark matter

    Astrophys. J.

    (1984)
  • BoschF.C.V.D.

    The universal mass accretion history of cold dark matter haloes

    Mon. Not. R. Astron. Soc.

    (2002)
  • BryanG.L. et al.

    Statistical properties of x-ray clusters: Analytic and numerical comparisons

    Astrophys. J.

    (1998)
  • BullockJ.S.

    Shapes of dark matter halos

    The Shapes of Galaxies and their Dark Halos

    (2002)
  • BullockJ.S. et al.

    Profiles of dark haloes: Evolution, scatter and environment

    Mon. Not. R. Astron. Soc.

    (2001)
  • BullockJ.S. et al.

    Galaxy halo occupation at high redshift

    Mon. Not. R. Astron. Soc.

    (2002)
  • CacciatoM. et al.

    On combining galaxy clustering and weak lensing to unveil galaxy biasing via the halo model

    Mon. Not. R. Astron. Soc.

    (2012)
  • CarreteroJ. et al.

    An algorithm to build mock galaxy catalogues using MICE simulations

    Mon. Not. R. Astron. Soc.

    (2015)
  • ChanK.C. et al.

    Effective window function for Lagrangian halos

    Phys. Rev. D

    (2017)
  • ChenZ. et al.

    Extracting HI astrophysics from interferometric intensity mapping

    Mon. Not. R. Astron. Soc.

    (2021)
  • ChildH.L. et al.

    Halo profiles and the concentration-mass relation for a ΛCDM universe

    Astrophys. J.

    (2018)
  • ClampittJ. et al.

    Galaxy–galaxy lensing in the Dark Energy Survey Science Verification data

    Mon. Not. R. Astron. Soc.

    (2017)
  • ColeS. et al.

    Biased clustering in the cold dark matter cosmogony.

    Mon. Not. R. Astron. Soc.

    (1989)
  • ComparatJ. et al.

    Accurate mass and velocity functions of dark matter haloes

    Mon. Not. R. Astron. Soc.

    (2017)
  • ContrerasS. et al.

    How robust are predictions of galaxy clustering?

    Mon. Not. R. Astron. Soc.

    (2013)
  • CorasanitiP.S. et al.

    Excursion set halo mass function and bias in a stochastic barrier model of ellipsoidal collapse

    Phys. Rev. D

    (2011)
  • CorreaC.A. et al.

    The accretion history of dark matter haloes – III. A physical model for the concentration–mass relation

    Mon. Not. R. Astron. Soc.

    (2015)
  • CouponJ. et al.

    The galaxy-halo connection from a joint lensing, clustering and abundance analysis in the CFHTLenS/VIPERS field

    Mon. Not. R. Astron. Soc.

    (2015)
  • DalalN. et al.

    The origin of dark matter halo profiles

    (2010)
  • DiemerB.

    COLOSSUS: a python toolkit for cosmology, large-scale structure, and dark matter halos

    Astrophys. J. Suppl. Ser.

    (2018)
  • DiemerB. et al.

    An accurate physical model for halo concentrations

    Astrophys. J.

    (2019)
  • DiemerB. et al.

    A universal model for halo concentrations

    Astrophys. J.

    (2015)
  • DiemerB. et al.

    The pseudo-evolution of halo mass

    Astrophys. J.

    (2013)
  • DolagK. et al.

    Numerical study of halo concentrations in dark-energy cosmologies

    Astron. Astrophys.

    (2004)
  • DuffyA.R. et al.

    Dark matter halo concentrations in the Wilkinson Microwave Anisotropy Probe year 5 cosmology

    Mon. Not. R. Astron. Soc.: Lett.

    (2008)
  • DuttonA.A. et al.

    Cold dark matter haloes in the Planck era: Evolution of structural parameters for Einasto and NFW profiles

    Mon. Not. R. Astron. Soc.

    (2014)
  • DvornikA. et al.

    Unveiling galaxy bias via the halo model, KiDS, and GAMA

    Mon. Not. R. Astron. Soc.

    (2018)
  • EinastoJ.

    On the construction of a composite model for the galaxy and on the determination of the system of galactic parameters

    Trudy Astrofizicheskogo Inst. Alma-Ata

    (1965)
  • EisensteinD.J. et al.

    Baryonic features in the matter transfer function

    Astrophys. J.

    (1998)
  • EkeV.R. et al.

    The power spectrum dependence of dark matter halo concentrations

    Astrophys. J.

    (2001)
  • FrenkC. et al.

    Dark matter and cosmic structure

    Ann. Phys.

    (2012)
  • GarcíaR. et al.

    A redefinition of the halo boundary leads to a simple yet accurate halo model of large-scale structure

    Mon. Not. R. Astron. Soc.

    (2021)
  • GeachJ.E. et al.

    The clustering of Hα emitters at z =2.23 from HiZELS

    Mon. Not. R. Astron. Soc.

    (2012)
  • GinzburgD. et al.

    Shot noise and biased tracers: A new look at the halo model

    Phys. Rev. D

    (2017)
  • GiocoliC. et al.

    Halo model description of the non-linear dark matter power spectrum at K>> 1Mpc-1

    Mon. Not. R. Astron. Soc.

    (2010)
  • GiocoliC. et al.

    Formation times, mass growth histories and concentrations of dark matter haloes

    Mon. Not. R. Astron. Soc.

    (2012)
  • HernquistL.

    An analytical model for spherical galaxies and bulges

    Astrophys. J.

    (1990)
  • This code is registered at the ASCL with the code entry ascl:2009.016

    View full text