Spin dynamics investigations for the EDM experiment at COSY

Precision experiments, such as the search for a deuteron electric dipole moments using a storage rings like COSY, demand for an understanding of the spin dynamics with unprecedented accuracy. In such an enterprise, numerical predictions play a crucial role for the development and later application of spin-tracking algorithms. Various measurement concepts involving polarization effects induced by an RF Wien filter and static solenoids in COSY are discussed. The matrix formalism, applied here, deals \textit{solely} with spin rotations \textit{on the closed orbit} of the machine, and is intended to provide \textit{numerical} guidance for the development of beam and spin-tracking codes for rings that employ realistic descriptions of the electric and magnetic bending and focusing elements, solenoids etc., and a realistically-modeled RF Wien filter.

The Standard Model (SM) of Particle Physics is not capable to account for the apparent matter-antimatter asymmetry of the Universe. Physics beyond the SM is required and it is either probed by employing high energies (e.g., at LHC), or by striving for ultimate precision and sensitivity (e.g., in the search for electric dipole moments). Permanent electric dipole moments (EDMs) of particles violate both time reversal (T ) and parity (P) invariance, and are via the CPT -theorem also CPviolating. Finding an EDM would be a strong indication for physics beyond the SM, and pushing upper limits further provides crucial tests for any corresponding theoretical model, e.g., SUSY.
Up to now, EDM searches mostly focused on neutral systems (neutrons, atoms, and molecules). Storage rings, however, offer the possibility to measure EDMs of charged particles by observing the influence of the EDM on the spin motion in the ring. These direct searches of e.g., proton and deuteron EDMs bear the potential to reach sensitivities beyond 10 −29 e cm. Since the Cooler Synchrotron COSY 1 at the Forschungszentrum Jülich provides polarized protons and deuterons up to momenta of 3.7 GeV/c, it constitutes an ideal testing ground and a starting point for such an experimental program.
The investigations presented here, carried out in the framework of the JEDI Collaboration 2 , are relevant for the preparation of the deuteron EDM measurement [3]. A radio-frequency (RF) Wien filter (WF) [4][5][6] makes it possible to carry out EDM measurements in a conventional magnetic machine like COSY. The idea is to look for an EDM-driven resonant rotation of the deuteron spins from the horizontal to vertical direction and vice versa, generated by the RF Wien filter at the spin precession frequency. The RF Wien filter per se is transparent to the EDM of the particles, its net effect is a frequency modulation of the spin tune, the number of spin precessions per turn. This modulation couples to the EDM precession in the static motional electric field of the ring, and generates an EDM-driven up-down oscillation of the beam polarization [7].
The search for EDMs of protons, deuterons, and heavier nuclei using storage rings [2,8] is part of an extensive world-wide effort to push further the frontiers of precision spin dynamics of polarized particles in storage rings. In this context, the JEDI results prompted the formation of the new CPEDM collaboration 3 , which aims at the development of a purely electric prototype storage ring, with drastically enhanced sensitivities to the EDM of protons and deuterons, compared to what is presently feasible at COSY [3,9].
Precision experiments, such as the EDM searches, demand for an understanding of the spin dynamics with unprecedented accuracy, keeping in mind that the ultimate aim is to measure EDMs with a sensitivity up to 15 orders in magnitude better than the magnetic dipole moment (MDM) of the stored particles.
The description of the physics of the applied approach, called RF Wien filter mapping, is discussed further in a forthcoming separate publication. The theoretical understanding of the method and its experimental exploitation are prerequisites for the planned EDM experiments at COSY [2], and will also have an impact on the design of future dedicated EDM storage rings [9]. This paper discusses various polarization effects that are induced by the RF Wien filter and static solenoids in the ring. The approach taken here strongly simplifies the machine lattice, and deals solely with spin rotations on the closed orbit [10,11], described by the SO(3) formalism. One aim of the work is to obtain a basic understanding about the interplay of spin rotations in a magnetic ring equipped with an RF Wien filter and solenoid magnets, under the simplifying assumption mentioned above. In an ideal machine with perfect alignment of the magnetic elements, the spin rotations on the closed orbit are generated primarily by the dipole magnets, therefore, for the time being, spin rotations in the quadrupole magnets are not considered.
As we shall demonstrate below, even with an idealized ring, the parametric RF resonance-driven spin rotations reveal quite a reach pattern of spin dynamics. Our results set the background for more realistic spin tracking calculations, based on recent geodetic surveys of COSY that make available position offsets, roll, and inclination parameters for the quadrupole and dipole magnets. The treatment of the spin transport through these individually misaligned magnetic elements, can, however, be readily incorporated in the applied matrix formalism. Besides that, the spin dynamics simulations carried out in the framework of the present paper, will serve as a valuable crosscheck of the analytic approximate treatment of the parametric spin resonance, based on the Bogolyubov-Krylov-Mitropolsky averaging technique [12].
The JEDI collaboration is presently implementing a beam-based alignment scheme at COSY, which aims at providing optimized beam-transfer properties of the quadrupole and dipole magnets in the ring, with the aim to make the beam orbit as planar as possible [13]. Once this is accomplished, the spin dynamics in the ring will be largely governed by the misaligned dipoles alone. Thus effectively, the approach described here will appropriately describe an EDM experiment using an RF Wien filter in a beam-based aligned ring.
The paper is organized as follows. In Sec. II, the effect of an EDM on the spin-evolution in a ring is discussed in terms of the Thomas-BMT equation. The inclusion of an RF Wien filter in an otherwise ideal ring is treated in Sec. III, while the polarization evolution with an RF Wien filter and additional solenoids is discussed in Sec. IV. The main findings are summarized in the conclusions in Sec. V. A brief outlook into additional aspects planned to be investigated using the simulation approach taken here in the near future is also given.

