Halos

Halo profiles, lensing quantities, and concentration–mass relations. The NFW profile math and derivations are in Cosmology Module under Halo Profiles; this page provides the full API reference for the halo sub-package.

Concentration–Mass Relations

(hod_mod.core.concentration)

Multiple calibrations of \(c(M, z)\) are available as standalone functions and via the ConcentrationModel wrapper:

  • Duffy+2008 — fitted to the Millennium simulation at \(z = 0\text{–}2\)

  • Dutton+2014 — based on Planck-normalised ΛCDM N-body runs

  • Klypin+2016 — MultiDark-Planck simulation calibration

  • Bhattacharya+2013 — calibrated against cluster lensing data

  • Diemer+2015 — uses the effective slope of P(k) via colossus

  • Diemer+2019 (default in HaloProfile) — updated colossus calibration

JAX-native concentration–mass relations.

Implements analytic c(M, z) models that are differentiable through the mass array. All functions work in h-units (masses in M_sun/h).

Available models

function

mdef

cosm.

needs σ

Reference

c_duffy08 | any c_dutton14 | 200c,vir c_klypin16 | 200c,vir c_bhattacharya13 | any c_diemer15 | 200c

WMAP5 P13 P13 WMAP7 any

no no no yes yes

Duffy et al. 2008, MNRAS 390 L64 Dutton & Macciò 2014, MNRAS 441 3359 Klypin et al. 2016, MNRAS 457 4340 Bhattacharya+2013, ApJ 766 32 Diemer & Kravtsov 2015, ApJ 799 108

Notes

  • All power-law models (Duffy, Dutton, Klypin) are @jax.jit-compiled and fully differentiable via JAX auto-diff.

  • Models that require the RMS density fluctuation σ(M, z) (Bhattacharya, Diemer) accept a pre-computed sigma array so they remain JAX-traceable.

  • Diemer+2019 (diemer19 in colossus) requires a 3-D lookup table and is not implemented here; use HaloProfile (which wraps colossus) for that model.

References

Duffy et al. 2008, MNRAS 390 L64 (arXiv:0804.2486) Dutton & Macciò 2014, MNRAS 441 3359 (arXiv:1402.7073) Bhattacharya et al. 2013, ApJ 766 32 (arXiv:1112.5020) Klypin et al. 2016, MNRAS 457 4340 (arXiv:1412.0028) Diemer & Kravtsov 2015, ApJ 799 108 (arXiv:1407.4605)

class hod_mod.core.concentration.ConcentrationModel(model: str = 'dutton14', mdef: str = '200c', hmf=None, statistic: str = 'median')[source]

Bases: object

Unified c(M, z) interface for all JAX-native concentration models.

Wraps all five analytic models behind a single .concentration() method. For models requiring σ(M, z) (Bhattacharya+2013, Diemer+2015), an HMF object must be supplied at construction time.

Parameters:
  • model (str) – One of 'duffy08', 'dutton14', 'klypin16', 'bhattacharya13', 'diemer15'.

  • mdef (str) – Mass definition, e.g. '200c', '200m', 'vir'.

  • hmf (HaloMassFunction or None) – Required for 'bhattacharya13' and 'diemer15' (provides σ(M, z)).

  • statistic (str) – 'median' or 'mean' (only used by 'diemer15').

Examples

Pure power-law (no HMF needed):

>>> cm = ConcentrationModel('dutton14', mdef='200c')
>>> c = cm.concentration(m_h, z=0.5, theta=theta)

Peak-height model (requires HMF):

>>> cm = ConcentrationModel('diemer15', mdef='200c', hmf=hmf)
>>> c = cm.concentration(m_h, z=0.5, theta=theta)
concentration(m_h: Array, z: float, theta: dict) Array[source]

Concentration c(M, z).

Parameters:
  • m_h (jnp.ndarray) – Halo masses [M_sun/h].

  • z (float) – Redshift.

  • theta (dict) – Cosmological parameter dict (needs at least 'Omega_m').

Returns:

