Article view

JAX-COSMO: An End-to-End Differentiable and GPU Accelerated Cosmology Library

By J.E. Campagne, François Lanusse, Joe Zuntz, A. Boucaud, Santiago Casas, Minas Karamanis, David P. Kirkby, Denise Lanzieri, Austin Peel, Yin Qiang Li

Article information

Publication
Published 28 April 2023
Institutions at publication
Centre National de la Recherche Scientifique; Université Paris-Saclay; Institut National de Physique Nucléaire et de Physique des Particules; Laboratoire de Physique des 2 Infinis Irène Joliot-Curie; Université Paris Cité; Commissariat à l'Énergie Atomique et aux Énergies Alternatives; CEA Paris-Saclay - Etablissement de Saclay; Astrophysique, Instrumentation et Modélisation; CEA Paris-Saclay; University of Edinburgh; Laboratoire AstroParticule et Cosmologie; Université Paris Diderot; RWTH Aachen University; Lawrence Berkeley National Laboratory; University of California, Berkeley; University of California, Irvine; École Polytechnique Fédérale de Lausanne; Peng Cheng Laboratory; Flatiron Institute
108 Citations OpenAlex, 4 December 2026 FULL LIST: Citations
Countries with citations No data yet
Usage Phase 3: not collected yet

Abstract

We present jax-cosmo, a library for automatically differentiable cosmological theory calculations. It uses the JAX library, which has created a new coding ecosystem, especially in probabilistic programming. As well as batch acceleration, just-in-time compilation, and automatic optimization of code for different hardware modalities (CPU, GPU, TPU), JAX exposes an automatic differentiation (autodiff) mechanism. Thanks to autodiff, jax-cosmo gives access to the derivatives of cosmological likelihoods with respect to any of their parameters, and thus enables a range of powerful Bayesian inference algorithms, otherwise impractical in cosmology, such as Hamiltonian Monte Carlo and Variational Inference. In its initial release, jax-cosmo implements background evolution, linear and non-linear power spectra (using halofit or the Eisenstein and Hu transfer function), as well as angular power spectra with the Limber approximation for galaxy and weak lensing probes, all differentiable with respect to the cosmological parameters and their other inputs. We illustrate how autodiff can be a game-changer for common tasks involving Fisher matrix computations, or full posterior inference with gradient-based techniques. In particular, we show how Fisher matrices are now fast, exact, no longer require any fine tuning, and are themselves differentiable. Finally, using a Dark Energy Survey Year 1 3x2pt analysis as a benchmark, we demonstrate how jax-cosmo can be combined with Probabilistic Programming Languages to perform posterior inference with state-of-the-art algorithms including a No U-Turn Sampler, Automatic Differentiation Variational Inference,and Neural Transport HMC. We further demonstrate that Normalizing Flows using Neural Transport are a promising methodology for model validation in the early stages of analysis. The software and documentation referred to in this paper can be found here.

Citations per year

Citations per year
YearCitations
2023 6
2024 29
2025 34
2026 39

OpenAlex counts citations by year for the last ten years only, so the total and the list of citing works can include earlier ones.

Works citing this article

OpenAlex counts 108 citations, but the citing work are not listed here yet: citing works are collected from OpenAlex a few at a time, and it lists most, not all, of the citations it counts.

Where its authors are based

Countries of the institutions the article's authors were affiliated to when it was published.

  • AUTHORS
  • CITATIONS No data yet
  • USAGE Phase 3
Authors by country
CountryAuthors
France4
United States3
China1
Germany1
Switzerland1
United Kingdom1