The driving circuit of the waveguide RF Wien filter for the deuteron EDM precursor experiment at COSY

The waveguide RF Wien filter is one of the key components of the JEDI project at the COoler SYnchrotron in Jülich. The driving circuit constitutes a fundamental part of the waveguide RF Wien filter. When running at the spin precession frequency, the driving circuit must ensure that the load impedance is set to the correct complex value so that the electric and magnetic fields are matched, leading to a vanishing Lorentz force during operation at high power levels up to 10 kW. This paper discusses the design, simulation, realization and performance analysis of the RF Wien filter driving circuit.

1 Introduction and motivation 1

.1 Introduction
The JEDI collaboration1 aims to conduct the first direct measurement of the permanent electric dipole moment (EDM) of deuterons at the COoler SYnchrotron (COSY) [1,2]. To enable COSY, as a magnetic storage ring, to perform such a measurement, a novel device called the "waveguide RF Wien filter" was developed, installed and commissioned for this purpose.

State of the art
The waveguide RF Wien filter is a unique device of its kind in the field of accelerator and particle physics. The design comprises a waveguide structure, designed to operate as a Wien filter i.e., it generates coupled, orthogonal, and, matched electric and magnetic fields. Conventional Wien filters incorporate electrostatic and magnetostatic and are used mainly as mass and velocity seperators. Another form of Wien filter that incorporates a pulsed electric field and a static magnetic field, is used for beam chopping purposes [3] only.

Lorentz force method
The spin dynamics of a particle with spin ì S in an arbitrary electric ( ì E) and magnetic field ì B including the EDM term [4] (in SI units) is governed by the T-BMT equation ì Ω MDM and ì Ω EDM represent the angular frequencies corresponding to the magnetic dipole moment (MDM) and the electric dipole moment (EDM) terms. For the current investigation, only ì Ω EDM is relevant which reads q, m, c, γ, and β are respectively, the elementary charge, mass, the Lorentz factor and the velocity of a particle in units of speed of light c [5].
In connection to the EDM measurements, in the RF Wien filter, the electric field ì E is orthogonal to the beam velocity vector ì β, which means that the term ì β · ì E ì β in eq. (1.2) vanishes. This property is guaranteed by the transverse electromagnetic (TEM) mode propagating in the device. Additionally, when the so called "Wien filter condition" is met, the following expression ì E +c ì β× ì B = ì F L cancels out, leading to a vanishing ì Ω EDM component. Practically, the Lorentz force ì F L is evaluated (and measured) integrally as Disentangling the three components of the Lorentz force, F x , F y , and F z reveals their connection to the field homogeneity, defined later in eq. (5.4). F x is minimized by impedance (mis-)matching 1Jülich Electric Dipole moment Investigations, http://collaborations.fz-juelich.de/ikp/jedi/.
-2 -(as will be explained in detail later). F y and F z , on the other hand, are functions of the unwanted field components, i.e., E y , B x , and, E z . They are strongly correlated to the electromagnetic design of the device. Extensive efforts have been invested to minimize these quantities by means of complex and highly detailed full-wave simulations [6,7]. For an ultimate precision experiment such as the EDM one, it is to important to quantify and evaluate the unwanted field components (see eq. (5.4)). In this paper, these are presented as functions of the electric circuit parameters (section 4).
For these reasons, very high requirements in terms of field homogeneity, orthogonality and matching have been imposed. Simulation wise, [6] the results were very promising including the effects of the mechanical tolerances and misalignments [7]. Practically, the device has been built with the best possible mechanical and electrical accuracy within the project budget. We were able to measure the amplitude beam oscillation up to 0.6 ± 0.5 µm,2 and it is not clear, up to-date which effect on the EDM resolution this implies. These are open questions that are currently being investigated [5,8].

The waveguide RF Wien filter
Briefly stating, the waveguide RF Wien filter is an electromagnetic structure that generates coupled, orthogonal and matched electric and magnetic fields. Matching, means that the field quotient Z q = E total /H total of the generated electric and magnetic fields is set to a value so that the equivalent electric and magnetic forces acting on the circulating beam particles are equally large i.e., vanishing Lorentz forces.
The structure incorporates the so-called parallel-plates waveguide. It is composed of a set of parallel electrodes supporting the transverse electromagnetic (TEM) mode. This means that the electric and magnetic fields fulfill the orthogonality condition of a Wien filter by design. In order to match the ratio of the total electric field to the total magnetic field, a mismatch variable resistor is placed at the load side of the device which ensures that part of the electric and magnetic fields are reflected back into the structure. The reflected fields interfere with the incident ones, which allows us to set the field quotient Z q to the required value.
In recent publications, the geometrical, electromagnetic and mechanical aspects of the waveguide RF Wien filter have been presented [6,7,9]. The present article is dedicated solely to the RF driving circuit, describing the design, simulation, tolerance analysis, and various measurements.