c (jnp.ndarray) – Dimensionless concentration, same shape as m_h.

hod_mod.core.concentration.c_bhattacharya13(m_h: Array, sigma: Array, omega_m: float, z: float, mdef: str = '200c') Array[source]

Concentration–mass relation of Bhattacharya et al. 2013 (WMAP7).

\[c(M, z) = K\,D(z)^{\alpha}\,\nu(M, z)^{\beta}, \qquad \nu = \frac{\delta_c}{\sigma(M, z)}, \quad \delta_c = 1.686\]

where \(D(z) = D(z)/D(0)\) is the linear growth factor (flat ΛCDM) and the parameters \((K, \alpha, \beta)\) depend on mdef (Table 2 of Bhattacharya+2013):

mdef

K

α

β

200c vir 200m

5.9 7.7 9.0

0.54 0.90 1.15

−0.35 −0.29 −0.29

Parameters:
  • m_h (jnp.ndarray) – Halo mass [M_sun/h].

  • sigma (jnp.ndarray) – RMS linear density fluctuation σ(M, z) at the requested redshift, same shape as m_h. Compute via HaloMassFunction.sigma.

  • omega_m (float) – Total matter density parameter Ω_m (static in JIT).

  • z (float) – Redshift (static in JIT).

  • mdef (str) – Mass definition: '200c', 'vir', or '200m' (static in JIT).

Returns:

c (jnp.ndarray) – Dimensionless concentration, same shape as m_h.

Notes

Calibrated on WMAP7. Valid for \(2 \times 10^{12} < M < 2 \times 10^{15}\ M_\odot/h\) and \(0 < z < 2\).

hod_mod.core.concentration.c_diemer15(m_h: Array, sigma: Array, n_eff: Array, omega_m: float, z: float, statistic: str = 'median') Array[source]

Concentration for the Diemer & Kravtsov 2015 universal c–ν–n model.

This model predicts \(c_{200c}\) from the peak height ν and the local slope n of the linear power spectrum (Eq. 1 of Diemer+2015 with updated parameters from Diemer & Joyce 2019):

\[c_{200c}(\nu, n) = (\phi_0 + n\,\phi_1)\,\left(\frac{\nu}{\eta_0 + n\,\eta_1}\right)^{-\alpha} \left[1 + \left(\frac{\nu}{\eta_0 + n\,\eta_1}\right)^{\beta}\right]\]

Updated (Diemer & Joyce 2019) median parameters: \(\phi_0=6.58,\ \phi_1=1.27,\ \eta_0=7.28,\ \eta_1=1.56, \ \alpha=1.08,\ \beta=1.77\).

Parameters:
  • m_h (jnp.ndarray) – Halo mass [M_sun/h].

  • sigma (jnp.ndarray) – RMS fluctuation σ(M, z) at the target redshift, same shape as m_h.

  • n_eff (jnp.ndarray) – Effective spectral slope n = d ln P / d ln k at scale k_R(M), same shape as m_h. Compute via neff_eisenstein_hu.

  • omega_m (float) – Total matter density Ω_m (static in JIT).

  • z (float) – Redshift (static in JIT; unused here, kept for interface consistency).

  • statistic (str) – 'median' (default) or 'mean'. Static in JIT.

Returns:

c200c (jnp.ndarray) – Concentration parameter \(c_{200c}\), same shape as m_h.

Notes

Always returns \(c_{200c}\). This model is cosmology-independent in the sense that it works for any input σ(M, z) and n_eff computed from the corresponding power spectrum.

hod_mod.core.concentration.c_duffy08(m_h: Array, z: float, mdef: str = '200m') Array[source]

Concentration–mass relation of Duffy et al. 2008 (WMAP5).

\[c(M, z) = A \left(\frac{M}{2 \times 10^{12}\,h^{-1}M_\odot}\right)^B (1 + z)^C\]

Parameters for each mass definition (Table 1 of Duffy+2008):

mdef

A

B

C

200c vir 200m

5.71 7.85

10.14

−0.084 −0.081 −0.081

