AG-2026.04-1526·astro-ph.CO·cross-listed: astro-ph.IMcs.AIhep-ph
spectroxide: A code package for computing cosmic microwave background spectral distortions
Authors
- Ethan Baker
- Hongwan Liu
- Siddharth Mishra-Sharma
Abstract
We present spectroxide, a code package for computing cosmic microwave background spectral distortions in which all ${\sim}14{,}500$ lines of Rust code, Python interface, and ${\sim}400$ 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 \sim 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 provide recommendations for best practices in human--AI collaborative development of scientific software. We make spectroxide publicly available on GitHub.
Submitted
27 April 20261 month ago
Version
v1
License
CC-BY-4.0
DOI
10.48550/arXiv.2604.24838
Summary
Researchers released spectroxide, an open-source tool for calculating how the cosmic microwave background's spectrum distorts due to energy injection in the early universe, written largely by an AI assistant under human physicist oversight.
- This is the first fully open-source code for computing CMB spectral distortions from arbitrary heat and photon injection across a wide redshift range, filling a gap in publicly available tools.
- An AI assistant wrote ~14,500 lines of code under human supervision, but physicists caught subtle bugs (wrong prefactors, near-cancellations) that automated tests missed—showing why domain expertise remains essential in scientific computing.
- The work demonstrates practical guidelines for human–AI collaboration on scientific software: automated tests are necessary but insufficient, and physics intuition is irreplaceable for catching dimensional or numerical errors.
curious · generated by claude-haiku-4-5
Chat with this PDF
Ask questions, probe assumptions, request a plain-English summary. Answers cite sections from the preprint itself.
Community
Questions and answers about this paper from other readers. No formal peer review — just a place to think out loud.