spectroxide: A code package for computing cosmic microwave background spectral distortions

summary

The gist

Spectroxide is a code package designed for computing cosmic microwave background (CMB) spectral distortions…

In short

Spectroxide is a Rust code package that computes cosmic microwave background spectral distortions by evolving photon occupation numbers under Compton scattering, double Compton emission, and Bremsstrahlung from high redshift to today. It allows researchers to model spectral changes caused by arbitrary heat and photon injection.

Key concepts

Photon Occupation Number n(x)
This represents the number of photons present at a specific frequency (x) in the cosmic microwave background. The solver tracks how this number changes over time and redshift as photons scatter, are created, or are injected into the system.
Coupled Scattering Processes
The evolution of n(x) is governed by three linked physical processes: Compton scattering, double Compton emission (DC), and Bremsstrahlung (BR). These interactions depend on the electron temperature ($T_e$), creating a complex feedback loop in how the photon spectrum evolves.
Spectral Distortion Models
The resulting distortion ($\Delta n$) is modeled as a combination of temperature-shift, $\mu$ (chemical potential), and $y$ (adiabatic) types. The package uses a specific formulation to fit these shapes, allowing extraction of the physical Bose-Einstein chemical potential ($\mu$) from observational data.

Terminology used across episodes

This episode discusses

The paper

spectroxide: A code package for computing cosmic microwave background spectral distortions · Read on arXiv

Boston University

We present spectroxide, a code package for computing cosmic microwave background spectral distortions in which all about 12, 000 lines of Rust code, Python interface, and over 950 automated tests were written by an AI assistant (Claude Code) under human physicist supervision. The solver evolves the photon Boltzmann equation under Compton scattering, double Compton emission, and Bremsstrahlung from z about 5 times 10 6 to the present, computing spectral distortions from arbitrary heat and photon injection within this redshift range. No fully open-source code of this kind is publicly available; we validate against analytic limits, published spectra, and publicly available precomputed Green's function tables. We document the development as a case study in AI-assisted scientific computing, highlighting how domain expertise caught physics bugs (incorrect dimensional prefactors, near-cancellation errors) that evaded the full automated test suite, and document the practices and validation methodology we found effective for human--AI collaborative development of scientific software. We make spectroxide publicly available on GitHub.

DOI: 10.21468/SciPostPhysCodeb.90

Transcript

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

Vera: I'm Vera.

Jocelyn: And I'm Jocelyn, here with Subrahmanyan.

Vera: We're looking at the paper: "spectroxide: A code package for computing cosmic microwave background spectral distortions".

Paper summary: Vera: So we've seen how Spectroxide is this code package that handles cosmic microwave background spectral distortions using AI assistance to run huge physics problems on supercomputers.

Jocelyn: Yeah, and the authors are Baker, Liu, and Mishra-Sharma. They basically built a whole system—code in Rust and a Python interface—that lets you calculate how things get distorted as the universe evolves from very early times down to today.

Subrahmanyan: It’s about taking these complex equations describing how photons scatter and evolve over cosmic time, like Compton scattering and Bremsstrahlung, and making them runnable.

Vera: They're solving this by evolving the photon occupation number on a non-uniform frequency grid as the universe redshifts from five million years after the Big Bang down to zero.

Jocelyn: And they’re keeping energy conservation pretty tight, using two tricks—an implicit time stepping scheme and a specific subtraction method to handle those tricky double Compton

Conclusion: Vera: So to wrap up, this paper is about Spectroxide, which is basically a whole system of code they built to calculate how energy injections into the very early universe change the spectrum of the cosmic microwave background light we see today.

Jocelyn: And those are Baker, Liu, and Mishra-Sharma. They used AI assistance to create this package in Rust and a Python interface, letting people actually run these huge physics calculations without having to deal with all that low-level coding themselves.

Subrahmanyan: The main idea is taking the complex way photons scatter over cosmic time—like Compton scattering or Bremsstrahlung—and making it a runnable computer program that models everything from five million years after the Big Bang right up to now.

Vera: They manage this by evolving the photon occupation number on a non-uniform frequency grid, and they handle energy conservation with two different tricks, making sure the results are reliable even when dealing with those tricky coupling terms.

Jocelyn: The output gives them a mix of different distortion shapes—temperature shift, mu-type, and y-type—and they use this to extract the Bose-Einstein chemical potential, which is a key piece of information for understanding what happened in the very early universe.

Subrahmanyan: So what this means for us is that we can use this tool to test theories about dark matter or other exotic particles that might leave fingerprints on those spectral distortions we see in the CMB.

Vera: It’s a bridge, really, between the abstract math of particle physics and the actual observable light coming from space. It’s turning theoretical ideas into something concrete you can test with real telescope data.

Jocelyn: And they give us these tools, like visibility functions for different shapes and correction terms, so we can really probe different physical effects imprinted on that spectrum.

Subrahmanyan: It’s a practical way to use AI to manage the incredible complexity of coupled differential equations across timescales that are just too vast for traditional methods.

Vera: This package is a concrete way to explore how energy injection shapes the light we see today from those very first moments of cosmic history.

Jocelyn: And they’re setting up parallel processing so you can run many different historical scenarios at once using that run sweep tool, which opens up a whole new way to explore these possibilities.

Subrahmanyan: It gives us a robust framework for testing predictions about physics that happened way before we could ever directly observe it with other methods.

Vera: So this work is about taking the theoretical picture of cosmic evolution and turning it into a runnable calculation to see what kind of distortions we might expect from new physics.

Jocelyn: And the next step is taking these calculations and comparing them to actual observational data to see if they match what we measure out in the sky.

More episodes

← Home