−0.47 −0.71 −1.01

Parameters:
  • m_h (jnp.ndarray) – Halo mass [M_sun/h].

  • z (float) – Redshift (static in JIT).

  • mdef (str) – Mass definition: '200c', 'vir', or '200m' (static in JIT).

Returns:

c (jnp.ndarray) – Dimensionless concentration, same shape as m_h.

Notes

Calibrated on WMAP5. Valid for \(10^{11} < M < 10^{15}\ M_\odot/h\) and \(0 < z < 2\).

hod_mod.core.concentration.c_dutton14(m_h: Array, z: float, mdef: str = '200c') Array[source]

Concentration–mass relation of Dutton & Macciò 2014 (Planck13).

\[\log_{10} c(M, z) = a(z) + b(z)\,\log_{10}\!\left(\frac{M}{10^{12}\,h^{-1}M_\odot}\right)\]

with redshift-dependent coefficients from Table 2 of Dutton+2014:

For mdef = '200c':

\[\begin{split}a(z) &= 0.520 + (0.905 - 0.520)\,e^{-0.617\,z^{1.21}} \\ b(z) &= -0.101 + 0.026\,z\end{split}\]

For mdef = 'vir':

\[\begin{split}a(z) &= 0.537 + (1.025 - 0.537)\,e^{-0.718\,z^{1.08}} \\ b(z) &= -0.097 + 0.024\,z\end{split}\]
Parameters:
  • m_h (jnp.ndarray) – Halo mass [M_sun/h].

  • z (float) – Redshift (static in JIT).

  • mdef (str) – Mass definition: '200c' or 'vir' (static in JIT).

Returns:

c (jnp.ndarray) – Dimensionless concentration, same shape as m_h.

Notes

Calibrated on Planck13. Valid for \(M > 10^{10}\ M_\odot/h\), \(0 < z < 5\).

hod_mod.core.concentration.c_klypin16(m_h: Array, z: float, mdef: str = '200c') Array[source]

Concentration–mass relation of Klypin et al. 2016 (Planck13).

Mass-based fitting function (Eq. 14 of Klypin+2016):

\[c(M, z) = C_0(z)\left(\frac{M}{10^{12}\,h^{-1}M_\odot}\right)^{-\gamma(z)} \left[1 + \left(\frac{M}{M_0(z)}\right)^{0.4}\right]\]

with redshift-interpolated parameters from Table 2 of Klypin+2016. This function implements the Planck13 cosmology fit.

Parameters:
  • m_h (jnp.ndarray) – Halo mass [M_sun/h].

  • z (float) – Redshift (static). Must be within the tabulated range [0, 5.4].

  • mdef (str) – Mass definition: '200c' or 'vir' (static).

Returns:

c (jnp.ndarray) – Dimensionless concentration, same shape as m_h.

Notes

Calibrated on Planck13 (MultiDark Planck simulation). Valid for \(M > 10^{10}\ M_\odot/h\), \(0 \leq z \leq 5.4\). Parameters are linearly interpolated between the tabulated redshift bins.

Halo Profiles

(hod_mod.core.halo_profiles)

NFW and Einasto halo profiles plus Fourier-space window functions.

Provides 3D density, projected surface density, lensing ΔΣ (all in JAX), the NFW normalized Fourier transform needed for the full halo model (Cooray & Sheth 2002), and the Einasto (1965) alternative profile (Asgari+2023 Eq. 47).

References

Bartelmann 1996; Wright & Brainerd 2000 — NFW projected Σ and ΔΣ Cooray & Sheth 2002, Phys.Rep. 372, 1 — NFW Fourier transform (Eq. 11) Einasto 1965; Asgari+2023 arXiv:2303.08752 Eq. 47 — Einasto profile

class hod_mod.core.halo_profiles.HaloProfile(cosmo_params: dict, cm_relation: str = 'diemer19', mdef: str = '200m')[source]

Bases: object

Concentration–mass relation and NFW profile parameters.

