Dipole fringe field thin map for compact synchrotrons

The fringe field of dipole magnets can be mportant in charged-particle beam dynamics [1,2]. For example, the edge angle effect on the vertical focusing has been parametrized by the fringe field integral introduced [1] and measured [3]. The nonlinear beam dynamics of the fringe field has also been included up to a sextupolelike potential in Ref. [2]. The fringe field effect is particularly important for compact accelerators that have a small bending radius. Applications of compact storage rings include the Inverse Compton Light Source (see, e.g., [4]), proton therapy synchrotrons, etc. The fringe field of dipole magnets typically extends to the range of the vertical magnet gap. The range of the fringe field is usually minimized to avoid magnetic field coupling due to limited available space in compact storage rings. As the range of the fringe field is reduced, parts of the fringe field effects may be minimized and others amplified. In particular, higher-order nonlinearity can become important. Often overlooked, an important feature of the dipole fringe field effect is the closed orbit deviation from the design orbit. This change of the closed orbit arises from the fact that the fringe field introduces continuously varying curvature, while the design orbit is defined by constant curvature starting from the hard edge dipole boundary. Although this fact is naive and simple, its effect can be large for compact storage rings and thus should not be disregarded. If not considered, it can cause significant misalignment errors for all other accelerator elements. As the fringe field extent decreases, the closed orbit deviation will also decrease. However, higher-order nonlinearity would increase. It is important to understand how these effects rely on the fringe field extent. Recently, the fringe field effects on nonlinear dynamics for compact rings and large emittance beams have been considered in Refs. [5,6]. The numerical method was used to extract the Taylor map or Lie map out of the 3D field data [7,8]. However, there is still a demand for an analytic expression of the fringe field map, particularly when the 3D field data are not available at the design stage. Because of its complex nonlinear effects, it is often hard to uncover the underlying physics based on simulation results alone. In addition, a good understanding of the dipole fringe field map can benefit not only storage ring design but also dipole magnet design. Theoretical studies on the influence of dipole fringe fields have been carried out by many researchers from the early 1960s through the early 1970s [9–14]. Although some earlier studies derived mapping equations up to third order of phase space variables, they often led to complicated expressions with too many integration parameters. This paper is intended to provide a simpler physics picture of fringe field effects. The Lie algebraic method is useful to study the fringe field effect [15]; e.g., the Methodical Accelerator Design ver.10 Polymorphic Tracking Code (MADX PTC) module implemented the second-order fringe field effect with a hard edge approximation [2]. However, the derivation is carried out on the pole face parallel frame, and it disregards the closed orbit deviation. This paper studies the effective thin map of the dipole soft fringe field using the Lie map method up to the next leading order of Magnus’ series and up to the 4th order of canonical variables with respect to the design orbit. We also calculate the mapping equation out of the Lie map to compare it with the simulation and an earlier study [1]. We organize this paper as follows. In Sec. II, we build a general fringe field model. Section III presents the corresponding Hamiltonian. Section IV reviews the Lie algebraic method to build an effective thin map. Section V presents the derived analytic map. Section VI compares the theory with the simulation results. Section VII discusses the fringe field induced closed orbit effect. Section VIII discusses the physics of the octupolelike potential. Section IX briefly shows the nonlinear detuning effect kilean20@gmail.com