Circuit design
For the deuteron EDM experiment at COSY, the RF Wien filter can be operated at four discrete frequencies i.e. at four different harmonics of the spin precession frequency, namely, 630 kHz, 871 kHz, 1380 kHz and 1621 kHz (see table 1 of ref. [6]). The field distributions change with frequency and so does the field quotient Z q , consequently. Z q is a form of impedance, therefore it constitutes a frequency-dependent quantity that is susceptible to changes depending on the operational conditions. Fulfilling the Wien filter condition at each of these frequencies requires a different load impedance. This poses an additional requirement on the circuit to provide an adaptive Z q value.
2Under the matched condition. Ideally, a variable load resistor would be used; the value of Z q is set by simply altering the value of this resistor. However, a commercial solution of a load resistor that is capable to support a power of 10 kW while maintaining a precision better than 10 −4 does not exist. Another possible approach is to build an impedance mismatch network and the decision was taken to realize such a system.
The full circuit scheme is shown in figure 1. The design of the circuit was performed using a circuit-electromagnetic co-simulation tool. Simulating circuit elements in full-wave simulation domains [10][11][12] combine field and network circuit theory. The CST Design Studio (DS)3 tool provides the possibility to efficiently design and simulate the circuit in the same environment where the electromagnetic simulations took place. One obvious advantage of this approach is that the results of the computationally expensive4 full-wave simulations performed during the design stage [7] could be used without the need to re-perform them. Circuit-electromagnetic co-simulations are typically much faster than full-wave simulations; in fact their typical run-time does not exceed some tens of seconds. In the circuit-electromagnetic co-simulation domain, models of cables, power splitters/combiners, transformers and RLC circuit elements can be inserted. This provides the possibility to observe their influence on the fields simultaneously. The electromagnetic fields are then regenerated according to the new equivalent scattering matrix of the circuit network [13].
It is important to note that the circuit was designed originally for the case where ferrite blocks are installed inside the device [6]. Due to the delay in the delivery of the ferrites, the circuit was adapted to cope with the absence of the ferrite blocks, and consequently, the value of the load impedance to reach the required value of the field quotient Z q = 173 Ω was changed.
Originating from a signal generator,5 the signal passes through a 4-way signal splitter with 2 : 2, 0 : 180 • C phase shift output. This allows the amplifiers to be driven in a push-pull mode of operation. Each of the signals is then fed into an amplifier6 with 60 dB gain. The amplifiers connected to the same electrodes are decoupled using transformer-based isolators. Thereafter, eight    figure 1). These detectors generate two rectified DC-signals proportional to the magnitude of the current and voltage components at that particular branch, and also two additional RF signals with amplitudes proportional to the current and voltage signals that are used as monitor signals. From these monitor signals the phase between the electric and magnetic fields is determined. Signals arriving from the same electrode are then combined with two power dividers [13,14]. A 1 : 1 transformer is placed just before the load where one of its terminals is connected to the voltage and current detector, labeled 'U/I-9' (see figure 1), which yields the load impedance, while the other terminal is connected to an LC-network, used for fine tuning of the load impedance.

High-power variable load resistor
The realized solution of a variable, stable and high-power load resistor consists of two fixed watercooled commercial 50 Ω resistors connected in parallel to yield a value of 25 Ω with an impedance matching network [13], incorporating variable capacitors. Varying these capacitors provides the mean of having a variable and stable load resistor depending on the accuracy of the capacitors. While other network topologies are also conceivable, e.g., as described in [15], the selected 'T'-type (C-C-L) matching network topology has been used because it allows for the magnitude and phase of the load impedance to be relatively decoupled, a desirable property required for the operation of the RF Wien filter. In fact, this property facilitates the implementation of a feedback network for the automatic minimization of the Lorentz force on the stored beam.
To build the impedance network for 871 kHz, a fixed inductor in the range between 20 µH and 30 µH is required. In contrast to ferrite-core coils, an air-coil is the simplest and easiest way to design an inductor that is able to provide the designated inductance. With ferrite-core coils, it is easier to reach high-inductances, but they require active cooling, which is associated with additional technical difficulties. A photograph of the constructed coil is shown in panel (a) of figure 2. For the present setup, 34 windings are sufficient to generate an inductance of 28.8 µH.