A. Thomas-BMT equation
Below, the basic formalism to decribe the spin evolution in electric and magnetic fields is briefly reiterated.
The generalized form of the Thomas-BMT equation describes the spin motion of a particle with spin S in an arbitrary electric ( E) and magnetic field ( B). Including EDMs (in SI units), it reads [14], where (2) Here m, γ, and β are the mass, Lorentz factor, and the velocity of a particle in units of the speed of light c in vacuum, S is given in the particle rest frame, and the fields E and B are in the laboratory system. The magnetic dipole moment µ (MDM) and the electric dipole moment d (EDM) are defined via the dimensionless Landé-factor g and η EDM and the magnetic anomaly is given by B. EDM tilt angle ξ from Thomas-BMT-equation In an ideal machine without unwanted magnetic fields, the axis about which the particle spins precess is given by the purely vertical magnetic field B = B ⊥ = B ⊥ · e y . Equating the COSY angular orbit frequency Ω rev = 2πf rev and the relativistic cyclotron angular frequency yields, for E = 0 with the parameters given in Table I, a vertical magnetic field of which can be considered as the field that corresponds to an equivalent COSY ring where the magnetic fields are evenly distributed.
Inserting B from Eq. (6) and E = 0 into Eq. (2), yields for the angular frequencies in the particle rest system In the laboratory system, however, we observe with the parameters of Table I the precession frequency with respect to the cyclotron motion of the momentum, where Ω rev denotes the COSY angular frequency along e y . The spin-precession frequency yields the familiar value of which is also listed in Table I. The angle by which the stable spin axis is tilted, i.e., the angle between Ω Lab and e y is obtained by evaluating Inspecting Eq. (8), the effect of an EDM in a magnetic machine can be expressed by the tilt of the stable spin axis away from the vertical orientation in the ring, given TABLE I. Parameters of the deuteron kinematics, the COSY ring, the deuteron elementary quantities, the electric dipole moment (EDM) assumed, and the field integrals of the idealized RF Wien filter (to eight decimal places). The deuteron momentum P is used to specify the deuteron kinetic energy T , and the Lorentz factors β and γ. The COSY circumference COSY is used to specify the COSY revolution frequency frev and the spin-precession frequency fs. The deuteron mass m and the deuteron g factor, taken from the NIST database [15] (not from the most recent one), are used to specify G. The deuteron EDM d is used to quantify ηEDM and ξEDM.
For an assumed EDM of d = 1 × 10 −20 e cm, and for deuterons at a momentum of 970 MeV/c, Eqs. (3) and (11) yield ξ EDM and η EDM , as listed in Table I.

C. Rotation matrices
Our description of the spin dynamics is based on the SO(3) formalism. A rotation by an angle θ around an arbitrary axis given by the unit vector n = (n 1 , n 2 , n 3 ) is described by the matrix [17] R( n, θ) = 4 In Eq. (11), an additional factor of 2 has been inserted in the denominator, correcting Eq. (10) of [16]).

D. One turn spin rotation matrix with EDM
With a non-vanishing EDM, in the rotation matrix of Eq. (12), the spins do not precess anymore around the vertical axis e y , but rather around the direction given by Therefore, the ring rotation matrix can be obtained by inserting into Eq.(12) the coefficients c 1 , c 2 , c 3 from Eq. (14), and by setting Here, the time t is defined by the number of momentum revolutions n in the ring, The spin-precession frequency f s , related to Ω Lab introduced in Eq. (8), can be expressed also via where f rev denotes the revolution frequency. A negative G factor indicates that the precession proceeds opposite to the orbit revolution. Thus, a one-turn matrix including the EDM effect is obtained by inserting θ(t) from Eq. (15) into Eq. (12) at t = T rev = 1/f rev . For comparison with numerical simulations, the ring matrix is explicitly given below (to four decimal places) for the parameters listed in Table I

E. Polarization evolution in the ring
The evolution of the polarization vector S 1 as function of time in the ideal bare ring is then described by where S 0 denotes the initial polarization vector. Figure 1 shows the situation when the spin rotation axis c, defined by Eq. (14), is tilted with respect to the normal to the ring plane n (y-axis in the figure) 5 .
In Fig. 2, the solutions of S 1 (t) from Eq. (19) for two different initial in-plane polarization vectors S 0 are shown for 10 turns. It is clearly visible that the polarization evolution occurs counter-clock wise with respect to the clock-wise rotation of the particles in the ring, since the deuteron G factor is negative.

