Magnet strength measurement in circular accelerators from beam position monitor data

Recent measurements of resonance terms suggested the extension of the existing technique to measure magnet strengths from turn-by-turn beam position monitor data. This article describes the algorithm to infer the magnet strength from the variation along the ring of the resonance terms and reports on the first measurement. Both the algorithm and the software written for the analysis of the data can be particularly useful in the commissioning period of an accelerator in order to find magnets with wrong strengths or polarities as well as magnets with large magnetic errors.


I. INTRODUCTION
Global and local resonance terms were measured in the Super Proton Synchrotron (SPS) and the Relativistic Heavy Ion Collider (RHIC) [1,2] from the Fourier spectrum of turn-by-turn data.The possibility of extending this technique to measure magnet strengths was proposed in [2,3] but could not be applied in the respective accelerators due to technical reasons.
The SPS, equipped with strong sextupoles, is an ideal test-bench to prove the feasibility of magnet strengths measurement.We have used existing beam position monitor (BPM) data acquired in [4].During this experiment the beam motion was excited by a single kick in the presence of seven strong sextupoles.The existing data have been now reanalyzed using an independent software application [5].The newly computed resonance driving terms are in agreement with those obtained in [4].For the first time, the measurement of the strengths of these seven sextupoles using resonance terms is presented here.This technique can be particularly useful in the commissioning period of an accelerator in order to find magnets with wrong strengths or polarities as well as magnets with large magnetic errors.
In Sec.II the normal form formalism [6,7] is briefly introduced.The scope of this section is threefold.First, it provides the basic ingredients (although already derived in [8]) necessary for the comprehension of the new formulas.Second, it shows how to compute the Hamiltonian coefficients h jklm directly from the magnet strengths, rather than from the harmonic analysis of particle tracking data.Third, as the sign in some exponential terms depends on the choice of the complex Courant-Snyder coordinates (q ip q ), we aim to collect all the fundamental relations making use of a consistent nomenclature.In Sec.III the new formula that allows the computation of magnet strengths from BPM data is presented.The experimental results are presented in Sec.IV, together with a brief description of the new software application developed for the analysis of the BPM data.