Vacuum capacitors
Vacuum capacitors are commonly known as high-performance capacitors with excellent capabilities to handle high levels of voltages and currents. Vacuum capacitors do not employ dielectric materials, instead, a vacuum is encapsulated inside low-loss ceramic vessels with outstanding insulation capabilities. In principle, the accuracy of these capacitors is determined by the accuracy of the stepper motor driving them, in addition to their ability to maintain a constant distance between the electrodes. As they are vacuum based, the thermal effects are negligible, which means that the capacitors are able to preserve the distance between the electrodes very accurately. The capacitors used in the driving circuit are produced by COMET Technologies.7 A photograph of two of such capacitors is shown in panel (b) of figure 2. Being the only variable components, the vacuum capacitors are the circuit elements that are responsible for tuning/de-tuning the load impedance and consequently the RF Wien filter. Their accuracy is critical to the performance of the RF Wien filter. In this article, only the performance of one capacitor is discussed, the other capacitors provide a very similar performance. According to the manufacturer, the capacitance range of C L varies between 50 pF and 1 nF with 10% tolerance. The measured values are in very good agreement with the data sheet of the capacitor. The measured capacitance C L varies between 49.92 pF and 983.56 pF at the four aforementioned operating frequencies of the RF Wien filter.
The first capacitor test conducted is the linearity test. The capacitance is measured with a vector network analyzer as a function of the driving motor steps. A fixed step size of 250 is used. The result of the linearity test is shown in figure 3. A clear linear behavior of C L is observed over the full range of the stepper motor, i.e., from 0 to 10 000 steps. 250 steps correspond to 23.25 pF ± 0.52 pF, leading to 0.0933 pF ± 0.0021 pF per step.
The second test performed is a repeatability test. In fact, two kinds of repeatability tests were conducted. In the first one, a fixed step size of 2000 steps was used. The capacitance is measured while the stepper motor is driven back and forth. The results are shown in panels (a), (b), and (c) of figure 4 with initial motor positions of 1000, 4000, and 7000, respectively. The error in all three cases did not exceed 0.06 pF in absolute value. In panels (d), (e), and (f) the results of the second repeatability test are shown, where also random step sizes were carried out, and the capacitance was measured when the motor returned back to its original position. The reported errors did not exceed 0.06 pF in this case as well.

1 : 1 transformer
A photograph of the transformer is shown in figure 5. It has a simple structure, consisting of wire windings around ferrite cores. Detailed information on transformer circuitry can be found in refs. [16,17]. The full structure is placed inside an aluminum housing equipped with a fan. Holes are drilled on the left and right sides of the housing for cooling purposes. A similar transformer architecture is used as the basic building block for the power combiners and isolators with slight variations. The transformer is used to combine the signals that are 180 • C out of phase coming from the upper and lower electrodes of the RF Wien filter.
To quantify the performance of the transformer, three tests were conducted. One to evaluate the insertion loss, another one to evaluate the return loss or simply the power reflections, and lastly a temperature test in case that an unknown impedance is connected to the transformer.
To evaluate the insertion loss, it is sufficient to measure, for instance, the S 42 scattering parameter. It denotes the power transfer from port (2) to port (4), given no input power at the other ports, i.e., ports (1) and (3) are grounded. A vector network analyzer is connected to port (2) and (4). The measured S 42 values at 630 kHz, 871 kHz, 1329 kHz and 1621 kHz are, respectively, −0.03 dB, −0.04 dB, −0.07 dB, and −0.08 dB. Ideally, these values should be 0 dB; non-vanishing values, however, indicate the insertion losses at the corresponding frequencies.
The power reflection is measured by plugging a 50 Ω resistor between ports (3) and (4), while grounding port (2). The scattering parameter S 11 signifies the reflection at port (1). The measured values of S 11 at 630 kHz, 871 kHz, 1329 kHz, and 1621 kHz are, respectively, −27.25 dB, −28.19 dB, −25.4 dB, and −25.7 dB indicating that the input impedance of port (1) is very close to 50 Ω at all the four frequencies. 8 The measured return and insertion losses are summarized in table 1.
The third test is used to monitor the temperature increase inside the transformer. Two 500 W amplifiers with 180 • C phase shift are connected to terminal ports (1) and (2) of the transformer.    (3) is connected to a grounded 100 Ω resistor, while port (4) is grounded. As verified with an infrared thermometer, the maximum registered temperature did not exceed 40 • C. The specifications state that if the temperature of any component of the driving circuit exceeds 60 • C, the system interlock switches the amplifiers off.