Supports two backends:

  • cm_relation='dutton14' — JAX-native Dutton & Macciò 2014 power-law (requires mdef='200c'). Fully differentiable w.r.t. halo mass.

  • Any colossus key (e.g. 'diemer19') — wraps colossus; not autodiff-capable but supports all mass definitions and models.

Parameters:
  • cosmo_params (dict) – Colossus-style cosmological parameters (ignored for cm_relation='dutton14').

  • cm_relation (str) – 'dutton14' for the JAX-native backend, or any colossus model name.

  • mdef (str) – Mass definition, e.g. '200m' or '200c'. Must be '200c' when cm_relation='dutton14'.

concentration(m_h: Array, z: float) Array[source]

Concentration parameter c(M, z) from the chosen c-M relation.

delta_sigma(R_proj: Array, m_h: Array, z: float, theta_cosmo: dict) Array[source]

ΔΣ(R) [M_sun h / Mpc^2] for a single halo of mass m_h.

rho_s_and_rs(m_h: Array, z: float, theta_cosmo: dict) tuple[Array, Array][source]

Characteristic density ρ_s and scale radius r_s [Mpc/h] for NFW.

r_delta = (3 M / 4π delta rho_ref)^{1/3} with (delta, rho_ref) from the mass definition mdef set at construction time. c = r_delta / r_s.

Parameters:
  • m_h (jnp.ndarray — halo mass [Msun/h])

  • z (float — redshift)

  • theta_cosmo (dict — cosmological parameters (needs Omega_m))

hod_mod.core.halo_profiles.concentration_dutton14_jax(m_h: Array, z: float) Array[source]

Concentration \(c_{200c}(M, z)\) from Dutton & Macciò 2014 (MNRAS 441, 3359).

\[ \begin{align}\begin{aligned}\log_{10}(c_{200c}) = a(z) + b(z)\, \log_{10}\!\left(\frac{M_{200c}}{10^{12}\,h^{-1}M_\odot}\right)\\a(z) = 0.520 + 0.385\,\exp(-0.617\,z^{1.21})\\b(z) = -0.101 + 0.026\,z\end{aligned}\end{align} \]

Valid for \(M_{200c} \in [10^{10}, 10^{15}]\,h^{-1}M_\odot\) and \(z \in [0, 5]\). Use with HaloProfile(mdef='200c', cm_relation='dutton14'). Fully differentiable w.r.t. m_h.

Parameters:
  • m_h (jnp.ndarray — halo mass \(M_{200c}\) [M_sun/h])

  • z (float — redshift (static; JIT-specialised per redshift value))

Returns:

c (jnp.ndarray — concentration \(c_{200c}\), same shape as m_h)

hod_mod.core.halo_profiles.einasto_rho(r: Array, rho_s: float, r_s: float, alpha: float = 0.18) Array[source]

Einasto (1965) density profile ρ(r) [M_sun h² / Mpc³].

\[\rho(r) = \rho_s \exp\!\left[-\frac{2}{\alpha} \left(\left(\frac{r}{r_s}\right)^\alpha - 1\right)\right]\]

(Asgari+2023 Eq. 47; Einasto 1965)

α 0.18 gives a profile close to NFW for cluster-mass halos (Klypin+2001, Merritt+2006). Smaller α → steeper inner cusp.

Parameters:
  • r ([Mpc/h], shape (Nr,))

  • rho_s (characteristic density [M_sun h² / Mpc³])

  • r_s (scale radius [Mpc/h]; ρ(r_s) = ρ_s exp(0) = ρ_s)

  • alpha (shape parameter (default 0.18))

Returns:

  • rho ([M_sun h² / Mpc³], shape (Nr,))

  • Accuracy

  • ——–

  • ρ(r_s) = ρ_s exactly (by construction; exp argument = 0 at r = r_s).

  • Monotonically decreasing verified analytically; numerical normalisation

  • ∫ 4πr² ρ dr (N=2000 log nodes) matches einasto_uk (k→0) to < 2%

  • for c ∈ [5, 20] (2026-04-23).

  • Timing

  • ——

  • ~ 21 µs / call (JIT-compiled, N=100 radii, CPU x86-64, 2026-04-23).

