cosmicjellyfish.cosmology.jaxcosmo_halofit#
Smooth Halofit for the jaxcosmo theory layer.
jax_cosmo.power.halofit locates the nonlinear scale by interpolating
sigma(R) = 1 linearly on a fixed 256-node grid in log R. The resulting
nonlinear spectrum is only piecewise smooth in the cosmological parameters:
whenever the root moves between two grid nodes the derivative jumps. For a 1%
parameter step those jumps reach ~13% in individual redshift rows, which is
fatal both for autodiff (it differentiates one linear piece) and for finite
differences (they average over several).
This module keeps the Halofit prescription and its coefficients - taken from
jax_cosmo.power (MIT licence, Copyright (c) 2022 Differentiable Universe
Initiative) - and only replaces the root find with a fixed-count Newton
iteration on the smooth integral
which converges to machine precision and is differentiable. Everything else
(n_eff, C, the a_n ... nu_n polynomials and equation C2) follows
jax-cosmo so that the two implementations agree to the accuracy of their
respective root finds.
Functions
Nonlinear matter power spectrum |
|
|
|
|