Power combiner
It has been decided at the design stage to split the RF signal feeding the electrodes so that a more homogeneous current distribution can be achieved in the plates (see figure 1). Thus, two power combiners are required. The circuit implementation of one of the power combiners is shown in -8 -figure 6. (Many other implementations are discussed in the literature [14,16,17].) The chosen implementation is a transformer-based architecture leading to a broadband response. The very same power combiners will also be used for the other harmonics of the spin precession frequency. Table 2 shows the results of scattering parameter characteristics of one of the power combiners measured at all the frequencies of interest. As can be noticed from the values of S 21 and S 31 , the imbalance does not exceed 0.01 dB for all four frequencies. The output port is also well isolated as verified by the values of S 23 and S 32 . Temperature tests at different frequencies are necessary, in particular when high-power levels are involved. The temperature is expected to increase inside the power combiner if a mismatch occurs between the two input branches. The following setup is used. Two 500 W amplifiers feed the combiner which is then connected to an attenuator and a 50 Ω load where a thermistor is placed. The results of the test are summarized in table 3. These measurements were performed without any cooling, although the combiner is equipped with a usually continuously running cooling fan. The measurements revealed a temperature rise of 2 K for operation of the power combiner for 15 min at 1 MHz. 15 min is the typical time-interval the device is required to operate continuously during the precursor EDM measurement experiment.

Amplifier isolators
A photograph of the isolator is shown in figure 7. One can clearly see the transformer building blocks (windings of coaxial cables around ferrite toroidal cores). A two-sided design has been adopted due to space restriction. Each isolator is cooled from each side by a dedicated fan. The isolators are used to prevent a power flow between the amplifiers that are connected to the same electrode. Therefore, it is expected that the isolator will warm up if any cross-talk should occur. The measurement setup of the isolator uses two 500 W amplifiers connected to the isolator, and then each of the outputs is linked to an attenuator and then to a 50 Ω load. Using an NTC thermistor, the -9 -  table 4. Two test cases have been conducted, one without any power difference at the input terminal of the isolator, i.e., ∆P = 0 W and a second case with ∆P = 245 W with the power levels from the first and second amplifiers being 435 W and 190 W, respectively. In this case, running the measurement setup for 15 min induced a temperature increase of ∆T = 4.5 K. During the off-line test, and within the normal mode of operation, i.e., the proper settings of the load capacitors, the device ran for around 2 h continuously. The maximum temperature registered was 28.8 • C. One can conclude that no problems are to be expected by the temperature increase of the isolators.  -10 -

Off-line measurements (without beam)
All the measurements described in the following were performed without the ferrite blocks and prior to the installation of the RF Wien filter into the COSY ring. Figure 8 shows the simulated and measured reflection coefficient S 11 . The port where the measurement took place is located just in front of the 1 : 4 splitter without the amplifiers (see the yellow port (1) in figure 14). At 871 kHz, a good agreement between the simulated S 11 parameter (−13.1 dB) and the measured value (−12.7 dB) could be verified. One can see that the measured S 11 curve is slightly wider than the simulated one, indicating that some resistance (probably in the form of losses) is not properly taken into consideration in the simulations. It is important to note that the measured and simulated S 11 values are obtained when the correct settings of the load impedance are implemented, i.e., the so-called matched case.

Impedance measurement
The matched case means setting up the RF Wien filter to a state where the proper magnitude and phase of the field quotient Z q is maintained. The correct magnitude of the field quotient corresponds to a defined value of the load impedance denoted by Z 9 , and is measured by the detector called U/I-9 (see figure 1). The simulations show that without the ferrite blocks, the value of Z 9 has to be 82.9 Ω. The load impedance Z 9 has been recorded over a period of more than one hour while operating the RF Wien filter at 1.5 kW. 35 427 data samples have been collected and the corresponding statistical distribution is shown in figure 9. Projecting the measured data into a normal distribution yields an estimated mean value of µ Z 9 = (82.9029 ± 9.78 × 10 −5 ) Ω, and standard deviation of σ Z 9 = 0.0048 Ω. One concludes that the intended value of the load impedance can be reached indeed with very good accuracy.