hod_mod.core.halo_profiles.einasto_uk(k_arr: ndarray, r_s_arr: ndarray, c_arr: ndarray, alpha: float = 0.18, n_r: int = 200) Array[source]

Einasto normalized Fourier transform û_m(k, M) via Gauss-Legendre quadrature.

\[\hat{u}_m(k|M) = \frac{ \int_0^{r_h} \rho_{\rm Ein}(r)\,j_0(kr)\,r^2\,\mathrm{d}r }{ \int_0^{r_h} \rho_{\rm Ein}(r)\,r^2\,\mathrm{d}r }\]

where \(r_h = c\,r_s\) is the truncation radius and

\[\rho_{\rm Ein}(r) = \rho_s\exp\!\left[ -\frac{2}{\alpha}\left(\left(\frac{r}{r_s}\right)^\alpha - 1\right) \right]\]

The ratio is independent of \(\rho_s\) and satisfies \(\hat{u}_m(k\to 0) = 1\). Integrals are evaluated by n_r-point Gauss-Legendre quadrature on \([0, c]\).

Parameters:
  • k_arr (array_like, shape (Nk,), wavenumbers [h/Mpc])

  • r_s_arr (array_like, shape (NM,), Einasto scale radii [Mpc/h])

  • c_arr (array_like, shape (NM,), concentration c = r_h / r_s)

  • alpha (float) – Einasto shape parameter (default 0.18, close to NFW for clusters).

  • n_r (int) – Number of Gauss-Legendre quadrature nodes (default 200).

Returns:

  • uk (jnp.ndarray, shape (Nk, NM), dimensionless, in (0, 1])

  • Accuracy

  • ——–

  • k→0 limit û→1 verified to < 1% (n_r=200 nodes, α=0.18). Converges to

  • < 0.1% relative error vs n_r=1000 benchmark for k ∈ [0.01, 100] h/Mpc

  • (2026-04-23).

  • Timing

  • ——

  • ~ 22 ms / call (not JIT-compiled, Nk=50 × NM=10, n_r=200, CPU x86-64,

  • 2026-04-23).

hod_mod.core.halo_profiles.nfw_delta_sigma(R: Array, rho_s: float, r_s: float) Array[source]

NFW excess surface density ΔΣ(R) = Σ_bar(<R) − Σ(R) [M_sun h / Mpc^2].

This is the galaxy-galaxy lensing observable.

hod_mod.core.halo_profiles.nfw_mass(r: Array, rho_s: float, r_s: float) Array[source]

NFW enclosed mass M(<r) [M_sun/h].

hod_mod.core.halo_profiles.nfw_mean_sigma(R: Array, rho_s: float, r_s: float) Array[source]

Mean projected surface density Σ_bar(<R) inside radius R (analytic).

Σ_bar(<R) = (2/R²) ∫₀^R Σ(R’) R’ dR’ Uses Wright & Brainerd 2000 Eq. 13.

hod_mod.core.halo_profiles.nfw_rho(r: Array, rho_s: float, r_s: float) Array[source]

NFW 3D density profile ρ(r) [M_sun h^2 / Mpc^3].

ρ(r) = ρ_s / [(r/r_s)(1 + r/r_s)²]

hod_mod.core.halo_profiles.nfw_sigma(R: Array, rho_s: float, r_s: float) Array[source]

Projected NFW surface density Σ(R) [M_sun h / Mpc^2] (analytic).

Uses the Bartelmann 1996 / Wright & Brainerd 2000 closed form.

hod_mod.core.halo_profiles.nfw_uk(k_arr: ndarray, r_s_arr: ndarray, c_arr: ndarray) Array[source]

NFW normalized Fourier transform û_m(k, M) (Cooray & Sheth 2002, Eq. 11).

\[\hat{u}_m(k|M) = \frac{1}{M}\int_0^{r_h} \rho_{\rm NFW}(r)\,j_0(kr)\,4\pi r^2\,dr\]