A. Electric and magnetic fields of the RF Wien filter
The RF Wien filter, described [4], has been designed in order to be able to manipulate the spins of the stored The beam particles move along the z direction. In the presence of an EDM, i.e., ξEDM > 0, the spins precess around the c axis, and an oscillating vertical polarization component py(t) is generated, as shown in Fig. 2. particles, avoiding as much as possible, the effect on the beam orbit. To this end, great care was taken to minimize the unwanted field components of the Wien filter and to characterize them via the Polynomial Chaos Expansion [18]. In EDM mode, the main component of the magnetic induction B WF is oriented along the y-axis, and the main component of the electric field E WF along the x-axis.
In order to avoid betatron oscillations in the beam, the magnetic and electric field must be matched to each other to provide a vanishing Lorentz force F L (see Eq. (3) of [4]), According to a full-wave simulation (FWS) 6 , including the ferrite cage (see label 6 in Fig. 1 of [4]), for an input power of 1 kW, a field integral of B WF along the beam axis of is obtained. Here, the active length of the RF Wien filter [4], denoted by is defined as the region, where the fields are non-zero. Under these conditions, the corresponding integrated electric field components with ferrites are  Table I. Panel (a) shows px(t), pz(t) and py(t) for an initially longitudinal polarization, and panel. (b) the same for sideways polarization. The bunch revolution is indicated as well. The magnitude of the py oscillation amplitude corresponds to the tilt angle ξEDM (see also Eq. (14) and Fig. 1).
The design and construction of the RF Wien filter includes a ferrite cage surrounding the electrodes, which improves the field homogeneity and increases the magnitude of the fields [4]. However, in order to simplify the installation, the RF Wien filter was installed at COSY without ferrites, and in addition, it was decided to proceed without ferrites until a first direct deuteron EDM measurement is available.
For this situation without ferrites, and for an input power of 1 kW [ignoring the unwanted components of the field integrals (B WF x , B WF z , and E WF y , E WF z )], one obtains from the full-wave simulation (FWS) The ratio of electric and magnetic field integrals from the FWS yields should ideally be equal to unity. The subsequent calculations use the field integrals of an idealized WF with vanishing Lorentz force F L , given in the last column of Table II. A field amplification factor is applied in the simulations to increase the field integrals of the ideal RF Wien filter (last column Table II) in the simulations, so that The field amplification allows one to speed up the simulation calculations accordingly, without affecting other aspects of the spin dynamics of the polarization evolution in the ring. In the description of the spin evolution via spin rotations on the closed orbit, momentum and position kicks are not considered.

B. Rotations induced by the RF Wien filter
The effect of the RF Wien filter on the polarization evolution in the ring is implemented by an additional rotation matrix. The spin rotation in the Wien filter depends on the applied field integrals (right column of Table II), multiplied by the factor f ampl .

Spin rotation angle in the Wien filter
In the following, the spin rotation angle ψ WF in the RF Wien filter is calculated numerically using the Thomas-BMT equation of Eqs. (1) and (2) with Ω EDM = 0. We start with an initial spin vector Electric and magnetic field vectors for Ω MDM in Eq.
(2) are obtained by computing the average fields from the idealized field integrals of the RF Wien filter (last column of Table II), given by where the effective length of the Wien filter is taken from Eq. (22). These conditions provide for a vanishing Lorentz force F L [see also Eq. (20)]. After passing the RF Wien filter once, the final polarization vector is given by and, after normalizing S fin to unity, the angle between S in and S fin is determined from the four-quadrant inverse tangent The spin-rotation angle in the RF Wien filter, divided by the idealized transverse magnetic field integral from Table II, yields Validating the numerical result for the spin-rotation angle ψ WF in the RF Wien filter obtained in Eq. (32) against the analytic expression, given in [16,Eq. (13)], yields where the time interval ∆t in the Wien filter has been expressed through the length WF . The spin rotation angle in the RF Wien filter, given in Eq. (34), constitutes an upper limit, which corresponds to a situation when a sharp δ-function-like bunch passes through the device. Realistically, the bunch distribution has to be folded in, and the spin-rotation angle will be reduced correspondingly.

RF Wien filter rotation matrix
The spin-rotation angle of the RF Wien filter changes as function of time according to where The Wien filter is operated on some harmonic of the spinprecession frequency f s [Eq. (17)], given by The RF Wien filter rotation matrix is given by where in the generic case, n WF is a unit vector along the magnetic field of the Wien filter. The case for instance, denotes the Wien filter EDM mode. The RF Wien filter matrix U WF (t) is only evaluated once per turn when the condition is met stroboscopically, otherwise, the implemented function returns the I 3 unit matrix. When the Wien filter is rotated around the beam axis (z) by some angle φ WF rot , and the oscillations also receive a contribution from the rotation of the MDM in the horizontal magnetic field.