Phase measurement
As there is no possibility to measure the electric and magnetic fields inside the device directly when the RF Wien filter is operated, a concept for measuring the phase using the current and voltage waves is established. At the operating frequencies of the RF Wien filter (i.e., between 600 kHz and 1700 kHz), the corresponding wavelength is much larger than then length of the RF Wien filter. This allows one to use the quasi-static approximation similar to the one used in [18]. It can be anticipated that the phase between the electric and magnetic field can be approximated by the phase between the current and voltage waves, a quantity that can be measured in real-time.
To further investigate this approximation, transient circuit electromagnetic co-simulations have been conducted with different load impedance values. Now, sinusoidal signals at 871 kHz are used to excite the simulations, in contrast to the full wave time-domain simulations which use pulses signals [10]. 9 The RF currents and voltages are recorded at the feeding points. Actually, only one 9Obviously, different excitation signals can also be used depending on the applications, as studied extensively in literature.   feeding point is sufficient to compute the phase. Simultaneously, the phase between the electric and magnetic field is calculated accordingly. Panels (a) and (b) of figure 10 show the results of the transient simulations, while panels (c) and (d) correspond to the full-wave simulations. Obviously, the circuit simulations permit to predict the phase between the electric and magnetic fields using the voltage and current signals. Up to a time t = 3 µs, the transient results are ignored and are not considered in the phase calculations. This is the time required by the 'RLC'-system to reach its steady-state.
It is important and required to accurately measure the phase between current and voltage in real-time. The effort to perform such measurements using a dedicated circuit has failed; the power dependency was intolerably large, and thus a well-defined calibration function could not be obtained. Alternatively, two monitor signals have been decoupled from the main RF signal using voltage dividers and current transformers. The signals were then fed into a Lock-in amplifier10 10The Lock-in amplifier used in this measurement is the 'HF2LI' from Zürich Instruments (ZI), AG, Zurich, Switzerland, https://www.zhinst.com.
-13 -  Figure 11. Comparison of the simulated phase between the electric field ì E and the magnetic field ì B and the measured phase between the voltage u(t) and current i(t), for the same combination of C L and C T using a lock-in amplifier.
(see ref. [19] for more information). Lock-in amplifiers are sensitive devices that extract and detect signals in extremely noisy environment. Desired signals can be actively tracked in real-time which allows a continuous monitoring of the phase. Figure 11 shows a comparison between the measured phase between the current and voltage and the simulated phase between the electric and magnetic fields. The values are measured/calculated for different combinations of C L and C T . A clear linear relation can be observed and the phase values are in very good agreement. In fact, the fitting error is less than 0.83% with a horizontal offset being not larger than 1.4 deg.

Performance and sensitivity analysis: theoretical foundation of the PCE method
This section presents the theoretical foundations of the Polynomial Chaos Expansion (PCE) that will be applied in section 5 for performance and sensitivity analysis of the driving circuit to the possible electrical uncertainties.

Polynomial chaos expansion (PCE)
In previous publications, we have applied the Polynomial Chaos Expansion (PCE) in order to study the effects of the mechanical tolerances on the performance of the RF Wien filter. Additionally, we also applied the so-called stochastic Galerkin method, which is another intrusive form of PCE to carry out fast beam and spin dynamics simulations with very large number of particles [20]. PCE is a spectral method where random variables can be expressed in terms of infinite series using orthogonal polynomials as the basis functions. The type of the orthogonal polynomial depends on the statistical distribution of the random variables as shown in table 5.
-14 - Table 5. Correlation between the type of random variables and their corresponding orthogonal polynomials.

Random variable distribution Orthogonal polynomials
Gaussian Hermite Uniform Legendre Gamma Laguerre Beta Jacobi

Building the basis polynomials
In this study all the uncertainties of the circuit are assumed to be Gaussian distributed, therefore, Hermite polynomials are used as basis functions. The 1D Hermite polynomial ψ n (ξ) is defined as The Hermite polynomials are orthogonal w.r.t. a normal probability density function f ξ , since The multidimensional Hermite polynomials are constructed using the tensor product of the 1D Hermite polynomials, via The i term is a multi-index set, constituting a multi-dimensional indexing scheme related to the multivariate orthogonal polynomials. It denotes the degree of the polynomial in each of the input variables. This is an important variable, as it provides a mechanism to alter and select a term from the set of the basis functions so that a computationally much less expensive PCE can be built, as will be shown later.

Computing the expansion coefficients
The multi-index set i for an m-dimensional input set and an expansion order of p is defined as Here, the expression · 1 denotes the L 1 -norm. Let ξ represent the set of the m-dimensional input variables, Ψ (ξ) be the set of constructed basis functions given ξ, and Ψ i (ξ) be the i th basis function. Any output quantity Y can then be expanded according to where α i denotes the i th expansion coefficient, corresponding to Ψ i (ξ).

JINST 15 P03021
To compute the expansion coefficients, a non-intrusive approach is used in this study. As a matter of fact, eq. (4.6) is nothing else than a large system of linear equations (LSLE) which can be solved using regression methods. The conversion of the regression method restricts the lower bound on the number of simulations N. N as a rule of thumb must be at least 1.5 times the number of polynomials basis P calculated as the following permutations Rewriting eq. (4.6) in matrix form yields . . . . . . . . .

