Filling Pattern Dependence of Regenerative Beam Breakup Instability in Energy Recovery Linacs

Beam breakup instability is a potential issue for all particle accelerators and is often the limiting factor for the maximum beam current that can be achieved. This is particularly relevant for Energy Recovery Linacs with multiple passes where a relatively small amount of charge can result in a large beam current. Recent studies have shown that the choice of filling pattern and recirculation scheme for a multi-pass energy recovery linac can drastically affect the interactions between the beam and RF system. In this paper we further explore this topic to study how filling patterns affect the beam breakup instability and how this can allow us to optimise the design in order to minimise this effect. We present a theoretical model of the beam-RF interaction as well as numerical modeling and show that the threshold current can vary by factors of 2-4, and potentially even more depending on the machine design parameters. Therefore a judicious choice of filling pattern can greatly increase the onset of BBU, expanding the utility of future ERLs.


I. INTRODUCTION
In the 2020 European Strategy for Particle Physics [1], superconducting Energy Recovery Linacs (ERLs) [2] were identified as a key accelerator technology requiring priority research and development to underpin the future anticipated needs of the community. Applications in particle physics cover both ERL-based colliders, such as LHeC [3,4], PERLE [5], FCC-ee [6] and beam coolers for hadron colliders, notably EIC [7]. ERLs are also seen as a promising option, in both academic and industrial contexts, for future Free-Electron laser light sources [8,9] and for nuclear physics through both direct beam internal target experiments [10] and through secondary production of narrowband gammas via inverse Compton scattering [11,12].
One common theme in these future applications is the requirement of high average beam power, with GW being an aspired-for reasonable mid-term goal. This is three orders of magnitude beyond that achieved to date, namely by the JLab FEL upgrade [13,14], indicating the importance of addressing this as a priority for ERL research.
A well known limitation on the current one can support in an ERL is a particular incarnation of so-called beam breakup (BBU) instabilities. BBU has potential to occur where the beam interacts with a higher order mode (HOM) of an RF structure that it traverses and becomes deflected. There are two general classes of BBU, cumulative [15][16][17][18][19][20] and regenerative [21,22]. Cumulative is where the deflection builds up over multiple structures and is not the subject of this study. Regenerative BBU is that of primary concern in recirculating and energy recovery linacs where there are multiple passes of the same bunch through each RF structure. This constitutes a feedback loop between the beam position offset and the HOM voltage.
Bunches passing through the cavity will excite a transverse HOM whose amplitude is dependent on the transverse offset of the passing bunches. In turn, the HOM voltage will deflect the subsequent bunches and increase their offsets. If the beam current is at a certain threshold, I th , then the magnitude of the HOM voltage and bunch offsets will reach an equilibrium, below this the HOM voltage will tend to zero, above it will cause the HOM voltage and bunch offsets will grow exponentially until beam loss occurs. This defines the BBU instability [23,24]. Whilst studies have been undertaken to investigate BBU instabilities for ERLs [25][26][27][28][29][30][31], no studies have yet considered the impact of different beam filling patterns and beam line topologies on the beam loading transients imparted on the cavities and bunches. This becomes important when considering multi-pass ERLs which, having now been demonstrated experimentally [32], feature in many designs for future ERL facilities due to the obvious advantage of providing higher beam energies without concomitant increase in the number of accelerating structures. The effect of the filling pattern, which describes the order in which bunches are injected into the ERL over subsequent turns, has in a previous publication [33] been shown to have a major impact on the stability of the RF system. Just as the fundamental mode and RF power are affected differently by our choice of beam line topology and filling pattern, the threshold current of regenerative BBU is also dependent on these parameters. In the following section, we show that the impact on BBU is somewhat more complex than it is for the fundamental mode due to the asynchronous nature of the HOM mode relative to the beam, as well as the transcendental relationship between the HOM voltage and the bunch offsets.
For regenerative BBU, the HOM mode has a sufficiently high Q-factor that the mode persists for a relatively long timescale. As the bunches pass through the structure they are given a transverse kick, whilst also contributing to the excitation of the HOM due to their off-axis trajectories. On recirculation they pass back through the structure with a larger offset, further exciting the mode. This feedback loop can grow exponentially until beam loss occurs.
Filling patterns are used to describe the order in which bunches are injected into a ring on subsequent turns, here we use the concept (introduced in [33]) of intra-packet blocks to describe the position they occupy on each turn. For example, for a 6-turn ERL (3 accelerating passes and 3 decelerating), the filling pattern [1 2 3 4 5 6] indicates that the first bunch goes to the first intra-packet block, the second bunch goes to the second block, and so on. The intra-packet block also fixes how many RF cycles are between bunches, as in the general case bunches are not necessarily injected into every RF cycle, illustrated in Fig. 1. These bunches forms a packet and multiples of such packets fill up the ring as shown in the Fig. 2. Similarly, filling pattern [1 3 2 4 5 6] indicates that the first bunch goes to the first block, second bunch goes to the third block, and so on. These filling schemes are called FIFO (first in first out) as the bunches maintain their order in the packet, however, their turn number changes turn by turn. One can also generated a packet where turn number in the packet doesn't change turn by turn by and consequently the cavity always see same packets passing thorough. Such a scheme is called sequence preserving (SP) scheme and denoted with curly brackets to be differentiated from square brackets of FIFO schemes. For example, SP pattern {1 4 2 5 3 6} describes the first bucket is always occupied by bunch at the first turn, the second bucket is always occupied by the bunch at fourth turn, and so on. The key differences are that in FIFO schemes, bunches remain in the same RF block and bunch turn numbers change, whilst in SP schemes the arc length for each turn of the ERL is specifically designed such that the bunches transition between RF blocks on each turn such that the sequence of bunch turn number in a packet remains constant on each turn; hence the name sequence preserving.
The number of possible filling patterns increases as (N − 1)!, where N is the number of recirculation passes of the ERL. The filling patterns are dependent on the bunch injection and recombination schemes. FIFO and SP patterns are merely the most simple subsets of all possible schemes that can be generated, this will be further studied in a future work employing a group theoretic classification technique. In this work we focus on SP schemes to show that BBU is affected by the filling pattern. There are several factors in multi-turn ERLs that can affect BBU, which are not present in circular machines: bunches at different turns have different energies so under the same HOM voltage higher energy bunches are deflected less than low energy ones; bunches transitioning from accelerating phase to decelerating phase need to be delayed by at least half an RF cycle and thus have a changed revolution time; bunches accumulate offset and kicks within the recirculating process which become amplified as the bunch energy decreases, this is termed adiabatic anti-damping. All these effects must be taken into account when determining filling pattern dependent BBU threshold currents.
In section II, we present an analytical derivation for the threshold current and its dependence on filling patterns and beam line topology and consider how it drives BBU. Due to the transcendental relationship between HOM voltage and beam trajectories, the analytical approach is unable to provide a simple calculation of the threshold current, however we are able to exploit it to provide insight into the behaviour of BBU under certain conditions. In Section III, we provide the results of numerical simulations from Matlab in order to determine the threshold current for different filling patterns for the SP schemes. These numerical simulations allow us to look at the frequency dependence of the threshold current for different filling patterns as well as to determine the threshold current for all filling patterns as a frequency-averaged threshold current. From this, we are able to show that with the correct choice of filling pattern, the threshold current can be increased significantly with appropriate optimisation.

