Differentiable N-body code for Galactic Dynamics -- Odisseo
Giuseppe Viterbo, Tobias Buck
TL;DR
Constrained modeling of the Milky Way's gravitational potential using stellar streams requires differentiable, physics-based simulations. Odisseo provides a differentiable direct $N$-body solver in the JAX ecosystem with JIT, vectorization, and multi-GPU support, enabling gradient-based inference for Galactic dynamics. The work demonstrates near-linear multi-GPU scaling and two inference routes on a mock GD-1 stream—gradient-descent with bootstrapping and orbit fitting with Fisher contours—recovering host and progenitor properties. This establishes a scalable, end-to-end differentiable framework for Galactic dynamics that supports uncertainty quantification and rapid prototyping, with pathways to neural-network coupling and broader dynamical applications.
Abstract
We introduce \textsc{Odisseo} (Optimized Differentiable Integrator for Stellar Systems Evolution of Orbits), a differentiable N-body code designed to constrain the gravitational potential of the Milky Way (MW) through dynamical modeling of accreted structures such as stellar streams. \textsc{Odisseo} is implemented in JAX, enabling just-in-time compilation, automatic differentiation, and hardware acceleration on GPUs and TPUs. The code features efficient, fully vectorized force calculations and exhibits near-linear scaling when distributing a single simulation across multiple GPUs, making it suitable for large scale optimization tasks. As a demonstration, we present a case study using a mock GD-1 stellar stream simulation, where we optimize four physical parameters via gradient descent: the accretion time and progenitor mass, as well as the masses of the host Navarro-Frenk-White (NFW) halo and Miyamoto-Nagai (MN) disk. \textsc{Odisseo} accurately recovers stream morphology and underlying parameters in a differentiable and scalable framework, providing a powerful tool for dynamical studies of the Milky Way and its accreted substructures.
