Context. The study of galaxy formation and evolution critically depends on our understanding of the complex photo-chemical processes that govern the evolution and thermodynamics of the interstellar medium (ISM). In a computational sense, resolving the chemistry is among the weightiest tasks in cosmological and astrophysical simulations. Aims. Astrophysical simulations can include photo-chemical models that allow for a wide range of densities (n), abundances of different species (ni/n) and temperature (T), and plausible evolution scenarios of the ISM under the action of a radiation field (F) with different spectral shapes and intensities. The evolution of such a non-equilibrium photo-chemical network relies on implicit, precise, computationally costly, ordinary differential equations (ODE) solvers. Here, we aim to substitute such procedural solvers with fast, pre-trained emulators based on neural operators. Methods. We emulated a non-equilibrium chemical network up to H2 formation (9 species, 52 reactions) by adopting the DeepONet formalism, namely: by splitting the ODE solver operator that maps the initial conditions and time evolution into a tensor product of two neural networks (named branch and trunk). We used KROME to generate a training set, spanning −2 < log(n/cm−3) ≤ 3.5, log(20) ≤ log(T/K) ≤ 5.5, −6 ≤ log(ni/n) < 0, and adopting an incident radiation field, F, sampled in 10 energy bins with a continuity prior. We separately trained the solver for T and each ni for ≃4.34 GPUhrs. Results. Compared with the reference solutions obtained by KROME for single-zone models, the typical precision obtained is of the order of 10−2, that is, it is 10 times better when using a training that is 40 times less costly, with respect to previous emulators that only considered a fixed F. DeepONet also performs well for T and ni outside the range of the training sample. Furthermore, the emulator aptly reproduces the ion and temperature profiles of photo dissociation regions as well; namely, by giving errors that are comparable to the typical difference between various photo-ionization codes. The present model achieves a speed-up of a factor of 128× with respect to stiff ODE solvers. Conclusions. Our neural emulator represents a significant leap forward in the modelling of ISM chemistry, offering a good balance of precision, versatility, and computational efficiency. Nevertheless, further work is required to address the challenges represented by the extrapolation beyond the training time domain and the removal of potential outliers.
Read full abstract