Source-linked AI summary
COLOSSUS: A python toolkit for cosmology, large-scale structure, and dark matter halos
Benedikt Diemer
TL;DR
Colossus addresses the repeated need for accurate, reusable calculations in cosmology, large-scale structure, and dark-matter-halo studies. It packages these computations and literature fitting functions into a fast, coherent Python toolkit, with documented accuracy and broad coverage across its cosmology, LSS, and halo modules. The paper presents the toolkit’s core routines and their accuracy, while identifying specific limitations from interpolation, cloud-in-cloud effects, and profile-based conversions.
Problem
Repeated cosmology, large-scale-structure, and halo calculations are non-trivial and susceptible to programming errors and numerical inaccuracies.
Method
Colossus standardizes basic calculations in a coherent Python interface spanning cosmology, LSS, and halo modules, with more than 40 literature fitting functions.
Results
The toolkit provides fast computations and discusses core routines with particular emphasis on their accuracy.
Takeaways & Limitations
Colossus offers a simple interface for basic quantities that other structure-formation and data-analysis codes rely on.
Takeaways & Limitations
Some functions trade accuracy for speed, and reliability is bounded by documented interpolation ranges and errors.
Abstract
from arXiv · showhide
This paper introduces Colossus, a public, open-source python package for calculations related to cosmology, the large-scale structure (LSS) of matter in the universe, and the properties of dark matter halos. The code is designed to be fast and easy to use, with a coherent, well-documented user interface. The cosmology module implements Friedman-Lemaitre-Robertson-Walker cosmologies including curvature, relativistic species, and different dark energy equations of state, and provides fast computations of the linear matter power spectrum, variance, and correlation function. The LSS module is concerned with the properties of peaks in Gaussian random fields and halos in a statistical sense, including their peak height, peak curvature, halo bias, and mass function. The halo module deals with spherical overdensity radii and masses, density profiles, concentration, and the splashback radius. To facilitate the rapid exploration of these quantities, Colossus implements more than 40 different fitting functions from the literature. I discuss the core routines in detail, with particular emphasis on their accuracy. Colossus is available at bitbucket.org/bdiemer/colossus.
1. INTRODUCTION
Colossus standardizes frequently repeated cosmology, large-scale-structure, and halo calculations in a coherent Python interface designed for simplicity, speed, and broad usability. Its design emphasizes convenient, reproducible computation while acknowledging that some functions trade accuracy for speed.
- Purpose: Colossus provides a coherent, well-documented Python interface for basic cosmology, large-scale-structure, and dark-matter-halo calculations.It is not intended to be an all-encompassing structure-formation library.
- Design goals: Intuitive usage lets users evaluate complex quantities in one or a few lines of code, supported by numerous fitting functions.The package implements fitting functions to simplify repeated calculations.
- Design goals: Performance is improved through interpolation tables that use few data points for a desired accuracy and persist between executions.This approach targets computationally intensive routines.
- Design goals: Colossus is stand-alone and pure Python, requiring only NumPy and SciPy and allowing installation by cloning the repository or using pip.Its functions also accept numbers and NumPy arrays, returning correspondingly shaped results.
- Design goals: The cosmology module covers redshifts from −0.995 to 200 and uses coherent physical units for function inputs and outputs.The package also aims to cover a wide range of input parameters.
- Accuracy and scope: Accuracy is not a stated design principle because some functions trade accuracy for speed, with function and interpolation-table accuracy reported throughout the paper.The code nevertheless strives to be as accurate as possible.
2. THE COSMOLOGY MODULE
The cosmology module models standard and extended FLRW cosmologies, then accelerates repeated evaluations with cosmology-specific interpolation tables while documenting accuracy and validity limits. It provides accurate calculations for key cosmological quantities, including densities, distances, times, growth, variance, and correlation functions.
- Cosmological model: Colossus implements FLRW cosmologies containing matter, baryons, dark energy, curvature, photons, and neutrinos.
- Cosmological model: Users can select predefined cosmological parameter sets, store multiple cosmology objects, and activate them globally for subsequent calculations.
- Numerical implementation: Interpolation tables are computed on demand with cubic splines, accelerating evaluations and supporting function inversion, but derivative accuracy is not guaranteed, especially at higher orders.
- Cosmological model: The module supports dark-energy equations of state that are cosmological constants, constant non-−1 values, linearly varying functions, or arbitrary user-defined w(z).
- Accuracy: Densities, distances, and times agree with astropy to a few times 10^-4 or better, while interpolation errors remain at a few times 10^-4 or better across representative cosmologies.
- Derived quantities: The variance interpolation covers 10^-12 to 10^3 h^-1Mpc with integration accuracy of 3 × 10^-3 or better and interpolation accuracy of 5 × 10^-3 or better.
- Derived quantities: The correlation-function integration has error at most 10^-5, while power-spectrum approximation errors reach about 4% and interpolation remains better than 1%.
3. THE LARGE-SCALE STRUCTURE MODULE
Colossus’s LSS module describes Gaussian-field peaks and collapsed halos through peak statistics, halo mass functions, and bias. It translates halo properties into equivalent linear-field quantities and provides multiple mass-function and bias models while documenting important assumptions and limitations.
- Module scope: The LSS module covers density peaks, peak height and curvature, halo mass functions, and halo bias for Gaussian random fields and collapsed structures.Matter-level functions reside in the cosmology module, while mass, radius, and structure of collapsed peaks reside in the halo module.
- Peak height and curvature: Peak height compares the variance on a halo’s Lagrangian scale with the critical overdensity required for collapse.Colossus maps halo mass, such as Mvir, to a comoving Lagrangian radius enclosing that mass at the universe’s mean density, then evaluates ν from σ and δc.
- Peak height and curvature: Peak curvature measures field steepness through x ≡−∇2δ/σ2, with Colossus providing both an integrated average-curvature calculation and a 1%-accurate fitting function.Higher-order variance moments such as σ2 require a Gaussian filter because the corresponding top-hat integral does not converge.
- Peak height and curvature: The cloud-incloud problem means average curvature at a given peak significance need not equal the curvature of peaks that form halos of a particular mass.Some peaks are absorbed into larger peaks, so not every statistically selected peak becomes an independent halo.
- Halo mass function and bias: The halo mass function gives halo abundance by mass, redshift, and cosmology, while Colossus returns multiplicity, number-density, or dimensionless forms and implements improved fitting functions beyond Press–Schechter.The implemented models cover both friends-of-friends and spherical-overdensity halo definitions.
- Halo mass function and bias: The universality of f(σ) remains debated, but its redshift evolution is relatively mild; Colossus lets users include or omit evolution when the selected model permits it.Its mass functions show excellent agreement with the hmf package, although default collapse-overdensity choices differ between the codes.
- Halo mass function and bias: Halo bias quantifies excess halo clustering relative to dark matter, and Colossus’s bias models focus on the expected scale-independent large-scale regime.The implemented models include peak-background-split prescriptions and numerical calibrations such as Tinker et al. (2010).
4. THE HALO MODULE
The halo module provides routines for spherical-overdensity halo definitions, density profiles, concentration models, and splashback predictions. It combines multiple literature fitting functions with numerical conversions and profile-based calculations, while retaining assumptions and model-definition caveats.
- Colossus implements fitting functions for halo density profiles, concentration, and the splashback radius.
- Spherical Overdensity: Spherical-overdensity masses and radii are defined using a chosen overdensity relative to the critical or mean matter density.The module also supports varying overdensity and redshift, including pseudo-evolution under a static profile assumption.
- Spherical Overdensity: Conversions between overdensity definitions require solving for the mass using a density profile, with NFW as the default and alternative profiles available.Concentration may be supplied or computed from a concentration–mass relation.
- Density Profiles: Profile models provide density derivatives, enclosed mass, surface densities, circular velocities, and spherical-overdensity quantities computed numerically from ρ(r).Colossus represents profiles as an inner one-halo term plus arbitrary outer-profile terms.
- Concentration: The concentration module compares several c–M model families based on power laws, halo age, or peak height.Models quantify different concentration definitions, including c200m, c200c, and cvir, and conversions can use NFW or DK14 profiles.
- The Splashback Radius: Splashback predictions depend on halo mass accretion rate and can return the radius, mass, enclosed overdensity, and scatter.Figure 6 compares model predictions for a halo with M200m = 1014 h−1M⊙ at z = 0, but models use different accretion-rate definitions.
5. FUTURE DEVELOPMENT
The project is intended to expand through new functionality, physics, and modules, with development increasingly shaped by users and collaborators. The author invites community participation through issue reports and collaboration.
- Future additions may include new fitting functions, warm dark matter physics, and modules related to galaxy formation.
- Users are encouraged to report bugs, documentation issues, and feature requests through BitBucket’s issue tracker.
- The author seeks collaborators to help move Colossus beyond an essentially single-developer project.