I. INTRODUCTION
The fringe field of dipole magnets can be mportant in charged-particle beam dynamics [1,2]. For example, the edge angle effect on the vertical focusing has been parametrized by the fringe field integral introduced [1] and measured [3]. The nonlinear beam dynamics of the fringe field has also been included up to a sextupolelike potential in Ref. [2]. The fringe field effect is particularly important for compact accelerators that have a small bending radius. Applications of compact storage rings include the Inverse Compton Light Source (see, e.g., [4]), proton therapy synchrotrons, etc.
The fringe field of dipole magnets typically extends to the range of the vertical magnet gap. The range of the fringe field is usually minimized to avoid magnetic field coupling due to limited available space in compact storage rings. As the range of the fringe field is reduced, parts of the fringe field effects may be minimized and others amplified. In particular, higher-order nonlinearity can become important.
Often overlooked, an important feature of the dipole fringe field effect is the closed orbit deviation from the design orbit. This change of the closed orbit arises from the fact that the fringe field introduces continuously varying curvature, while the design orbit is defined by constant curvature starting from the hard edge dipole boundary. Although this fact is naive and simple, its effect can be large for compact storage rings and thus should not be disregarded. If not considered, it can cause significant misalignment errors for all other accelerator elements. As the fringe field extent decreases, the closed orbit deviation will also decrease. However, higher-order nonlinearity would increase. It is important to understand how these effects rely on the fringe field extent.
Recently, the fringe field effects on nonlinear dynamics for compact rings and large emittance beams have been considered in Refs. [5,6]. The numerical method was used to extract the Taylor map or Lie map out of the 3D field data [7,8]. However, there is still a demand for an analytic expression of the fringe field map, particularly when the 3D field data are not available at the design stage. Because of its complex nonlinear effects, it is often hard to uncover the underlying physics based on simulation results alone. In addition, a good understanding of the dipole fringe field map can benefit not only storage ring design but also dipole magnet design.
Theoretical studies on the influence of dipole fringe fields have been carried out by many researchers from the early 1960s through the early 1970s [9][10][11][12][13][14]. Although some earlier studies derived mapping equations up to third order of phase space variables, they often led to complicated expressions with too many integration parameters. This paper is intended to provide a simpler physics picture of fringe field effects.
The Lie algebraic method is useful to study the fringe field effect [15]; e.g., the Methodical Accelerator Design ver.10 Polymorphic Tracking Code (MADX PTC) module implemented the second-order fringe field effect with a hard edge approximation [2]. However, the derivation is carried out on the pole face parallel frame, and it disregards the closed orbit deviation. This paper studies the effective thin map of the dipole soft fringe field using the Lie map method up to the next leading order of Magnus' series and up to the 4th order of canonical variables with respect to the design orbit. We also calculate the mapping equation out of the Lie map to compare it with the simulation and an earlier study [1].
We organize this paper as follows. In Sec. II, we build a general fringe field model. Section III presents the corresponding Hamiltonian. Section IV reviews the Lie algebraic method to build an effective thin map. Section V presents the derived analytic map. Section VI compares the theory with the simulation results. Section VII discusses the fringe field induced closed orbit effect. Section VIII discusses the physics of the octupolelike potential. Section IX briefly shows the nonlinear detuning effect by an octupolelike potential. Section X show fringe field effects on a compact ring as an example. Finally, the conclusion is in Sec. XI.

A. Fringe field extent
Conventionally, the dipole vertical gap and magnet aperture are used to represent the fringe field extent [1,7], because the fringe field extent is generally about the size of the magnet aperture. Throughout the paper, we will use the vertical gap g to represent the fringe field extent.
Using dimensional analysis, we can understand the relationship between the vertical gap and the fringe field extent. The physical quantities of length dimension include horizontal width, longitudinal length, and vertical gap of a dipole. Normally, the horizontal width and longitudinal length are large enough that their effect on the fringe field is minimal. Therefore, the vertical gap is the main contribution to the fringe field extent. Apart from the vertical gap, the pole face shaping or a magnetic clamp is used to shape the fringe field and effectively reduce the fringe field extent. However, even after shaping the fringe field, the extent will still increase as the vertical gap increases. The field shaping can be understood in the Enge-functional model, which is often used for fringe field modeling: where ϵ is a length dimensional physical quantity relevant to the fringe field and c i are coefficients that determine the field shape. This model is quite general, because there are many parameters that fit on a realistic field. Note that these coefficients are responsible for the field shape and thus can reduce the fringe field extent effectively. However, ϵ is still the main contribution for the overall field extent. Since the vertical gap is the only length dimensional quantity relevant to the fringe field, the vertical gap is often used as ϵ in this modeling.

B. Edge parallel frame
Consider a rectangular dipole shown in Fig. 1, where the shaded region indicates the dipole. The right-hand rule coordinate system ðx; s; zÞ is adopted. The rectangular frame parallel to the edge is characterized by adding a bar on top of each coordinate variable ðx;s;zÞ. ρ is the design curvature, and θ E is the edge angle. The coordinate relation between the edge parallel frame and the Frenet-Serret frame near the dipole entrance is given bȳ wheres ¼ 0 is the location of the dipole entrance, ρðsÞ is infinite before the edge, and constant design curvature after the edge, and