Sparse PCE
In high-dimensional problems, where the number of random input variables m (typically m ≥ 10), the full-PCE becomes computationally unfeasible. For instance, a 15-dimensional problem, as in the case of this study, and with an expansion order e.g., of 5, generates P = 15 504 (see eq. (4.7)) basis functions and consequently requires at least 1.5 × P = 23 256 simulations to converge. Alternatively, one can build a sparse version of PCE [21,22] by either truncating the basis terms whose influence on the output is minimal using the following mechanism. First, the basis functions with the highest order of interaction (see figure 3.1 of ref. [23]) are eliminated according to the so-called sparsity-of-effects principle. This principle declares that the low-order interactions dominate the system response over the high-order ones. To do so, a new term is introduced into the multi-index set, the 'q-norm', which is now denoted by I m, p,q . The 'q-norm' is a quasi-norm in the probability space11 and depending on its value (0 < q ≤ 1), it controls the hyperbolicity of the truncation scheme. It is defined as (4.10) To build the new hyperbolic multi-index set, I m, p,q , higher-order interactions are eliminated by ignoring all the elements in the full-rank multi-index set I m, p , whose q-norm · q , is larger 11The probability space is a metric space.   than p, i.e., the expansion order is (4.12) A graphical representation of the hyperbolic truncation scheme set is depicted in figure 12 with a q-norm varying from 1 to 0.25. The higher-order interactions are taken out gradually. The polynomial terms selected for the first random variable are located on the horizontal axis, while on the vertical axis the corresponding terms of the second variables are shown. If the blue dots on the outer layer are connected, the shape resembles a hyperbola, hence the name hyperbolic truncation.
Next, the least-angle regression (LAR) algorithm is applied [21,22,24,25]. The LAR algorithm was originally proposed by Efron [26] as a modification of the well-known statistical method, called Least Absolute Shrinkage and Selection Operator (LASSO). The LAR algorithm applies a further selection scheme on the remaining basis functions. The selection procedure accounts only for the basis functions according to their highest contribution to the system response regardless of their order of interaction. The LAR algorithm does not compute the expansion coefficients, it only selects the basis functions. Then, the regression method is used to compute the coefficients. Figure 13 shows an example when the LAR algorithm is applied to quantify the unwanted electric field components. In this case, m = 15, p = 10, and q = 0.4. Only a 2-dimensional graph -17 -2020 JINST 15 P03021 is shown, and the red crosses correspond to the full-PCE, the blue disks are associated with the hyperbolically truncated set and the green circles are the selected points by the LAR algorithm.
Obviously, the number of selected basis functions has substantially decreased after applying the LAR algorithm.

Cross-validation
The expansion order p, the q-norm and the dimension of the input samples are basically unknown quantities. One starts with an initial guess and the required parameters are updated to the quality of the PCE model. This means that the PCE model has to be cross-validated. A very well-known cross-validation technique is the leave-one-out-error [27]. Its working principle is to split the input/output data into N sets.12 N − 1 sets are used to build a fit model referred to as M to predict the leave-one-out (LOO) model. The error is then simply the residual according to where Y k = M ξ − {ξ k } . A reliable PCE model requires a leave-one-out error e rr LOO of the order of 10 −2 [28].

PC-based sensitivity analysis
The global sensitivity is performed by decomposing the variance of the output Y as a function of the contribution of each variable and possibly their combination (interaction). The independence of the random input variables and the orthonormality of the PCE permits the direct computation of one known sensitivity scheme, called the Sobol sensitivity via the Sobol decomposition [29]. Let Y ξ i denote the output associated with the random variable ξ i . Rewriting eq. (4.6) as a function of 12N is the number of simulations carried out.

JINST 15 P03021
terms of the variable ξ i gives Here I ξ i is the multi-index set of the variable ξ i , i.e., the i th term in the multi-index row is non-zero. Therefore, to characterize the output related to the ξ i or any of its combinations, all that is required are the PC coefficients.
IfD denotes the variance of the estimated outputŶ, the partial variances corresponding to the random input variables are denoted asD ξ 1 ,...,ξ 10 . In this case, the total and partial variances are calculated, respectively, asD Finally, the Sobol indices corresponding to the parameters ξ i are calculated according tô (4.14)

Performance and sensitivity analysis: applying the PCE method
This section applies the aforementioned steps to construct a probabilistic performance and sensitivity analysis of the driving circuit of the RF Wien filter. Circuit elements are subject to uncertainties either in the form of tolerances or noise. These uncertainties are in most cases unavoidable or too cumbersome to be minimized. Therefore, it is important to consider them as part of the design and consequently to quantify the overall system performance in their presence.

Defining the system response
Based on the same principle used in refs. [6,7], the unwanted electric and magnetic field components ì E ⊥ and ì H ⊥ are defined as The performance of the driving circuit is expressed in terms of the unwanted electric and magnetic field [7], and as a function of the Lorentz force F L . The unwanted fields, specified via f int E ⊥ -19 -and f int H ⊥ , are calculated by taking into account the total fields (see [6]), and are defined as = 1152 mm is the effective length of the RF Wien filter along the longitudinal axis. The field contributions outside the considered length are very small (of the order of 10 −4 ) and are not taken into account. Table 6. Statistical distributions of the random variables representing the stochastic electrical variations of the driving circuit of the waveguide RF Wien filter. G (µ, σ) indicates a Gaussian distribution with a mean value of µ and a standard deviation of σ.
variable standardized description distribution Unit ) Ω

