Simple multi-interacting fluids in SymBoltz
We implement a simple and general way of specifying arbitrary interactions between baryons, dark matter and dark energy in the Einstein--Boltzmann code SymBoltz. Due to the symbolic-numeric interface and approximation-free structure of SymBoltz, the model definition is remarkably compact and convenient to modify by specifying only the covariant coupling. The full equations are stiff, but stable and fast to integrate with an efficient implicit solver, particularly with the sparse and analytical ODE Jacobian generated from the symbolic equations. We first validate it using single-interaction models, comparing their background evolution and matter and CMB power spectra with those from modified versions of CLASS, finding $0.1\%$--$1\%$ agreement at most scales. Finally, we show how our framework makes it trivial to implement models with any interactions of any complexity among all three species simultaneously, which requires a more involved implementation in other Einstein--Boltzmann codes like CLASS or CAMB. Our full model is specified in only around 300 lines of code and is easy to modify for any other interaction by just specifying it in three lines.