WorksPhysics and Astronomy
Reveal normal form structure for nonlinear map in accelerator beam physics with symplectic neural network
Abstract
Long-term multi-turn tracking is required to study nonlinear phenomena in circular accelerators, such as resonances, chaotic motion, and the dynamic aperture. General-purpose neural networks do not preserve the symplectic structure of Hamiltonian dynamics, so their errors can grow over many turns. Symplectic neural networks (SympNets) guarantee symplecticity through their architecture rather than through a loss penalty. In this work, we use a SympNet to learn the normal-form transformation of a nonlinear map from tracking data. In the learned coordinates, the dynamics become a rotation of each mode, whose amplitude-dependent phase advance is given by a second network. We demonstrate the method on a four-dimensional McMillan-type map. The model reproduces the one-turn dynamics, the learned phase advances stay constant along each trajectory to within ~rad, and orbits become close to circles in the learned coordinates at small and moderate amplitude. At large amplitude the learned orbits spread noticeably, and the cause of this degradation is not yet established. The approach is a step toward fast, structure-preserving surrogate models for lattice analysis and online beam-dynamics applications in storage rings.
Introduction
Nonlinear fields from sextupole and octupole magnets and from lattice imperfections limit the dynamic aperture of modern circular accelerators. They make the betatron tune depend on amplitude (amplitude-dependent tune shift, ADTS), distort the invariant curves in phase space, and can drive particles onto resonances, with consequences for beam lifetime and injection efficiency [4]. Accurate models of these amplitude-dependent nonlinearities are therefore essential for accelerator simulation and stability analysis. Integrable nonlinear maps such as the McMillan map [6], whose invariants are known exactly, provide a controlled setting in which such models can be tested.
Perturbative normal-form methods [3, 5] describe weakly nonlinear motion accurately, but as series expansions they lose accuracy at large amplitude, near resonances and close to the dynamic aperture. Element-by-element tracking is accurate but costly when many particles must be followed over many turns. Data-driven models can learn the one-turn map directly, but generic networks do not preserve the symplectic structure of the dynamics, so their errors can grow over long-term tracking. Symplectic neural networks [1] and Hamiltonian neural networks [2] remove this problem. On their own, however, they do not explicitly represent the invariants of the motion, so small errors in the learned map can still distort orbits and accumulate phase error, particularly under strong ADTS. A natural remedy is to learn coordinates in which the motion becomes simple. SympNets have been combined with Koopman operator methods, which seek coordinates in which the dynamics is linear [7]. Here we instead combine them with normal-form theory, which lets the turning angle depend on amplitude, as described below.
The normal-form framework [3, 4] describes nonlinear dynamics through a nonlinear coordinate transformation to a simpler representation: away from resonances, a rotation of each mode whose phase advance depends on amplitude. Constructing this transformation analytically is difficult, since the underlying series may converge poorly at large amplitude, and near resonances the motion cannot be reduced to independent rotations.
In this paper, we learn the normal-form transformation directly from tracking data. Specifically, we
use a symplectic neural network (SympNet) [1] to represent the transformation to normal-form coordinates, combined with a separate network that gives the amplitude-dependent phase advance of each mode;
study a simplified four-dimensional McMillan-type map [6], an integrable nonlinear map whose invariants are known exactly, as a controlled test case;
present results on the accuracy of the learned one-turn map, the constancy of the learned phase advances, and the conservation of the normal-form actions, and discuss the limitations of the model at large amplitude.
Model Setup
Conventional accelerator modeling methods mainly rely on analytical perturbation theory and numerical iterative mapping algorithms. Analytical normal-form methods suffer from limited approximation accuracy under strong nonlinearity and large-amplitude initial conditions, failing to fully characterize distorted orbital features. Traditional numerical mapping strategies can require many repeated computations, especially when many particles and many turns must be tracked. In recent years, data-driven surrogate modeling has emerged as an efficient alternative for physical system prediction, demonstrating outstanding capabilities in fitting complex nonlinear dynamic systems. However, general neural networks lack physical constraint awareness, often destroying the intrinsic symplectic conservation property of Hamiltonian systems. Such unconstrained models typically produce non-physical phase-space volume changes, unstable tune prediction, and serious cumulative drift in long-term autonomous rollout, which severely limits their practical application in accelerator studies.
Existing symplectic neural networks [1] and Hamiltonian neural networks [2] preserve the symplectic structure of the dynamics, but they do not explicitly represent its invariants. Small errors in a learned one-turn map can therefore still distort orbits and accumulate phase error over many turns, particularly for large-amplitude orbits with strong amplitude-dependent tune shift (ADTS). Here we instead build the normal-form structure into the model [3]: the dynamics are represented as a rotation in normal-form coordinates, so that the action of each mode is conserved exactly, and the tune appears explicitly as the phase advance of this rotation.
The goal is to learn the one-turn map of a nonlinear system in a form that exposes its normal-form structure. Given the phase-space vector , the model represents the map as
where is a learnable symplectic transformation from the physical phase space to the latent normal-form coordinates , is a rotation acting in the latent space, and transforms the rotated coordinates back to physical phase space. The rotation is block-diagonal, one rotation per mode,
with phase advances , (tunes ) predicted for each particle by a separate network, — FN (described below). Unlike conventional analytical normal-form methods, where the transformation is constructed as a power series, and here are learned from data. For multi-turn propagation, the map is applied recursively, , with each output used as the input of the next turn, as in conventional particle tracking.
FN is a fully connected network that maps the phase-space state to two phase advances. It has linear layers (default , width ) with tanh activations between them:
The outputs are bounded to :
and define the rotation of Eq (2). Each block is a rotation, so holds exactly for any ; no additional constraint is needed.
Constraints on the latent rotation. The network FN maps the phase-space state to the phase advances of the two normal modes. Its outputs are bounded to and define a block-diagonal rotation in the latent space, one rotation per mode. Because each mode is rotated rather than transformed arbitrarily, its action is conserved exactly, and orbits remain circles in normal-form coordinates [3]. The phase advances are further constrained by the phase-advance loss to be constant along each trajectory, so that they depend only on the invariants while still varying with amplitude, as expected for an integrable map [6].
Symplectic Neural Network Architecture. The symplectic neural network (SympNet) adopted in this work is constructed based on symplectic coordinate transformations and state-dependent rotation blocks, which inherently preserve the symplectic geometry of the phase space. The architecture consists of three core modules: a symplectic encoder , a nonlinear rotation block , and a symplectic decoder .
The symplectic encoder is implemented via a sequence of symplectic affine transformations and separable non-identity activation layers. It maps the physical phase-space coordinates into a latent space where the transverse oscillations are approximately decoupled. This latent representation separates the amplitude-dependent tune effects from linear phase advance, enabling independent handling of horizontal and vertical motion.
Inside the rotation block , a multilayer perceptron (FN) takes the physical phase-space state as input and outputs the phase advances and of the two latent modes, i.e. the tunes . These define a block-diagonal rotation acting on the latent phase-space variables. Unlike the fixed linear rotation in conventional tracking codes, the rotation angles vary with the particle state, which captures nonlinear detuning such as the amplitude-dependent tune shift. A loss term keeps the phase advances constant along each trajectory, so that in practice they depend only on the invariants of the motion.
The symplectic decoder is the inverse transformation of . It converts the rotated latent coordinates back to physical phase space . Both encoder and decoder are built as invertible symplectic maps, so the full composition is symplectic for fixed phase advances; because the phase advances depend on the state, it is approximately symplectic overall. The entire forward pass is an explicit deterministic map with no hidden iterative solvers.
Known limitations of the architecture. Because the rotation is block-diagonal, the actions and of the two latent modes are each conserved separately. The model can therefore only represent dynamics that possess two separately conserved actions in some set of coordinates; any coupling that transfers action between the learned modes cannot be represented. In addition, FN computes the phase advances from the full phase-space state rather than from the actions alone, so the learned map is symplectic only approximately; computing both phase advances as derivatives of a single learned function would make it exactly symplectic.
Key note: and are learnable symplectic neural networks rather than constant matrices. This distinguishes the proposed framework from conventional analytical normal-form methods, where the transformation is constructed via power-series expansions.