The analytic result for a truncated NFW profile (truncation at r_h = c r_s):

\[\hat{u}_m = \frac{ \cos(K)[{\rm Ci}(K(1+c)) - {\rm Ci}(K)] + \sin(K)[{\rm Si}(K(1+c)) - {\rm Si}(K)] - \sin(cK) / [(1+c)K] }{\ln(1+c) - c/(1+c)},\quad K = k\,r_s\]

(derivation: IBP on ∫₀^c sin(Kx)/(1+x)² dx, substitute t = K(1+x))

û_m(k 0) = 1 by l’Hôpital (verified analytically). Not JIT-compatible: uses scipy.special.sici.

Parameters:
  • k_arr (array_like, shape (Nk,), wavenumbers [h/Mpc])

  • r_s_arr (array_like, shape (NM,), NFW scale radii [Mpc/h])

  • c_arr (array_like, shape (NM,), concentration c = r_h / r_s)

Returns:

  • uk (jnp.ndarray, shape (Nk, NM), dimensionless, in (0, 1])

  • Accuracy

  • ——–

  • k→0 limit û→1 verified to < 1% for K < 1e-6 (L’Hôpital guard applied).

  • Shape agrees with direct numerical quadrature (200 nodes) to < 0.1% for

  • k ∈ [0.01, 100] h/Mpc, c = 10, r_s = 0.3 Mpc/h (2026-04-23).

  • Timing

  • ——

  • ~ 196 µs / call (not JIT-compiled, Nk=50 × NM=10, CPU x86-64, 2026-04-23).

hod_mod.core.halo_profiles.nfw_uk_jax(k_arr: Array, r_s_arr: Array, c_arr: Array) Array[source]

NFW normalized Fourier transform û_m(k, M), JAX-native (autodiff-compatible).

Same analytic formula as nfw_uk() (Cooray & Sheth 2002, Eq. 11) but replaces scipy.special.sici with a pure-JAX series/asymptotic implementation via _si_jax() / _ci_jax(). Fully JIT-compiled and differentiable w.r.t. r_s_arr and c_arr.

See nfw_uk() for the analytic formula and accuracy notes.

Parameters:
  • k_arr (jnp.ndarray, shape (Nk,))

  • r_s_arr (jnp.ndarray, shape (NM,))

  • c_arr (jnp.ndarray, shape (NM,))

Returns:

  • uk (jnp.ndarray, shape (Nk, NM), in (0, 1])

  • Accuracy

  • ——–

  • Agrees with scipy-based nfw_uk to < 0.1% for K ∈ [10⁻⁴, 100] h/Mpc,

  • c ∈ [3, 20], r_s ∈ [0.01, 5] Mpc/h (verified 2026-05-19).

hod_mod.core.halo_profiles.satellite_nfw_uk(k_arr: ndarray, r_s_arr: ndarray, c_arr: ndarray, r_vir_arr: ndarray, b_sat_conc: float = 1.0, f_cut: float = 0.0, gamma: float = 0.0, n_r: int = 100, n_k_coarse: int = 128) Array[source]

Satellite normalized FT combining three inner-profile extensions (GL quadrature).

The satellite number density profile:

\[n_{\rm sat}(r) \propto \left(\frac{r}{r_{\rm vir}}\right)^{\gamma} \left[1 - \exp\!\left(-\frac{r}{f_{\rm cut}\,r_{\rm vir}}\right)\right] \rho_{\rm NFW}(r;\,c_{\rm sat}), \quad 0 \le r \le r_{\rm vir}\]

with \(c_{\rm sat} = b_{\rm sat\_conc}\,c_{\rm DM}\).

Halo Model Power Spectrum

(hod_mod.core.halo_model)

Full halo model matter power spectrum P_mm(k) = P^{1h}_mm + P^{2h}_mm.

Implements the Asgari et al. (2023) halo model for the matter auto-power spectrum. The 1-halo term captures intra-halo (shot-noise) clustering; the 2-halo term recovers linear clustering on large scales.

