- Open Access
Differentiable simulations for particle tracking in accelerators: Analysis, benchmarking, and optimization
Phys. Rev. Accel. Beams 28, 114603 – Published 25 November, 2025
DOI: https://doi.org/10.1103/cbds-lst1
Abstract
Optimization of beamlines and lattices is a common problem in accelerator physics, which is usually solved with semianalytical methods and numerical optimization routines. However, these are usually of the gradient-free or finite-difference type, whose computational cost grows quickly with the number of optimization parameters. On the other hand, the cost of gradient-based optimization can scale well with the number of parameters, but only if the computation of the gradient is itself efficient (e.g., not via finite differences, which are inefficient). Recently, there has been an emergence of so-called “differentiable” codes that efficiently provide gradients. Nevertheless, analysis and benchmarking comparisons of these techniques have largely been absent from the literature. In this work, we develop our own differentiable code via autodifferentiation. We analyze and benchmark differentiability against finite differences in two test cases, a space-charge FODO cell from the literature and a realistic future beamline at CERN. The analyses and benchmarking are done both theoretically and empirically. Finally, we embed the gradient provided by the differentiable code in gradient-based optimization routines and compare with gradient-free methods. This work offers the first such analysis and benchmarking and thus contributes toward the development of more efficient and performant particle accelerators.
Physics Subject Headings (PhySH)
Article Text
References (25)
- C. Iselin, The mad program, in Computing in Accelerator Design and Operation (Springer, Berlin, Heidelberg, 1984), 10.1007/3540139095_98.
- R. Ramjiawan, S. Döbert, J. Farmer, E. Gschwendtner, F. M. Velotti, L. Verra, G. Z. Della Porta, V. Bencini, and P. N. Burrows, Design and operation of transfer lines for plasma wakefield accelerators using numerical optimizers, Phys. Rev. Accel. Beams 25, 101602 (2022).
- M. Remta, F. Velotti, F. Huhn, P. Arrutia Sota, and Y. Dutheil, Towards tailored beam distributions for fixed target experiments at CERN, in Proceedings of the 16th International Particle Accelerator Conference, Taipei, Taiwan (JACoW, Geneva, Switzerland, 2025), pp. 967–970, https://meow.elettra.eu/81/author/matthias-remta-cern-ch/index.html.
- L. Yang, D. Robin, F. Sannibale, C. Steier, and W. Wan, Global optimization of an accelerator lattice using multiobjective genetic algorithms, Nucl. Instrum. Methods Phys. Res., Sect. A 609, 50 (2009).
- L. Deniau et al., MethodicalAcceleratorDesign/mad-x: 5.09.01, 2023, 10.5281/zenodo.10255261.
- J. A. Nelder and R. Mead, A simplex method for function minimization, Comput. J. (United Kingdom) 7, 308 (1965).
- G. Iadarola et al., Xsuite: An integrated beam physics simulation framework, in Proceeding of the 68th ICFA Advanced Beam Dynamics Workshop on High-Intensity and High-Brightness Hadron Beams (HB2023), Geneva, Switzerland (JACoW, Geneva, Switzerland, 2024), TUA2I1, 10.18429/JACoW-HB2023-TUA2I1.
- N. Hansen, A. Auger, R. Ros, S. Finck, and P. Pošík, Comparing Results of 31 Algorithms from the Black–Box Optimization Benchmarking BBOB–2009 (Association for Computing Machinery, New York, NY, USA, 2010), pp. 1689–1696.
- A. Jameson, Aerodynamic design via control theory, J. Sci. Comput. 3, 233 (1988).
- L. Magri, Adjoint methods as design tools in thermoacoustics, Appl. Mech. Rev. 71, 020801 (2019).
- Our World in Data, Computation used to train notable AI systems, by domain, https://ourworldindata.org/grapher/ai-training-computation-vs-parameters-by-domain (2024).
- J. Ansel et al., pytorch 2: Faster Machine Learning Through Dynamic python Bytecode Transformation and Graph Compilation (Association for Computing Machinery, New York, NY, USA, 2024), pp. 929–947.
- M. Abadi et al., tensorflow, large-scale machine learning on heterogeneous systems, 2015, https://zenodo.org/records/16852354.
- J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, and Q. Zhang, jax: Composable transformations of python+numpy programs, 2025, http://github.com/jax-ml/jax.
- J. Gonzalez-Aguilera, Y.-K. Kim, R. Roussel, A. Edelen, and C. Mayes, Towards fully differentiable accelerator modeling, in Proceedings of the 14th International Particle Accelerator Conference (IPAC23), Venice, Italy (JACoW, Geneva, Switzerland, 2023), pp. 2797–2800, 10.18429/JACoW-IPAC2023-WEPA065.
- J. Kaiser, C. Xu, A. Eichler, and A. Santamaria Garcia, Bridging the gap between machine learning and particle accelerator physics with high-speed, differentiable simulations, Phys. Rev. Accel. Beams 27, 054601 (2024).
- J. Wan, H. Alamprese, C. Ratcliff, J. Qiang, and Y. Hao, jutrack: A julia package for auto-differentiable accelerator modeling and particle tracking, Comput. Phys. Commun. 309, 109497 (2025).
- L. Deniau, mad-ng, a standalone multiplatform tool for linear and non-linear optics design and optimisation, arXiv:2412.16006.
- J. Wan, H. Alamprese, C. Ratcliff, J. Qiang, and Y. Hao, jutrack code repository, 2025, https://github.com/MSU-Beam-Dynamics/JuTrack.jl [Accessed 2025-06-01].
- A. G. Baydin, B. A. Pearlmutter, A. A. Radul, and J. M. Siskind, Automatic differentiation in machine learning: A survey, J. Mach. Learn. Res. 18, 1 (2018).
- F. Huhn and F. M. Velotti, ADPT–Auto-Differentiable Particle Tracking, 2025, 10.5281/zenodo.17305665.
- J. Qiang, Differentiable self-consistent space-charge simulation for accelerator design, Phys. Rev. Accel. Beams 26, 024601 (2023).
- D. Kraft, Algorithm 733: TOMP–fortran modules for optimal control calculations, ACM Trans. Math. Softw. 20, 262 (1994).
- C. Zhu, R. H. Byrd, P. Lu, and J. Nocedal, Algorithm 778: L-BFGS-B: fortran subroutines for large-scale bound-constrained optimization, ACM Trans. Math. Softw. 23, 550 (1997).
- R. Roussel, J. P. Gonzalez-Aguilera, E. Wisniewski, A. Ody, W. Liu, J. Power, Y.-K. Kim, and A. Edelen, Efficient six-dimensional phase space reconstructions from experimental measurements using generative machine learning, Phys. Rev. Accel. Beams 27, 094601 (2024).