Passive higher-harmonic rf cavities with general settings and multibunch instabilities in electron storage rings

© 2018 authors. Published by the American Physical Society. Published by the American Physical Society under the terms of the »https://creativecommons.org/licenses/by/4.0/» Creative Commons Attribution 4.0 International license. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI. We introduce a perturbation-theory, mode-analysis method for longitudinal multibunch instabilities driven by the higher harmonic cavity (HHC) fundamental mode. The method, based on the exact solution of the unperturbed particle motion in the rf bucket and suitable for modeling the effect of cavities with general settings, is applied to study the feasibility of reutilizing the existing Advanced Light Source (ALS) HHCs in the ALS Upgrade (ALS-U). We find that with ALS cavities the ALS-U would be susceptible to a fast =1 mode instability. Interestingly, the instability is driven by the imaginary rather than the real part of the cavity fundamental-mode impedance.


I. INTRODUCTION
The ALS-U is the Advanced Light Source (ALS) upgrade to a multibend achromat lattice, diffraction-limited light source [1]. While the upgrade entails the replacement of most components, for obvious reasons it is desirable to recycle as much as possible of the existing infrastructure, including the rf systems and in particular the passive normalconducting higher-harmonic cavities (HHCs). HHCs are widely employed in the new-generation light sources to lengthen the bunches and reduce intrabeam scattering.
In passive operation, the basic HHC physics parameters are the shunt impedance R s and the fundamental-mode resonance frequency ω r . Adopting common language, we say that these parameters are "optimal" [2] if first and second derivatives of the total rf voltage experienced by the synchronous particle vanish (bunch profile maximally flat). For a given circulating average beam current, there is a unique pair of R s and ω r meeting the optimum condition.
The ALS currently operates with three 3rd-harmonic cavities, each with R s ¼ 1.7 MΩ. As a result of a lower main-cavity voltage requirement, in the ALS-U the optimum HHC shunt impedance is only 1.35 MΩ. In principle, a single ALS HHC, having shunt impedance close to optimum, would then be sufficient. Unfortunately, the resulting power loss would significantly exceed the cavity limit (about 5 kW).
The combined shunt impedance of two ALS cavities is farther from optimum but two cavities would still achieve the desired (∼4) bunch-lengthening factor and reduce scattering effects as effectively, since the latter are not critically dependent on the details of the bunch longitudinal profile. A larger shunt impedance is accommodated by tuning the HHCs further away from the 3rd-harmonic of the rf generator frequency, and while this comes with some advantages (lower dissipated power and Robinson instability growth rate) it has the potential to drive the longitudinal l ¼ 1 coupled-bunch instability mode. The study of this mode is the main topic of the paper. The problem is investigated by mode analysis with the primary goal of estimating the growth rates.
The framework for a perturbation-theory mode analysis applicable to our problem goes back at least to Sacherer's work in the 1970s [3] and later refinements by Wang and others [4][5][6][7][8][9][10], but to our knowledge it has always been applied in the form specialized to optimum HHC configuration, with more general cases handled by some heuristic adaptation of this theory [11,12]. Our approach is based on the exact numerical solution of the unperturbed particle motion at equilibrium, similar to the method successfully applied in the analysis of single-bunch broad-band impedance driven instabilities [13][14][15], permitting an accurate treatment of the more general HHC settings. Our main result is a mode l ¼ 1 growth-rate estimate of about 5 ms −1 . In combination with the mode low oscillation frequency (less than 50 Hz), this appears to place the instability out of reach of existing longitudinal feed-back systems [16], thus undermining the feasibility of reusing two ALS HHCs as existing.
The content of the paper is as follows. In the next section we establish notation and sketch the derivation of the linearized Vlasov equation for mode analysis. In Sec. III we write and solve the dispersion-relation equation for the set-up with two ALS HHCs over a range of cavity tuning. In Sec. IV we study the dispersion equation for optimum HHCs in the approximate form found in the literature. Although the latter would be expected to apply strictly only to the optimum case, we attempt to apply it also to nonoptimum HHCs (tuned for comparable bunch lengthening) and find reasonable agreement with the results from Sec. III. We then work out asymptotic approximations to the solutions and use them to recognize that while the l ¼ 0 mode (Robinson's) instability is driven by the real part of the impedance, in the case of interest the l ¼ 1 mode instability is driven by the imaginary part. The Appendices report formulas for beam loading (A), bunch equilibrium and optimum HHC settings (B), details on the numerical method (C), effective impedance for the modes of interest (D), and useful formulas for motion in a purely quartic potential (E).

II. LINEARIZED VLASOV EQUATION
We write the equations of motions for synchrotron oscillations as where V rf ðzÞ is the total rf voltage, E 0 the design beam energy, T 0 the revolution time, U 0 the energy per turn lost to radiation, α > 0 the momentum compaction, δ ¼ ðE − E 0 Þ=E 0 the particle relative energy, and z the longitudinal coordinate. We adopt the sign convention z < 0 for a particle in the bunch head and eV rf > 0 for energy gain (elementary charge e > 0). The total voltage V rf ðzÞ ¼ V 1 ðzÞ þ V 3 ðzÞ results from main and passively operated 3rd higher-harmonic cavities. A cavity voltage has two contributions, one from the external rf generator and the other from beam loading. For simplicity, we model the main rf cavity voltage without distinguishing between the two and credit the rf feed-back system with maintaining the voltage amplitude V 10 and phase ϕ 1 to their set values: V 1 ðzÞ ¼ V 10 sinðk 1 z þ ϕ 1 Þ, where k 1 ¼ ω 1 =c with ω 1 ¼ hω 0 being the rf generator frequency, h the (main cavity) harmonic number, and ω 0 ¼ 2π=T 0 the revolution frequency. Throughout this paper we assume a uniform beam filling with all the rf buckets occupied by bunches having particle population N and hence I avg ¼ eNω 1 =2π ≡ eN=T 1 average circulating current.
The voltage of passive HHCs, V 3 ðzÞ ¼ V 3;0 ðz; ρ 0 Þþ V 3;1 ðz; ρ 1 Þ, is entirely due to beam loading and can be distinguished into two components, one depending on the bunch profile ρ 0 ðzÞ at equilibrium and the other on the timedependent deviation e −iΩt ρ 1 ðzÞ from equilibrium occurring during an instability, where Ω is the mode complex-number frequency. The first has the form where F and Φ are the amplitude and phase of the Fourier integral of the bunch profileρ 0 ðk 3 Þ ¼ Fe iΦ evaluated at the third-harmonic k 3 ¼ ω 3 =c ¼ 3ω 1 =c, and ψ is the HHC tuning angle (see Appendix A). The second is where ZðωÞ is the HHC fundamental-mode impedance,ρ 1 is the Fourier integral of ρ 1 ðzÞ, and ω p;l ¼ ðph þ lÞω 0 , with l ¼ 0; 1; …; h − 1 being the instability coupledbunch mode number of interest (for a justification of this expression, see [5,6,[17][18][19]). For brevity we will write ω p without the mode index and introduce the notation The sum in (4) extends to AE∞ but because Z is narrowband centered in a neighborhood of ω 3 , to very good approximation it can be restricted to p ¼ AE3. We then write the total rf potential as the sum of zeroand first-order terms V rf ðzÞ¼V rf;0 ðz;ρ 0 ÞþV rf;1 ðz;ρ 1 Þ, The equations of motion are canonical with Hamiltonian H ¼ αcδ 2 =2 þ UðzÞ and potential UðzÞ ¼ U 0 ðzÞ þ U 1 ðzÞ, with Similarly, we decompose the Hamiltonian as Having introduced the action/angle variables ðJ; φÞ for the unperturbed motion and used the corresponding canonical transformation to change the variables ðz; δÞ → ðJ; φÞ in the perturbed system (in the following z ¼ ζðJ; φÞ will denote the spacial coordinate part of this transformation), the Vlasov equation for the beam phase-space distribution reads Through first order Any function Ψ 0 of H 0 solves (8) and is an equilibrium. The physical equilibrium in an electron storage ring has the particular form where A is a normalization constant and β is determined so as to yield the thermal distribution ∼e −δ 2 =2σ 2 δ in energy deviation, with σ δ being the natural rms energy spread. From inspection of the kinetic part of the Hamiltonian we infer β ¼ αcσ 2 δ and therefore has normalization R ρ 0 ðzÞdz ¼ 1. Note that (11) is a nontrivial equation since the HHC part of the potential U 0 ðzÞ depends on ρ 0 ðzÞ through F and Φ [20], see Appendix B. Write Ψ ¼ Ψ 0 þ e −iΩt Ψ 1 and the linearized equation (9) becomes where ω s ¼ ω s ðJÞ ¼ ∂H 0 =∂J is the synchrotron oscillation frequency. Representing the perturbation Ψ 1 ðφ; J; ΩÞ ¼ P ∞ m 0 ¼−∞ R m 0 ðJÞe im 0 φ as a series of azimuthal modes, we have Upon multiplying by e −imφ , integrating over φ, and defining the following functions involving the canonical transformation ζ (see, e.g., Mosnier [14]) we finally write: For later convenience, we have renamed the index p → p 0 .

III. DISPERSION-RELATION EQUATION
In (17) multiply by H m;p ðJÞ, divide by ðΩ − mω s Þ and integrate over J to find where G m;p;p 0 ðΩÞ ¼ In its form, Eq. (19) is strictly valid for Im Ω > 0 (unstable modes); it can be extended to the whole complex plane by analytic continuation but for our purposes this will not be necessary. Upon truncating the sum on m 0 , Eq. (18) reduces to a 2ð2m max þ 1Þ system of linear equations in the form being the entries of the 2ð2m max þ 1Þ × 2ð2m max þ 1Þ dimensional square matrix B, leading to the dispersionrelation equation An alternative approach, not adopted here but useful if we are interested in determining the form of the eigenfunctions, is to introduce S m ðJÞ ¼ ½Ω − mω s ðJÞR m ðJÞ½ ∂Ψ 0 ∂J −1 and rewrite and then proceed with a discretization of SðJÞ on a grid [15]. Equation (22) is solved numerically searching for roots with positive imaginary part for the l ¼ 0 and l ¼ 1 modes over a range of tuning angles ψ. Finding the numerical solution entails determining the equilibrium ρ 0 ðzÞ and associated potential U 0 ðzÞ (Appendix B); and synchrotron frequency ω s ðJ i Þ, Hamiltonian H 0;i ¼ R J i 0 ω s ðJ 0 ÞdJ 0 , and canonical transformation ζðJ i ; φÞ on a grid J i , (see Appendix C). As a technical aside, the integral in (19) is best computed after a change of integration variable from J to r ≡ z R ¼ ζðJ; 0Þ, where z R is the coordinate of the right turning point of the unperturbed orbit with action J.
The solutions, based on the ALS-U machine and HHC parameters of Tables I and II, are shown in Fig. 1 indicating a large l ¼ 1 mode instability growth rate of about 5 ms −1 , for the design ψ ¼ 86.5 o working point yielding the desired bunch length. The dashed curve in the bottom right picture is the approximate asymptotic expression (49) derived later in Sec. IV B; the solid line is the expression (32), which applies to the limit where the HHCs are effectively turned off. In the bottom-left picture the solid line is Eq. (45), seen to track the numerical result very closely over the entire tuning angle range (we will get back to this point). For later consideration, notice that the ratio ImΩ=ReΩ is much smaller (larger) than unity for l ¼ 0 (l ¼ 1).
We expect coupled-bunch mode l ¼ h − 1 (or equivalently l ¼ −1) to have a similar growth rate as l ¼ 1. As for the higher order modes l > 1 we expect them to lead to weaker (if any) instabilities since the beam-spectrum lines ω 3 AE lω 0 probe the impedance tails farther away from the resonance peak (see Fig. 6).
The bunch profiles for various HHC tuning are shown in Fig. 2, while Fig. 3 highlights the bunch profile for the nominal settings and related quantities of interest. The numerical calculation was done by retaining only the jmj ¼ 1 dipole components; we verified that including the quadrupole components jmj ¼ 2 changes the results only slightly.
In the next section we specialize the calculation to the dipole approximation and consider two limiting cases. One where the HHCs are absent (quadratic potential) and the other where they have optimum settings. We represent the rf potential in the second case as a pure quartic and use a simplified analytical expression for the canonical transformation to derive the approximate dispersion-relation equation in the form found in the literature. We solve this equation numerically and we work out asymptotic approximations to the solutions to gain insight into how the impedance relates to the instability.

IV. DIPOLE APPROXIMATION
Introduce the usual definition of effective impedance Z eff ðΩÞ ¼ P At that setting, the growth rate of the instability is about 5 ms −1 (or 0.2 ms growth time) while the oscillation frequency is less than 50 Hz (or 20 ms period); the large disparity between the two characteristic times places the instability out of reach of existing longitudinal feedback system. The pictures to the left are for the much more benign l ¼ 0 (Robinson's) instability. Note that for this instability the oscillation frequency of the mode remains very close to the synchrotron oscillation frequency in the absence of HHCs (about 2.7 kHz, see Table I). See the text for the meaning of the curves in the bottom pictures.
In particular, for short bunches ω 3 ζ=c ≪ 1: whereζ m ðJÞ ¼ ð2πÞ −1 R 2π 0 e imφ ζðJ; φÞdφ is the Fourier integral of the canonical transformation. The dispersionrelation equation then reduces to A. Quadratic potential In the absence of harmonic cavities, the synchrotron frequency is amplitude-independent ω s ðJÞ ¼ ω s0 , with the bunch equilibrium having the form of a gaussian. The relevant part of the canonical transformation to action/angle variable is z¼ζðJ;φÞ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi Jαc=ω s0 p cosφ, yieldingζ 1 ðJÞ ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi Jαc=ω s0 p =4π, and the dispersion equation (26) becomes or equivalently, since having defined the current parameter Consider two limiting cases depending on whether the imaginary part Ω i of the complex mode frequency Ω ¼ Ω r þ iΩ i is much larger or smaller than the real part Ω r : If the detuning is small, we recover Sacherer's equations in the short-bunch limit (see [9,21]), Ω r ≃ ω s0 and B. Quartic potential (approximate canonical transformation) 1. Exact numerical solution to the approximate dispersion-relation equation In a purely quartic potential the transformation from canonical to physical coordinates has the approximate form z ¼ rðJÞ cos φ with rðJÞ given by (E2) being a function of J only; the approximation (amounting to neglecting φ-harmonics of ζðJ; φÞ of order higher than one), is accurate within 4-5% [6]. With this, the function H 1;3 ðJÞ ¼ iJ 1 ðk 3 rðJÞÞ reduces to a Bessel function of the first kind J 1 . After a change of integration variable, the dispersionrelation equation reads where we have made use of the expression (E5) for the equilibrium, introduced the dimensionless scaled mode frequency (Appendix E) and used the notation Γ 1=4 ≡ Γð1=4Þ for the Euler gamma function. This is the equation usually found in the literature in connection with HHCs, (in this form or with the additional short-bunch approximation J 1 ðc 1 xÞ ≃ c 1 x=2). Note that some authors present a version that differs from (34) in that only the m ¼ þ1 term is included in the derivation (with the result that the denominator in the  Table III. integrand is linear rather than quadratic in x); as pointed out in [5,6] both m ¼ AE1 should be included. Define and introduce the dimensionless effective-impedance parameter to write the dispersion-relation equation (34) in the form We solve (38) numerically to study the l ¼ 0, 1 modes for optimum HHCs and represent the solutions by Keil-Schnell diagrams, top pictures in Fig. 4.
In these plots, the solid red curves are drawn by letting ReΩ vary in ½−∞; ∞ while ImΩ is set to the imaginary part of the numerical solution, as indicated. Similarly, the green curves are drawn by letting ImΩ vary in ½0; ∞ while ReΩ is set to the real part of the numerical solution as indicated, so that the solutions are at the intersection of the red and green curves. The red dashed curve, corresponding to ImΩ ¼ 0 is the stability boundary: if ζ eff falls within the region containing the origin, as in the top-right picture, the mode is stable (Landau damping) [22].
We also make an attempt to apply (38) to the study of the two nonoptimum ALS HHCs (bottom figures in Fig. 4). In the calculation we used σ z ¼ 14.7 mm as determined from the exact equilibrium and then estimated hω s i using Eq. (E6). We found results that are within 10% of the more accurate solution obtained in Sec. III, see summary in Table III. In the next section, we will then feel encouraged to employ (38) as a basis to work out analytical asymptotic expressions for studying the solutions in both the optimum and nonoptimum HHC cases.
From the table, also notice that the Robinson (l ¼ 0) instability is considerably larger in the optimum HHC case, but still slow enough to be radiation damped (the radiation damping time being τ z ¼ 14 ms).

Asymptotic analytical solution to the approximate dispersion-relation equation
Under the assumption jΩj ≫ 1, we approximate the denominator in the integrand of (36) asΩ 2 − x 2 ≃Ω 2 and write having expanded the square of the Bessel function through fourth order, in order to find the dispersion-relation equation for the asymptotic approximation to the solution.
In terms of Ω, the mode frequency in physical units, Eq. (38) reads with current parameter defined aŝ where ffiffi ffi 2 p π 2 =Γ 2 1=4 ≃ 1.06. Next, write Ω ¼ Ω r þ iΩ i and consider the following two subcases. (1) Case Ω i ≪ Ω r . Relevant for mode l ¼ 0. We have Ω 2 r þ 2iΩ r Ω i ≃ iÎReZ eff −ÎImZ eff , and therefore Specifically, for l ¼ 0 (see Appendix D) It turns out that for l ¼ 0 and optimum HHCs, it is always jΩj ≫ 1, thus making the asymptotic analytic expression (45) always valid. To show this, make use of (B8) with Φ set to zero to find 3 sin 2ψ ¼ V 1 j cos ϕ 1 j=ðI agv R s FÞ, insert in (44), and recall (35) to find Since F is on the order of unity and in electron machines k 1 σ z is naturally small,Ω r and henceΩ are significantly larger than unity (for ALS-U, k 1 σ z ≃ 0.15 andΩ 2 r ≃ 60).  [18]. Also, notice that it tracks remarkably well the l ¼ 0 mode growth rate for nonoptimum HHCs over the whole tuning range, (solid curve in the bottom-left picture of Fig. 1). (2) Case Ω r ≪ Ω i . This is relevant for mode l ¼ 1 when using two ALS HHCs. We have −Ω 2 i þ 2iΩ r Ω i ; ≃iÎReZ eff −ÎImZ eff , and therefore (for ImZ eff > 0) Specifically, for l ¼ 1, see (Appendix D) From Eq. (47), note that in this regime it is the imaginary, not the real, part of the impedance that drives the instability, see also Figs. 5 and 6 for a graphical explanation.
The accuracy of (49) as judged from Fig. 1, dashed curve, is not as good as that of (45) as jΩj ≃ 1.4 is only marginally greater than unity and the asymptotic approximation not fully valid.
FIG. 5. Comparing the instability drivers for the l ¼ 0 (left) and l ¼ 1 (right) mode instability. For the l ¼ 0 mode it is the real part of the HHC fundamental mode impedance to be relevant and the instability growth rate depends on the difference between the values of Re Z on the upper ω 3 þ Ω r and lower ω 3 − Ω r sidebands, where Ω r is the (real) mode oscillation frequency, divided by Ω r or, effectively, the derivative of Re Z at ω ¼ ω 3 . The pictures indicate that the Re Z (positive) slope for the optimum HHCs (top) is larger than that for the ALS HHCs (bottom) and therefore the instability higher. (For better illustration, in the picture Ω r is not to scale.) In contrast, for mode l ¼ 1, in the regime where the asymptotic approximation (47), (49) applies, it is ImZ to be relevant: the growth rate is proportional to the square root of the algebraic sum of the two contributions −ð3=2ÞR s sinð2ψ 1 Þ and −ð3=2ÞR s sinð2ψ −1 Þ at ω 3 þ ω 0 and ω 3 − ω 0 respectively, see Eq. (D5). When the resonance frequency ω r is to the right of ω 3 (this is where HHCs are operated for bunch lengthening), the sum is always positive but it is much larger for the ALS HHCs (bottom-right picture) since these are tuned further away from ω 3 . In fact, for optimum HHCs that sum is small enough for Landau damping to suppress the instability (see the top-right picture in Fig. 4).
FIG. 6. Real (blue) and imaginary (red) part of the effective impedance for mode l ¼ 1 for two ALS HHCs (solid) and optimum HHCs (dashed). The picture highlights how the ALS HHCs operating tuning range is at larger angles ψ (i.e., away from the resonance peak) compared to the optimum HHCs reflecting a larger shunt impedance. The left ends of the two ranges correspond to about a factor 4 lengthening in both cases. The larger ALS-HHC Im Z eff is the reason for the higher sensitivity to the l ¼ 1 mode instability.
We recognize that the asymptotic expressions derived here are very similar in form to those valid for a quadratic potential (previous section) with current parameterÎ G replaced byÎ. The two normalized current parameters are also very closê having used k 1 σ z ≃ 0.15. In other terms, in the regime where the asymptotic approximation applies, the instability growth rates calculated using a Gaussian-profile approximation for the bunches are off by only 10%. We should note that this is the regime where Landau damping is absent. This is a good place to pause and call attention to confusing statements on Landau damping occasionally found in the literature. Sometimes (e.g., [18], p. 333), a growth rate is first estimated invoking a quadratic form for the potential as in Sec. IVA, accompanied by the (correct) disclaimer that the naive derivation ignores Landau damping, with Landau then credited as yielding damping with a rate equal to some fraction of the system frequency spread, possibly restoring stability if the latter is large enough. Not always emphasized is the crucial qualification that in order for Landau damping to appear, the real part of the frequency of the mode of interest should overlap with the system natural frequency spread (here due to the rf bucket nonlinearities). In fact, this overlap does not occur for the HHC-induced Robinson instability since, as noticed in the comment made below Eq. (46), we always have jΩj ≫ 1.
In other words, (45) is an already accurate growth-rate estimate and Landau cannot be expected to come to the rescue (nor in this case would Landau's help be needed, since the combined main and higher-harmonic cavity system tends to be Robinson stable even before radiation damping is factored in). For instabilities other than Robinson's (e.g., due to HOMs) Landau damping from the HHC-induced synchrotron-oscillation frequency spread may or may not materialize, depending on the characteristics of the impedance and other relevant machine parameters. In fact, in many cases the presence of HHCs can aggravate the longitudinal instabilities, a known but not widely acknowledged fact [8,23,24]. On the other hand, the l ¼ 1 mode damping found for optimal HHCs is an example where Landau damping is effective. Somewhat analogously, in the transverse plane HHCs help with damping instabilities in the presence of finite chromaticities [25] but may worsen the TMCI instability [26]. Further complicating the matter, we should add that there are other potential sources of Landau damping to multibunch longitudinal instabilities not considered here, like bunch-to-bunch synchrotron oscillation variations due to nonuniform beam filling [27,28].

V. SUMMARY AND CONCLUSIONS
In conclusion, we have shown that use of two of the existing ALS HHCs in the upgraded ALS can achieve the sought bunch lengthening but at the cost of driving a fast l ¼ 1 longitudinal mode instability difficult to control. The reason is a shunt impedance of the two combined cavities significantly larger than the ALS-U optimum, forcing a large detuning that pushes the HHC fundamental mode to overlap with the ω 3 þ ω 0 beam-spectrum line.
Short of installing a newly designed system, a conceivable solution to the problem is to add the third ALS HHC in the bunch-shortening mode (negative tuning angle ψ < 0) while the other two are retuned to maintain the desired bunch lengthening. This helps in two ways: it forces the resonance peak of the other two cavities closer to the 3rdharmonic and creates a negative contribution to Im Z eff , thus compensating the other two cavities' positive contribution. We have found a combination of tuning angles that would work in principle and result in complete (Landau) damping of the offensive mode. However, it remains to be determined if the solution is practical as the cavities power loss would be close to the limit. A more detailed discussion will be reported elsewhere.
While the relevance of the most immediate conclusion is somewhat restricted to the particular ALS/ALS-U circumstances, our study includes findings that are of more general interest. Summarizing, we have established: (i) a formula [Eq. (45)] that improves, albeit slightly, on the commonly found expression for the HHC-induced Robinson instability; (ii) that this instability is generally not Landau damped [Eq. (46)]; (iii) that the mode l ¼ 1 may or may not be Landau damped depending on the HHC parameters and that in the case of interest the instability is driven by the imaginary rather than the real part of the impedance [Eq. (47)]; (iv) a consistent set of equations to frame the problem of determining the optimum HHC settings (Appendix B); (v) a simple formula for the power loss for optimum HHCs [Eq. (B14)].
We emphasize that the analysis of the l ¼ 1 mode cannot be carried out using the familiar Sacherer's formulas (which relate the instability to the real part of the impedance [9,21]), and doing so would result in a large error.
Finally, our calculation was carried out under the assumption (not fulfilled by the ALS-U) of uniform beam filling. While we do not expect the presence of the eleven 10 ns gaps envisioned in the ALS-U beam for swap-out injection to alter the result substantially, it is possible that the presence of the gaps could have some stabilizing effect. This will be addressed in future studies. Also left to future work is the extension of mode analysis to include the relevant and desirable regime where the bunch is overstretched (double-well rf potential), [29,30].

ACKNOWLEDGMENTS
We acknowledge useful discussions with S. De Santis, C. Steier, K. Baptiste, F. Sannibale, and the ALS-U team. Work supported by the US Department of Energy Contract No. DE-AC02-05CH11231.

APPENDIX A: BEAM LOADING IN THE HHC
Coupling of the circulating beam with a passive cavity is modeled by the wake potential WðtÞ and/or the corresponding impedance ZðωÞ: Causality implies that WðtÞ ≠ 0 only for t ≥ 0. We assume the resonator model The effect of a passive HHC on beam dynamics is fully described by the shunt impedance R s , quality factor Q, and resonant frequency ω r . Notice our sign convention, where the tuning angle ψ ω is positive for frequency ω below the cavity resonant frequency, ω < ω r . To simplify notation in this section introduce τ ¼ z=c in units of time to denote the longitudinal coordinate. Assume the beam consists of a uniform train of bunches separated by T 1 ¼ T 0 =h (all buckets are occupied), with identical profile ρðτÞ and N particles/bunch. The voltage experienced by a test particle with coordinate τ in one bunch is affected by the passage of that bunch and particles of other bunches that passed earlier: where the sign is consistent with eV < 0 indicating energy loss. Because of causality, the sum over m can be extended to −∞ without changing the result. Using (A1) and into (A4) yields VðτÞ ¼ −eNð2πÞ −1 P ∞ m¼−∞ R ∞ −∞ dω× ρðωÞe −iωðτþmTÞ ZðωÞ. Next, use the Poisson sum rule P ∞ m¼−∞ e −imωT 1 ¼ 2π P ∞ p¼−∞ δðωT 1 − 2πpÞ and obtain with I avg ¼ eN=T 1 . Assuming the HHC resonance to be sufficiently narrow, only the terms p ¼ AE3 (third-harmonic cavity) in the sum will contribute appreciably. Finally, making use of (A2) we conclude VðτÞ ≃ −I avg ½ρðω 3 ÞZðω 3 Þe −iω 3 τ þ c:c: having expressed the bunch form factor at the third harmonic frequency ω 3 ¼ 3ω 1 in terms of amplitude and phase:ρðω 3 Þ ≡ Fe iΦ . In the above equation and throughout the paper ψ ≡ ψ ω 3 is the HHC tuning angle.

APPENDIX B: BEAM EQUILIBRIUM AND OPTIMUM HHC SETTINGS
At equilibrium the combined total rf voltage from main and higher-harmonic cavities is Introduce the scaled potential uðz; F; The expression (11) for the bunch profile at equilibrium with normalization R ρ 0 ðzÞdz ¼ 1 reads We choose the coordinate system so that ðz ¼ 0; δ ¼ 0Þ corresponds to the synchronous particle at equilibrium. Energy balance for the synchronous particle requires eV rf;0 ð0; ρ 0 Þ ¼ U 0 , or from Eq. (B1) Equation (B3) can be regarded as a functional equation in the unknown ρ 0 ðzÞ, similar in form to a Haissinski equation or an algebraic equation in the two unknowns F and Φ. Adopting the latter interpretation we proceed to evaluate the FT of (B3) at k ¼ k 3 and write For the given shunt impedance R s and tuning angle ψ, Eq.'s (B6) and (B7) in combination with (B4) can be solved numerically for F, Φ, and ϕ 1 . Optimally designed HHCs are defined as yielding an rf potential V rf;0 ðz; ρ 0 Þ with vanishing first and second derivative at z ¼ 0, i.e., The exact determination of the optimum settings entails the simultaneous numerical solution of the five equations (B4) and (B6)-(B9) for the five unknowns F, Φ, ϕ 1 , R s , and ψ. However, anticipating that the rf potential is accurately approximated by retaining only the quartic term (an even function, implying Φ ¼ 0), one can easily work out the following simple and fairly accurate analytical expressions. From (B6), expanding cosðk 3 zÞ through second order, F ≃ R ½1 − ðk 3 zÞ 2 =2ρ 0 ðzÞdz ¼ 1 − ðk 3 σ z Þ 2 =2, and from (B4), (B8), and (B9) consistent with, e.g., [18]. For ALS-U parameters, with natural bunch length σ z0 ≃ 3.5 mm and bunch lengthening factor ∼4 [see Eq. (E7) in Appendix E], we have F ≃ 0.9 and the optimum R s can be quickly determined from (B12) once the tuning angle is derived from the two previous equations. To avoid confusion, note that (B12) is strictly valid only for ψ given by the optimal value (B11). The beam power lost to the HHCs is calculated by averaging the voltage over a bunch and multiplying by the average circulating current valid for arbitrary values of shunt impedance and tuning angle; the second equality follows from R dzρ 0 ðzÞ cosðk 3 z þ ψ − ΦÞ ¼ F cos ψ. Interestingly, for optimum HHCs combining (B12) and (B13) yields the following handy formula exhibiting no explicit dependence on shunt impedance or tuning angle where P rad ¼ I avg U 0 =e is the power lost to radiation. Observe that in the limit of vanishing radiation energy loss (U 0 → 0), P cav vanishes. In this limit, both the main and higher-harmonic cavities are operated at the zerovoltage crossing phase and in a bunch with symmetric profile as many particles lose as gain energy.

APPENDIX C: NUMERICAL DETERMINATION OF THE CANONICAL TRANSFORMATION
From the unperturbed Hamiltonian H 0 ¼ αcδ 2 =2 þ uðzÞαcσ 2 δ we derive the action variable: where z L < z R are the left/right turning points determined as the two z-roots of 2H 0 =ðαcÞ − 2uðzÞσ 2 δ ¼ 0. (Our analysis is restricted to the case where there is only a single pair of turning points, excluding the double-well potential case). From the synchrotron oscillation period one deduces the synchrotron oscillation frequency ω s ðJÞ ¼ 2π=T s . To determine the canonical transformation z ¼ ζðJ; φÞ we proceed as follows. (i) Establish z max > 0 such that e −uðz max Þ < ε, for ε sufficiently small. Set H 0;max ¼ uðz max Þαcσ 2 δ and find z ¼ z min < z max as the second root of H 0;max ¼ uðzÞαcσ 2 δ . Verify that e −uðz min Þ < ε; if not, choose a larger z max and repeat. (ii) Determine z e , the coordinate of the elliptical (stable) equilibrium point by solving u 0 ðz e Þ ¼ 0. On a uniform grid, introduce the turning points to the right of z e , z R;i ¼ iΔz, i ¼ 0; 1; …n z − 1, with Δz ¼ ðz max − z min Þ=n z . Each z R;i identifies a distinct orbit, with left turning point z L;i obtained by finding the second root of H 0;i ¼ uðzÞαcσ 2 δ , where H 0;i ¼ uðz R;i Þαcσ 2 δ . (iii) From (C1) and (C2) determine the action J i and period T s;i corresponding to the orbit with turning point z R;i . (iv) Solve the equations of motion for the unperturbed Hamiltonian numerically with initial conditions zðt ¼ 0Þ ¼ z R;i and δðt ¼ 0Þ ¼ 0, to find the orbit ðzðt j ; iÞ; δðt j ; iÞÞ on a uniform grid t j . Use φ j ¼ ω s ðJ i Þt j , relating the angle coordinate φ to time, and thus determine the canonical transformation ζðJ i ; φ j Þ ¼ zðt j ; iÞ on a rectangular grid.

APPENDIX D: EFFECTIVE IMPEDANCE
Following established conventions, we define the effective impedance as Z eff;l ðΩÞ ¼ X p¼AE3 ω p;l ω 1 Zðω p;l þ ΩÞ; ðD1Þ where ω p;l ¼ ðph þ lÞω 0 . We are specifically interested in the effective impedance associated with the fundamental mode of a third-harmonic cavity, to which only the terms p ¼ AE3 contribute significantly. For vanishing or small mode number l ≪ h the coefficient in front of Z can be approximated as ω AE3;l =ω 1 ≃ AE3 and therefore Z eff;l ðΩÞ ≃ 3Zðω 3;l þ ΩÞ − 3Zðω −3;l þ ΩÞ; ðD2Þ where ω AE3;l ¼ AEω 3 þ lω 0 . Expressions in the small Ω limit: (i) Effective impedance for l ¼ 0 mode: Z eff;l¼0 ðΩÞ ≃ 4R s Qcos 2 ψ sinð2ψÞ Ω ω 1 − 3iR s sinð2ψÞ þ OðΩ 2 Þ: ðD3Þ (ii) Effective impedance for l ¼ 1 mode. Define the tuning angles ψ AE1 : We have: For instability analysis the Ω dependence can effectively be ignored. Also, observe that mode l ¼ h − 1 (equivalent to l ¼ −1) has the same ImZ eff as l ¼ 1 and therefore can be expected to exhibit similar growth rate.