Figure 1. Architecture of the model. The SympNet encoder maps the physical state to latent normal-form coordinates , which are rotated by phase advances computed by FN from , and mapped back to physical phase space by the decoder .
Data Feeding Strategy The initial conditions are sampled uniformly in amplitude (not in action) in each of the and planes, with random phases, so the data set covers both small-amplitude, nearly linear motion, and the large-amplitude regime where ADTS is strongest. The training data are generated with a four-dimensional McMillan-type map. With Twiss parameters , , and , one turn reads
with , , , and . Each initial condition is tracked with Eq. (3), and consecutive states are paired as . No normalization is applied to the coordinates.
For training, the one-turn pairs are grouped into batches such that each trajectory lies entirely within one batch, since some of the loss terms below are computed per trajectory. The order of the batches is shuffled in every epoch. The training settings are listed in Table 1.
| Setting | Stage 1 | Stage 2 |
| Epochs | 120 | 60 |
| Initial learning rate | (fresh optimizer) | |
| Conservation weight | 10 | 10 |
| Latent weights | 2 | 2 |
| Radius weights | 0.2, ramped over 25 epochs | 0.6, no ramp |
| Plateau patience | 15 epochs | 10 epochs |
| Shared settings | ||
| Training data | 200 trajectories 400 turns | |
| Initial amplitudes | uniform in [0.05, 0.70] per plane, random phases | |
| Batch size | about 2048 pairs, whole trajectories | |
| Optimizer | AdamW, weight decay , gradient clipping at norm 1 | |
| Learning-rate schedule | halved on plateau, minimum | |
| SympNet | 6 blocks of 6 activation layers, 5 linear mixers | |
| fit | 10% of points closest to the origin | |
| FN | linear layers of width | |
| Precision, seed | float64, random seed 1234 |
Table 1. Training settings.
Loss-function The phase advances are internal quantities, not targets: there are no ground-truth labels for them. What is available is data, i.e. observed one-turn pairs , and the model is trained so that the resulting map reproduces these dynamics. The total loss is a weighted sum of terms, all computed on one-turn pairs. Write for the latent coordinates of a data point, for the rotation with the phase advances FN assigns to , and for the number of pairs in a batch. The augmented loss terms consist of latent and losses, radius and losses, the predicted loss, and the combined total loss. These terms encourage the learned model to preserve the observed dynamical structure across different amplitudes.
The latent and loss is
where are weighting coefficients for the latent and coordinate errors, and is the number of samples.
For each transverse mode, define the latent actions of an encoded data point
For a trajectory with points , let and be the mean and variance of along that trajectory, and likewise for . The radius loss reads
where is the number of trajectories in a batch, and and weight the horizontal and vertical modes. The loss vanishes when every observed orbit is a circle in the learned coordinates. Normalizing by the mean action gives small and large orbits equal weight, and no model prediction is involved: the loss acts on the encoded data only.
Each training sample consists of an initial value and its image under the map. The network is trained to reproduce this image, by minimizing
where is the number of training samples.
Conservation loss. For each point , assigns the phase advances . For a trajectory with points in the batch, let
and likewise for . The conservation loss is
averaged over the trajectories in the batch. It vanishes when the phase advances are constant along every trajectory, while still allowing different trajectories to have different phase advances.
The total loss combines all components:
where are hyperparameters controlling the relative contribution of each loss component.
Results
The trained model learns an approximate normal-form transformation for the nonlinear symplectic map : a coordinate change
under which the motion, visibly non-circular and amplitude-dependent in the original variables, becomes close to a rotation in the learned variables,
with the block-diagonal rotation of Eq. (2). The phase advances assigned by stay nearly constant along a given trajectory, with standard deviations of – over the trajectories examined. This is the defining property of action-angle coordinates of an integrable system: the angle advances at a constant rate turn by turn, while the action is conserved. The quality of the learned normal form can be quantified by the residual
the mean squared difference, per latent coordinate, between the rotated latent point and the latent point of the true next state.
Figure 3 and Figure 4 show that the learned transformation maps the non-circular orbits of the McMillan-type map to nearly circular orbits in normal-form coordinates. The phase advances produced by remain nearly constant along each trajectory, with standard deviations of order rad, consistent with an integrable map. The SympNet transformation is symplectic by construction, and the rotation is symplectic for fixed phase advances; since the phase advances depend on the state, the full map is symplectic only approximately. At large amplitude, the orbits show noticeable radial dispersion in normal-form coordinates, which grows gradually with amplitude; its cause has not yet been established.