II. ANALYTICAL MODEL
In this section, we derive an analytical expression for the threshold current to allow us to understand how the filling pattern and recirculation scheme of the ERL affects the threshold current. We start by following the standard derivation described in other works, such as [22,25,26]. Then we augment this initial expression for the threshold current, casting it in terms of a generic beam filling pattern.
BBU can be a long and/or short-range effect and is caused by transverse offsets of the bunch centroids exciting deflecting modes, which are usually dipole fields, which then give a transverse kick to the bunch on the next turn. For short-range BBU, the HOM mode excited has a small loaded Q-factor (Q L ) and as such the mode is sufficiently attenuated before the bunches return in order to prevent a significant transverse kick to the bunch after it has completed one revolution, but it can have a significant effect on bunches directly behind the driving bunch. From the Panofsky-Wenzel theorem [34], we relate the transverse voltage of the HOM mode in terms of the transverse variation in longitudinal voltage as: It can also be shown that a bunch of charge q bunch excites this HOM mode and increases the transverse voltage as where x is the transverse offset from the electrical centre of the cavity, c is the speed of light, ω is the angular frequency of the HOM mode, R Q ⊥ is the transverse R/Q and φ is the phase of the beam with respect to the peak of the HOM voltage. A derivation of this beam loading can be found in [35]. For a recirculating ERL, the energy of the bunches will vary from one turn to the next and therefore, we need to consider the one-turn map for each turn, taking into account the energy variation of the bunch during the turn. Furthermore, we also need to factor in the deflection from the HOM on each turn, which will depend on the bunch energy. In general, we can write a simple first-order one-turn map as where R (n) ij is the i, j matrix element for the one-turn map for turn n, x n and x n are the position and angle trajectory of the bunch on turn n and δx (n) HOM and δx (n) HOM are the position and angle deflection from the HOM mode. From Eq. 3, we have a means of determining all the bunch positions if the transverse HOM voltage is known. In addition, from Eq. 2, we can write an expression for the collective beam loading of the HOM mode due to k bunches, taking into account the Q L of the mode and the phase shift between bunches as (4) In Eq. 4, we define without loss of generality that 2Q L = 1. The stored energy in a cavity is given as from Eq. 5, we can determine the RF power transferred by the beam as By substituting Eq. 4 into Eq. 6 and assuming that the bunch charge is either constant for all bunches or periodic such that the mean bunch charge is bounded, then k→∞ j=1 qj δt = I beam , then we obtain: We also know that when the cavity HOM voltage is at equilibrium, where P c is the ohmic power dissipation in the cavity, given as The threshold current is defined as the maximum allowed beam current before the HOM voltage grows exponentially, thus it is the limit of stability for the accelerator. At the threshold current, the HOM voltage is at steady state at some value, below it, the HOM voltage will decay exponentially. Thus the only solutions to Eq. 8 are the trivial case where |V ⊥ | = 0, or when I beam = I th , where I th is the threshold current. We can obtain the threshold current from Eqs. 8 and 9 as (10) From hereon, it is convenient to introduce some definitions as the beam loading will be periodic over several timescales. We define a bunch packet as an ensemble of N consecutive bunches for an N -turn ERL, such that each bunch has completed a different number of recirculating passes. Furthermore, it is assumed that on a given turn, each bunch packet is equivalent. Finally, we know that from Eq. 3 that if the bunch offsets are dominated by the kicks from the HOM, then x j will depend on the HOM voltage, V ⊥ , which in turn will depend on the bunch charge, q j . If we assume that the variation in q j is small, then it can be approximated as a constant. Thus if V ⊥ and x j both depend on the bunch charge, then the overall charge dependence is cancelled in the threshold current. As we shall see further on in this section, the threshold current will have a charge in the equation, although as we know that the charge dependence cancels, we can take q = 1 C for convenience without loss of generality.
From [33] it is known that for any choice of bunch filling pattern and recirculation scheme, the filling pattern will repeat every N turns, or in some cases an integer divisor of N . Additionally, in [33] the concept of a sequence preserving (SP) scheme is discussed, whereby for a given filling pattern, a recirculation scheme can be chosen such that the sequence of bunch turn numbers in a packet is the same on each turn. For SP schemes, we see that the bunch packets are equivalent for all turns and so we can also trivially see that this will indeed be periodic over N turns. To aid in the following derivation, we shall define a form factor for a single bunch packet (f n,k ), a single turn (F n,k ), and N -turns ( F k ) respectively as where k is the bunch number in the packet, n is the turn number. These form factors are a convenient means of quantifying the effect on HOM voltage from the bunches over different timescales. These form factors depend explicitly on the filling pattern and recirculation scheme.
As we assume that the bunch structure is periodic over a bunch packet and also periodic over N turns, then it is also convenient to define the duration of a bunch packet as T packet and the mean revolution period of the ring as T rev = M T packet . Based on this, we can express the 1-turn and N -turn form factors in terms of the bunch packet form factor as We note in Eq. 12 that the summations for the 1and N -turn form factors are finite geometric sums which can easily be evaluated. From Eq. 10 it is convenient to convert the summation in the denominator into a more appropriate form and we shall do so by exploiting the N -turn form factor from Eq. 12 and will consider the summation in Eq. 10 to tend to infinity. .
Next we shall evaluate the HOM voltage from Eq. 10 and for this, we shall assume that the cavity is at steady state, thus over a single turn, the HOM voltage amplitude will be periodic over each bunch packet, however for convenience, we shall determine the HOM voltage from all the bunches in a single turn. Thus we can say that the condition for convergence is given as We can rearrange Eq. 14 and solve for V ⊥ , but we also only need the magnitude of this. We shall once again assume that the bunch charge is constant, thus we can consider the mean bunch charge and we can also express the summation as the 1-turn form factor from Eq. 13 to obtain We can now substitute Eqs. 13 and 15 into Eq. 10 to obtain (16) It should be noted that in general the 1-turn form factor changes turn by turn, therefore this implies that the threshold current is time-dependent as a result of this. We also have that the form factor in the numerator is counting from the (k − 1) th bunch, whereas in the denominator it is counting from the k th bunch. We can express the 1-and N -turn form factors in terms of the bunch packet form factors and sum the threshold current over all bunches and turns to give the following general expression for the average threshold current In Eq. 17, q ω 4Q L is essentially the most basic possible estimate for the threshold current, α is an enhancement factor that depends on the HOM frequency, mean revolution period and number of recirculation turns in the ERL.

