Approximating Nonlinear Forces with Phase-Space Decoupling

Beam tracking software for accelerators typically falls into two categories: fast envelope simulations limited to linear beam optics, and slower multiparticle simulations that can model nonlinear effects. To find a middle ground between these approaches, we introduce virtual coordinates in position and momentum which have a cross-dependency (i.e. p=f(x) where x is an initial position and p* is a virtual projection of momentum onto the position axis). This technique approximates multiparticle simulations with a significant reduction in calculation cost.


Introduction
The software for predicting and correcting beam dynamics in real time is largely dependent on approximations that treat the phase-space density as a single envelope [1,2], while multiparticle tracking codes that can account for nonlinear forces are more CPU-intensive and only suitable for machine design or offline diagnostics [3,4]. In developing the ESS Linac Simulator (ELS), our group intends to incorporate nonlinear tracking without sacrificing real-time diagnostics capability.
Expanding on prior works [5,6], we introduce a multiparticle optimization method by using "virtual" phase-space coordinates that allow for the independent calculation of position and momentum densities. It is important to classify these coordinates as non-physical: they are derived assuming a cross-dependency exists (e.g. p * = f (x 0 ), where p * and x 0 are virtual momentum and real position, respectively).
When used in conjunction with standard techniques for multiparticle tracking, these virtual coordinates allow for the use of monovariate polynomials, which present a significant reduction in the number of required calculations when compared with the bivariate polynomials normally needed.
Although the results to follow consider only multiparticle tests, these techniques may be integrated into beam-envelope simulations by building contour maps from low-particle-count samples.

Theory
For simplicity, we will begin by considering only transverse motion along a single axis with an initial Gaussian distribution (though we will test the resulting approximation in 2D on various initial distributions).
The starting point for this method, outlined in Ref. [6], involves taking particle count N as an invariant as the position and momentum envelopes ρ x and ρ p evolve: where ρ L x and ρ 0 x are the respective final and initial position densities, and likewise for the momentum densities.
To exploit this identity, ρ L x must be independent of p 0 . This can be accomplished using the approximation [7,8] where α and β are the well-known Twiss parameters. Unfortunately, this approximation is only valid if the previous history of the beam is linear (thus maintaining elliptical phase space densities). Since we want an algorithm that remains accurate for iterated nonlinear kicks (which develop irregular density profiles), a new approximation is needed.
Proceeding under the constraint that the initial distribution is Gaussian in both x and p, we can solve Eq. 1 for x 0 and p 0 .
which yields This solution does produce a bigaussian phase-space ellipse, but is unsuitable for approximating p 0 with distributions of an irregular shape. We continue by guessing that a solution exists for p 0 = f (x 0 ) for irregularly shaped distributions. Denoting these solutions as p * and ρ * p for momentum and momentum density, respectively, we have where it is critical to note that p * is solely dependent on x 0 , while ρ * p remains a function of p 0 (and likewise for x * and ρ * x ). With the left-hand-side integrand and integration variables decoupled, it follows (for both x * and p * ): Exploiting particle-count invariance again, and squaring N , we can assert that and thus We can then simplify, treating all p 0 -dependent terms as f (p 0 ): Then, dividing by ρ 0 p dp 0 , the expanded f (p 0 ) terms become zero and we have: By reusing Eqn. 6, all p 0 dependence can be eliminated, leaving where the second solution can be obtained integrating by parts, and, in the case of a Gaussian initial distribution, the placeholder in the denominator is defined as Thus, in contrast with Eq. 4, we have an expression where ∂p ∂x is no longer constant. We now check the following approximation: Where we normalize D using Eq. 4; setting to p * ≈ −p 0 near |x 0 | = 0 , leaving which can be shown numerically to agree with Eqn. 11 for |x 0 | 6 σ x . At this point, the updated particle postition x L can be calculated using an exponential Lieoperator method [9]: where t is elapsed time in the lab frame and the Hamiltonian for a normal multipole magnet in the transverse plane is H = e p k · Re(x 0 + iy 0 ) n a n−1 Here, e, p, m, and a 0 are the fundamental charge, reference longitudinal momentum, particle mass, and magnet-pole raidus, respectively; n = 3, 4, 5... for sextupoles, octupoles, decapoles, etc; and k has units of [T · m −1 ]. In the following sections, longitudinal momentum is normalized to 1 GeV/c and a 0 is set to 20 mm unless otherwise noted. In implementing Eq. 15, H must be calculated symbolically first for each element. Then, p * (x 0 ) and x 0 are substituted in at each step, reducing the bivariate x L (x 0 , p 0 ) to a monovariate x L (x 0 , σ x , σ p ), where σ x and σ p remain constant for a given timestep.  Although an analogous x * (p 0 ) can be derived, it is not useful in practice. Specifically, in calculating Eq. 16 in 2D for position and momentum -x L (x 0 , y 0 , p * x , p * y ) and p xL (x * , y * , p x0 , p y0 ) -the resulting x L expression is dependent on σ x and σ px , while p L is dependent on σ x , σ y , σ px , and σ py , rendering it computationally inefficient. Other schema involving alternate forms such as p L (x 0 , p * ) have been checked, but the following is found to be most stable, with notable performance gains: Where the D subscript denotes a drift space of at least five times the kick length. This effectively limits the technique to a thin-lens approximation. Such drift spaces can be reserved for incorporating space-charge effects, leading to a comparable number of calculation steps using Eq. 17 versus a standard nonlinear beam-physics code. Figure 1 compares the accuracy of multiparticle transformations following Eq. 17 with and without using p * . Also shown are tests for p * = 0 and a "naive" approximation, where p * ≈ p 0 from Eq. 4 is used in the low |x 0 | limit of Eq. 14:

Multiparticle Simulation
To emphasize visible discrepancies, the results shown have their σ values updated after each timestep by taking a new standard deviation. However, if mean absolute deviations are taken instead, an improved matching with the baseline can be observed. Both the naive and null-momentum approximations fail at σ p σ x (i.e. at energies exceeding 1 GeV). Figure 2 illustrates such a case for 2D Gaussian proton distributions with a kinetic energy of 8 GeV passing through an octupole magnet. In the 2D case, beam parameters were derived relativistically from Twiss parameters and B 0 by normalizing the kinetic term in Eq. 16 to the beam's average kinetic energy then verified against Tracewin [10]. 5 10 15 20 Lie Transform Order

Conclusion
For the non-null p * approximations, performance improves with increasing particle count, with increasing magnetic pole count, and particularly with increased order of Lie-transform series truncation (Fig. 3). Since trajectory variations are negligible beyond a 6th-order truncation in most cases, the average reduction in CPU overhead using Eq. 14 is roughly 15%. Similar results were obtained for sextupoles, decapoles, and high-order magnets, as well as with waterbag distributions, despite the assumption of a Gaussian shape in deriving Eq. 14. At low energies (or specifically, any low σp σx ratio), all three approximations tested have essentially identical results, with escalating performance in the following order: p * = (f [erf]); p * = −x 0 · σ p /σ x ; p * = 0 .
For all the approximations tested, trajectories only became unstable in cases where the momentum of the baseline exceeded ∼100σ p . Thus, the major limitation to this technique is its large drift-kick ratio requirement.