C. Field symmetries
By the symmetric nature of the rectangular dipole, the magnetic scalar field can be written as [16] Φðx;s;zÞ where Bρ is the rigidity. This symmetry is still approximately true near the edge for nonrectangular dipoles.

D. Curved field boundary model
Since the horizontal dipole width is finite, we expect the fringe field to degrade toward each of the horizontal ends. This fact can be modeled by a curved field boundary at dipole ends [1] as shown in Fig. 2. Note that the curved FIG. 2. Curved field boundary. R is the field boundary radius, and r is the distance from the origin to an arbitrary point. field boundary model has rotational symmetry about the origin of the curve, and thus, instead of Eq. (4), the magnetic potential at dipole entrance could also have been written asΦ where r 2 ¼ ðR −sÞ 2 þx 2 . Then expansion inx gives us where ∂ r denotes the derivative with r. Therefore, we find However, for generality, we will not use the curved field boundary model. Instead, what we do learn from this modeling is thatφ 21 is of the order of 1=ðρgRÞ, where g is the vertical magnet gap which also represents the fringe field extent. Normally, g ≪ R as well as g ≪ ρ.
If we do not use the curved field boundary model, we need to find a way to define the length dimensional quantity R, which can describe how the fringe field degrades towards each of the horizontal ends. Rewriting Eq. (8) in terms of the vertical magnetic field, We define the parameter R as where ∂x denotes the derivative with respect tox. When the derivative is not available, the other way to define R is to take it as the horizontal width of the dipole. It is expected that as the dipole width becomes larger the horizon degradation would become smaller. In order to simplify, let us rewrite the potential Eq. (4) as − ½ā 00 ðsÞ þbðsÞz where we have used the Poisson equation and redefinedā ðsÞ ¼φ 01 ðsÞ;bðsÞ ¼φ 21 ðsÞ: ð12Þ Assuming the neighboring fringe field does not overlap, we require the following boundary conditions: where the superscript n indicates the nth-order derivative and the boundary L must be ∞, as the fringe field and its derivatives do not suddenly vanish at any finite value of L.

III. FRINGE FIELD HAMILTONIAN
In order to construct the Hamiltonian for the Frenet-Serret frame (fsFrame), we would like to build the vector potential in fsFrame. As the vector potential is not unique, we fix the gauge such that where h s ¼ 1 þ x=ρ is the geometric factor. Therefore, we find Then, the Hamiltonian can be obtained by where δ is the fractional momentum deviation. Explicitly, we write the Hamiltonian up to the 4th order of canonical variables which are responsible for the nonlinear detuning. However, since there is a closed orbit deviation introduced by the fringe field, we include one more extra order in the horizontal variables: where aðsÞ and bðsÞ are defined, respectively, by and the drift is approximated to The approximation is enough for the calculation of the map up to the next leading orders.

IV. EFFECTIVE THIN MAP
In order to calculate the map, we would like to briefly review some of the Lie algebraic techniques in this section.