C. Polarization evolution in the ring with RF Wien filter
The evolution of the polarization vector S as function of time t in the ring with RF Wien filter can be numerically evaluated via The corresponding situation is illustrated in Fig. 3. The spin rotations in the ring can be described by U ring . A turn begins with the revolution in the ring, and it ends with one pass through the RF Wien filter. Between two successive points in time at which a particle encounters the RF Wien filter, its spin is just idly precessing in the machine.
According to Eq. (42), the spin motion is stroboscopic in the sense that the spin rotation follows the angle ψ(t) of the RF Wien filter [Eq. (35)] turn-by-turn. The RF Wien filter therefore induces a stroboscopic turn-by-turn conversion of the transverse in-plane polarization into a vertical one (or vice versa). Using the Bogolyubov-Krylov-Mitropolsky (BKM) averaging method [12], the turn-by-turn evolution of the polarization can be approximated by the continuous dependence on the revolution number, given by n = f rev · t [Eq. (16)]. For the generic orientation of the RF Wien filter, the BKM averaged buildup of the vertical polarization proceeds with the resonance tune (or strength) [16] The direct simulations using Eq. (42), discussed below, will furnish important crosschecks with respect to the accuracy of the analytic approximations based on the BKM averaging.
D. Radial magnetic RF field in the Wien filter

Driven oscillations and resonance strength ε MDM
As an illustration of the principal features of the polarization evolution, we take the case where the RF Wien filter is rotated in the so-called MDM mode with magnetic field along − e x , i.e., for φ WF rot = 90 • , where the initial polarization S 0 = − e y .
Using the function for S 2 (t), given in Eq. (42), for the conditions of Table I, driven oscillations for RF Wien filter with magnetic field aligned along − e x , for φ WF rot = 90 • [see Eq. (41)] were simulated. One example for K = −1 is shown in Fig. 4. Subsequently, the simulated oscillation data were fitted using the function  Table I and for the harmonic K = −1. The plot contains 101 points for a total of 10 000 turns.
The quality of the fit to the numerical data is evaluated in terms of squared deviations via where the weight factors are w i = 1, and p y (t) = e y · S 2 (t).
In the last row of Table III, the reduced χ 2 = SSE/ndf is given, where n points = 101, and ndf = n points − 4 = 97, since the fitted function in Eq. (44) has four parameters.
The resulting angular oscillation frequency Ω driven = b, given in Table III, was obtained using the field integrals, listed in Table I. The uncertainties were obtained using a computation time of about 40 s 7 . The oscillation frequency normalized to the real magnetic field integral  Table I. yields, The driven oscillations of the vertical polarization p y (t) (Fig. 4) are induced by the horizontal magnetic field of the RF Wien filter that couples to the deuteron MDM. Since the device is operated exactly at the spin-precession frequency, the associated resonance strength or resonance tune [16] can conveniently be expressed via

Width of the spin resonance
The detuning of the frequency at which the RF Wien filter is operated can be parametrized by substituting in Eq. (36) As shown in Fig. 5, the resulting oscillation pattern is modified. Specifically, the oscillation amplitude of p y (t) in Eq. (44) is altered. The argument of the sine function is subjected to the substitution which can readily be derived from Eqs. (A7) and (A8) of [16]. From a number of such simulations, the oscillation amplitudes and the oscillation frequencies as function of ∆f WF are obtained by fitting. In order to reduce the time required for the simulations, again a field amplification factor of f ampl = 10 3 was used. This leads to oscillations that are faster by the same factor. The simulated data can be described by a Lorentz curve of the form, The left panel of Fig. 6 shows the simulated spin resonance, already corrected for the field amplification factor. For all harmonic excitations used in the RF Wien filter, the simulations yield, within errors given, the same width of Γ = (0.4488 ± 0.0001) Hz . (51) Using the nominal fields of the RF Wien filter (right column of Table II and f ampl = 1), the driven oscillations have a frequency of The two panels on the right side show that a quadratic fit to the driven oscillation frequency should be only used in a narrow region around the minimum.
The quality factor of an underdamped oscillator Q is defined as where ∆f driven is the full width at half maximum, and f driven is the resonance frequency. Thus, at a deuteron momentum of P = 970 MeV/c, a theoretical estimate of the Q value of the oscillating deuteron spins in the machine amounts to In this case, the experimental determination of the resonance strength ε EDM amounts to the determination of the tilt angle ξ EDM and of the associated EDM, via Eqs. (11) and (3).