Modeling the input parameters
The uncertainties of the circuit elements studied here C L , C T , C p1 , C p2 , L f , L p and R f (see figure 14) are represented by the variables x 1 to x 7 , respectively, and are listed in table 6. These parameters are modeled as Gaussian distributed random variables G(µ, σ). The matched point for the variable -20 -  These desired values are set as the mean of the corresponding distribution. The standard deviations of the capacitors were set to 1 pF. The fixed inductance L f was built to provide initially 30 µH. However, when connected to the other elements in the network, the measured value eventually obtained was L f = 27.5 µH, i.e., smaller than the design value. The liquid-cooled resistor13 is able to maintain a purely resistive response R f = 25 Ω up to 800 MHz. Under active cooling, R f does not deviate from its nominal resistance value. According to ref. [30], for a copperbased resistor, an increase in the resistance from a 25 Ω to 26 Ω requires a temperature difference 13It is produced by Altronic Research, Inc., Yellville, Arizona, U.S.A., http://altronic.com.
-21 -of ∆T = 10.25 K, which is highly improbable especially if a highly-efficient water-cooling process is employed. Nevertheless, the tolerance calculations assume σ R f = 2 Ω (see ref. [30] for the calculation formula). The parameters and their statistical characteristics are summarized in table 6.
The imperfections in the circuit elements may lead to non-homogeneous excitation signals. This means that at each electrode, the RF signals are not necessarily identical; these uneven signals might differ in phase and/or amplitude. To model such imperfections, additional functional blocks have been added to the circuit model where the phase shifts and the attenuation levels can be altered.
The variables x 8 to x 11 and x 12 to x 15 in table 6 represent these phase and attenuations variations induced at the functional blocks labeled (17), (18), (19) and (20) in figure 14, respectively. The measurement results of the 1:4 signal splitter showed that it introduces a deterministic phase shift of 0.1 deg. As four separate amplifiers are used, they possess slightly different phase (and amplitude) response. The measured phase distortions induced by the amplifiers are summarized in table 7. These deterministic phase shifts were set as the mean values for the variables x 8 , · · · , x 11 . A large set of measurements14 (more than 10 4 samples) leading to a phase standard deviation of 10 −3 deg. The signal amplitudes were characterized at each excitation port by setting an attenuation in dB. The measured mean values of the variables x 12 , · · · , x 15 were set respectively to 0 dB, meaning no attenuation, 0.1 dB, 0.3 dB, and 0.2 dB attenuation. The standard deviation was set to 0.12 dB, as can be seen in table 6. Table 7. Measured phase differences at the signal feeding the electrodes. As there are 4 input ports labeled (1) to (4). Port (1) is taken as the reference.

Performance analysis
First, a set of 1000 samples15 of all the input parameters is generated using the (nested) latinhypercube scheme. Using this set, 1000 circuit-electromagnetic co-simulations have been conducted. Of course, if this is found later to be not sufficient, the original set can be enlarged (enriched) and more simulations could be carried-out so that convergence is ensured. The total computation time of the 1000 simulations was around 13 h. Figure 15 shows the probabilistic performance of the RF Wien filter under the given uncertainties of circuit elements. 10 6 samples have been reconstructed using the PCE coefficients to formulate the probability density functions of f int E ⊥ , f int H ⊥ and F L , shown in panels (a), (b), and (c) of figure 15, respectively. Each of the aforementioned quantities has been fitted to a normal distribution with the fitting parameters and errors summarized in table 8.
In terms of the unwanted electric field f int E ⊥ , the RF Wien filter performs well. The estimated mean value of f int E ⊥ is of the order of 10 −6 , with very narrow spread (10 −7 ) from this mean value, 14They were measured using a Lock-in amplifier from Zurich instruments. 15This number was an educated-guess from working with the PCE method for relatively long time in many applications.  as can be seen in table 8. The predicted mean value of the unwanted magnetic field f int H ⊥ implies that the RF Wien filter also performs well, but with a substantially wider spread (10 −4 ). The reason for this difference is that the structure has been optimized for better f int E ⊥ , as this led to a better cancellation of the Lorentz force by about a factor 5, as discussed in ref. [6]. The estimated performance of the RF Wien filter in terms of the Lorentz force cancellation F L also predicts a very good performance. Values of |F L | = (5.2 × 10 −2 ± 3.3 × 10 −4 ) eV/m with a width of σ F L = 10.4 × 10 −2 eV/m are definitely not measurable, as has been found during the commissioning measurement of the RF Wien filter. The associated induced oscillations of the beam would be on the nanometer level.

