Skip to content

bihalofit-JAX: A Differentiable Code for the Nonlinear Matter Bispectrum and its Projected Statistics

Alexander Roskill, Matteo Zennaro

astro-ph.IMarXiv:2611.18281

Abstract

Theoretical predictions for the nonlinear matter bispectrum and related projected statistics have been historically very expensive to evaluate, leading many analyses to rely on emulators to speed up slow numerical codes. We show in this paper that this need not be the case: improved numerical techniques can be leveraged to directly evaluate predictions for the nonlinear matter bispectrum and projected statistics at speeds preferable for inference. We present bihalofit-JAX, an open-source, fully differentiable code for the nonlinear matter bispectrum based on the BiHalofit fitting formula, which includes numerous related projected statistics such as angular bispectra, skew spectra and aperture statistics. It computes 10000 triangles of the matter bispectrum in 1--2\ ms per cosmology, one to three orders of magnitude faster than other implementations. It agrees numerically with the original BiHalofit code to better than 0.02\% on average over the cosmologies the formula was calibrated on, where the formula itself is accurate to 20\% against simulations. It is also efficiently vectorised such that one can compute e.g. 500 cosmologies in 2\ ms. This speed-up grows even more in the case of the third-order aperture statistics, which we compute in 6\ ms for one cosmology, between 3×103 and 2.4×104 times faster than other publicly available codes. The pipeline is fully differentiable, and we demonstrate its performance in a simple inference problem, comparing the No-U-Turn Sampler (NUTS) to gradient-free inference with the affine-invariant ensemble sampler (emcee).

Create a lesson