A. Magnus series
Let Hðsjs 0 Þ be the time evolution operator from s 0 to s which acts on canonical variables of the Hamiltonian system such that xðsÞ ¼ H½xðs 0 Þ; sxðs 0 Þ, where x is the set of canonical variables and s is the time variable. Then it satisfies the following differential equation [15]: where H is the Hamiltonian and the pair of colons is Dragt's notation [15] of the Poisson bracket. Magnus's exponential solution of the differential equation of operators such as Eq. (19) is given by [15] Hðsjs 0 Þ ¼ exp ½∶Ω H ðsjs 0 Þ∶; where Ω H is the Lie map generator. Unlike a Dyson series, the exponent solution is symplectic.
C. Effective thin map of dipole entrance be the fringe field and ideal bending magnet Hamiltonian, respectively. And let D, F , and B be the Lie map of the drift, fringe field, and ideal bend, respectively. Then they can be factorized into The effective thin map M is the fringe field map sandwiched by the inverse drift and inverse ideal bend map: where we have used the Baker-Campbell-Hausdorff formula [15]. Defining the interaction picture potential by the Lie map generator Ω M becomes V. CALCULATION RESULT The integration in Eq. (27) is over the longitudinal coordinate s of the design orbit. However, the measurement of the field along the curved frame can be cumbersome. Therefore, we will convert the integration variable from s tō s, using Eq. (2).
In addition, we define the dimensionless field integration parameters where ΘðsÞ is the step function which is 1 inside of the dipole and 0 outside of the dipole, and we set L ¼ ∞.
Although the normalization constants R and g will cancel out with the coefficients of Eqs. (35) and (36), this normalization makes the field integration parameters universal. This means they are about same order of magnitude for all dipoles. Among them, K 2 is the well-known parameter so-called Field INTegration (FINT) which is responsible for vertical focusing correction [1,2]. Then, Eq. (27), the Lie map generator for the dipole entrance, becomes In the same way, one can calculate the Lie map generator for the dipole exit: A. Discussion on bending angle By definition, the design bending angle is given by However, the actual bending angle is where l is the path length. Therefore, in order to meet the design bending angle to the leading order, we require the integration parameter K 1 to be zero: Then, the mapping equations by Eqs. (35) and (36) become, for the dipole entrance, Δz ¼ xztan 2 θ E ρð1 þ δÞ ; ð41Þ From Eqs. (40) and (42), we find that there is a closed orbit and momentum deviation. The mapping equations for the dipole exit are Note that there is a closed orbit deviation also, but the closed orbit momentum deviation is not present for the dipole exit. The octupolelike potential is present for both TABLE I. The effect of the nonlinear fringe field on chromaticities ξ and nonlinear detuning parameters α of Tsinghua Thomson scattering X-ray source (TTX). The 3rd-order and 4th-order fringe field kicks are gradually turned on, and the nonlinear optics parameters are measured from the tracking data. "Kin" represents the case when only linear fringe field kicks are used in tracking and thus the nonlinear optics contribution comes purely from the nonlinear kinetics. "Sext" represents the case when a sextupolelike fringe field kick is added, and "Oct" represents the case when an octupolelike fringe field kick is finally added. The 1st-order chromaticity ξ comes from a sextupolelike potential, and thus the octupolelike fringe field kick does not contribute. And since the octupolelike fringe field kick is vertical, it contributes only on the vertical detuning parameter.
Switch the entrance and exit. Note also that the closed orbit deviation is proportional to g 2 , while the octupolelike potential is inversely proportional to g. Therefore, as one makes the fringe field as sharp as possible, the closed orbit deviation will vanish, but the octupolelike potential and higher nonlinear effect will increase drastically. In addition, since the octupolelike potential is coupled with z 3 , it can contribute to large vertical detuning as shown in Table I.

VI. SIMULATION
Now, we verify our derivation via computer simulation. We track the particle through the Lorenz force which can be simplified to where p mech indicates the mechanical momentum. The definition of τ is somewhat similar to proper time in relativity, but here it is normalized to a length dimensional quantity.

A. Simulation of thin map
An effective thin map is obtained by sandwiching the back transforms of the drift and dipole at each end of the fringe field map. As for the dipole entrance, we used the following steps.
(i) Transform from fsFrame to rFrame (rectangular frame perpendicular to the edge).
(ii) Back drift tos ¼ −L, where we used a large enough value of the field boundary L ¼ 30g.
(iii) Apply the leapfrog method until the particle reachess ¼ L.
(iv) Back transform using an ideal dipole field until the particle reachess ¼ −x tan θ E , which corresponds to s ¼ 0.

B. B-field setting
Throughout the simulation, we assume the horizontal width is large enough thatb is ignorable. Then the magnetic field can be obtained fromΦ ðx;s;zÞ Bρ ¼āz −ā 00z And we use the the logistic functional fringe field modelā This setting gives a simple analytic expression for field integration parameters:

C. Closed orbit effect for dipole entrance
The closed orbit effect can be checked by setting all the initial canonical variables to zero, i.e., In this simulation, θ E ¼ π=8 is used as an example. The simulation results for the dipole entrance with various values of g and ρ are shown in Figs. 3 and 4. They show good agreement with our derivation. Note that the closed orbit deviation is proportional to g 2 and about the order of a millimeter.