Figure 3. Phase-space visualization and quantitative metrics for a single small-amplitude particle trajectory.

Figure 4. Phase-space portraits of multiple particle trajectories with different oscillation amplitudes.

Figure 2. Loss function during training history.
Figure 3 and Figure 4 indicate that the model retrieved an approximate normal-form (action-angle) coordinate system for this nonlinear symplectic map at small and moderate amplitude; at the largest amplitudes in the training data, the learned orbits are noticeably less circular.
Figure 3 shows this directly: the rotation parameters remain essentially flat across a full trajectory (), and the trajectory traced in the learned space sits close to the reference circle. This is exactly the defining signature of action-angle coordinates: the angle advances at a constant rate turn by turn, and the action (amplitude) is conserved — which is not true of the same trajectory in the original variables, where the motion is visibly non-circular. (The near machine-precision reconstruction error is a consequence of the exact invertibility of the symplectic architecture and serves as a consistency check rather than evidence of the normal form.)
Figure 4 shows where this result holds and where it does not: at small-to-moderate initial amplitudes, the learned contours are noticeably closer to circular than the original phase-space contours. At the largest tested amplitude, however, the learned contour remains distorted and non-convex, meaning the model has not (yet) demonstrated that it has found the true normal-form coordinates there. This may be a genuine physical limit of the system — a real nonlinear lattice/map typically stops being close to integrable past some amplitude (the “dynamic aperture” idea) — or a training/data-coverage limitation; the two have not yet been distinguished.
Taken together, the network has learned to discover numerically the invariant structure of the dynamics, not merely to fit input–output pairs: it found a coordinate system in which this nonlinear problem looks simple. This claim is well supported at small and moderate amplitude and remains open at large amplitude. The degradation at large amplitude may reflect a limitation of the block-diagonal representation, or limited coverage of large amplitudes in the training data; these two causes have not yet been distinguished.
Conclusions and Discussion
We have presented a model that learns the normal-form transformation of a nonlinear symplectic map from tracking data. A SympNet provides an exactly invertible, symplectic transformation to latent coordinates, in which the dynamics are represented as a rotation of each mode with amplitude-dependent phase advances given by FN network. Training uses one-turn pairs drawn from tracked trajectories. The loss weights follow a two-stage schedule that first fits the dynamics and then tightens action conservation. In the first stage, the prediction, latent and phase-advance terms are active from the start, while the action weights are ramped up gradually, so that early training captures the amplitude-dependent dynamics. The second stage continues from the trained networks with a fresh optimizer, a lower learning rate and larger action weights. The resulting model gives stable tune predictions and well-reproduced orbit shapes for small- and medium-amplitude particles (Figure 4); its symplectic structure comes from the SympNet architecture rather than from the loss function.
The proposed method has several limitations. First, large-amplitude orbits show residual oscillations in normal-form coordinates, and increasing the weight of the action loss reduces it only slightly. It is not yet established whether this reflects the block-diagonal form of the rotation or limited training data at large amplitude. Second, because FN computes the phase advances from the full phase-space state rather than from the actions alone, the learned map is symplectic only approximately. Finally, the method has so far been demonstrated only on a McMillan-type map; its application to realistic lattices remains to be tested.
Future work will focus on addressing the above deficiencies to further improve model generalization and physical robustness. Redesigning the loss function architecture is essential to maintain stable and effective symplectic regularization throughout the training process. Moreover, improved latent-space modeling strategies will be explored to eliminate amplitude-dependent systematic bias, enabling high-fidelity beam simulation across full phase-space regions. In summary, the proposed framework provides an efficient and physically reliable surrogate solution for fast nonlinear beam dynamics simulation, offering great potential for future high-precision accelerator lattice optimization and long-term beam orbit prediction.
References
- [1]P. Jin, Z. Zhang, A. Zhu, Y. Tang, and G. E. Karniadakis, “SympNets: Intrinsic structure-preserving symplectic networks for identifying Hamiltonian systems,” Neural Networks 132, 166–179 (2020).arxiv.org/abs/2001.03750
- [2]S. Greydanus, M. Dzamba, and J. Yosinski, “Hamiltonian neural networks,” in Advances in Neural Information Processing Systems 32 (2019).arxiv.org/abs/1906.01563
- [3]É. Forest, Beam Dynamics: A New Attitude and Framework (Harwood Academic Publishers, Amsterdam, 1998).
- [4]A. W. Chao, K. H. Mess, M. Tigner, and F. Zimmermann (eds.), Handbook of Accelerator Physics and Engineering, 2nd ed. (World Scientific, Singapore, 2013).
- [5]É. Forest, M. Berz, and J. Irwin, “Normal form methods for complicated periodic systems: A complete solution using differential algebra and Lie operators,” Part. Accel. 24, 91–113 (1989).
- [6]E. M. McMillan, “A problem in the stability of periodic systems,” in Topics in Modern Physics, edited by W. E. Brittin and H. Odabasi (Colorado Associated University Press, Boulder, 1971), pp. 219–244.
- [7]K. Anderson and Y. Hao, “Koopman operator method for nonlinear dynamics analysis using symplectic neural networks,” in Proc. IPAC’24, Nashville, TN, USA, JACoW Publishing (2024), paper MOPS10, doi:10.18429/JACoW-IPAC2024-MOPS10.DOI