ABCMB: A Python+JAX Package for the Cosmic Microwave Background Power Spectrum

arXiv:2602.15104 · astro-ph.CO, hep-ph · Submitted 2026-02-16 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Astrophysics Radio. Generated commentary on the latest astrophysics papers.

Vera: Next we'll be talking about the paper "ABCMB: A Python+JAX Package for the Cosmic Microwave Background Power Spectrum".

Jocelyn: The paper was written by Zilu Zhou, Cara Giovanetti and Hongwan Liu from New York University and Lawrence Berkeley National Laboratory and University of California, Berkeley and Boston University.

Vera: Stay tuned as we take you through the paper and discuss its implications.

Jocelyn: We also have Subrahmanyan with us today — guest researcher.

Vera: Alright, let's get started.

Title: Vera: We're starting our show with a new paper titled 'ABCMB: A Python+JAX Package for the Cosmic Microwave Background Power Spectrum'. It's written by Zilu Zhou, Cara Giovanetti, and Hongwan Liu.

Jocelyn: That title is a lot to take in, Vera. What does a 'Python and JAX package' actually mean for someone trying to interpret CMB data?

Subrahmanyan: It acts as a high-performance simulator for the early universe. By using JAX, the authors are able to model the complex interactions of light and matter using modern computing techniques.

Vera: I noticed the authors are coming from heavy-hitting institutions like NYU and Berkeley.

Jocelyn: Does that mean this is a tool specifically designed for the big survey teams?

Subrahmanyan: It's certainly built for that level of precision. This software provides a way to test cosmological models against the high-resolution data coming from missions like Planck or the Simons Observatory.

Vera: I'm so excited to see how this impacts our ability to map the sky.

Jocelyn: We definitely need to see what this code actually does under the hood.

Summary: Vera: We're diving into the mechanics of 'ABCMB: A Python+JAX Package for the Cosmic Microwave Background Power Spectrum'. It handles everything from gravitational lensing to the effects of massive neutrinos.

Jocelyn: I was reading about how it manages recombination and BBN. How does a software package handle the physics of the first few minutes of the universe?

Subrahmanyan: They've integrated specialized modules called LINX and HyRex to do that. These allow the code to calculate the abundance of elements and the state of the early plasma with extreme precision.

Vera: And the whole system is differentiable.

Jocelyn: I've heard that term used in machine learning, but how does it apply to the sky?

Subrahmanyan: It means the code doesn't just give you a single answer. It provides the mathematical gradients that show exactly how your results change when you adjust a cosmological parameter.

Vera: That's going to make parameter estimation so much more efficient.

Jocelyn: We should check how it compares to the current industry standards.

Improvements: Vera: Let's talk about the results for 'ABCMB: A Python+JAX Package for the Cosmic Microwave Background Power Spectrum'. The authors claim subpercent agreement with the standard CLASS code.

Jocelyn: If it's that accurate, I'm wondering about the computational cost. Is it going to be a slog to run on a standard workstation?

Subrahmanyan: That's the beauty of the GPU optimization they've implemented. The code can actually outperform single-core CPU runs, especially when you're working with high-resolution data.

Vera: I also love the object-oriented design they used. They mention you can add new physics without ever touching the original source files.

Jocelyn: That sounds like a massive win for researchers testing new dark matter models.

Subrahmanyan: It really lowers the barrier to entry for new physics. You can define a new particle species as a simple Python class and the entire solver integrates it automatically.

Vera: It's such a flexible approach for the community.

Jocelyn: We're almost ready to wrap this up.

Conclusion: Vera: We're wrapping up our discussion on 'ABCMB: A Python+JAX Package for the Cosmic Microwave Background Power Spectrum'.

Jocelyn: This tool feels like it will be a staple for the next generation of CMB surveys.

Subrahmanyan: It provides a powerful link between theoretical particle physics and observational data.

Vera: We've seen how it can change the way we analyze the early universe.