D. Closed orbit effect for dipole exit
In the same way, the simulation results for the dipole exit with various values of g and ρ are shown in Figs. 5 and 6. Recall that there was no closed orbit momentum deviation for the dipole exit up to the order of g 2 . Therefore, we fit it to the next order Oðg 3 =ρ 2 Þ.

E. Octupolelike potential effect
Since we have good agreement with Ref. [1] up to the sextupolelike potential, we jump to verify the octupolelike potential effect, which is present in the following differential: Note that the octupolelike potential is inversely proportional to the fringe field extent. In order to verify the differential, we exploit the automatic differentiation technique [17] similar to the differential algebra [7]. The theoretical and simulated values of the differential ∂ 3 z Δp z are shown in Fig. 7.

VII. UNDERSTANDING CLOSED ORBIT EFFECT
The fringe field effect on the closed orbit deviation rises from the nonconstant curvature of the particle trajectory. Consider a particle initially following the design orbit FIG. 8. Illustration of the difference between the particle orbit and the design orbit at the dipole exit. The bold line represents the design orbit, and the thick dashed line represents the particle trajectory. The curvature of the particle trajectory increased step by step. Initially, ρ is the design curvature, then ρ 1 ¼ 2ρ and ρ 0 ¼ 3ρ, and finally exits the field region. The three large dots correspond to the origins of the three curvatures.   inside of a dipole. When the particle starts to see the fringe field near the dipole exit, the deflecting angle becomes smaller and smaller. Therefore, when it passes through the fringe field, there is a net displacement indicated by x c in Fig. 8. Note that if the total deflection angle is the same as the design angle of the dipole, there is only a closed orbit deviation and no closed orbit momentum deviation. Figure 9 illustrates how the closed orbit and momentum deviation arise by the dipole fringe field at the entrance. Consider a particle initially following the design orbit outside of a dipole. When the particle starts to see the fringe field near the dipole entrance, it starts to deflect slowly. When it finally passes through the fringe field, we see that the particle trajectory and the design orbit differ not only by a displacement but also by an angle indicated by the two red tangential lines. Figure 10 illustrates that the closed orbit effect of the dipole entrance and exit fringe field does not cancel out when a particle passes through a dipole.

VIII. UNDERSTANDING OCTUPOLELIKE POTENTIAL
The physics behind the octupolelike potential is the Maxwellian constraint on the magnetic potential: As the fringe field extent decreases, ∂ 2 s Φ increases. Since the horizontal variation of the field is slow, this must be canceled by ∂ 2 z Φ. Therefore, the magnetic potential that obeys the Maxwellian constraint is Note that the second term is a sextupolelike potential. However, as the integrated effect of it is zero R B 00 ds ¼ 0, the leading order of its effect is the 2nd order of this sextupolelike potential which is an octupolelike potential. This is similar to the fact that sextupoles in an accelerator contribute to the nonlinear detuning by concatenation of all sextupoles.

IX. DETUNING BY OCTUPOLELIKE POTENTIAL
One of the interesting effects of the octupolelike potential is the detuning effect. Since a Lie map generator of an accelerator element is an effective Hamiltonian multiplied by the length of the element, we find the effective octupolelike potential of Eqs. (35) and (36) can be written as [18] H oct ¼ δðsÞ where δðsÞ indicates the Dirac delta function at the dipole edge. Therefore, the vertical detuning parameter is where, in the last line, we assumed that the betatron function is continuous across the edge, i.e., β z ð0 − Þ ≃ β z ð0 þ Þ which usually is true. By dimensional analysis, the sextupolelike potential of the fringe field edge will contribute to the detuning parameter by an order of Oðβ 2 x β z =ρ 4 Þ. Therefore, the effect by octupolelike potential on the detuning FIG. 9. Illustration of the difference between the particle orbit and the design orbit at the dipole entrance. The bold line represents the design orbit, and the thick dashed line represents the particle trajectory. The curvature of the particle trajectory decreased step by step. Initially, ρ 0 ¼ 3ρ, then ρ 1 ¼ 2ρ, and finally reaches the design curvature ρ. The three large dots correspond to the origins of the three curvatures. The blue line indicates the coordinate s where the particle orbit curvature finally becomes ρ. Red lines are tangent to the particle and design orbit at s. parameter can be larger as the fringe field extent becomes shorter. It is worth mentioning that the hard-edge model is ill defined if one goes beyond a quadrupole, and the fact that the detuning term by an octupolelike potential is infinite in the hard-edge model has already been known [7,19].

