ETEAPOT: symplectic orbit/spin tracking code for all-electric storage rings

Proposed methods for measuring the electric dipole moment (EDM) of the proton use an intense, polarized proton beam stored in an all-electric storage ring"trap". At the"magic"kinetic energy of 232.792 MeV, proton spins are"frozen", for example always parallel to the instantaneous particle momentum. This paper describes an accelerator simulation code, ETEAPOT, a new component of the Unified Accelerator Libraries (UAL), to be used for long term tracking of particle orbits and spins in electric bend accelerators, in order to simulate EDM storage ring experiments. Though qualitatively much like magnetic rings, the non-constant particle velocity in electric rings give them significantly different properties, especially in weak focusing rings. Like the earlier code TEAPOT (for magnetic ring simulation) this code performs \emph{exact tracking in an idealized (approximate) lattice} rather than the more conventional approach, which is \emph{approximate tracking in a more nearly exact lattice.} The BMT equation describing the evolution of spin vectors through idealized bend elements is also solved exactly---original to this paper. Furthermore the idealization permits the code to be exactly symplectic (with no artificial"symplectification"). Any residual spurious damping or anti-damping is sufficiently small to permit reliable tracking for the long times, such as the 1000 seconds assumed in estimating the achievable EDM precision.


I. INTRODUCTION
a. Orbit and spin simulation code needed for electric storage rings. The U.S. particle physics community has recently updated its vision of the future and strategy for the next decade in a Particle Physics Project Prioritization Panel (P5) Report. One of the physics goals endorsed by P5 is measuring the EDM of fundamental particles (in particular proton, deuteron, neutron and electron).
Since Standard Model EDM predictions are much smaller than current experimental sensitivities, detection of any particle's non-zero EDM would signal discovery of New Physics. If of sufficient strength, such a source could provide an explanation for the observed matter/antimatter asymmetry of our universe. A proton EDM collaboration [1] has proposed a storage ring proton EDM measurement at the unprecedented level of 10 −29 e· cm, an advance by nearly 5 orders of mag-nitude beyond the current indirect bound obtained using Hg atoms. This paper is limited to the theoretical orbit and spin dynamical formulation within ETEAPOT, which is a newly developed code within the Universal Accelerator Libraries (UAL) simulation environment. The accompanying paper "Using ETEAPOT to resurrect the AGS-Analogue ring for EDM planning" describes the practical application of the ETEAPOT code with emphasis on details of simulation requirements for the EDM measurement.
b. Complications imposed by electric bending. The fundamental complication of an electric ring, as contrasted to a magnetic ring, is the non-constancy of particle speed. A fast/slow separation into betatron and synchrotron amplitudes has become fundamental to the conventional (Courant-Snyder) magnetic ring formalism. But, in an electric lattice the mechanical energy (as quantified by the relativistic factor γ = 1/ 1 − β 2 ) varies on the same time scale as the transverse x and y amplitudes. On the other hand, changing only in RF cavities, the total energy E = γmc 2 + eV (r), which includes also the potential energy eV (r), changes on a slow time scale, which makes a similar fast/slow separation valid.
In the magnetic formalism, since it is only in RF cavities that the mechanical energy varies, the γ factor is invariant in the rest of the ring. Furthermore one is accustomed to treating energy as constant for times short compared to the synchrotron period. To the extent the betatron parameters are independent of particle energy, the betatron and synchrotron motions can then be superimposed.
To most closely mimic this treatment in an electric ring, and to continue to regard γ as the fundamental "energy-like" parameter, requires us to evaluate γ only in regions of zero electric potential, which is to say, not in RF cavities, and not in electric bending elements-in other words, only in field free drift regions. This leads to a curious, but entirely satisfactory, representation in which the particles spend most of their time inside bend elements where γ is varying, and little time in short drift regions where γ is constant. The reason this is fully satisfactory is that the drift regions are closely spaced, and more or less uniformly spaced around the ring. Knowing the lattice functions exactly at those points is operationally equivalent to knowing them everywhere. With this interpretation, one can again rely on the approximate representation of the motion as a superposition of fast betatron and slow synchrotron motions.

II. PARTICLE TRACKING PARADIGMS
The conventional formulation of accelerator physics is based on a paraxial approximation in which all orbit angles are small relative to a central design orbit. Not only is this approximation quite good for small rings, it becomes progressively better as ring radii increase. The most important formulas obtained in this approach are based on linearization of the paraxial orbit equations. For sufficiently small amplitudes orbit evolution can be represented by "transfer matrices" multiplying initial displacements, represented in 6D phase space by six component displacement vectors. By introducing nonlinear "transfer maps" this approach can be extended to larger amplitudes by representing each output variable as a (truncated) power series of terms each of which is a product of initial components, or their squares, cubes, etc. This approach can be referred to as approximate tracking in an "exact" lattice where "exact" means, for example, that magnetic field profiles, fringe fields etc., once represented faithfully by accurate power series, can be subsumed into the previously described truncated power series orbit representations.
The TEAPOT tracking paradigm [3] is very different. It is a refinement of the "kick code" paradigm, under development when TEAPOT was first introduced, about thirty years ago. Though still based on the paraxial approximation, elements are sliced into sufficiently short segments that they can be represented by delta function "kicks", or kinks, where orbit slopes change discontinuously, but displacements are continuous. The main virtue of this approach is that it is symplectic; i.e. particle beams respect Liouville's theorem.
TEAPOT took the more extreme approach of jettisoning the paraxial approximation altogether, and insisting that orbits be constructed only from exactly determined, analytic orbits, interupted where appropriate, by kicks. This can be referred to as exact tracking in an approximate lattice. This approach is restricted by the fact that exact orbits are known only in very special cases; for example in uniform magnetic fields. However, by introducing thin kick elements it is possible to represent actual elements and actual rings to good accuracy. These added kicks may be artificial, meaning they model field deviations from the idealized field, or they may represent the total fields of elements physically present in the lattice. All this is explained in detail in the original Schachinger and Talman paper [3], which remains valid, and in use, to this day. To restrict the length of the present paper, only features newly introduced in ETEAPOT, and not covered in the original paper, are described.
One new feature is the requirement to use electric rather than magnetic bending elements, which brings in the complication already mentioned, that, unlike in magnets, particle speeds are not constant in electric elements. The other new feature is the need to also track the particle spins. To respect the TEAPOT paradigm this further restricts the list of allowable lattice elements to elements for which the BMT equation, an abbreviation for Michel, Bargmann, and Telegdi [4], is exactly solvable. Fortunately it is possible, even straightforward, to meet both of these new restrictions.
The ETEAPOT approach has been developed to address new requirements of the proton EDM project. First is the transition from mgnetic to electric bending. Magnetic tracking codes like TEAPOT and MAD implicitly take advantage of the constant speed of particles in magnetic fields. This seriously complicates the porting of simulation algorithms to electric rings in which the particle speed depends on the local electric potential energy. Thick bending elements are again to be replaced by integrable force fields. As it happens, Inverse square law is the unique force field for which the 3D relativistic equations of motion can be solved exactly. The second major ETEAPOT extension has been the introduction and tracking of particle spin vectors (which provides the EDM signature of the EDM experiment). The differential equation governing spin motion is the BMT equation. In general 3D motion the BMT equations are computationally challenging. But in our idealized elements the BMT equations can be solved exactly, as required by the fundamental TEAPOT/ETEAPOT design principle.
By symmetry, every orbit in a radial force field lies in a plane, referred to here as "the bend plane". This plane is always close to but, in general, not quite identical to the horizontal symmetry of the ring. In spherical (r, θ) coordinates the differential equation governing r(θ) for a relativistic particle orbit in an inverse square law force field can be solved exactly [6]. These are like classical planetary orbits or the orbits in a hydrogen atom treated classically. Even relativistically, every orbit is a precessing ellipse-like (rosette) figure, familiar to Newton in classical mechanics, and for relativistic motion to Einstein, in his general relativistic calculation of the advance of the perihelion of Mercury.
Using (r, θ) polar coordinates, it will be shown shortly that orbit evolution in an inverse square law bend plane is described exactly by , and x = r − r 0 where r is the radial distance from the bend center to the particle position. Then x is the (paraxial) radial displacement from the design central orbit, which is a circle of radius r 0 . This formula is as simple as it is only because the motion is two dimensional. The potential energy depends only on r(θ), permitting the speed, and hence the momentum components to be expressed analytically as functions of θ. In correlating this equation with conventional paraxial treatment, one notes that the independent variable θ here differs from the independent longitudinal variable s, which is the path length along the design orbit; but s and θ advance proportionally in bend elements, with the constant of proportionality being the design radius r 0 .
Each particle being tracked has its own private orbit plane parameters in the orbit equation-though they are all very nearly the same for realistic beams. The parameters in Eq. (1) are interpretable (approximately) as follows: λ is "average" radius, is "eccentricity", θ 0 is the angular deviation from perihelion, and κ (interpretable as the "tune" in accelerator jargon) establishes the betatron phase advance per unit angular advance.
For particle tracking this formulation is simpler than the 3D description of orbits in a uniform magnetic field. One price to be paid for this simplicity is the need to transform each particle into, and later, out of, its private 2D orbit plane (with its own basis vectors) as it enters, and later, leaves a bending element. These transformations, not shown here, are elementary near-identity rigid rotations (including spin).
A more serious price for this exact, "global" coordinate, approach is purely numerical. Though Eq. (1) is analytically exact it is numerically treacherous-the paraxial quantity x is a millimeter scale length compared to r which is very nearly equal to the r 0 which is a large length, such as 40 m. The special numerical treatment needed to handle this issue is discussed below.
In the horizontal y=0 bend plane, a radial electric field with index m power law dependence on radius r is and the electric potential V (r), adjusted to vanish at r = r 0 , is The "cleanest" case, shown in Figure 1, has m=1 and is known as the Kepler or the Coulomb electric field of a point source. One way our case is more general than Kepler's is that our treatment has to be exactly relativistic. This m=1 case can be referred to as "spherical" since the equipotentials are spheres centered on a point charge at the center, and r is the radius in (r, θ, φ) spherical coordinates. For m=1 the Kepler problem can be solved in closed form with the same generality as in the relativistic as in the nonrelativistic case. However the orbits are no longer exactly elliptical, nor restricted to a single plane. The m=0 field is referred to as "cylindrical" and r is the radius in (r, φ, y) cylindrical coordinates. This field is the experimentally easiest to produce, using cylindical electrodes having the same central axis. It has been tacitly assumed that the EDM storage ring bends will be constructed this way, even if the optimal electrode shape would be somewhat different. As already explained, (weak) thin quadrupoles can be used to tailor the fields to overcome this impediment. Curved-planar electrodes produce the electric field shown in Figure 2 c. Solution of the equation of motion. Throughout much of this section formulas of Muñoz and Pavic [6] will be transcribed essentially unchanged, except for bringing symbols into consistency with conventional accelerator notation. The Muñoz/Pavic formulation, though equivalent to various other formalisms describing relativistic Coulomb orbits, is especially appropriate for our relativistic accelerator application. Muñoz and Pavic show that the "generalized"-Hamilton vector is especially useful for describing 2D relativistic Kepler orbits. Our 3D accelerator application can be formulated in such a way as to use only such 2D orbits. Except for scale factors, and a γ-dependent offset, the pair (h r ,h θ ) will reduce to the conventional phase space coordinates (x, x ). 1

