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
- spectroxide: A code package for computing cosmic microwave background spectral distortions · Paper Radio
- Science with CMB spectral distortions
- New Horizons in Cosmology with Spectral Distortions of the Cosmic Microwave Background
- Taking the Universe's Temperature with Spectral Distortions of the Cosmic Microwave Background
- Rich structure of non-thermal relativistic CMB spectral distortions from high energy particle cascades at redshifts z 2 times 10 5
- New CMB spectral distortion constraints on decaying dark matter with full evolution of electromagnetic cascades before recombination
- Exotic energy injection in the early universe II: CMB spectral distortions and constraints on light dark matter
- Dark Photon Oscillations in Our Inhomogeneous Universe
- Modeling Dark Photon Oscillations in Our Inhomogeneous Universe
- Revisiting Dark Photon Constraints from CMB Spectral Distortions
- Shaping Dark Photon Spectral Distortions
- Constraints on primordial magnetic fields from CMB distortions in the axiverse
- Polarized anisotropic spectral distortions of the CMB: Galactic and extragalactic constraints on photon-axion conversion
- Revisiting Constraints on Resonant Axion-Photon Conversions from CMB Spectral Distortions
- CMB spectral distortions constraints on primordial black holes, cosmic strings and long lived unstable particles revisited
- Constraints on the spectral signatures of superconducting cosmic strings
- A Limit on Primordial Small-Scale Magnetic Fields from CMB Distortions
- Probing early-universe phase transitions with CMB spectral distortions
- BISOU: a balloon project to measure the CMB spectral distortions
- SPECTER: An Instrument Concept for CMB Spectral Distortion Measurements with Enhanced Sensitivity
- Teasing bits of information out of the CMB energy spectrum
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
- 2605.09037-Exploring the faint limit of the ESA PLATO space mission: A case study of extragalactic research with the self-lensing supermassive black hole binary candidate, Spikey
- 2506.21677-Lensing Without Borders: Measurements of galaxy-galaxy lensing and projected galaxy clustering in DESI DR1
- 2606.12265-Deep Learning Calibration of the Quasar UV and X-ray Luminosity Relation for Cosmological Applications
- The day in conversation for 2026-12-05
- Daily Summary for 2026-12-05
- 2411.04107-Looking into the world of interacting supernovae
- 2508.20927-Unsupervised Classification of Gamma-ray Bursts from Blazars (GRBBLs) with Machine Learning
- 2510.17987-Piling up in the darkness: Features of the BBH mass distribution from isolated binaries
- 2512.01640-Equivalence of Radial Stability Criteria for Multifluid Stars
- 2512.16638-Cygnus X-3: A variable petaelectronvolt gamma-ray source