Table of Contents
Fetching ...

MAD-NG, a standalone multiplatform tool for linear and non-linear optics design and optimisation

Laurent Deniau

TL;DR

MAD-NG delivers a stand-alone, cross-platform framework for linear and nonlinear accelerator optics design and optimization, integrating a Lua-based scripting layer with the fast GTPSA core to enable high-order, parametric analysis. By supporting multiple lattice formats, multi-lattice workflows, and a rich command set (survey, track, twiss, match, taper, etc.), it accelerates both modeling and optimization tasks, including dynamic aperture studies, through parametric maps and nonlinear normal forms. Key contributions include a highly scalable differential-algebra engine, a parametric optimization workflow that reduces Jacobian evaluations, and significant speedups over MADX-PTC (roughly $50$–$80$×), enabling rapid exploration of large design spaces for complex accelerators like the LHC and FCC-ee. The practical impact is substantial: MAD-NG enables faster, more reliable design iterations, easier integration with external tools (e.g., Python via PyMAD-NG), and robust handling of advanced features (patches, radiation, tapering, backtracking, and reversed sequences) across diverse accelerator projects.

Abstract

The paper will provide an overview of the capabilities of the Methodical Accelerator Design Next Generation (MAD-NG) tool. MAD-NG is a standalone, all-in-one, multi-platform tool well-suited for linear and nonlinear optics design and optimization, and has already been used in large-scale studies such as HiLumi-LHC or FCC-ee. It embeds LuaJIT, an extremely fast tracing just-in-time compiler for the Lua programming language, delivering exceptional versatility and performance for the forefront of computational physics. The core of MAD-NG relies on the fast Generalized Truncated Power Series Algebra (GTPSA) library, which has been specially developed to handle many parameters and high-order differential algebra, including Lie map operators. This ecosystem offers powerful features for the analysis and optimization of linear and nonlinear optics, thanks to the fast parametric nonlinear normal forms and the polyvalent matching command. A few examples and results will complete this overview of the MAD-NG application.

MAD-NG, a standalone multiplatform tool for linear and non-linear optics design and optimisation

TL;DR

MAD-NG delivers a stand-alone, cross-platform framework for linear and nonlinear accelerator optics design and optimization, integrating a Lua-based scripting layer with the fast GTPSA core to enable high-order, parametric analysis. By supporting multiple lattice formats, multi-lattice workflows, and a rich command set (survey, track, twiss, match, taper, etc.), it accelerates both modeling and optimization tasks, including dynamic aperture studies, through parametric maps and nonlinear normal forms. Key contributions include a highly scalable differential-algebra engine, a parametric optimization workflow that reduces Jacobian evaluations, and significant speedups over MADX-PTC (roughly ×), enabling rapid exploration of large design spaces for complex accelerators like the LHC and FCC-ee. The practical impact is substantial: MAD-NG enables faster, more reliable design iterations, easier integration with external tools (e.g., Python via PyMAD-NG), and robust handling of advanced features (patches, radiation, tapering, backtracking, and reversed sequences) across diverse accelerator projects.

Abstract

The paper will provide an overview of the capabilities of the Methodical Accelerator Design Next Generation (MAD-NG) tool. MAD-NG is a standalone, all-in-one, multi-platform tool well-suited for linear and nonlinear optics design and optimization, and has already been used in large-scale studies such as HiLumi-LHC or FCC-ee. It embeds LuaJIT, an extremely fast tracing just-in-time compiler for the Lua programming language, delivering exceptional versatility and performance for the forefront of computational physics. The core of MAD-NG relies on the fast Generalized Truncated Power Series Algebra (GTPSA) library, which has been specially developed to handle many parameters and high-order differential algebra, including Lie map operators. This ecosystem offers powerful features for the analysis and optimization of linear and nonlinear optics, thanks to the fast parametric nonlinear normal forms and the polyvalent matching command. A few examples and results will complete this overview of the MAD-NG application.

Paper Structure

This paper contains 12 sections, 18 figures.

Figures (18)

  • Figure 1: MAD-NG ecosystem with all main components shown with relationship, and grouped by purpose: blue for objects, orange for commands, purple for 3D geometry and linear algebra, red for 6D dynamics and differential algebra.
  • Figure 2: The vertical axis shows benchmark times normalized to the C implementation, and LuaJIT in the 3rd column is one of the best performers along with Julia and Rust, while being the only one to be a dynamically typed programming language allowing rapid development.
  • Figure 3: The object model uses prototypal inheritance (black arrows) with dynamic lookup (red arrows) that stops at the first match, with intermediate attribute writes (purple arrows) shortening the search path.
  • Figure 4: Example of using to build the lattice layout (top), and to calculate the particle coordinates $x, y$ (left axis) and first derivatives $\frac{\partial x}{\partial p_t}=R_{16}, \frac{\partial y}{\partial p_t}=R_{36}$ (right axis) along $s$ around LHC IP5 (bottom axis). All axes are in meters.
  • Figure 5: Example using and results to reconstruct the horizontal motion of the reference particle for the upstream (purple) and downstream (green) beams in the local frame $(x, s)$ on the left, and in the global frame $(X,Z)$ on the right.
  • ...and 13 more figures