Jocelyn: I'm really looking forward to seeing it used in the next big data release.

Subrahmanyan: It's a significant step forward for computational cosmology.

Vera: Thanks for joining us today, everyone.

Jocelyn: See you for the next paper.

Zilu Zhou, Cara Giovanetti, Hongwan Liu

New York University · Lawrence Berkeley National Laboratory · University of California, Berkeley · Boston University

astro-ph.CO, hep-ph

Submitted: 2026-02-16

Updated: 2026-09-10

Comments: 56 pages, 15 figures

Journal ref: Zilu Zhou et al JCAP08(2026)078

DOI: 10.1088/1475-7516/2026/08/078

Code: https://github.com/TonyZhou729/ABCMB

License: http://creativecommons.org/licenses/by-sa/4.0/

Importance score: 45/100

The gist: This paper presents ABCMB (Autodifferentiable Boltzmann solver for the CMB), a new differentiable Einstein-Boltzmann solver designed for cosmic microwave background (CMB) analysis.

Key concepts

Differentiable code
This means the code provides mathematical gradients that show exactly how results change when a cosmological parameter is adjusted. Instead of providing just a single answer, this capability makes the process of parameter estimation much more efficient for researchers analyzing early universe data.
JAX-based simulation
By using JAX, ABCMB acts as a high-performance simulator for the early universe. This allows researchers to model complex interactions of light and matter using modern computing techniques and GPU optimization, which can outperform single-core CPU runs when working with high-resolution data.
Object-oriented design
The package's design allows researchers to add new physics, such as new particle species, without modifying the original source files. A user can define a new particle as a simple Python class, and the entire solver integrates it automatically, lowering the barrier for testing new dark matter models.

Terminology

Summary

This paper presents ABCMB (Autodifferentiable Boltzmann solver for the CMB), a new differentiable Einstein-Boltzmann solver designed for cosmic microwave background (CMB) analysis. As precision cosmology moves toward higher-dimensional parameter spaces and more complex models, the ability to perform efficient, gradient-based parameter estimation is essential to overcome the computational expense of traditional Markov-Chain Monte Carlo methods.

Architecture and philosophy

ABCMB utilizes a significant departure from predecessor codes by employing an object-oriented architecture refactored for improved extensibility. The code is built using JAX, which allows it to be Just-In-Time (JIT) compiled for faster run times and makes it backend-agnostic, meaning it can be trivially accelerated on GPUs. The core philosophy is to minimize the need for users to modify source files; instead, new physics can be introduced by defining new fluid modules that are passed into ABCMB at initialization.

The computation is managed by a centralized model that dispatches several specialized modules:

  • Background modules for computing thermodynamic quantities and managing recombination.

  • Perturbation modules for solving the evolution of coupled ordinary differential equations.

  • Spectrum modules for integrating transfer functions to compute power spectra.

Key capabilities and physics

The package is a complete code capturing important effects to linear order in CDM cosmology. It provides a state-of-the-art Einstein-Boltzmann solver that achieves subpercent agreement with established codes like CLASS. The primary breakthroughs of the package include:

  1. Ease of use and extensibility, allowing new physics to be added without ever needing to open a source file.

  2. A high precision recombination calculation provided by the companion code HyRex, which is a differentiable version of HYREC-2.

  3. A fast, state-of-the-art BBN calculation via the inclusion of LINX, enabling precise theoretical predictions rather than interpolating pre-tabulated results.

The solver currently includes effects such as lensing, E-mode polarization, and massive neutrinos.

Differentiability and gradients

A major advantage of ABCMB is that it is fully differentiable, meaning functional gradients are computed using automatic differentiation (AD) rather than numerical derivatives. This makes the code particularly powerful for Fisher forecasting and enables the use of efficient, gradient-based sampling algorithms such as Hamiltonian Monte Carlo (HMC). Because ABCMB uses forward AD, it is well-suited for its large number of outputs, including thousands of C and P(k) values.

