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

arXiv cs.AI / 4/29/2026

📰 NewsDeveloper Stack & InfrastructureSignals & Early TrendsIdeas & Deep AnalysisModels & Research

Key Points

  • The paper introduces spectroxide, a software package for computing cosmic microwave background (CMB) spectral distortions over a key redshift range using photon Boltzmann-equation evolution.
  • The code models processes including Compton scattering, double Compton emission, and Bremsstrahlung, allowing users to compute distortions from arbitrary heat and photon injection between redshift z ~ 5×10^6 and today.
  • Development was notably AI-assisted: an AI assistant (Claude Code) generated ~14,500 lines of Rust code plus a Python interface, alongside ~400 automated tests, under human physicist supervision.
  • The authors validate spectroxide against analytic limits, published spectra, and precomputed Green’s function tables, and document real physics bugs (e.g., incorrect dimensional prefactors and near-cancellation errors) that domain experts caught despite automated testing.
  • The package is released publicly on GitHub and presented as a case study with practical recommendations for human–AI collaborative scientific software development.

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.