X. EXAMPLE ON A COMPACT RING DESIGN
The effect of the dipole fringe field is important to compact storage rings. As an example, we discuss the dipole fringe field effect on a Tsinghua Thomson scattering X-ray (TTX) source, which is a 4.8 meter storage ring composed of all linear elements. The ring consists of a pair of quadrupoles which are used to adjust the damping partition number and four dipoles whose edge angles are chosen for proper betatron tunes [4]. The layout is shown in Fig. 11. The bending radius is ρ ¼ 0.24 m, and the fringe field extent and FINT K 2 assumed for the machine design were g ¼ 25.4 mm and K 2 ¼ 0.9, respectively [4]. In order to see the nonlinear effects of the dipole fringe field, we gradually turned on the sextupolelike fringe field potential and then the octupolelike fringe field potential and measured nonlinear detuning parameters and chromaticities on tracking data. As for the 4th-order fringe field effect, we assumed K 3 ¼ 1=6, which comes from a logistic functional model like Eq. (52). The result is shown in Table I. Note that even if TTX consists of the all linear elements the nonlinear kinetics contribute to nonlinear detuning and chromaticity significantly. However, it shows that the nonlinear fringe field effect contribution on the nonlinear optics parameter can be more important especially for the vertical motion. Since TTX is very compact, it is sensitive to the change of fringe field extent by Eqs. (43) and (47). Therefore, in order to see the scaling law of detuning parameter Eq. (57), we varied K 2 along with g such that gK 2 is constant. And as shown in Fig. 12, the result agreed with the theory Eq. (57).
Next, we turned on K 0 , which is responsible for the closed orbit deviation, and searched for the fixed point. The result can be found in Fig. 13. Note that the closed orbit of several millimeters is generated. As the beam pipe radius is also about millimeter order, there can be severe beam loss. The concave corresponds to the dipole location, and the convex corresponds to the focusing quadrupole location. It shows that, as the dipole fringe field introduces a closed orbit deviation, the focusing quadrupoles appear to be misaligned and effectively work as FIG. 11. TTX layout: Four dipoles in red and two focusing quads in blue. Contribution of an octupolelike potential of the effective fringe field map on the detuning parameter. The superscript "4th" denotes the detuning contributed by only the 4th-order potential. The tune is calculated by applying a numerical analysis of fundamental frequencies [20] algorithm on numerical turn-byturn tracking data. When we track the particles, we gave a fringe field kick according to Eqs. (40)-(47) which are verified by Figs. 3-7 and Ref. [1]. And the detuning is calculated from the difference of the tunes for different initial amplitudes of the betatron motion on tracking data. bending magnets. This example illustrates the importance of the closed obit deviation and corresponding misalignment error for a compact ring.

XI. CONCLUSION
We derived the effective thin Lie map generator and mapping equations of transverse dynamics for the dipole fringe field up to an octupolelike potential. Two major findings were the closed orbit deviation, which is of the order of g 2 =ρ, and the octupolelike potential, which is of the order of 1=ðgρ 2 Þ. These two effects were not included in SLAC-75 [1].
The closed orbit effects depend mainly on two field integration parameters K 0 and K 1 . The field integration parameter K 1 must vanish by definition or, equivalently, by dipole design in order to have the intended bending angle as the design orbit. We also showed that the closed orbit deviation can be large enough to graze the beam pipe for a compact ring.
The octupolelike potential was shown to be inversely proportional to the fringe field extent. Similarly, higherorder nonlinearities are expected to be inversely proportional to the higher power of fringe field extent.
Therefore, a careful dipole fringe field design will be needed for the compromise between the closed orbit and nonlinearities. For example, when the beam emittance is small, the closed orbit deviation is a more important concern than the nonlinearities. Therefore, one would like to minimize the fringe field extent in this case.