A. Worked example: SP schemes
As previously mentioned and also discussed in more detail in [33], SP schemes have the property that the sequence of bunch turn numbers in a packet does not change from one turn to the next. It can be shown that all filling patterns will have a unique recirculation scheme to form an SP scheme, but the converse is not necessarily true. We can use the properties of SP schemes to find a special case form of Eq. 17 because the filling pattern and therefore bunch packet form factors are independent of turn number. .
The ratio of form factors needs to be determined numerically due to the cyclic dependence between |V ⊥ | and the transverse offset of the beam (Eqs. 3 and 15), resulting in a transcendental equation for the cavity voltage. Fig. 3 shows α vs ωT rev for different numbers of recirculation turns (N ) where we have assumed that Q L = 1000. This shows that we expect the mean threshold current to decrease with increasing N , placing a constraint on the feasibility of designing arbitrarily many turn ERLs. Furthermore, it shows that α tends to a series of Dirac δ-functions in the limit that N → ∞. As expected, α is maximal when ωT rev = 2nπ, where n is an integer, and also α ≈ 0 when ωT rev = (2n + 1) π.
B. Properties of the bunch packet form factor, f n,k From Eqs. 17, we note that the threshold current depends on both f n,k and f n,k−1 . This is because |V ⊥ | at some moment in time depends on the cumulative beam loading of all previous bunches; which depends on f n,k−1 . However, the threshold current also depends on the effect this voltage has on the next bunch passing through; which depends on f n,k . It would therefore be beneficial to understand the relationship between the form factor evaluated over different bunches as well as to gain some insight into the structure of the form factor. Starting from Eq. 12, it is useful to express the form factor in a non-modular form. Starting with the modular part, we can rewrite it as We can now remove the modular form since |z| 2 = zz * , and in addition, we can write the multiple of two summations as a double-summation instead to obtain N +k−1 j=k From Eq. 20, we can split the double summation into two separate parts, the first where j = l will become a single summation and for the case where j = l, due to the symmetry of the equation, when know that f (j, l) = f (l, j), thus without loss of generality, we can take double the summation and impose the constraint that j > l to obtain . (21) Eq. 21 can be substituted back into Eq. 12 to give a convenient means of calculating the form factors without needing to compute complex numbers. Furthermore, in this form, we can explore the relationship between f n,k and f n,k−1 by understanding how each summation over k − 1 relates to the summation over k. We shall assume that the ERL is stable and periodic over a bunch packet, thus x N +k = x k and also T N +k = T packet + T k . From the single summation, we can express it as Applying the same to the double summation, we obtain .
Substituting Eqs. 21-24 into Eq. 12, we obtain where (25) Eq. 25 now provides us with an explicit relationship between f n,k−1 and f n,k that can be used to with the computation of I th .
FIG. 4: HOM voltage when test current I test is above (black), below (red), and at (blue) the threshold current.

