spectroxide#

A PDE solver for CMB \(\mu\)- and \(y\)-type spectral distortions from energy and photon injection between \(z \sim 10^3\) and \(z \sim 5\times 10^6\).

The photon occupation number \(n(x, \tau)\) evolves under Kompaneets scattering, double Compton, bremsstrahlung, Hubble expansion, and a user-specified injection source. The core solver is implemented in Rust and integrated through Python; an analytic Green’s-function approximation (Chluba 2013) is also provided for fast estimates.

For physical background and derivations, see the paper.

Quick example#

from spectroxide import solve

# Full Rust PDE — single burst at z_h = 2e5, Δρ/ρ = 1e-5
result = solve(injection={"type": "single_burst", "z_h": 2e5}, delta_rho=1e-5)
print(f"mu = {result.mu:.3e}, y = {result.y:.3e}")

For full coverage of injection scenarios, photon injection, and tabulated sources see Tutorials or CLI reference.