The differentiability extends across the entire pipeline; when used with LINX, the entire pipeline from BBN through recombination and the CMB power spectrum is fully differentiable. This allows researchers to explore complex interdependencies between BBN abundances, baryon density, and effective neutrino numbers.

Performance and validation

ABCMB has been validated against HYREC-2 and CLASS, showing subpercent accuracy in the matter power spectrum and CMB temperature/E-mode spectra. In terms of performance, the code is highly efficient on GPU hardware. While CLASS uses various approximation schemes to achieve speed, ABCMB's JAX-based implementation allows it to remain competitive or even faster in certain regimes.

The paper highlights several performance characteristics:

  • On NVIDIA GPUs, ABCMB can outperform the CLASS run time when considering modes up to = 4000.

  • The runtime scales more favorably with the number of modes considered than codes like CLASS do.

  • The code is backend-agnostic, allowing it to be run on both CPU and GPU.

Improvements for AI systems

1. Integration of Fully Differentiable Black Box Simulators via Forward Automatic Differentiation (AD)

  • What the improved AI system can do: Instead of treating external scientific or engineering simulators as non-differentiable black boxes that require slow, error-prone numerical finite-difference methods, the system can integrate them directly into its optimization loop. By utilizing forward AD, the AI can compute stable, high-precision functional gradients through complex, non-linear differential equations. This enables the use of hyper-efficient gradient-based sampling (e.g., Hamiltonian Monte Carlo) for real-time parameter estimation and design optimization in high-dimensional scientific datasets.

2. Object-Oriented Modular Extensibility for Autonomous Knowledge Injection

  • What the improved AI system can do: The system can move away from monolithic architectures toward a template inheritance model. When the AI encounters new domain knowledge (e.g., a new set of chemical reaction rates, physical laws, or mathematical axioms), it can automatically wrap that knowledge into an independent, object-oriented module that inherits from existing base classes. This allows the AI to integrate and reason with entirely new species of logic or physics within its core engine without requiring model retraining or manual modification of its underlying source code.

3. High-Dimensional Output Optimization via Forward-Mode Gradient Computation

  • What the improved AI system can do: In specialized engineering or generative design tasks where the output dimensionality (e.g., thousands of physical properties, structural points, or molecular states) is significantly larger than the input parameter space, the system can switch from standard reverse-mode backpropagation to forward-mode differentiation (jacfwd). This allows for more efficient and computationally stable gradient calculations across massive output vectors, facilitating hyper-accurate optimization in complex design landscapes.

4. JIT-Compiled, Backend-Agnostic Reasoning Kernels

  • What the improved AI system can do: The system can implement Just-In-Time (JIT) compilation for its mathematical and logical reasoning subroutines. This allows the AI to dynamically compile its own reasoning chains into highly optimized machine code that is backend-agnostic, meaning the same logic can transition seamlessly between CPU, GPU, and TPU environments. This ensures maximum computational throughput and minimal latency when scaling from simple logical tasks to heavy numerical simulations.

Abstract

We present ABCMB, a differentiable Einstein-Boltzmann solver for the cosmic microwave background (CMB). ABCMB is an analysis-ready code package capturing important effects to linear order in Λ CDM cosmology. It computes the CMB power spectrum and includes effects like lensing, polarization, massive neutrinos, and a state-of-the-art treatment of Big Bang Nucleosynthesis and recombination. ABCMB has sub-percent-level agreement with CLASS and can be run on a GPU with competitive, and sometimes even faster, run times, owing to ABCMB's favorable run time scaling with maximum multipole moment. It is refactored compared to previous codes and takes advantage of object-oriented programming to improve extensibility, meaning new physics can be added to it without the need for modifying source files. ABCMB provides accurate and stable gradients to the user, making Fisher analyses straightforward, and enabling the use of efficient gradient-based sampling methods.

Sources

Related papers