A. ERL BBU code with Filling Pattern
As the concept of filling patterns for ERLs is relatively new, none of the existing BBU simulation codes are currently able to incorporate this into their calculations. We have adapted the ERLBBU algorithm [22,25,26] to include the calculation of BBU with filling patterns by not assuming a constant bunch spacing. These modifications describe the arrival time and energy of each individual bunch. Benchmarking against the experimental results presented in Table 5.1 of Ref. [26] provided consistent results when applying the same bunch pattern assumed in the literature. Our modified script predicted a threshold current of 2.39 mA, which is slightly closer to the experimental results than other codes and analytical estimates due to these corrections. The ERLBBU algorithm starts with a test current and an initial HOM voltage (which for the following simulations is assumed to be 10 kV transverse voltage). Bunches are injected with small, Gaussian distributed, transverse offsets. This simulation estimates if the cavity voltage increases or decreases over time under the test current, as shown in Fig. 4, and generates a new test current accordingly and repeats the process until the threshold current is determined within a userdefined tolerance range. As seen in Fig. 4, when the threshold current of 2.39 mA is reached, the cavity HOM voltage has converged to an equilibrium value. The assumed parameters are given in Table I. The magnitude of the transverse offset of the bunches also increases or decreases in a similar fashion to the HOM voltage as shown in the Fig. 5.