Sensitivity analysis
A variance-based sensitivity analysis [29,31] is conducted as a function of the parameters of the circuit elements. The results of the sensitivity analysis are summarized in figure 16. The blue, green and yellow bars correspond to the unwanted electric and magnetic fields f int E ⊥ , f int H ⊥ , and to the Lorentz force F L , respectively. The impact of each of the uncertain parameters is denoted by a Sobol indexŜ ξ i . Figure 16 expresses the variances of f int E ⊥ , f int E ⊥ , and F L as a function of the variances of each uncertain input variable. It is important to note that only the first-order Sobol indices are shown here, while the indices belonging to higher-order interactions are omitted because of their negligible contribution to the total variance. The values of all the outputs as a function of all the uncertain parameters are summarized in table 9.  (see table 6 for the corresponding parameters and variables).

Unwanted electric fields E ⊥
Unwanted electric fields f int E ⊥ are mainly influenced by the fixed inductor L f (30%) denoted by S ξ 5 and by the fixed resistor R f (50%), represented by S ξ 7 . Apparently, the influence of the capacitors on f int E ⊥ is not visible as indicated by the small values of S ξ 1 , S ξ 2 , S ξ 3 and S ξ 4 . This does not mean that the capacitors do not influence the electric field. It means that the variation margins of the capacitors are not large enough to introduce noticeable effects on the unwanted electric field f int E ⊥ . The standard deviation of σ ξ 5 = σ L f = 0.5 µH is sufficient to widen the response of f int E ⊥ by 30% (S ξ 5 ). This is not very critical as the effect of the coil can be compensated by the capacitors C L and C T . The most important parameter is the fixed resistor which contributes up to 52% (S ξ 7 ) to the spread of f int E ⊥ from the mean value. In the calculations, σ ξ 7 = σ R f = 2 Ω has been considered as a standard deviation of R f . According to the temperature measurements, however, such a variation should never occur in practice. The phase variation contributes by ≈ 3.5% at each feeding port (see labels (17), (18), (19) and (20)

Unwanted magnetic fields H ⊥
The magnetic field approximation in the magneto-static regime is mainly influenced by the current distributions on the electrodes. It can be further elaborated that the unwanted magnetic field f int H ⊥ is related to the inhomogeneity of the current distribution. This assumption is emphasized by the sensitivity results of f int H ⊥ . Only the magnitude and the phase of the feeding signals appear to affect f int H ⊥ . Similarly to f int E ⊥ , the phase turns out to contribute almost equally to the variance of f int H ⊥ , up to 14%. The signal magnitude on the other hand is the main influencing factor responsible for more than 80% of the total variance (ξ 12 , . . . , ξ 15 ).

Lorentz force F L
The performance analysis in terms of the Lorentz force F L involves the electric and magnetic fields instead of the unwanted components. Therefore, it is straightforward for the Lorentz force to depend -24 - Table 9. Values of the Sobol sensitivity analysis shown in figure 16. on the parameters affecting the load impedance, a response similar to f int E ⊥ with different contributing importance values. The variance of the inductor and the resistor L f and R f share together 97% of the variance of the Lorentz force. Therefore, the performance of these two elements is crucial for the overall performance of the RF Wien filter.

Summary
This paper summarizes the efforts to realize the driving circuit of the waveguide RF Wien filter. The circuit has been designed and simulated with CST design studio (DS).3 The circuit elements were fabricated by Barthel HF-Technik,6 and the elements were tested and validated with measurements, conforming well with the simulation results.
A PCE-based performance analysis of the full system response under uncertainties has been conducted. The unwanted electric and magnetic field components were not increased under circuit uncertainties. Also, the Lorentz force values corresponding to beam oscillations are reasonably small.
A sensitivity analysis has been performed with the help of the PCE. There unwanted electric field components were found to be mainly influenced by the fixed coil and the fixed resistor in the matching network. Unwanted magnetic field components were mainly affected by the uniformity of the feeding signals. The Lorentz force showed to be mostly sensitive to the main parameters that were affecting the unwanted electric field contributions.
The JEDI collaboration has conducted dedicated beamtimes to commission the RF Wien filter including the driving circuit. Within the limits of our measurement tool, we were able to match the electric and magnetic fields to a degree that the amplitude of the induced beam oscillations did not exceed (0.6 ± 0.5) µm which will be discussed in detail in a forthcoming publication.
The lower-limit of the non-vanishing Lorentz force required for the EDM experiment is still unknown. It is currently under investigation. We developed a new spin tracking code to compute the hierarchy of uncertainties, including the residual Lorentz force, in order to understand their individual impact on the EDM signal.