\[ \begin{align}\begin{aligned}P^{1h}_{mm}(k) = \frac{1}{\bar{\rho}_m^2} \int M^2\, \hat{u}_m^2(k,M)\, n(M)\, dM\\P^{2h}_{mm}(k) = P_{\rm lin}(k)\, \left[\frac{1}{\bar{\rho}_m} \int M\, \hat{u}_m(k,M)\, b(M)\, n(M)\, dM\right]^2\end{aligned}\end{align} \]

References

Asgari et al. 2023, arXiv:2303.08752 — halo model review (Eqs. 34–35) Cooray & Sheth 2002, Phys.Rep. 372, 1 — NFW window function (Eq. 11)

class hod_mod.core.halo_model.HaloModelPowerSpectrum(hmf, halo_profile, pk_lin, m_min: float = 10000000000.0, m_max: float = 1e+16, n_m: int = 100)[source]

Bases: object

Matter power spectrum P_mm(k) from the halo model.

Combines a 1-halo and 2-halo term using NFW profile window functions and the chosen halo mass function and bias.

\[ \begin{align}\begin{aligned}P^{1h}_{mm}(k) = \frac{1}{\bar{\rho}_m^2} \int M^2\, \hat{u}_m^2(k,M)\, n(M)\, dM\\P^{2h}_{mm}(k) = P_{\rm lin}(k)\, \left[\frac{1}{\bar{\rho}_m} \int M\, \hat{u}_m(k,M)\, b(M)\, n(M)\, dM\right]^2\end{aligned}\end{align} \]

where \(\hat{u}_m(k,M)\) is the NFW normalized Fourier transform (Cooray & Sheth 2002 Eq. 11, implemented in nfw_uk), \(n(M)\) is the halo mass function, \(b(M)\) is the linear halo bias, and \(\bar{\rho}_m = \Omega_m \rho_{\rm crit,0}\).

On large scales (k → 0): \(\hat{u}_m → 1\) so the 2-halo integral → 1 (by the mass-weighted bias normalization), recovering \(P^{2h}_{mm} → P_{\rm lin}\) as expected.

Parameters:
  • hmf (HaloMassFunction) – Provides dndm(m, z, theta) and bias(m, z, theta).

  • halo_profile (HaloProfile) – Provides rho_s_and_rs and concentration (colossus c–M relation).

  • pk_lin (LinearPowerSpectrum) – Provides pk_linear(k, z, theta) for the 2-halo term.

  • m_min, m_max (float [M_sun/h]) – Mass integration limits.

  • n_m (int) – Number of log-spaced mass bins.

pk_1h_mm(k_arr: ndarray, z: float, theta: dict) Array[source]

1-halo matter power spectrum (Asgari+2023 Eq. 34).

\[P^{1h}_{mm}(k) = \frac{1}{\bar{\rho}_m^2} \int M^2\, \hat{u}_m^2(k,M)\, \frac{dn}{dM}\, dM\]
Parameters:

k_arr ([h/Mpc], shape (Nk,))

Returns:

p1h ([(Mpc/h)³], shape (Nk,))

pk_2h_mm(k_arr: ndarray, z: float, theta: dict) Array[source]

2-halo matter power spectrum (Asgari+2023 Eq. 35).

\[P^{2h}_{mm}(k) = P_{\rm lin}(k)\, \left[\frac{1}{\bar{\rho}_m} \int M\, \hat{u}_m(k,M)\, b(M)\, \frac{dn}{dM}\, dM\right]^2\]
Parameters:

k_arr ([h/Mpc], shape (Nk,))

Returns:

p2h ([(Mpc/h)³], shape (Nk,))

pk_mm(k_arr: ndarray, z: float, theta: dict) Array[source]

Total matter power spectrum P_mm = P^{1h}_mm + P^{2h}_mm.

Parameters:

k_arr ([h/Mpc], shape (Nk,))

Returns:

pk ([(Mpc/h)³], shape (Nk,))