B. Simulation Initial Parameters
The scan is performed for a 6-turn ERL with 3 accelerating and 3 decelerating turns. To start with we used similar simulation parameters to those used in Ref [26] as summarized in Table. I. The transitioning bunch is that moving from accelerating to decelerating phase. The transition is achieved by delaying the bunch by least half an RF cycle. Therefore, the revolution period of the transitioning bunch is half an RF cycle longer. The injected bunches are 7.3 MeV and they gain/lose 39 MeV in each in accelerating/decelerating turn. We simulated two injection frequencies, which are of 1 5 th and 1 10 th of fundamental mode frequency f , i.e. bunches are injected in every 5 and 10 RF cycles T RF , respectively. The horizontal injection offsets are set 10 times of the vertical as bunches are bent in the horizontal plane and would be dominated by horizontal jitters. Here we don't need to be the exact on the initial parameters like HOM voltages and offset jitters as we are looking at the trend (growth or decline) to decide whether the test current is above or below I th .

C. Frequency dependence
The results show the threshold current is frequency dependent. Firstly, the simulation results show the threshold current is periodic over HOM frequency range of 1.24 MHz as shown in the Fig. 6. The blue, red, and green colors each indicate 1 period of the curve. Such periodicity is expected from the general form the threshold current equation [26] where E beam is the beam energy in electron Volt, e is electron charge, c is speed of light in vacuum, ω H is the HOM angular frequency, R Q HOM is geometric shunt impedance of the HOM, R 12 is the transfer matrix element relates the angular kick to the off-set after one recirculation and T rev is the revolution period. Note that this equation only applicable for estimating threshold current for simple 2-turn ERL. Nevertheless, we can use it to explain periodicity. The period arises from periodicity of the term sin(ω H t tr ). Given the revolution period is 802 ns, the period P f,HOM is 1/T rev = 1.24 MHz. Secondly, we see that the periodicity is not exact but the the threshold current slowly decreases as the HOM frequency increases. Such relation can be also seen from the Eq. 26.