A. Hamiltonian coefficients and magnet strength
The Hamiltonian describing the particle motion at a generic location of the accelerator b is given by the following expression: e ijÿk x x;0 lÿm y y;0 ; ( where J q and q are the action phase variables, q;0 are the initial phases, and h b jklm are the Hamiltonian terms of order j k l m n.These Hamiltonian terms are given by a summation over the magnetic elements of the accelerator in the following form: (2) where b w;q are the phase advances of the magnet number w with respect to the location b.The coefficients h w;jklm are real and proportional to the multipole strengths via (see Appendix A for the derivation) i is introduced to select either the normal or the skew multipoles.According to the above relation, the dimensions of h w;jklm are m 1ÿjklm=2 .From the measurement of h w;jklm the magnetic strengths can be directly inferred using the betatron functions.

B. Normal form, resonance driving terms, and BPM spectrum
The Hamiltonian H defined in Eq. ( 1) depends on both the actions J q and the phases q .Nonresonant normal form coordinates can be introduced to obtain a Hamiltonian that depends only on the action variables HI x ; I y .This transformation is performed by introducing a function F, defined as e ijÿk x x;0 lÿm y y;0 ; (4) where I q , q , and q;0 are the new actions, phases, and arbitrary initial conditions, respectively.It can be shown [9] that the terms f b jklm at a certain location b, in the firstorder approximation, are related to the Hamiltonian coefficients h w;jklm via where Q x and Q y are the betatron tunes.f b jklm (at any location) diverge when a resonance occurs, i.e. when j ÿ kQ x l ÿ mQ y p p2 N: For this reason f jklm are called resonance driving terms (RDT).The first-order approximation implicit in Eq. ( 5) is enough as long as we want to measure the magnet strengths of quadrupoles and sextupoles.In [8] the complex Courant-Snyder variable, defined as h x;ÿ x ÿ i px , at turn N and location b is related to the resonance driving terms as e i1ÿjk2 x N b;x;0 mÿl2 y N b;y;0 ; (7) and, equivalently for the vertical plane, e ikÿj2 x N b;x;0 1ÿlm2 y N b;y;0 : (8) Note that neither h x;ÿ nor h y;ÿ are canonical coordinates.This however does not influence the derivation of our final results, since all the observables are eventually related to the canonical coordinates x; px ( ŷ; py ).For a detailed analysis of the effect of the nonsymplectic transformation, see [6].The nonlinear tunes x;y appear in the above expression instead of Q x;y since this approach takes into account possible amplitude dependent detuning.The first term in the right-hand side of Eqs. ( 7) and ( 8) are called fundamental or tune lines.The secondary lines contained in the summation are generated by all the magnetic perturbations and are proportional to the RDTs.The amplitude and phase of the secondary lines in the horizontal spectrum are given by where f b jklm denotes the phase of the RDT f jklm , while Hp; q and p;q stand for the amplitude and phase of the spectral line with frequency p x q y in the horizontal spectrum.Equivalently for the vertical plane, The horizontal and vertical tune lines are represented by H1; 0 and V0; Note that from Eqs. ( 6)-( 8), the spectral lines H1 ÿ j k; l ÿ m and Vk ÿ j; 1 ÿ m l appear only if j Þ 0 and l Þ 0, respectively.In Appendix B the correspondences between excited spectral lines and RDTs are listed.Note that the analogous classification concerning the vertical plane has been rectified in the updated version of Ref. [8].

III. MAGNET STRENGTHS FROM RDT VARIATION ALONG THE RING
The difference of the resonance driving terms at two observation locations (BPMs) of the ring, w and w ÿ 1, depends only on the multipoles placed between these two locations, exactly, ĥ w;jklm f w jklm e ÿijÿk w;wÿ1 x lÿm w;wÿ1 y ÿ f wÿ1 jklm ; (15) where w;wÿ1 q are the phase advances between the two locations and f w jklm is the RDT measured at the BPM number w.An illustrative proof of this relation is given in Appendix C. The left-hand side (lhs) of the above equation is therefore an observable given by ĥ w;jklm X h ;jklm e ijÿk wÿ1 ;x lÿm wÿ1 ;y : ( The sum runs over all the multipoles between the BPMs number w ÿ 1 and w, while wÿ1 ;q are the phase advances between those multipoles and the BPM number w ÿ 1 (see Fig. 6).h ;jklm are the Hamiltonian coefficients defined in Eq. (3).Equation (15) reveals the most important feature of this approach: the amplitudes of the RDT at two BPMs change only if there are multipoles in between.Vice versa from the difference between the two RDTs a total strength of the multipoles in between ĥw;jklm is inferred.
In general, it is not possible to derive directly the strengths K and J from ĥw;jklm .Nevertheless, in the case that there is only one multipole in between two consecutive BPMs, Eq. ( 15 If the betatron phase and the beta functions at the multipole are known, using Eqs.( 3) and ( 17), the strengths K w;nÿ1 and J w;nÿ1 can be inferred.

IV. MAGNET STRENGTH MEASUREMENT FROM SPS DATA
During 2002 a measurement campaign aimed to measure the RDTs was carried out in the SPS at CERN [1,4].Seven strong sextupoles were connected to introduce large nonlinearities.Their locations and the model parameters are listed in Table I.
Other 108 sextupoles used for the chromaticity correction where also powered.These sextupoles are grouped in four families, whose parameters are listed in Table II.
The new software application bpm2rdt has been developed for the analysis of BPM data and is available with documentation [5].Despite the complex formalism, the input consists only of the number of turns to analyze, the tunes Q x;y , and of two external files with the BPM turn-byturn data and the lattice model (magnet strengths and Twiss parameters), respectively.While the first file is used for the analysis of the experimental data, the second is used to compute all the observables predicted by the model.Note that in general the Twiss parameters at the locations of the multipoles cannot be extracted directly from the BPM data.The code first constructs the observables h q;ÿ N at each BPM.Then it performs the fast-Fourier-transform (FFT) of these variables, finds automatically the peaks of the Fourier spectra, and calculates the corresponding RDTs f jklm , the strengths ĥjklm , and the local terms jklm introduced in [2].All these observables are printed out together with the prediction from the model for a direct comparison.
Note that the relations listed in Table IV are derived assuming turn-by-turn oscillations without decoherence and properly calibrated BPMs.To take into account the decoherence of the SPS data, the measured f 3000 has been multiplied by the decoherence factor 2. In Ref. [1] it is indeed proved how the decoherence of the BPM signal reduces the amplitude of each secondary spectral line by a factor that depends on both the excited resonance and the amplitude detuning 0 .The decoherence factor of a generic horizontal spectral line 1 ÿ j k; m ÿ l is defined as j1 ÿ j k m ÿ l 0 yx = 0 xx j and represents the reduction factor when compared to the single-particle case (our model).
In Fig. 1 the measured f 3000 is plotted around the ring together with the prediction from the model.Model and measurement are in good agreement as in [4].However, the   measured f 3000 shows small jumps at locations where they were not expected.This is due to an intrinsic error in constructing the complex variable h q;ÿ q ÿ ip q .Indeed to compute the momentum p q at a given BPM, the position (in normalized coordinates) measured at the next BPM is used [10]: where q is the phase advance between the two BPMs.This formula however applies only in the absence of nonlinearities or coupling sources between the two monitors.If this condition is not satisfied because the computation of p q contains an intrinsic error, whose estimation is given in [2], that may reveal in artificial jumps.
To avoid this problem, a new observable was defined in [2] using data from three consecutive BPM.This new signal does not require any momentum reconstruction and the local terms jklm that are computed from its spectrum have the same physical meaning as the Hamiltonian terms ĥjklm , although the measurement of jklm is more accurate.In Fig. 2 3000 measured from the SPS data is plotted and, as expected, no term is visible in the region with the unexpected jump of f 3000 .Despite the fact that jklm is an observable more robust than ĥjklm , it exists an additional difference that needs to be stressed for a correct interpretation of the measurement, jklm being defined as jklm X q e i1ÿjk xq mÿl yq SEN xq h q;jklm : (19) The above summation extends over the multipoles in between the three BPMs, h q;jklm are the Hamiltonian coefficients defined in Eq. ( 3) of the multipole number q, whose phase advances with respect to the first BPM are xq and yq .SEN xq is defined as 8 > < > : where x;1 x;1 ÿ =2, and x;2 x;2 ÿ =2.
x;1 and x;2 are the phase advances between the first and the second BPM and between the second and the third, respectively.If the BPMs are 90 degrees apart (and this is the case for the SPS BPMs), jklm and ĥjklm are equivalent, while the first one diverges if the distance is close to 180 degrees.Hence, when measuring large jklm , one has to  I) fulfill the condition of being the only source of nonlinearities between the two adjacent BPMs.The other four extraction sextupoles have at least another chromaticity sextupole in between the two adjacent BPMs.However, the extraction sextupoles are much stronger than the chromaticity sextupoles and as first approximation the chromaticity sextupoles might be neglected.
In Fig. 3 the measured ĥ3000 are plotted together with the predictions from the model.The agreement for j ĥ3000 j varies from 3% (LSEN.424) to 28% (LSE.4060).Error in the phases is of about 10%, confirming the correct setting of the polarities.Because of the lattice configuration of the SPS, the phases of ĥ3000 provide a direct measurement of their polarities as shown in the figure.

V. CONCLUSION
A beam based method to measure the magnet strengths and polarities has been presented.The method is based on the harmonic analysis of multi-BPM turn-by-turn data of a transversally kicked beam.Both the new algorithm and the software application bpm2rdt have been successfully tested by using existing SPS data.
Introducing the complex Courant-Snyder coordinates q q p 2 h q;ÿ h q; , where h q; 2J q p e i q q;0 , and q stands for x or y, we obtain The binomial theorem can be invoked again to expand h q;ÿ h q; H n ÿRe Renaming the indexes s !j and t !l and simplifying the factorials, the Hamiltonian reads It can be easily shown that the real part of the sum selects the normal terms K nÿ1 if the power of y (i.e.l m) is even, whereas the skew terms J nÿ1 are selected when l m is odd (See From the above relation, one derives Eq. ( 3).

APPENDIX B: RESONANCE CLASSIFICATION AND NOMENCLATURE
The starting points for a complete classification (up to the first order) of RDT, spectral lines, and resonances are the following relations: j ÿ kQ x l ÿ mQ y p 2 N excited resonance; (B1) H1 ÿ j k; m ÿ l horiz: line; if j Þ 0; (B2) The generic potential term x s y q selects the index j k s and m l q, as shown in Eq. (A2).The relations between the RDTs and the excited spectral lines are given in Table IV, where the line amplitudes ja jklm j and the phases a jklm are derived from Eqs. ( 9)-(12).In Fig. 4 some typical BPM spectra obtained by single-particle tracking are also shown.
Table V shows how to compute the RDT from the spectral lines, i.e., how to remove the dependences from I x;y and x;y;0 , assuming that the BPMs are properly calibrated.

APPENDIX C: CALCULATION OF THE MAGNET STRENGTH FROM THE RDTS
In this Appendix we provide an illustrative proof of Eq. ( 15).First we consider the case with only one magnet between two consecutive BPMs (see Fig. 5).
It is convenient to define some quantities as follows: M w and BPM b;q are the betatron phases of the magnet number w and the BPM number b, respectively, both calculated with respect to a starting point.Each time b < w a factor Q must be added to take into account the crossing of this point.With the above nomenclature, Eq. ( 5) reads h w;jklm are calculated inverting the linear system (C5).For the sake of clarity, we show a case with W 3 (the generalization to any number is straightforward) and omit the subscript jklm, h 3 e B 3 ÿW 1 h 1 e B 3 ÿW 2 h 2 e B 3 ÿW 3 h 3 : In the matrix notation the system reads H A h,  074001-6 The linear system eventually reads providing the solution  where wb q are the phase advances between the magnet number w and the BPM number w ÿ 1, whereas w;wÿ1 q the phase advances between the two consecutive BPMs.
The most general case with T sources between two consecutive BPMs introduces a modification in the lhs of the above equation, namely, the replacement of the single Hamiltonian coefficient with a sum of all the contributions, The sum is over all the T multipoles between the BPMs number w ÿ 1 and w, wÿ1 ;q are the phase advances between those multipoles and the BPM number w ÿ 1 (see Fig. 6).

FIG. 1 .
FIG. 1. (Color) RDT f 3000 along the ring.The vertical lines indicate the location of the seven extraction sextupoles.Error bars correspond to 1.Only the values from BPMs providing error bars smaller than 20% are shown.

FIG. 2 .FIG. 3 .
FIG. 2. (Color) Measured and expected absolute value of 3000 .Error bars correspond to 3.Only the values providing error bars smaller than 20% are shown.

W 1 f 1 e
ÿB 1 ÿ f 3 e QÿB 3 e W 2 f 2 e ÿB 2 ÿ f 1 e ÿB 1 e W 3 f 3 e ÿB 3 ÿ f 2 e ÿB 2 for the above equations reads h w e W w f w e ÿB w ÿ f wÿ1 e ÿB wÿ1 ; for 2 w W h 1 e W 1 f 1 e ÿB 1 ÿ f W e QÿB W : (C8) Reinserting the index jklm and making explicit W w , B w , and Q, we obtain h w;jklm e ÿijÿk wb x lÿm wb y f w jklm e ÿijÿk w;wÿ1 x lÿm w;wÿ1 y ÿ f wÿ1 ; (C9) h w;jklm e ÿijÿk wb x lÿm wb y !ĥw;jklm ;

FIG. 6 .
FIG.6.Schematic view of a section of the ring when several multipoles are placed between two BPMs.

FIG. 5 .
FIG. 5. Schematic view of a ring taking into account the distribution of BPMs and multipoles.

TABLE I .
Parameters of the seven strong sextupoles.

TABLE II .
Parameters of the 108 chromaticity sextupoles.

TABLE III .
Selection of index relative to the main corrector magnets.A. FRANCHI, R. TOMA ´S, AND F. SCHMIDT Phys.Rev. ST Accel.Beams 10, 074001 (2007)