FIG. 1.
The bold curve shows a particle orbit passing through a spherical, m = 1, electrostatic bending element. The shaded surfaces are electrodes and the figure is grossly distorted. The "Q" shown at the origin is the "effective point charge" that would give the same idealized electric field as the electrodes.
In accelerator context the evolution of h for any particular particle will be interpretable as the phase space evolution of that particle. We will refer to h as the "MPvector" since, as far as we know, Muñoz and Pavic intoduced it. In the non-relativistic regime h is related to the (nonrelativistically conserved) Laplace-Runge-Lenz vector. As generalized by Muñoz and Pavic, though not quite conserved in the relativistic regime, h satisfies a very simple equation of motion, whose exact solutions are sinusoids, even at arbitrarily large "betatron" amplitudes.
In geometric mechanics jargon [7], the lattice is therefore "integrable". The h formalism then makes it possible to define an implicit transfer matrix (where "implicit" implies the matrix elements depend on each particle's own conserved orbit parameters, a.k.a. "orbit elements"). This has the virtue of hiding the strong coupling between kinetic energy and horizontal position in an electric ring. the generalized-Hamilton vector slightly, for example making it dimensionless rather than a velocity. Dividing by a constant characteristic velocity will bring the formalism more into conformity with standard accelerator terminology. Except for these overhead tildes, in this section, quantities and formulas will be largely copied from M & P; this includes using the abbreviation f for df /dθ. When the formulas have finally been interpreted in accelerator context, the usual accelerator definition of the prime symbol, with f standing for df /ds, where s is arc length, will be adopted. On the design orbit of radius r 0 , where θ and s are both defined, one has s = r 0 θ, and this rescaling merely introduces constant factors r 0 into the formulas.

FIG. 2.
The bold curve shows a particle orbit passing through a curved-planar cylindrical, m = 0, electrostatic bending element. The electrode spacing is g and the design orbit is centered between the electrodes in the y=0 plane.
Though h is not conserved in general, Muñoz and Pavic show (and it will soon become obvious) that h is conserved if and only if the orbit is circular. For the proton EDM lattice the design orbit is circular within bends. Also, for weak-focusing lattices, neglecting the effects of lattice quadrupoles situated between the bends, offmomentum closed orbits are also almost circlular.
But h also has the numerical disadvantage mentioned earlier-transverse displacements (the normally significant aspect of accelerator dynamics) need, at least superficially, to be described by expressions having large cancellations. This makes it essential to use series approximations very carefully, even when the linearized paraxial approximation is fully valid. It is important to organize the evolution formulas in such a way as to exploit cancellations analytically, for example arranging for leading terms to cancel analytically, rather than relying on their numerical cancellation. This can usually be accomplished (without sacrificing exact expressions) by simplifying the sum of the approximately cancelling terms and keeping track and restoring any discrepancy. This recovers numerical precision for small amplitudes comparable to that achieved in conventional Courant-Snyder formulation.
Another inconvenient aspect of the Muñoz/Pavic formalism is the fact that the design, central orbit is degenerate in the sense that it is, in fact, the arc of a perfect circle. This is precisely the condition in which the perihelion (or aphelion) angular orbit element is undefined because the radius vector length is independent of angular position. This ambiguity is most important in the time of flight calculations needed for accurate modeling of synchrotron (longitudinal) oscillations-a calculation that strains the numerical accuracy because all path lengths are so nearly equal.
These same considerations complicate the derivation of explicit (meaning the elements are independent of particle coordinates) transfer matrices and their generalization to truncated power series transfer maps. This also is only a inconvenience that can be worked around.
With qualitative discussion complete, the analytic formulation can begin. The Lorentz force equation in the m=1 spherical case is where k is the customary MKS notation for 1/(4π 0 ) except for implicitly including also the (point) charge factor. On the central orbit the centripetal force equation is where k, like E 0 , the on-axis electric field, is defined to be positive. In UAL, as in the MAD simulation code, energies like p 0 c are always expressed numerically in GeV units, such that their numerical value in the computer is 10 −9 p 0 c/e, giving them GV units-an MKS unit. From Eq. (6), k/e=(p 0 c/e)β 0 r 0 and k is always expressed in the computer as 10 −9 k/e, which gives it GV-m units-also an MKS unit. The on-axis electric field E 0 is measured in GV/m units. In these units k = E 0 r 2 0 , numerically, with r 0 measured in meters.
A particle's angular momentum is In terms of the design momentum p 0 and the design radius r 0 , L 0 = r 0 p 0 , and k L 0 c = β 0 (= 0.598379 for pEDM).
Like k, internally (i.e. in the computer), L 0 c is expressed numerically as 10 −9 L 0 c/e. For internal numerical values to be most easily substituted into an analytic external documentation formula, factors should be grouped as pc/e, Lc/e, k/e, etc. or, as here, k/(Lc), and factors of 10 9 (for eV to GeV conversion) put in "by hand". Eq. (8) is also useful in the form In SXF lattice description files (discussed further in the accompanying paper [2]) the RF parameter V actually stands for 10 −9 times the maximum energy change in eV of charge e passing through the RF cavity. One shows easily that both the total energy (where the "I" superscript on γ I re-emphasizes that this relativistic factor has to be evaluated "inside" the bend element, where it depends on the local electric potential) and the angular momentum are constants of the motion. It has been necessary to distinguish between the Muñoz potential energy eV M and our potential energy eV , because our potential vanishes on the design orbit, while theirs vanishes at infinity. For the design orbit, using Eqs. (9) and (10), one obtains (The curious presence of γ 0 in the denominator follows from the definition of potential energy.) Using the obvious unit vector relations (valid for motion with angle θ increasing)θ = −r, andr =θ, where primes stand for d/dθ, the Lorentz equation can be re-expressed as Defining covariant velocity u = γ I v, and using Eq. (11) to express dθ/dt in terms of L, the u equation of motion is Muñoz and Pavic then introduce the generalized Hamilton vector which we refer to as the MP-vector. It is specially tailored so that the differential equation for h reduces to (The previously mentioned constancy of h on circular orbits is evident from this equation, since γ I is constant on, and only on, circular orbits.) Using where the new parameter κ (soon to be identified as horizontal betatron "tune") is defined by On the design orbit (Of course κ 0 will not be controlled to this accuracy in practice and, in any case, quadrupoles and drifts in the lattice will alter the ring tunes.) Solving Eq. (18) for r, the orbit equation in bend elements can be expressed in terms of h θ ; where The parameter λ is especially important in the storage ring context, because the second term in the denominator of Eq. (21) is both small compared to the first, and oscillatory. As a result λ can be thought of loosely as an average radial position. (As earlier, the "constants of motion" L, κ,¯ , and λ are to be referred to as "orbit elements". Though constant along any single particle orbit, they are different (though only very slightly) for each individual particle.) In component form Eq. (17) is The relativistic factor γ I (equal to (E M + k/r)/(m p c 2 )) can be expressed in terms of h θ . First, eliminate r in favor of u 0 using the first of Eqs. (18), then eliminate u 0 if favor of h θ , and, finally, solve for γ I ; Needed for simplifying Eqs. (23), differentiating this equation yields (Heuristically, this expresses the dependence of mechanical energy accompanying the change in potential energy associated with change in particle position.) After several lines of algebra, Eqs. (23) then reduce to These are the equations that justify having introduced the generalized Hamilton vector. Their general solution can be written as where θ is a running angle in the interior of the bend and θ 0 is an angle to be determined, along with C, by matching to the known initial conditions. These new "orbit elements", C and θ 0 , are expressible in terms of the previously defined orbit elements. They are now to be used to parameterize the true, particle-by-particle orbits through the bend element. (As explained elsewhere, the effects of the small deviations of the actual electric field from the Coulomb field are to be corrected for by virtual delta function kicks between bend slices.) Concentrating on h θ , and defining θ to be zero at the bend entrance, we have These equations determine C and θ 0 to satisfy The initial conditions for h θ need to be determined from the known coordinates of the particle just as it enters the bend region. From its defining Eq. (16), Note that γ, like L, is a running, particle-specific probe variable. updated on every entry to or exit from a bend element. When inside the bend it is equal to γ I , but γ varies discontinuously as the particle passes bend edges (off-axis). In Eq. (18), for any particular particle, r is the only factor which is not a constant of the motion. We therefore have (31) The second of Eqs. (29) can then be used to fix θ 0 , but this requires resolving the multiple-valued nature of the inverse tangent function. One hopes this can be done by requiring r to be "smooth" (continuous, with continuous slope) across the bend entrance edge. Even this is tricky since, for non-normal incidence, there is a refractive deflection 2 at the boundary. This deflection is small, especially near normal incidence, which is always true in our case. To resolve the inverse tangent ambiguity for non-normal incidence it would usually be sufficient to choose the value for which the slope is most nearly continuous. But to be safe one has to account explicitly for the refractive kink.
From Eq. (21) the radial coordinate r is given by This is the orbit equation previously introduced in Eq. (1). Borrowing terminology from solar planetary orbits about the sun, from its structure, one sees that θ 0 is either the angle at perihelion, or aphelion, depending on the sign of . In multi-million turn tracking, there are many opportunities to misidentify aphelion and perihelion or to obtain the wrong sign for -this complication is associated with the degeneracy of the central orbit that was mentioned earlier.
Using Eqs. (22), (29), and (32), By expressing the small parameter , proportional to the small Hamilton vector value and slope (or rather their quadrature sum), this formula is essential to the implementation of the Muñoz/Pavic approach. (These "small" quantities can even be infinitesimal in the analytic treatment.) From these equations one has obtained simple analytic parameterizations for x(θ) and γ I (θ). In particle tracking one knows x in to high accuracy and wishes to find x out , also to high accuracy. Their difference is given by This manipulation has suppressed the harmful cancellation exhibited in Eq. (32) which gives r rather that the radial displacement from the design orbit. Eventually, when deviation from 1/r 2 electric field dependence is modeled by thin virtual quadrupoles, to improve precision, one will slice the bends finer and finer.
In the context of accelerator physics one can ask for the similar evolution equations for vertical coordinate y. But this question is inappropriate; the Kepler orbit lies, by definition, in a single plane and we always choose the ETEAPOT the refractive corrections are included at all bend edges and neglected at all other edges. At bend field edges there are also fringe field corrections (which are especially important sources of spin decoherence.) The fringe field and refractive corrections are evaluated separately and simply superimposed at every bend edge.
propagation plane to be the plane containing the incident velocity vector. Instead of keeping track of y we have to keep track of the orbit plane or, equivalently, the normal to the orbit plane. This vector changes discontinuously (but only by a tiny angle) in passing through thin multipole elements. It is undefined in drift regions and is constant in bend elements. Keeping track of the orbit plane is covered in later sections.
d. Rescaling of the MP-vector and updating the horizontal slope. For updating the horizontal slope component, we introduce the previously-announced rescaling of the MP-vector; Dividing by the design velocity v 0 has rendered h dimensionless, and the further factor of γ 0 in the denominator simplifies matching to conventional lattice function representation. At this time we also switch definitions of the prime operator notation so that f ≡ df /ds, where s is arc length along the design orbit. With this revised notation Eqs. (26) become Finally it is possible to make contact with more familiar accelerator variables, such as p x and p s , the radial and longitudinal particle momentum components. From the definition ofh r in Eq. (16), after rescaling (35), the transverse momentum is given by where p 0 = γ 0 m p v 0 is the design momentum and p [1] is the symbol used for x internally in the UAL code.
(Some components in the chain of equalities in Eq. (37) may assume paraxial approximation, even if for no reason other than that the definition of x is unambiguous only in the paraxial limit.) So h r is nothing other than the phase space coordinate conjugate to x, namely dx/ds. When applied at the exit of a bend, the value of x given by Eq. (37) would better have been called x out,− , since the refractive compensation associated with exiting the bend would still need to be made to produce p [1] valid just outside the bend exit.
Potential loss of numerical precision is always an issue. A compact, numerically accurate way to update the 2D phase space coordinates is to work directly from Eq. (32). For bend angle ∆θ, the argument θ − θ 0 is ∆θ. The increment in x from input to output is Differentiating Eq. (32) produces Including the change of independent variable from θ to z, the increment from input to output is These formulas avoid taking the difference of nearly equal terms.
e. Pseudoharmonic description of the motion. In general the MP plane will be close to, but not exactly identical with the horizontal lattice design plane. In this section, for simplicity in making contact with Twiss functions, these two planes will be treated as equivalent.
At this point we wish to correlate the dynamic quantities introduced so far with more familiar (to accelerator scientists) quantities such as Twiss functions, betatron phase advances, transfer maps, and so on. The relationships are especially simple for a combined function, weak-focusing ring; this will be described before developing the full Twiss function formulation needed for separated function lattices. In general, the definition of lattice functions within electric bend elements will be more complicated, but also not very important for the EDM experiment.
Eq. (36) yields In traditional Courant-Snyder (CS) formalism the betatron phase ψ and the positive-definite lattice function β(s) are related by Even with θ = s/r 0 , because β(s) is not necessarily constant, the angles ψ and θ = s/r 0 , though monotonically related, are not strictly proportional. The virtue of the beta function formalism is primarily due to its ability to describe each orbits in a complicated lattice as a sinusoidal function of unambiguous phase advance ψ. Shortly we will have to admit that our generalization of the CS formalism to electric lattices will be limited, in principle, to describing orbits outside bending elements, where the electric potential vanishes. The parameter β introduced now will be applied inside bends, and it is assumed to be independent of s. Furthermore it will not match up smoothly with the adjacent outside β functions. This reflects the small discontinuity in particle kinetic energy at bend edges.
In practice this issue is largely academic. In any realistic ring there are many drift spaces, more or less uniformly distributed. Especially with the weak focusing expected in EDM rings, the ranges of β function variations will be quite limited. Simply interpolating the (slightly ambiguous) beta functions in the bend regions from their (reliably known) values in the drifts should be sufficient for most purposes.
As already stated, our electric lattice model admits only uniform, inverse square law bending elements (though with artificial thin trim elements). Within such a bend we approximate β ≡ dβ/ds = 0 and horizontal"betatron" oscillations of amplitude a are described by Differentiating once more yields Substituting this into Eq. (36) produces Just as h r and h θ vary "in quadrature", so also do x and x . The ratios of their maxima are Collecting results, we have (Remember that these x and x values are only the precise Frenet-Serret laboratory coordinates when the M-P plane coincides with the horizontal laboratory reference frame, which is always a good approximation.) To summarize, one sees that, to linearized approximation, the components of the MP-vector are, except for scale factors, identical to the betatron phase space components. The parameter β has been used in this section only to produce familiar-looking formulas. For a weak focusing ring we now see that this β need never have been introduced, since it is just an abbreviation for r 0 /κ. It does not depend explicitly on s, but through its κ factor it depends on γ, x and x , and is therefore different for different particles.
f. Revolution period. For modeling longitudinal dynamics it is critical to obtain the revolution period T rev. to good accuracy for every particle. From Eqs. (11), (24), (27), and (32) one has To obtain time of flight dt/dθ has to be integrated over θ.
Both integrals can be evaluated in closed form to obtain t as a function of θ. However the formulas are complicated and their evaluation is numerically treacherous, for reasons discussed below. For the study of longitudinal dynamics and synchrotron oscillations what is needed is the deviation of the time of flight from the time of flight of the design particle. This is a very small difference of two large numbers. Eq. (48) can be recast as Here ∆θ = θ − θ 0 , the factors A and B (both of which deviate little from constancy and can never become "small") replace the other factors in Eq. (48), and A 0 is the values of A on the design orbit. All of the factors A, B, A 0 , , and κ are constant on any particular orbit being followed, and all have values very close to their values on the design orbit. The only variable factor is ∆θ. The first two terms cancel approximately, which makes the evaluation of the first term critical. The third term requires no special treatment since theC factor is already differentially small. The cancellation tendency can be ameliorated by adding and subtracting a term HereC = /˜ has been obtained using Eq. (32). In Eq. (50) all terms are differentially small and the small differences of large numbers have been moved outside the integrals. For the proton EDM experiment, since | | never exceeds 1/1000, the integrand can be expanded in powers of before integrating. A typical leading term in these integrals is ∆θ multiplied by a constant factor. While using this time of flight formalism ETEAPOT includes this term as well as terms with extra powers of up to 5 and does not check automatically that this last term is, itself, negligible. An alternate, seemingly more robust, hybrid time of flight calculation, now used by default in ETEAPOT, is desribed later.
A subtle feature of the time of flight evaluation results from the fact that the ellipticity vanishes on perfectly circular orbits (of which the design orbit is one). This causes the angle θ 0 , which is the angle to perigee, to be indeterminate because perigee is indeterminate on a circular orbit. Eq. (32), the second of Eqs. (22) and Eq. (29) force to be non-negative. And yet the major and minor axes can switch from prolate to oblate when an arbitrarily small kink is applied to an orbit for which is close enough to zero. When this happens the angle θ 0 advances discontinuously through π/2. When this hap-pens the angle θ also advances discontinuously through the same angle.
These changes do not affect the integrals in Eq. (50) which depend only on θ−θ 0 . They do, however, make the time of flight calculation hyper-sensitive to the determination of θ 0 , which can change erratically in progressing from one bend element to the next, after passing through a straight section which possibly contains a quadrupole. A discontinuous change in θ 0 can change the analytic, closed-form indefinite integrals used in applying Eq. (48).
IV. TRANSFORMATION FROM LOCAL FRAME TO MP FRAME.
g. Determination of the MP bend plane. In order to reserve x for radial displacement in the Muñoz-Pavic (MP) bend plane we now use overhead bars to designate conventional Courant-Snyder (CS) coordinates. At a location where the longitudinal coordinate has been shifted to be z = 0, the particle position (x,ȳ, 0) is given by Scaled angular momentum components are then given bỹ The scaled central angular momentum isL 0 = −ŷ, and the perpendicular componentL ⊥ is which defines two (small) angles the tilted bend plane makes with true vertical. This equation determines the (small) rotation angles about transverse axes that rotate the horizontal plane into the MP plane. The trigonometry is not exact. But it is accurate enough for the extremely small angles involved. h. Merging 2D MP-tracking into 3D. With the orbit geometry being worked out in the 2D MP plane, it remains necessary to transform back and forth to the local 3D Frenet frame. The goal of a tracking calculation is to obtain the output particle radius vector r out for a given input particle radius vector r in . The corresponding unit vector evolution is fromr in = (x in ,ŷ in , 0) tor out . We calculate this unit vector evolution first.
On the design orbit the input and output vectors arê d in = (1, 0, 0) andd out = (cos θ, 0, sin θ), both lying in the horizontal (xz)-plane. With the design bend angle defined to be θ, one haŝ The particle-specific bend angle φ, in its own bend plane, satisfiesr where φ is close to, but not equal to, θ in general. Letting a and b = ±|b| = ± √ 1 − a 2 be the components ofr out alongd out , one haŝ r out = (a cos θ, ± 1 − a 2 , a sin θ).
(For clockwise orbit) the unit vector normal to the bend plane,n is known from calculations based on the particle coordinates at the entrance to the bend element. To determine a we require 0 =n in ·r out = n x a cos θ ± n y 1 − a 2 + n z a sin θ. (60) Solving for a, a = n y n 2 y + n 2 x cos 2 θ + 2n x n z cos θ sin θ + n 2 z sin 2 θ .
(61) The angular advance φ then satisfies cos φ =r in ·r out =x in a cos θ +ŷ in b.
The radial coordinate is then given by Eq. (21) which is repeated here; where h θ is given by Eq. (27). The output radius vector is then given by In this way the evolution can be completed using just Courant Snyder coordinates. i. Electric sector bends with field index m. The Muñoz and Pavic, Hamilton vector approach described so far, though ideal for fast exact particle tracking, is less well matched to developing the Courant-Snyder Twiss function description conventional in accelerator theory. A more conventional approach is taken in this section. As well as enabling a truncated power series formalism for electric rings, the results can be used for corroborating results already obtained. This includes independently confirming the integrable dynamics demonstrated for m=1. Though discovered using the Muñoz/Pavic approach, this remarkable integrability property must necessarily be derivable also in the paraxial-based approach. Initially this treatment will be generalized to include field indices other than m = 1.
To produce weak vertical focusing the radial electric field has to fall off as 1/r 1+m , with m > 0. The m = 0 case is singular, and leads to a logarithmic potential. 3 Introducing design radius r 0 and central field −E 0 the electric field for y=0 is The electric potential V (r), adjusted to vanish at r = r 0 was given earlier in Eq. (3). The independent (longitudinal) coordinate s is to be replaced by the angular coordinate θ θ = s r 0 .
Following standard treatments of relativistic Kepler orbits [8][9] [10][11], we change dependent variable from x(s) = r − r 0 (with independent variable s) to a (dimensionless) dependent variable ξ(θ) (with independent variable θ); Note that ξ is proportional to x for small x and that, notationally, x ≡ dx/ds and ξ = dξ/dθ. The present 3 Integrating the electric field from r = 1 to r = 1 + ∆ one reconstructs the potential from the electric field-call itṼ . Its value at r = 1 + ∆ is The logarithmic potential can be seen to be a degenerate form required for m = 0, where E ∝ 1/r. The electric field corresponding to this potential is E ∝ 1/r 1+m . This shows howṼ approaches the logarithmic potential in the limit of small m.
discussion is limited to planar orbits, in which case the definition of x by r = r 0 + x is the usual Frenet-Serret definition. For 3D motion this definition is not quite exact but realistic vertical amplitudes will always be small enough that the effect on x of projection onto the horizontal plane will be neglected. The identity will be prominent in subsequent formulas. Inverse relations are With ξ regarded as a function of θ and x as a function of s, the abbreviations ξ = dξ/dθ and x = dx/ds have been used. For simplicity in describing the approach to be taken, we temporarily specialize to the m=0 "cylindrical" case. The electric potential V (r), adjusted to vanish on the design orbit, is The design parameters are related by where p, v, and β are proton momentum, velocity, and v/c. The momentum vector components are defined by The electric force alters only the radial momentum component dp r dt = −eE 0 r 0 r .
For m=0 the invariance of the system to translation along the y-axis, causes p y to be conserved, and to invariance under rotation around the central axis, causes L y , the vertical component of angular momentum, to be conserved. For a particle in the horizontal plane containing the origin the angular momentum vector is (75) The design orbit angular momentum is We seek the orbit differential equation giving dependent variable r as a function of independent variable θ. The (conserved) total proton energy E is the sum of the mechanical energy and the potential energy Squaring this equation yields The terms on the right hand side of this equation can be expressed in terms of r, dr/dθ, and conserved quantities. From Eqs. (73) and (75), p r can be expressed similarly using Eq. (73); p r p θ =ṙ rθ = 1 r dr dθ , and hence p r = L y r 2 dr dθ .
Making these substitutions yields When the field index m was first introduced it was visualized as being a small number, just large enough (and positive) to produce some vertical focusing. But the subsequent analysis has not relied on m being small. Generalizing the previous formulas for arbitrary m values, and expressing the in-plane momentum in terms of angular momentum L y , ξ and ξ , the mechanical (total minus potential) energy can be expressed in terms of particle mass and momentum components. This generalizes Eq. (81) for arbitrary m; Differentiating this equation with respect to θ, and simplifying, This equation can be reduced to quadratures but, the subsequent integral cannot be performed analytically for noninteger m values, and only with difficulty, if at all, for m values other than 1.
j. Specialization to m = 1 Planar Orbits. The formulas just obtained simplify spectacularly for m=1. For example, the electric potential (defined to vanish for ξ = 0) is given by To obtain the orbit equation we can start from Eq. (83), specialized to the spherical electrode geometry shown in Fig. 1.
Eq. (83) becomes especially simple for motion in the y = 0 plane with m=1; The last form implicitly defines abbreviations Q x and ξ co . It also introduces a representation of transverse displacements as the superposition of a "betatron" part and an "off-energy" part. It can hardly be over-emphasized how simple this equation of motion is. When expressed in terms of ξ the motion is not only simple harmonic, it is simple harmonic for arbitrarily large oscillation amplitudes. The only reservation is that ξ cannot exceed 1, at which point r=∞.
For our application the coefficient Q 2 x is positive, which means there is horizontal focusing with horizontal tune Q x given by The off-energy central orbit is given by With L y and E allowed to vary, (especially in RF cavities, but not within electric bend elements) the parameters Q x and x co have to be regarded as locally, rather than globally, defined. It is important to notice though, that the parameters entering the definitions of both Q x and ξ co are invariants of any given particle's motion. The quantities E 0 and β 0 are obviously invariant because they are properies of the on-energy central orbit. The quantities E and L 2 y are invariant by conservation of energy and angular momentum, but they are, in general, (slightly) different for different particles.
k. Particle-specific transfer matrices. In practice there will be drift regions, quadrupoles, RF cavities and other apparatus in the ring, not to mention artificial thin quadrupoles inserted within the bend to compensate for actual field index differing from m=1. Eq. (85) will be applied only within individual sector bend elements. But the simplest possible application of the formulas has a single element bending through 2π-which is to say, making up the whole ring. The x motion described by linearized treatment is only sinusoidal for small amplitudes. But, since the denominator is a periodic function of θ, x(θ) has the same period. For the frozen spin value β x = 0.59838, with orbits close enough to circular that L ≈ L 0 , the tune is Q x = 0.8012. (Notice that the parameter Q and the Muñoz parameter κ are identical parameters.) Our equations, being fully relativistic, are valid in the nonrelativistic limit β 0 → 0. In the nonrelativistic limit the orbits are simply Keplerian planetary orbits, which are known to form closed ellipses, corresponding to Q x =1. So one can say that the shift of Q x away from 1 is a relativistic effect. 4 An orbit having initial vertical displacement or slope leaves the horizontal (design) plane. It nevertheless lies 4 As a curiosity, one can evaluate the corresponding tune shift of the orbit of planet Mercury around the sun. We pretend the orbit is circular (when in fact its eccentricity is = 0.21, yielding, for fixed total energy, (L/L 0 ) 2 ≈ 1/(1 − 2 ) ≈ 1.04.) Mercury's mean orbital velocity is 47.87 km/s so β 0 = 1.596 × 10 −4 and Qx ≈ 1 − β 2 0 /2 = 1.27 × 10 −8 ; this represents a negative fractional advance of the perihelion each turn. (Our electrostatic formulation amounts to accounting for the relativistic increase in inertial mass with no corresponding increase in gravitational attraction.) Since its orbital period of 0.241 years, Mercury completes 100/0.241=415 revolutions in 100 years. Meanwhile, its Einsteinian general relativistic perihelion advance is 43 arcsec. Expressed as a fractional deviation per revolution, this is 43/(360 × 3600 × 415) = 7.99 × 10 −8 . It appears, therefore, that the perihelion advance is reduced by about 16% by the special relativistic inertial increase. This is roughly consistent with Chandler [12]. in a single plane, and its evolution is the same as if it were in the design plane. From this point of view Q y = 0. On the other hand, if one insists on interpreting non-zero y values as vertical betatron oscillations, the vertical tune is Q y = 1. This is an unusual example of "tune aliasing".
For pure horizontal betatron oscillations For propagating the radial displacement ∆ξ = ξ − ξ co , one can introduce cosine-like trajectory C ξ (θ) satisfying C ξ (0) = 1, C ξ (0) = 0 and sine-like trajectory S ξ (θ) satisfying S ξ (0) = 0, S ξ (0) = 1. They are given by For describing evolution of (ξ, ξ ) from its initial values (ξ in , ξ in ) at θ = 0 to its values at θ one can use the "transfer matrix" defined by where C ≡ cos(Qθ) and S ≡ sin(Qθ), to give or, spelled out in inhomogeneous form, The subscript ξ on M ξ and its components is to serve as a reminder that this matrix is particle-specific, and is therefore not a transfer matrix in the conventional, linearized, particle-independent, sense. In spite of appearing superficially to be linearized, M ξ describes nonlinear motion, and is exact for all amplitudes. Eq. (92) can be written more compactly as l. Propagation Through a Sector Bend Starting from known coordinates (x in , x in− ) just preceding the entrance to a sector bend, where the electric potential vanishes, one presumably knows E and, therefore, (In our hard edge approximation) just past the entrance, x, E, and p x are unchanged, but the other dynamic variables have changed. In particular, using conservation of p x , This has determined x in+ . The last expression has been arranged to give not just the magnitude, but also the sign of x in+ . (The argument of the square root can never change sign.) Notice that this calculation has included the (very small, because of near-normal incidence) "refractive" bending at the interface. Using Eq. (68), initial coordinates (ξ in , ξ in ), just inside the sector bend can be obtained; Note also that L y , which is proportional to (r 0 + x)p z changes according to with both numerator and denominator known from earlier formulas. From Eqs. (86) and (87) it can be seen that L y is the only variable parameter in the definitions of Q and x co ; (not counting changes in E occurring in RF cavities).
Q and x co can be updated accordingly. With the updated version of x co one can determine ξ in − x co which is needed as an input for the bend element transfer matrix.
From the known bend angle ∆θ, cosine and sine factors C and S can be calculated, and all elements of transfer matrix M ξ determined. Then, using Eq. (93), one obtains the components (ξ out , ξ out ) just before the exit from the sector bend.
To get out of the bend element the steps taken at the input have to be reversed.

VI. TIME OF FLIGHT AND LONGITUDINAL PHASE SPACE DYNAMICS
The treatment of orbits has been based on positions, slopes and momenta, with no need for velocities. To calculate time of flight, velocity is required. These calculations will proceed in parallel with the orbit calculations but they are described separately here to emphasize the essentially different evolution of position r(θ) and ct(θ), which is the arrival time (expressed as a length) relative to that of the central particle. With all quadrupoles and multipoles treated as thin in ETEAPOT, the only contributions to time of flight come from drifts and electric bend elements. The only essential complication comes from the dependence of particle speed on position.
Even apart from their different velocities, with all orbits very nearly parallel, the path length is very nearly the same for all particles. Yet synchrotron oscillation dynamics depend sensitively of their time of flight differences. Furthermore, the main reason the spin coherence time SCT can be long is the strong tendency for excess spin precession to cancel over complete synchrotron oscillation cycles. To the extent this cancellation depends nonlinearly on synchrotron amplitude the SCT is impaired. These considerations make time of flight calculation difficult, yet important.
As shown previously, in the m = 1 Muñoz/Pavic treatment the time of flight integrals can be evaluated exactly and in closed form. But the resulting formulas are quite complicated, and numerically treacherous, because they contain (multiple-valued) inverse tangents and cotangents. Formulas are given in the ETEAPOT user manual [13].
In the paraxial approach (in spite of previously having been shown to be "integrable" for m = 1) the time of flight integral cannot be expressed in closed form. But, after power series expansion, the integrals are elementary. The resulting power series is so rapidly convergent that accuracy to machine precision is quick. We have found this approach more robust than the Muñoz Pavic approach for analysing longitudinal motion. This formulation is described next.
m. Kinematic variables within electric bend elements. For the m = 1, inverse square law case being emphasized, the electric field and electric potential are given by Eqs. (2) and (3); The latter equation, along with Eq. (92), permits the potential energy to be expressed in terms of θ and initial conditions.
Then γ(θ) is obtained from (100) From this formula one can obtain β(θ) using From the y-component of Eq. (75) we also have, for motion in the horizontal plane, Warning: Note that, with right-handed Frenet coordinates, and clockwise orbit (which we now assume) L y is negative. This accounts for the negative sign in Eq. (102). The right hand side of this equation can now be expressed in terms of θ, invariants and initial conditions. The negative sign (−L y ) is specific to clockwise orbits, with θ increasing along the orbit. There seems to be no universally accepted sign convention distinguishing clockwise and counter-clockwise beam evolution in storage rings. This sign ambiguity causes the tracked time of flight variable ct to also be ambiguous. The appropriate RF phase is then, similarly, ambiguous. n. ξ evolution and convergence estimates. Using Eq. (68), initial conditions (ξ 0 , ξ 0 ) have been expressed in terms of initial x conditions; The evolution of x is obtained using Eq. (92), whose upper equation yields This formula can be used to give ξ as a function of θ, for example when calculating times of flight. Then , and r(θ) = r 0 + x(θ).
For the proton EDM experiment the value of radius r 0 will be, say, 40 m. An initial value x 0 = 1 m would be unrealistically large. It is better therefore to use centimeter units. Then r 0 = 4000 cm, and the initial displacement of a cosine-like trajectory is 1 cm. With the electrode spacing being 3 cm, a unit-amplitude, cosine-like trajectory happens to have something like a maximal amplitude. Dropping terms of one higher order, for example from quadrupole order to sextupole order, therefore amounts to making an error of about one part in 4000. An error of this magnitude is likely to be unimportant unless some resonance causes its repeated effect to accumulate constructively over many turns. o. Time of flight through bends. A formula for the time of flight has already been given in Eq. (48). Since this form is integrable, it gives the exact flight time in closed analytic form. However it has the disadvantage that the angle θ 0 (which is the angle to "perihelion") is hard to determine unambiguously, because it is multiplevalued, and because perihelion is indeterminate for circular orbits. The most important circular orbit is the design central orbit and, depending on elements encountered in the ring, the local angle to perihelion can vary erratically.
It is useful, therefore, to have an alternate, highly accurate, though not necessarily analytically exact, form, to accompany the Muńoz form developed earlier. From Eq. (102) the time of flight dt, expressed as a distance d(ct) is given by Note that the variable factor r 2 has been replaced using Eq. (69) and that the parameters Q and ξ co , though invariant, are particle-dependent as in Eqs. (86) and (87).
(The proliferation of "/e" factors is for convenience in converting electron-volts to MKS energy units.) Formula (106) can be checked on the design orbit where ξ = 0, using L 0 c = −m p c 2 γ 0 β 0 r 0 ; which is correct. The time of flight through an element with angle ∆θ is given by (where, for clockwise motion, −L y is positive). Over the corresponding sector the time of flight of the design particle is The increment in time relative to the design particle is The integrand can be expanded in a series in ξ; All the required integrals (over the range from 0 to ∆θ, which is the bend angle) are elementary-the integrands are integer powers of sin Qθ or cos Qθ, and the series in Eq. (112) is rapidly convergent. It is important to remember that quantities, in this case L y , which are discontinuous in the transition from just outside to just inside a bend element, have to be updated to the value inside before evaluating these A i coefficients. Because ξ 2 is necessarily positive while ξ can have either sign, the "quadratic" term proportional to ξ 2 may compete with the preceding "linear" term proportional to ξ, which can have either sign and will tend to cancel on the average. As has been stated repeatedly, since the coefficients are particle-dependent, this formula has to be performed individually for every particle at every bend, p. Time of flight through straight sections. Different particles also have different flight times through drift sections or multipole elements of length . The path length excess is approximately and the off-speed correction is The total effect is or, more directly, q. Time of flight due to vertical oscillation. For bends only the projection of the orbit onto the horizontal plane has been found so far. It remains to evaluate the time of flight ascribable to vertical betatron motion. We assume there is no direct coupling between x and y.
We also neglect the effect of the small speed variations accompanying horizontal oscillations. Also neglecting the small bending in sufficiently-finely sliced bend elements, we treat them as straight. With these approximations the bend element is treated as a drift as far as vertical oscillations are concerned. The off-velocity effect has already been included in the horizontal calculation. Copying from Eq. (116),

VII. LUMPED CORRECTION FOR FIELD INDEX DEVIATION
Analytic propagation formulas have been given for 1/r 2 radial dependence of the electric field. The actual radial dependence will deviate from this, with m, the deviant field index, having been defined in Eq. (2). E ∼ 1/r 1+m , so m = 1 for the Coulomb's law field dependence. For this, the "spherical" case, the orbit equations have been solved in closed form.
The ETEAPOT strategy, even for m = 1, is to treat sector bends as thick elements with orbits given by the analytic m = 1 formulas. The m = 1 case is handled by inserting zero thickness "artificial quadrupoles" of appropriate strength. As with TEAPOT, this approximation becomes arbitrarily good in the thin slicing limit. Though the idealized model differs from the physical apparatus, the orbit description within the idealized model is exact, and hence symplectic. For too coarse slicing, even though the orbit deviates from the "true" orbit, it remains "exact" (for a lattice with that slicing). One blames the inaccuracy on the fact that the lattice model deviates from the true lattice, not on the fact that the equations are being solved approximately. By varying the slicing one can judge from the limiting behavior what degree of slicing is appropriate.
In a magnetic fields there is "geometric" horizontal focusing even in a uniform field. (For example a cyclotron orbit with non-vanishing initial slope returns to its starting point after one full turn-its horizontal tune therefore being 1.0.) A deviant field index m introduces further horizontal and vertical focusing terms of equal magnitude, but of opposite sign, into the focusing equations The corresponding focusing strength coefficients in electric fields are [14] K (m) Note that for m = 0 (the "cylindrical" case) there is no vertical focusing. With the electric field being independent of y for cylindrical electrodes, this is obviously correct. (The subscript "1" indicates "quadrupole" order; a more careful treatment brings in higher order corrections.) The parentheses segregate the geometric focusing (which is independent of m) from the gradient focusing (which vanishes for 1/r field variation). Re-writing these equations for our spherical m = 1 case; With our sign convention, positive K-value corresponds to focusing. Hence, for example, there is already "one unit" (in units of 1/r 2 0 ) of vertical focusing in the Coulomb case. In the ETEAPOT formalism the focusing given by Eqs. (120) is already implicitly included since the particle orbits are being tracked exactly.
For modeling the focusing for m values other than m=1 the focusing coefficients we need are given by Eqs. (119). The geometric focusing terms already match but we have to make up the differences in gradient focusing: These are the coefficients of the distributed focusing we have to apply to "convert" the Coulomb formulas to model the actual m value. The pure m=1 Coulomb field itself provides "one unit" of vertical focusing. The strengths of the quads we insert artificially are therefore the sum of two terms; one cancels the Coulomb defocusing handled by the ETEAPOT formalism; the other superimposes focusing proportional to m, equal but opposite horizontal and vertical. The artificial quadrupoles have zero length, but their length-strength product has to be matched to the "field integral" corresponding to length L bend of the bending slice being compensated.
Before continuing with the treatment for m = 0 it is important to remember the discontinuous increments to E as a particle enters or leaves a bending element. The discontinuity is equal (in magnitude) to the change in potential energy. When correcting the focusing by artificial quadrupoles we have to decide whether the artificial quadrupoles are "inside" or "outside", since the actual deflections will be different in the two cases. Since the difference is quadratic in transverse displacement, the difference would be called a "sextupole" effect. By treating the artificial quad as "inside", which we do (because we decline to include longitudinal drift at zero potential), we avoid introducing an artificial sextupole effect.
Whatever criteria for slicing quadrupoles that have been used for magnetic rings, the same criteria apply here. The default slicing in ETEAPOT treats a thick bend as a half bend, a single kick at the center, and then another half bend. For example, with m = −1.3, the central quad is vertically defocusing with inverse focal length q = 1/f = 2.3 /r 2 0 , where is the arc length through the full bend.
Numerically, with r 0 = 40 m and equal to, say, 16 m, the ratio of focal length to element length is (40/16) 2 /2.3 ≈ 2.7. With element length small compared to focal length, this suggests that the compensation will be fairly good even with such coarse slicing. The entire EDM ring, with its 8 full cells, would then be represented by 16 half-bends. In practice one will probably choose less coarse slicing.
The transfer matrices for the thin effective quadrupole are For m = 1 these kick matrices reduce to identity matrices.
With linearized evolution through half bend formally represented by "transfer matrix" B (1) ∆θ/2 , bend/kick/bend evolution through bend angle ∆θ in an element with field index m is then described by the matrix VIII. SPIN TRACKING r. Spin tracking through thick elements. The second main new feature implemented in ETEAPOT is spin evolution. To leading approximation spin precession occurs in central force, inverse square law, force field regions. With this assumption the orbit through a bend element of any individual particle lies in a single fixed plane.
Each individual particle's spin vector can be decomposed into a (conserved) components ⊥ , normal to the bend plane, and a (precessing) 2-component vectors , lying in the bend plane.
To lowest approximation hard edge bends are assumed, though a refractive deflection accompanying the change in electric potential is included. To a next approximation the fringe field electric potential is represented as a linear ramp. In this region, because the particle speed is necessarily non-magic, there is a noticeable difference in precession rates of spin and momentum. Furthermore the precession error at entrance and exit add constructively. It is assumed that the paths through the entrance and exit fringe fields lie in the same plane as in the bend interior.
As always in ETEAPOT, field deviations from radial inverse square law are modeled by artificial quadrupole "kicks".
Quadrupoles, whether real or artificial (as well as all other multipoles) are treated as thin. This includes the approximation that the electric potential is independent of position, both transversely and longitudinally in the element. Because the element thickness is treated as zero, there is no further time of flight error caused by the neglect of speed changes as the particle passes through the multipole.
Superimposed multipoles are therefore exactly superimposed which means that spin precession are modeled by successive rotations, with no dependence on the order in which they are applied. All such spin rotations are concatenated explicitly into a single (near-identity) precession matrix. For improved numerical precision all such concatenations are performed analytically and the result expressed as the exact sum of an identity matrix and a deviation matrix. This circumvents the problem of large, approximately canceling precessions and avoids spurious non-commutative geometric precessions.
Quadrupoles too thick to be validly treated as thin, are sliced, with regions between the sliced thin quadrupoles treated as drifts.
s. Spin representation. Laboratory frame spin components are (s x , s y , s z ). Bend frame spin components (s x ,s y ,s z ), are illustrated on the left in Figure 3, which projects the spin vector onto the bend plane.
As with the orbit equation, the BMT equation is exactly solvable only because the orbit stays in a single bend plane. For particles in realistic beams this is very nearly, but not exactly, the local (x, y) central design plane. t. Transforming spin components from Lab frame to bend frame (and back again). From orbit tracking to some current location in the ring one knows the laboratory frame position, r, and momentum, p, and hence the angular momentum L = r×p. One also knows the spin vector s; r = r xx + r yŷ + r zẑ , p = p xx + p yŷ + p zẑ , All of these quantities refer to a point infinitesimally past the bend entrance, after refractive correction, but not yet having included any entrance fringe field effect. Any spin precession in the interior (including fringe fields) of a bend element occurs in a single bend plane. To exploit this reduction from 3D to 2D it is first necessary to obtain the spin components in an orthonormal frame having its "y" axis perpendicular to the plane and its "z" coordinate tangential to the orbit. The purpose of this section is to document this transformation. In the (always excellent) paraxial approximation, and for nearmagic particle velocity, this transformation will be close to identity. x is the deviation of the (bold face) particle orbit from the (pale face) design orbit. If the bend plane coincides with the design bend plane (as is always approximately the case)β β β 0 andẑ are identical. θ is the reference particle deviation angle from longitudinal and ϑ is the tracked particle deviation angle from longitudinal. On the average θ and ϑ are the same, but betatron oscillations cause them to differ on a turn by turn basis, and also to make the instantaneous bend plane not quite horizontal.
We can establish an orthonormal, right-handed basis triad with axis 3 parallel to p and axis 2 parallel to −L (where the negative sign is appropriate for clockwise orbits); These equations can be re-expressed formally, with all coefficients known, as The vector s can be expanded as s =s 1 e 1 +s 2 e 2 +s 3 e 3 =s 1 (a 11x + a 12ŷ + a 13ẑ ) + . . . = (a 11s1 + a 21s2 + a 31s3 )x + . . . .
The final relation can be expressed in matrix form as where R is an orthogonal matrix, This yields the spin components in the bend frame. Their propagation through the bend is described below.
After the bend plane spin components have been updated at the output of the bend element it is necessary to transform them back to the (local) laboratory frame. This entails repeating the preceeding formulas starting with Eqs (125), but with r, p and L having been evaluated (in local laboratory coordinates) just inside the output face of the bend element. In other words all of the quantities in Eqs (125) will now refer to a point just before the bend exit. Then, following Eqs. (132) u. Exact solution of the BMT equation. We introduce, at least temporarily, the term '"inverse square law bend" to characterize a bend having field index m = 1, which is the case being treated in our 2D formalism. In this case the orbit stays in a single plane. Also, in this frame any precession of the spin is purely around an axis normal to the plane. Obtaining the initial values of the spin components in this frame was described in the previous section.
In the bend plane the orbit lies in a single plane. Superficially this may suggest we are accounting only for horizontal betatron oscillations and neglecting vertical betatron oscillations. In fact, however, the ETEAPOT treatment accounts for arbitrary betatron and synchrotron motion by assigning different "wobbling planes" to each individual particle. Even allowing for vertical betatron motion these frames are all very nearly parallel to the global horizontal design frame of the ring. For the 2D evolution through electric bend elements in ETEAPOT, any betatron oscillations actually present for a particular particle are folded into the determination of its particlespecific orbit plane, and the initial coordinates in this plane.
As shown in Figure 3, the initial spin vector is s = −s sinαx +s yŷ +s cosαẑ.
Heres yŷ is the out-of-plane component ofs,s is the magnitude of the in-plane projection ofs, andα is the angle between the projection ofs onto the plane and the tangent vector to the orbit. Jackson's [15] Eq. (11.171) gives the rate of change in an electric field E, of the longitudinal spin component as This is undoubtedly a fairly good approximate equation in any more-or-less constant electric field, but it is exact only for the m = 1 Keplerian electric field, which is the only field in which each orbit stays in its own fixed bend plane. In fact, the derivation is not quite valid even for our m = 1 case-though the design orbit is circular, the betatron orbits are slightly elliptical. This violates our assumption that orbit and electric field are exactly orthogonal. Neglecting this error amounts to dropping a term from the RHS of Eq. (134). This term is down by four orders of magnitude compared to the calculated value. Furthermore this term would average to zero (over many betatron cycles) except for a possible non-zero (quadratic in bend angle) commutation geometric phase error. Such an error would be expected to be down by another four orders of magnitude. Furthermore, the importance of this "error" can be investigated, and reduced, by finer slicing of the bend element. Meanwhile the velocity vector itself has precessed by angle ϑ relative to a direction fixed in the laboratory. Note that this angle ϑ, the angle of the individual particle's orbit is approximately, but not exactly equal to the angle θ of the design orbit.
In the ETEAPOT treatment each particle in an electric bend element evolves in its own bend plane.s is the component in this plane of the total spin vector. At every entrance to an electic bends has to be calculated from the known laboratory frame description of s, which also has to be updated as the particle exits the bend. (Ideally, in an EDM storage ring experiment any out-ofplane component of s would be evidence of non-vanishing electric dipole moment.) The precession rate of ϑ is governed by the equation where the curvature is 1/r = eE/(vp) and (just in this equation) s temporarily stands for arc length along the orbit. Dividing Eq. (136) by Eq. (137) and using pc = m p c 2 γβ, In this step we have also surrepticiously made the replacement ϑ → θ. Though these angles are not the same, over arbitrarily long times they necessarily advance at the same rate. In any case the error in equating ϑ to θ becomes progressively more valid in the fine-slicing limit, as the orbit is more nearly approximated by straight line segments. Explicitly the bend frame precession advance is the sum of two definite integrals where To account for fringe fields two more terms, ∆α FF,in and ∆α FF,out , will later be added directly to the right hand side of Eq. (139). This treatment makes the less-thanperfect assumption that the precession axes in the fringe fields are normal to the bend plane, which makes it valid to simply sum the bend field and fringe field precessions.
v. Spin tracking through fringe fields. So far, as a particle enters or exits a bend element, its potential energy has been treated as changing discontinuously with its kinetic energy changing correspondingly. For spin tracking, because there is significant excess spin precession in fringe fields we have to treat this region more carefully. Instead of treating the potential as discontinuous, we now assume the change occurs over a longitudinal distance ∆z FF which, for estimation purposes, we take equal to the separation distance (symbol gap) between the electrodes; ∆z FF = gap. (For the "protonium" model, introduced later for comparison with with analytic SCT calculations, the drift lengths are taken to be negligably small, making the fringe field spin precession negligible.) For orbit tracking the fringe field region is assumed to be short enough to be treated as "thin". That is, any change in the particle's radial offset occuring in range ∆z FF is to be neglected and the integrated deflection applied at the center (i.e. the edge of the bend). As a result the curve x(z) is continuous, but its slope dx/dz is discontinuous. Entrance transitions from outside a bend to inside are described first.
Inside the bending element the increase in potential energy from orbit centerline to radial position x is e∆V (x). As synchroton oscillations move the particle radially in and out, the sign of ∆V (x), just inside the bend edge oscillates between negative and positive values, and the sign of the deviation from the magic velocity oscillates correspondingly. This will tend to average away the spin run-out occurring in the fringe field region over times long compared to the synchrotron period. In the long run it is the deviation from zero of this average that has to be determined. This can be done by pure numerical tracking or theoretically or, possibly, by a theoretically-weighted averaging of the numerical tracking data.
Once one is able to determine the spin decoherence the task will shift to designing sextupole distributions capable of increasing the spin coherence time SCT. Our approach will be to study the effectiveness of such schemes before attempting to improve the precision of our fringe field treatment.
The deflection angle θ (F F ) of the design orbit in the fringe field at one such edge is approximately = 0.5 × 0.03/40 = 0.375 × 10 −3 ; (141) this is half of the deflection occurring in advancing a distance gap in the interior of the bend. (The angle θ (F F ) is implicitly assumed to be positive, irrespective of whether the orbit is clockwise or counter-clockwise.) Consider a particle approaching the fringe field region at radial displacement x. At the longitudinal center of the fringe field region the kinetic energy of this particle deviates from its "proper" (i.e. fully-inside value at radial displacement x) by the amount where ∆V tot is the total voltage increase from inner electrode to outer electrode. (The electric field points radially inward in order for positive particles to bend toward negative x but, by convention, E is positive.) Here, for simplicity, we are neglecting the fact that the actual electric field will have more complicated x-dependence depending, for example, on the value of the field index m. Our assumed fringe field spatial dependence is also simplistic.
The leading effect of passage through a bend region with γ deviation from magic ∆γ, is a rate of change of spin angle α per unit deflection angle θ given by Combining equations, the excess angular advance occurring while entering the bend at displacement x is (Aside: it may be appropriate to keep another term in expansion (143) in order to include the fact that dispersion introduces a correlation between γ and x which, after averaging, leaves a finite precession, even if < x > vanishes in Eq. (144) .) In our initial treatment of this edge effect we are assuming this precession lies in exactly the same plane as the orbit plane of the particle in the bend element, justifying the notation ∆α FF Entrance (and, later, exit) values can then simply be added to the main precession through the bend element. Meanwhile, in the fringe field region the advance of the tangent to the orbit is θ (F F ) as given by Eq. (141). The + sign on the rhs of Eq. (144) reflects the fact that, for a particle displaced radially outward, the particle momentum is completing some of its rotation in the fringe field where its magnitude is more positive than in the bend interior.
Though the fringe field precession occurs continuously over the range gap it is applied discontinuously at the bend edge. This is consistent with our hard edge treatment of the particle's momentum evolution. Because α is measured relative to the orbit direction, Eq. (144) gives the spin angle precession over and above the advance of the tangent to the orbit.
The fact that spin and momentum angular advances do not match has come about because the particle has bent appreciably while its speed deviates from the magic value. On exiting the bend element the particle bends similarly while its γ deviation is given by the same formula (142). Eq. (144) therefore applies to both entrance and exit. Unfortunately this means that excess input precession and excess output precession combine constructively rather than tending to cancel (as edge focusing commonly does.) The largest magnitude ∆γ (F F ) can have is For a particle with magic velocity skimming the outer electrode, where the effect is maximum, the angular runout is given by With perhaps 50 edges in the lattice, and revolution frequency of about 1 MHz, the maximum spin runout will be about one revolution per second. This vastly exaggerates the spin decoherence, of course, because it does not account for the averaging effect of synchrotron oscillations. A challenge for lattice design is to perfect the synchrotron oscillation averaging to zero. w. Spin tracking through thin elements. Most of the elements in a storage ring cause spin precession which approximately conserves the vertical component of spin s yŷ . The leading exceptions to this in a proton EDM storage rings are the quadrupoles (either focusing or defocusing) present in the lattice to keep β y much smaller than β x . Particles having non-vanishing vertical betatron amplitude are deflected vertically which causes s yŷ to precess. There is a very strong tendency for this precession to cancel in subsequent quadrupoles and, therefore, probably not contribute significantly to spin decoherence. Nevertheless it is essential for this precession to be modeled correctly to avoid spurious EDM-mimicking precession. All quadrupoles and sextupoles in the lattice cause similar precession to at least some degree.
In ETEAPOT the only thick elements are bends and drifts. Spin evolution through them has already been discussed. All other elements are treated as thin element (position dependent) kicks. Copying from the treatment in bends, spin evolution through a thin element is described by where the deflection ∆θ is (for now) defined to be positive and ∆α is the resulting angular deviation of the "bend" plane spin coordinate relative to the orbit; here "bend" is in quotes to emphasize the fact that the bend plane is not, in general, horizontal. By far the most important instance of this is the deflection of vertically offset orbits in lattice quadrupoles. For a particle with transverse position (x, y), the magnitude of the angular deviation ∆θ in a quadrupole of strength q is given by where q is the inverse focal length of the quadrupole. The absolute value sign in this equation eventually has to be removed; it is included here so that the discussion of signs can be deferred. The magnitude of the angular deflections in sextupoles and higher order multipoles are also functions only of the combination r = x 2 + y 2 . Eq. (148) generalizes to ∆θ quad = |q|r, ∆θ sext = |S| 2 r, ∆θ oct = |O| 6 r, where S is the conventionally defined sextupole strength and O is the conventionally defined octupole strength. 5 5 The element strengths appearing in an SXF lattice description A significant complication concerns the sign of ∆α. For a particle with no vertical displacement there is no ambiguity, since the bend plane in the quadrupole is the same as the overall (horizontal) lattice design plane. In this case, with y = 0, Eq. (147) can be made more explicit; where, by convention, a horizontal focusing quad has q > 0. The sign in Eq. (150) reflects the fact that, for x > 0 and q > 0, the quadrupole "helps" by bending the momentum in the same sense as the bending elements. This formula makes it clear that reversing the sign of q reverses the sign of ∆α. For obtaining the proper sign for general multipoles it is necessary to handle consistently the transformation from laboratory to bend frame spin coordinates, which is why the sign issue has been deferred.
For a particle incident at (x 0 , y 0 ) the equation of the line of intersection of the deflection plane with the transverse plane is In a quadrupole the roll-angle of the deflection plane (with counter-clockwise roll taken as positive) is φ 0 = tan −1 (y 0 /x 0 ), irrespective of quadrant and whether the quadrupole is focusing or defocusing. However the inverse tangent function is, itself, multiple valued. To make it single valued one can determine φ 0 using φ 0 = arctan2(qy 0 , qx 0 ). Along with Eq. (147), this establishes both the sign and magnitude of ∆α, while preserving the sign reversal when the sign of q reverses. Including also sextupoles, octupoles and other multipoles, one obtains φ 0,quad = 1 arctan2(qy 0 , qx 0 ), φ 0,sext = 2 arctan2(Sy 0 , Sx 0 ), φ 0,oct = 3 arctan2(Oy 0 , Ox 0 ).
With roll angles of the bend plane determined this way, the following formulas apply to all multipoles. The required spin rotation matrix is file include the integer factors. That is, the quad parameter is b 1 = q, the sextupole parameter is b 2 = S/2, the octupole parameter is b 3 = S/6, and so on.
To avoid serious loss of numerical precision, it is essential to use trigonometric identities to express the matrix product exactly and explicitly in this way. This utilizes the fact that the dominant, identity matrix part of the central matrix commutes with the outer matrices, whose product is I. The remaining, exact matrix elements are are explicitly small.
Since the common factor 2 sin( ∆α/2) is tiny, all matrix elements are small even for angles φ of order π. Multiplying this matrix on the right by (s x , s y , s z ) T produces deviations (∆s x , ∆s y , ∆s z ) which, added to (s x , s y , s z ), give the output spin coordinates.