D. Filling Pattern Dependence
We performed ERL BBU tracking simulations and estimated threshold current for different sequence preserving filling patterns, where the cavity will always see same sequence of bunches passing through. The scan is over frequency range of 2.1054 and 2.1066 GHz, which covers one full aforementioned P f,HOM = 1.24 MHz period. As the ERL is 6 turn, 6 bunches form a packet. Such packets are repeated multiple times to fill up the circular accelerator ring.
The scan results for 5T RF spacing are as shown in the Fig. 7. The threshold currents as function of HOM frequencies are given for different patterns. As can be seen, E. Averaged threshold current We performed threshold current scans for the 120 SP patterns. The simulated frequency range is 1 period, P f,HOM , for each pattern. The averaged threshold current over for each pattern is shown in Fig. 8 for the case phase advance µ is 1.5 π. As can be seen, pattern number 12 has the highest threshold current at 2 A, more than 3 times the lowest threshold current. Pattern numbers 10, 12, 19, 23, 33, and 36 have high threshold currents above 1.6 A for both 10T RF and 5T RF spacing cases. Clearly, some patterns are better than others in the terms of lowering BBU instabilities. The highest threshold current is 2.028 Amps when filling pattern No. 12 is used. Overall, the 5T RF bunch spacings have larger threshold currents as can be seen from Fig. 8 and Tab II. The maximum, minimum, and average of the 5T RF bunch spacing are higher than of the 10T RF .
The relationship between threshold current and filling patterns is complicated as several parameters (like bunch arrival times, energies, and orders) change simultaneously when filling pattern is changed, consequently the average threshold currents appear to be random for different filling patterns. The analytical model fails to predict the threshold current of such a complicated system and one has to rely on numerical simulation tools only.
Another observation is that the spacing of the bunches   has a big effect on the threshold currents for some patterns but not others. In pattern number 12 for example, both 5T RF and 10T RF spacings have similar threshold current, while pattern number 43 for example does not.
We also compared frequency scans of these two patterns, as shown in Fig. 9.
FIG. 10: Average threshold current 120 SP patterns with different phase advances with 10T RF bunch spacing. Threshold currents are higher when phase advances are integer times of π F. Phase advance dependence of threshold current A scan of threshold currents with the two different phase advances of 1.5 and 2 π with 10T RF bunch spacing is shown in Fig. 10. When the phase advance is integer times π, bunches enter the cavity with minimum offset and hence the BBU instability is minimized. Consequently, the threshold currents are increased greatly. We see when the tune changed, the dependence of the threshold current on the patterns have changed as well.
The BBU threshold current is dependent on many parameters that interact in a complicated manner, making it difficult to choose the best pattern with the highest threshold current using the analytical approach. We have however demonstrated that one can find the best filling pattern for a given set of parameters by performing pattern scans with numerical simulations.

IV. CONCLUSION
We have investigated the impact of filling pattern choice in a multi-pass ERL on the regenerative BBU instability. We find analytically that the mean threshold current decreases with increasing ERL turn number, placing constraints on the feasibility of designing arbitrarily many turns. In [27] states a scaling rule of I th with the number of turns as 1/ (N (2N − 1)), which differs slightly from our own form given as α and α in Eq. 17 and 18, which provides a more generalised expression for this scaling law, although it is also clear that the scaling law will depend on the recirculation scheme. We demonstrated filling pattern dependence of the regenerative BBU instability threshold current. For example, we observed a factor of 3 difference in the threshold current between worst and best patterns for SP schemes. The threshold current and best filling pattern depend on many parameters interacting in a complex manner. We constructed a new ERL tracking code to numerically scan for the best filling pattern to maximise the threshold current. This tool will assist in the design of future ERL projects.