Polarization evolution with development of py(t)
In the following, the polarization buildup in the machine is addressed. The interplay of the different frequencies involved is illustrated in Fig. 7.
The same situation as in Fig. 7 is depicted in Fig. 8, the only difference is the larger turn number. The graph illustrates the experimental evidence for an EDM, namely a non-vanishing slope of the vertical polarization p y (t). This slope describes the steady out-of-plane rotation of the polarization vector on the background of oscillations  shown in the bottom panels of Fig. 2, where the oscillation amplitude A perfectly matches with the angle ξ EDM , used in the simulation (see Table I).
The slope can be determined by fitting using where f s is not a fit parameter, but taken from Eq. (17). Thus, using the above parametrization, the initial slope is given byṗ 2. py(t) dependence on the phases φRF and φ S x 0 The RF phase φ RF is introduced in Eq. (35). During a real experiment, this phase needs to be maintained by a phase-locking system (for details see [19]). Another way to parametrize the same effect is via the angle φ S x 0 = ∠( S 0 , e x ), which is illustrated in Fig. 9(a).
Within the formalism described in [16], it is the interplay between the stable spin axis c at the RF Wien filter and its magnetic axis n WF ( B WF ) that controls via [ c × n WF ] the orientation of S 0 . On the other hand, one could start by fixing the orientation of S 0 by picking some angle φ S x 0 . The resulting evolution of p y (t), however, must be the same, except for a possible constant shift between the two phases φ RF and φ S x 0 . The buildup of a vertical polarization component, which is equivalent to a rotation of the polarization vector out of the ring plane due to the EDM for a set of random azimuthal angles φ S x 0 and φ RF has been computed. The results are shown in Fig. 10.
Within the given uncertainties, the two simulated data sets for φ S x 0 and φ RF , as expected, yield the same results. The only difference is a phase shift of π/2 between f (φ S x 0 ) and g(φ RF ). The weights that are used to find the optimum parameters are all equal in the two data sets.
Correcting the initial slope parameter a in Table IV for the employed field amplification factor used in the simulation, yields a prediction for the initial slope that one would expect in an ideal ring in the presence of an EDM of d = 10 −20 e cm. For an initial polarization | S 0 | = Horizontal and longitudinal polarization components px(t) and pz(t) during the ten turns in the machine, as described by S2(t) using Eq. (42) for the K = −1 harmonic and an initial polarization vector S0 in the horizontal (xz) plane. The magnetic field B WF of the RF Wien filter points along ey, and f ampl = 10 3 . The evolution of py(t) for the same initial condition S0 = (0, 0, 1) is shown in Fig. 2(a). Also indicated are the bunch revolution and the Wien filter RF frequency, and the corresponding RF amplitude when the beam bunch meets the Wien filter RF (•). 1, with the parameters for the idealized RF WF, given in the last column of Table II, one obtainṡ Since the comparison ofṗ y (t)| t=0 with experiment requires knowledge of the magnitude of S(t), the approach taken in [20] is convenient, because the angle of the out-  Table I. The red line is a fit to the data using Eq. (56) that yields an initial slope of dpy(t)/dt| t=0 = B = (4305.059 ± 5.268) × 10 −6 s −1 (for f ampl = 10 3 ).
of-plane rotation α is independent of the magnitude of the beam polarization. The quantity of interest, indicated in Fig. 9(b), in that case isα(t)| t=0 . The polarimeter measures p y (t), irrespective of the in-plane polarization p xz (t), given by  The red (blue) curve shows the initial slope as function of 25 random values of φ S x 0 (φRF), using a field amplification factor f ampl = 10 3 . The simulated data are fitted using the functions indicated in the inset. The resulting parameters are listed in Table IV. Each data point is obtained from a graph like the one shown in Fig. 8, but for 10 000 turns and 501 points.

From this it follows thaṫ
3. Initial slope versus slow oscillation amplitude Figure 11(a) shows the initial slopes for four different assumed EDMs, for an ideal ring and an idealized Wien filter, based on the conditions listed in Table I. The EDMs manifest themselves twofold, namely in different slopes and in larger amplitudes of the fast oscillation. The linear slopes in Fig. 11(a) are of course just the very beginning of a sinusoidal oscillation that becomes visible only when the EDM becomes large, as depicted in Fig. 11(b), where d = 10 −15 e cm (61) has been used in the simulation. The initial slope of the vertical polarization component is related to the strength of the EDM spin resonance. Another way to obtain this information is to vary the RF phase φ RF , as indicated in Fig. 10. The initial slope can of course also be obtained from the slow oscillation. The vertical polarization can be described by which respects the property that for any φ RF , p y (t)| t=0 = 0. The derivative of p y (t) with respect to time iṡ where the value given corresponds to the situation shown in Fig. 11(b). Numerically, the red curve in Fig. 11(b) has been parametrized by the function It turns out that the amplitude of the averaged oscillation [red curve in Fig. 11  According to [16], the EDM induced angular oscillation frequency ω in Eq. (62) can be expressed through the EDM resonance strength ε EDM and the angular revolution frequency ω rev , via In terms of the initial slope, the resonance strength is given by While the slopes can be easily determined as function of φ RF , the latter method using Eq. (69) clearly also requires knowledge about the oscillation amplitude a. Knowing the initial slopes alone, does not allow one to determine the resonance strength ε EDM . Using the technique of variation of φ RF , as shown in Fig. 10, Fig. 12 yields an initial slope oḟ which agrees numerically well within errors with the value given in the last line of Eq. (63).

Determination of the running spin tune, based on the polarization evolution S2(t)
The standard definition of the spin tune as a rotation around the local stable spin axis n s at every point in the machine does not involve a time dependence of the polarization evolution, like the one generated by the RF Wien filter. When a time-dependent polarization is involved, in the following, the term running or instantaneous spin tune is used. In case there is a time-dependent or instantaneous spin tune, the direction of n s also changes as function of time, i.e., n s ≡ n s (t) (see further Sec. III E 5). Using the numerical simulations for S 2 (t), or any other spin-evolution function, one can numerically determine the running spin tune in the following way. For this one needs three spin vectors from the spin-evolution function, say a = S 2 (t) , b = S 2 (t + T rev ) , and c = S 2 (t + 2 · T rev ) (71) Using these three vectors, two more vectors are constructed, The in-plane angle between d(t) and e(t) can be used to determine the running, time-dependent spin tune ν s (t).
To this end, we define the normal vector N of the plane that contains d and e, that corresponds to the instantaneous (running) spin axis. Using N , we find the in-plane components of b and c, via The normalized versions of these vectors are called and the running spin tune is determined from The factors in front of arctan take care that ν s (t) generates the correct sign based on the G-factor and the number of spin-precessions per turn. As a cross check of the algorithm, with RF WF switched off, for the beam conditions given in Table I where all three numbers have been calculated using Eq. (76). As an additional cross check, the difference of the spin tunes which is very close to the achievable machine precision 4 . During a revolution in the machine, as prescribed by S 2 (t) using Eq. (42), the spin tune remains constant during each turn (see Fig. 13). When the RF Wien filter is switched on, due to the additional spin rotation in the time-varying RF field, the spin tune jumps from turn to turn. The oscillation amplitude of the spin tune variation due to the RF Wien filter using a power of 1 kW (see Table I) is well consistent with the expectation from the spin rotation formalism The average spin tune, however, remains constant.

Instantaneous spin orbit determination based on S2(t)
The running spin orbit vector n s can be easily determined from the procedure of the previous section, using the normal vector N , defined in Eq. (73), Similarly to the running (instantaneous) spin tune, the instantaneous spin orbit (running spin axis) exhibits oscillatory in-plane components.

A. Evolution equation with additional static solenoids
In the course of this paper, with the RF Wien filter in EDM mode ( B WF e y ), the EDM interaction with the motional electric field in the ring, was the only source of up-down spin-oscillations.
In the following, two static solenoids in the straight sections will be added to the ring. Besides that, we shall make an allowance for rotations of the RF Wien filter around the longitudinal e z (momentum) direction. Such rotations induce a radial magnetic RF field, and, in conjunction with the solenoidal magnetic fields, we start mixing the EDM and MDM induced rotations. The idea, common to all EDM experiments, is to disentangle the EDM signal from an extrapolation to a vanishing MDM contribution [21,22].
With two static solenoids added to the ring, the resulting sequence of elements is depicted in Fig. 14. The one-turn ring matrix can be split into two arcs, one arc made of the dipole magnets D 1 to D 12 , and the second  Table I for d = 0 (red) and d = 1 × 10 −20 e cm (blue), when the RF Wien filter is switched OFF. On the right, the RF Wien filter is switched ON in EDM mode with f ampl = 1. The red curve shows the spin oscillation frequency fs from Eq. (17), and the blue line the running spin tune difference νs(t) − ν (1) s for each turn. It should be noted that the initial spin vector S0 is not in the ring (xz) plane (see Fig. 1).
In a similar fashion as in Eq. (42), one can write for the polarization evolution,

B. Spin-rotation angle in a static solenoid
In a solenoidal magnet with a field integral BDL = B d , the spins are rotated around the longitudinal di-rection e z , and the rotation angle is given by The spin rotation angle in the solenoid for deuterons at a momentum of P = 970 MeV/c, normalized to the mag- C. Spin tune and spin closed orbit with solenoids using S3(t) In the following, the abbreviation, e.g., χ Sol 1 rot = χ 1 is used. For an ideal ring, free of magnetic imperfections, the spin tune change ∆ν s (χ 1 , χ 2 ), due to solenoids S 1 and S 2 in the ring (see Fig. 14), the left side of Eq. (30) of Ref. [16] can be approximated by π∆ν s (χ 1 , χ 2 ) · sin(πν 0 s ), where ν 0 s denotes the unperturbed spin tune in the machine. For small spin rotation angles in the solenoids, Eq. (30) can thus be approximated by ∆ν s (χ 1 , χ 2 ) = 2χ 1 χ 2 + cos πν 0 s · χ 2 1 + χ 2 2 8π sin (πν 0 s ) .
In order to validate the spin evolution equation for S 3 (t), given in Eq. (83), in Fig. 15 the spin tune changes ∆ν s are compared to the approximation of Eq. (86) for four different cases.

D. Spin-closed orbit in a non-ideal lattice
The static solenoids or magnetic imperfections in the ring affect the spin-closed orbit vector n s = c in the machine. The situation is similar to the one depicted in Fig. 1, but there, only the tilt due to the EDM was taken into account. The presence of static solenoids in the ring can be numerically evaluated using Eq. (80) with S 3 (t) [Eq. (83)].
Since the time t begins to count right behind the RF Wien filter (see Fig. 14 (87) Figure 16 shows how the axis c = (c x , c y , c z ) is affected by the solenoids S 1 and S 2 , and the presence of an EDM d. For numerical comparisons, a number of special cases are numerically evaluated in Table V.

E. Strength of the EDM resonance
As depicted in Fig. 13, and already discussed in Sec. III E 4, the operation of the RF Wien filter modulates the spin tune. While the average spin tune is equal to the one obtained when the RF Wien filter is switched off, solenoids and magnet misalignments in the ring, however, affect the spin tune. Therefore, the spin-precession frequency and thus the frequency at which the RF Wien filter should be operated, differs from the unperturbed spin tune. The spin tune ν s must be determined anew for every solenoid setting to ensure that the resonance frequency for the RF Wien filter is given by and this frequency needs to be used in ψ(t)) [Eq. (35)], as it controls the RF Wien filter spin-rotation matrix The EDM resonance strength ε EDM , actually a resonance tune, is defined as the ratio of the angular frequency of the vertical polarization oscillation Ω py induced by the EDM relative to the orbital angular frequency Ω rev , Since Ω py corresponds to ω [first line in Eq. (63)], the resonance strength can in principle be determined from a single observation of Ω py . Alternatively, the resonance but this requires that the initial slopes need to be determined as function of, e.g., φ = φ RF . The statistical aspects of this will be further elucidated in Sec. IV E 2.
1. Evolution of py(t) as function of φ WF rot and χ Sol 1 rot The EDM resonance strength ε EDM [Eq. (89)] manifests itself in the oscillation frequency, as illustrated in Fig. 17 for two pairs of Wien filter rotation angle and spin-rotation angle in solenoid S 1 , (φ WF rot , χ Sol 1 rot ), where χ Sol 2 rot = 0. The resulting oscillation pattern of p y is fitted using amplitude a and frequency ω are given in each panel, together with various other parameters. The calculation for the ideal ring situation in panel (b) uses a 1000 times larger assumed EDM value of d = 10 −17 e cm and a larger number of turns n turns = 100 000, in order to make the oscillations of p y (t) visible as well.
2. Comparison of ε EDM from Ω py andṗy(t)|t=0 by variation of φRF One would expect that the variation of the RF phase φ RF will affect the resulting oscillation amplitudes a and offsets b of Fig. 17, while the oscillation frequencies ω, and thus the resonance strengths ε EDM remain unchanged.
In the panels of Fig. 18, for the same combinations of φ WF rot , χ Sol 1 rot , shown in Fig. 17,ṗ y (t)| t=0 and the oscillation frequency ω are computed for 36 randomly picked values of φ RF . The graph illustrates that in the presence of solenoid fields and RF Wien filter misalignments, the determination ofṗ y (t)| t=0 by variation of φ RF , making use of Eq. (90) yields results comparable to the direct determination of the resonance strength from the oscillation frequency Ω py via Eq. (89). The oscillation amplitudes a andṗ y | t=0 exhibit an identical dependence on φ RF , while the obtained resonant tune ε EDM remains constant over the whole range of φ RF .
The resonance strengths extracted fromṗ y (t)| t=0 and Ω py make use of the very same simulated data. The results are summarized in Table VI, where for the numbers that should match, the same color is used. Although the different extraction methods show good overall agreement, the uncertainties of ε EDM (Ω py ), however, are substantially smaller than those from ε EDM (ṗ y | t=0 ) by a fac- tor of at least 20. The reason for this is that in general frequencies can be measured more accurately than other quantities, and the determination of ε EDM (Ω py ) involves fewer uncertainties in the error propagation. The most accurate determinations are obtained from Ω py when χ Sol 1 rot = 0. In the following, we briefly comment on some features of the results obtained so far (Fig. 17, Table VI). We observe that numerically 2 sin πν s = 1.0041 1. Then, according to Appendix A, we expect in good agreement with the results shown in Fig. 18. The resonance tunes determined fromṗ y | t=0 and from Ω py are identical. For the above reason of 2 sin πν s 1 and small EDM contribution, the equalities hold.
F. Resonance strength ε EDM for random points φ WF rot , χ Sol 1 rot The resonance strengths shown in Fig. 19 are obtained using the fit function of Eq. (91) (ω = Ω py ) and then Eq. (89) for a set of randomly chosen pairs of (φ WF rot , χ Sol 1 rot ) and χ Sol 2 rot = 0. For all points, φ RF = 0 and S 0 = (0, 0, 1) Using the evolution function S 3 (t) [Eq. 83] which includes the ideal ring with solenoid S 1 and the RF Wien filter and an assumed EDM of 10 −18 e cm, for which the EDM tilt angle is ξ EDM ≈ 300 µrad, in the angular range, , and χ Sol 2 rot = 0, the pattern shift is clearly visible, as seen in Fig. 19(b).

Operation of RF Wien filter exactly on resonance
In this section, the contour of the surface ε EDM φ WF rot , χ Sol 1 rot , shown in Fig. 19(a), is compared to the theoretical expectation, given in Eq. (A5). The functional dependence describes a quadratic surface, also know as Elliptic Paraboloid, and is used here in the  Table I apply. The RF Wien filter is operated at harmonic K = −1. The extracted resonance strengths are summarized in Table VI. for an otherwise ideal COSY ring assuming a deuteron EDM of d = 10 −20 e cm (for (b), at (0 • , 0 • ), d = 10 −17 e cm). The beam conditions are given in Table I using the real field magnitudes of the RF Wien filter, since f ampl has been divided out. For the calculations nturns = 2 × 10 4 and npoints = 200, except for (b) , where nturns = 10 5 .
where the unperturbed spin tune ν It should be emphasized that the simulations shown in Fig. 19 reflect the situation when the RF Wien filter is operated exactly on resonance. During the corresponding EDM experiments in the ring, however, a certain spin-tune feedback is imperative to maintain for long periods of time the resonance condition, i.e., the spinprecession frequency in Eq. (35), using the measured spin tune [23]. To maintain phase and frequency when the RF Wien filter is actively operating, turns out to be much more tricky, and more sophisticated approaches, beyond those outlined in [19], are presently being pursued by the JEDI collaboration. Only such a phase and frequency lock during a measurement cycle enables one to take full advantage of the large spin-coherence time (SCT) of τ SCT 1000 s, achieved by JEDI at COSY [24,25].
The result of a fit without weighting is shown in Fig. 21(a). It should be noted that within the uncertainties obtained from the fit, A = B, while C and χ 0 are compatible with zero. Here, χ 0 represents a primordial tilt of the stable spin axis at the RF Wien filter along the horizontal axis, c x . For the model ring, one would expect a property which is nicely returned by the fit shown in Fig. 21(a). In addition, the fit to the simulated data is expected to return φ 0 = ξ EDM (d = 10 −18 e cm) = 0.3054 mrad, given by Eq. (11), and the fitted result φ 0 = (0.3054 ± 0.0002) mrad (97) returns this value accurately.

Validation of the scale of ε EDM
The fit with the elliptic paraboloid, shown in Fig. 21(a), indicates that the surface is described with A = B. In the following, the first fit function from Eq. (94) is slightly altered, yielding (a) Fit to the surface of ε EDM 2 , shown in Fig. 19(a), using Eq. (94). The resonance strengths have been scaled by a factor around 6 × 10 9 .
(b) Fit to the simulated data from Fig. 19(a) where a factor F = 10 20 has been used to scale the resonance strength. The second fit now uses weights derived from the uncertainty of the fitted Ω py using Eq. (89). The resulting fit is shown in Fig. 21(b). The agreement between theoretical model and simulated data is good, the χ 2 /ndf = 374.4/194 = 1.9. According to Eq. (A5), the factor in front of the brackets in Eq. (98) reads where the Wien filter rotation angle ψ WF from Eq. (34) is used. Inserting the numerical value of A from the fit (inset Fig. 21(b)), and taking into account that the results are in mrad, the ratio A · 10 6 F · k = 9.9954 × 10 −1 (100) yields the expected value near unity, which validates the scaling factor in Eq. (A5). The second fit yields a similar value for φ 0 = (0.305 34 ± 0.000 05) mrad ≈ ξ EDM (d = 10 −18 e cm) , compared to the first fit, shown in Fig. 21(a), and χ 0 and C are both compatible with zero.

V. CONCLUSIONS AND OUTLOOK
The SO(3) matrix formalism used here to describe the spin rotations on the closed orbit, i.e., the spin dynamics of the interplay of an RF Wien filter with a machine lattice that includes solenoids, proved very valuable. The general features of the deuteron EDM experiment at COSY can be obtained rather immediately. Of course, the approach taken is no replacement for more advanced spin-tracking codes, but the results obtained here can be applied to benchmark those codes.
In addition, it should be noted that the JEDI collaboration is presently applying beam-based alignment techniques to improve the knowledge about the absolute beam positions in COSY [13]. Once this is accomplished, the approach described here to parametrize the spin rotations solely on the basis of the closed orbit, will become more realistic.
The polarization evolution in the ring in the presence of an RF Wien filter that is operated on resonance, in terms of the resonance tune or resonance strength ε EDM is theoretically well understood. This will allow us to investigate in the future effects of increasingly smaller magnetic imperfections, either through additional solenoidal fields in the ring, or by transverse magnetic fields via the rotation of the RF Wien filter around its axis.
In the near future, it is planned to incorporate into the developed matrix formalism also dipole magnet displacement and rotation parameters, available from a recent survey at COSY. This will allow us to determine the orientation of the stable spin axis of the machine at the location of the RF Wien filter, and to extract the EDM from a measurement of the resonance strengths as function of φ WF rot , χ Sol 1 rot . It is possible to incorporate the spin rotations from misplaced and rotated quadrupole magnets on the closed orbit into the formalism as well.
An approach based on the polynomial chaos expansion has been successfully applied to determine a hierarchy of uncertainties during the construction of the RF Wien filter [6]. Such a methodology, in conjunction with the spin-tracking approach based on the matrix formalism outlined here, can be employed to efficiently generate a hierarchy of uncertainties for the EDM prototype ring [9] from the different design parameters of the ring.
The spin-tracking approach used here, shall be also applied to study various aspects of the presently applied spin-tune feedback system, used to phase-lock the spin precession to the RF of the Wien filter [19].