{'fraction_non_alphanumeric': 0.03843171046962516, 'fraction_numerical': 0.014189286227200918, 'mean_word_length': 4.253659272672401, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Minimising statistical errors in calibration of quantum-gate sets

Calibration of quantum gates is a necessary hurdle to overcome on the way to a reliable quantum computer. In a recent paper, a protocol called Gate Set Calibration protocol (GSC) has been introduced and used to learn coherent errors from multi-qubit quantum gates. Here, we extend this study in a number of ways: First, we perform a statistical analysis of the measurement uncertainties. Second, we find explicit measurement settings that minimize this uncertainty, while also requiring that the protocol involves only a small number of distinct gates, aiding physical realizability. We numerically demonstrate that, just by adding two more single-qubit gates to GSC, the statistical error produced in the calibration of a CNOT gate is divided by a factor of more than two.


Introduction
A fundamental property of quantum mechanics is its intrinsic uncertainty: responses of measurements can only be predicted probabilistically. Therefore, experiments aimed to extract information from a quantum system have to be designed so as to reduce the expected statistical uncertainty. The branch of statistics concerned with such questions is called design of experiments (DOE). Among the main objectives of DOE is the optimisation of statistical error, as well as validity, reliability and replicability. DOE has been applied in different quantum information problems such as parameter estimation [1,15], and quantum state and process tomography [10,13,16]. In this article, we address the task of implementing DOE in a calibration protocol for quantum gate sets.
Specifically, we will work with the Gate Set Calibration (GSC) protocol introduced in Ref. [5] for the purpose of identifying coherent errors in unitary quantum gates.
Given a set of available quantum gates, initial states and measurements, GSC constructs short gate sequences that allow all coherent gate errors to be extracted. This protocol can be considered as a middle way between Randomized Benchmarking (RB) and Gate Set Tomography (GST), as it provides more detailed information than the former using fewer measurements than the latter [4,11].
In this article we use DOE to optimise GSC. Specifically, we introduce parameters in the sequences that GSC builds and perform an optimisation over these parameters to minimise the statistical error of GSC. This article is structured as follows. Section 2 introduces a simplified version of GSC and establishes the notation. In Section 3 we present the theoretical framework under which the optimisation of GSC will be carried out. In other words, we analyse the statistics of GSC and define a measure of uncertainty that will allow us to compare the statistical error of different versions of GSC. Section 4 is dedicated to the optimisation of GSC. We design an optimisation protocol to minimise the statistical error with respect to the measure of uncertainty. Moreover, the version of GSC resulting from the optimisation is further modified taking into account the feasibility of the protocol. Finally, we verify in Section 4.1 that the reduction of the statistical error is also achieved when imperfect measurements are considered. The paper ends with an outlook in Section 7.

The Gate Set Calibration protocol
In Ref. [5], a new protocol for characterizing and calibrating quantum gates, Gate Set Calibration protocol (GSC), has been introduced. In this section, we will introduce the notation and present a slightly simplified version of the protocol. In particular, we restrict attention to the specific, and experimentally relevant, case of calibrating a two-qubit CNOT gate subject to coherent errors.
Gate Set Calibration consists of the following steps. First, the qubits are initialized in a known state. Then, a gate sequence from a set of available gates is applied to the initial state, and finally a measurement is performed. All coherent gate errors can be extracted by repeating this process for different sequences, initial states and measurements, as we will see below.
Assume that we aim to implement a set of unitary quantum gates. In reality, the hardware will realize perturbed gates, which we still assume to be unitary.
Consider concretely a situation where only gates in the set {CNOT, X (1) θ , Y (1) θ , X (2) θ , Y (2) θ } can be applied, namely a global CNOT and arbitrary single-qubit rotations around X-and Y-axis. Here, the superscripts indicate on which qubit the gate is applied, and the gates are defined as where σ 1 , σ 2 , σ 3 are the Pauli matrices and σ 0 = I. We assume that all single-qubit gates are already calibrated, and thus here we want to use GSC to tune a perturbed CNOT gate, which we denote asCNOT. The deviation from the optimal gate is measured by the coherent error operator associated with the gate. In the particular case of the CNOT gate we define In order to analyze the perturbed gate, we expand the error operator in the Pauli basis for suitable coefficients p, which we call error parameters, and for τ k = τ ij = σ i ⊗ σ j . The choice of the prefactor of the sum ensures that the unitarity of E to first order implies that p k are real.
The ultimate goal of GSC is to obtain the error parameters, p. To estimate the error parameters, GSC considers a number of experimental settings, which we label with the letter s. These settings can vary in the initial state, the gate sequence, and the measurement. As initial state we will always take ρ = |00 00| and perform a measurement M s ∈ {σ 0 ⊗ σ 3 , σ 3 ⊗ σ 0 }. Thus, for each setting one can experimentally estimate the quantity R s ( p) = Tr (G ls,s · · ·CNOT( p) · · · G 1,s )|00 00|(G † 1,s · · ·CNOT( p) · · · G † ls,s )M s , which we will refer to as the measurement responses. Here, l s is the length of each sequence and G j,s ∈ {X θ } are the single-qubit gates of sequence s. Following the framework of Ref. [5], we now make the assumption that the error parameters are small, and thus assume that the vector of responses depends only linearly on p. We write where we define the matrix elements of L as These matrix elements, L su , as well as R( 0) can be computed analytically. Therefore, given the perturbed responses, R( p), we obtain the gate errors parameters by solving the inverse problem To ensure that the matrix L is non-singular, it is necessary that the number of responses is equal to or greater than the number of error parameters. When this is not the case, additional responses can be added by considering more sequences, initial states or measurements. Moreover, the condition number of L must not be too large so that computing the inverse of L is numerically stable.
Having introduced the basic setup, we are now in a position to explain more clearly the motivation of this paper. Table 1 summarizes the combination of sequences and measurements used in Ref. [5] to calibrate a perturbed CNOT using GSC. In the third column of Tab. 1, we see that the settings chosen consider only responses distributed around zero. Put differently, R s ( 0) = 0 for all s = 1, . . . , 15. It turns out that, if one looks at statistics, this is also the point of maximal uncertainty since the variance of the responses is maximal for R s ( 0) = 0 (see Fig. 1). In fact, it is not obvious what the optimal point is, i.e., which settings of GSC minimize the statistical error and, at the same time, ensure stability of the numerical inverse of L and implementability of the protocol. Our research looks into this trade-off between reducing the statistical error, but still having a well-conditioned matrix L. Although we only consider the calibration of a two-qubit gate, the statistical analysis performed in the following sections can be generalised to higher dimensions straightforward.    (1)). Each row corresponds to one setting, where gates are applied from left to right and followed by a measurement (either τ 3 = σ 0 ⊗ σ 3 or τ 12 = σ 3 ⊗ σ 0 ). The last column contains the measurement responses up to first order in the error parameters, p (see Eqns. (2) and (3)).

The statistics of GSC
Quantum mechanics is unable to predict with certainty future events, such as the measurement outcomes. Therefore, as we do in this section, it is essential to consider the statistics of the problem we are investigating to minimize statistical errors. Here, we study the statistics of GSC by determining the probability distribution according to which the measurement responses are distributed, as well as the error parameters. Subsequently, we define a quality measure that will allow us to compare the statistical error between different versions of GSC.
Before starting the discussion about GSC statistics, let us establish that all estimated quantities will be denoted by a superscript * . Assuming independence, a two-outcome measurement is described by a binomial distribution, B(N, q), where N is the number of repetitions and q the probability of obtaining the outcome. In the scenario presented in Section 2, fifteen measurements are performed, one per setting, and each one is repeated N times. Therefore, the overall outcome is described by a random vector with binomially distributed components. It is well known that a binomial distribution can be approximated by a normal distribution such that N (N q, N q(1 − q)) in the limit of sufficiently large N . Our interest is, in particular, focused on spin qubits, which are considered in Ref. [5] and where a high number of repetitions is easy to obtain. We can therefore assume that the overall GSC outcome approximates a multivariate normal distribution and assume specifically that the estimated vector of responses is distributed as with R s ( p) defined in Eq. (2). Note that the covariance matrix Σ is diagonal, i.e., settings are independent of each other.
The estimated error parameters, p * , are computed with Eq. (4) using the estimated responses, R * obtained from the lab. Therefore, p * is a random vector distributed according to a multivariate Gaussian distribution with p * ∼ N ( p, L −1 ΣL −T ), where L −T := (L −1 ) T .
In order to quantify the statistical error, we need to construct a measure of uncertainty. We take our quality measure to be the mean squared distance between p * and p, i.e., where Σ p * − p := L −1 ΣL −T is the covariance matrix of the random vector p * − p with matrix elements Σ (su) p * − p . Note that p * − p = 0 since p * = p, which we have used in the second equality. We extend the definition of D 2 to singular L by defining it to be ∞ in this case. Now that we have characterised the statistics of GSC and defined a quality measure, we are able to minimize the statistical error of GSC. In the next section, we will look for a set of sequences, initial states and measurements which achieves a small mean squared distance under the restrictions that, first, L is a well-conditioned matrix and, second, the settings of GSC are physically implementable.

Optimizing GSC
In this section, we employ the statistical characterization we have developed in Sec. 3 to optimize the calibration protocol GSC. To do so, we introduce some parameters in the settings of GSC and optimize the statistical error over these parameters. Aiming for a physical implementation of GSC, we further modify the optimised settings in order to have a small number of different gates. Before all this, however, we start analysing the version of GSC proposed in Ref. [5] with the quality measure defined in Sec. 3.
In Ref. [5], GSC is introduced and applied in a two-qubit scenario to calibrate a perturbed CNOT gate, as we have summarized in Sec. 2. When we evaluate the statistical error of this version of the protocol in terms of the mean squared distance defined in Eq. (6), we obtain that D 2 ≈ 7.4/N .
As we have already mentioned in Sec. 3, we can assume that each estimated response, R * s , is distributed according to a normal distribution such that N (R s ( p), Σ) with R s ( p) and Σ defined in Eqns. (2) and (5), respectively. For the settings chosen in Ref. [5], each estimated response is distributed around zero when p = 0 (see the last column of Tab. 1). The calibration of the CNOT is, therefore, performed at the point of maximal uncertainty, i.e., where the variance of each response reaches its maximum, Σ ss = 1/N , as we can see in Fig. 1. Here we have restricted the attention to the diagonal elements of Σ because all settings are independent of each other.
We propose to slightly modify GSC in order to benefit from working at a point with smaller statistical error. To this end, we allow a different angle for each rotation of each GSC sequence so that the calibration of aCNOT is performed using the sequences in Tab. 2. Our idea is to numerically optimize the mean squared distance of these settings over the angles θ 1 , . . . , θ 25 with a local derivative-free optimizer that allows boundary constraints.  Figure 2: Above, angles that minimize the mean squared distance of the calibration of aCNOT using sequences in Tab. 2 (Eq. (6)). Below, the same angles after a folding transformation (i.e., mapping θ i −→ 2π − θ i for all θ i > π) and setting θ 1 = θ 2 = θ 6 = θ 9 = θ 15 = θ 16 = θ 17 = θ 18 = π/2. Since the mean squared distance is invariant under folding transformation and independent of θ 1 , θ 2 , θ 6 , θ 9 , θ 15 , θ 16 , θ 17 , θ 18 , both angle combinations achieve the minimum value, D 2 ≈ 3.4/N .
We use the algorithm specified as nlopt ln bobyqa in the NLopt library [9], which, according to the documentation, is derived from the BOBYQA subroutine introduced in Ref. [14]. This algorithm optimizes the objective function by iteratively constructing its quadratic approximation. We set boundary constraints such that θ i ∈ [0, 2π] for all i = 1, . . . , 25. A stopping tolerance for the optimizer is set to 10 −10 at the angles. Note that a local optimizer such as BOBYQA does not always converge to a global minimum. In order to gain confidence that our result is indeed a global minimum, we have repeated the optimization 10 4 times with random starting points. In roughly one in 30 runs, the optimizer stopped at values within a factor of 10 −5 of the smallest mean squared error observed.
We have obtained a minimum mean squared distance of D 2 ≈ 3.4/N with the combination of angles in Fig. 2. This means that one can achieve a reduction of the statistical error of GSC by a factor of 0.46 with respect to the version of the GSC proposed in Ref. [5].
This new version of GSC requires sixteen single-qubit rotations for a maximal sequence depth of four gates. Specifically, we need one rotation for each different angle and, for some angles, we need two rotations: one rotation around the X-axis and one rotation around the Y-axis. Note that, although all rotations X nφ and Y nφ , where n is an integer, can be implemented by applying n times the rotation X φ or Y φ , respectively, this implies a cost in the sequence depth.
From an experimental point of view, tuning and calibrating sixteen different single-qubit rotations is undesirable. Therefore, we would like to reduce the number of different angles without introducing a significant cost in the mean squared distance. We have observed numerically that the mean squared distance is invariant under the following transformations of the set of optimal angles (the transformations are not symmetries of the objective function at non-optimal points): 1. degeneracy: any change of the angles θ 1 , θ 2 , θ 6 , θ 9 , θ 15 , θ 16 , θ 17 , and θ 18 as long as L remains non-singular; 2. global reflection: θ i −→ 2π − θ i for all i = 1, . . . , 25; 3. local reflection: θ i −→ 2π − θ i only for one i ∈ {1, . . . , 25} as long as L remains non-singular; 4. folding transformation: It would be tempting to set all the angles listed under 1. to zero, thereby eliminating the corresponding gates. However, it turns out that this choice does lead to a singular L and will therefore not be considered here. Still, a significant reduction of complexity can be reduced by making use of the above symmetries. The folding transformation allows us to reduce, without any cost in the mean squared distance, the number of different rotations to thirteen for a maximal sequence depth of four gates. At the price of increasing the sequence depth to seven gates, one can further reduce to eleven distinct rotations.
To reduce even more the number of gates in the set of available gates, we use the fact that the minimal mean squared distance is degenerate. In Fig. 3, we can see that the minimum mean squared distance is achieved regardless of the value of the angles θ 1 , θ 2 , θ 6 , θ 9 , θ 15 , θ 16 , θ 17 and θ 18 . As mentioned before, we can unfortunately not set these angles simply to zero, and thus get rid off the corresponding rotations, because L becomes singular. These angles can alternatively be set to π/2, which is a single-qubit gate already required to implement GSC (see Fig. 2). The mean squared distance remains at D 2 ≈ 3.4/N and now GSC needs only four rotations and a maximal sequence depth of five gates.  Ultimately, we are proposing a GSC protocol that calibrates a two-qubitCNOT gate with a statistical error 0.46 times smaller than in Ref. [5]. The set of allowed gates is where θ = 0.62208π, and the maximal sequence depth is five, as we can see in Tab. 3.

Introducing imperfect measurements
In all previous sections, the measurements performed in GSC are assumed to be perfect. In other words, we have assumed that one can perform a projective measurement in some orthogonal basis. However, in the laboratory, devices are imperfect and subject to noise. Here, we investigate how the results behave under a simple noise model.
Let us consider the scenario presented in Sec. 2: calibrating a perturbed gate,CNOT, (see Eq. (1)) using GSC. All measurements performed in GSC are Pauli observables, and thus they have only two outcomes, the positive and the negative outcome. The error model used here is given by an perfect Pauli measurement, followed by a asymmetric binary channel. More precisely, the model takes two error parameters F + , F 1 ∈ [0, 1] such that if the perfect measurement yields the outcome +1, the imperfect one will return +1 with probability F + and −1 with probability 1 − F + . The situation for the (−1)-outcome of the perfect Pauli measurement is analogous.
The probability to read a positive outcome on the measurement device after measuring M s is then where q s is the probability of obtaining the positive outcome, i.e., q s = (1+R s )/2, and R s is defined in Eq. (2). Recall that R s depends on the error parameters, and so do q s and Q s (+).
s 1st gate 2nd gate 3rd gate 4th gate 5th gate M s R s ( p)
The probability that the measurement device gives a negative outcome after measuring M s is It is easy to check that Q s (+) + Q s (−) = 1.
The imperfect measurement responses are hence given bỹ Then, the matrix elements of L can be written as As we have done in Sec. (3), we use the mean squared distance as measure of uncertainty to compare different versions of GSC. The mean squared distance considering imperfect measurements becomes˜ where the matrix elements of the covariance matrix of the perturbed measurement responses,Σ, Let F + = 0.99 and F − = 0.98 and consider the GSC presented in Ref. [5], which uses the sequences in Tab. 1. The statistical error measured by the mean squared distance in Eq. (8) is D 2 ≈ 7.8/N . Allow now a different angle for each GSC rotation, i.e., consider the sequences in Tab. 2. With the optimization procedure described in Sec. 4, we minimize the mean squared distance in Eq. (8) over the angles θ 1 , . . . , θ 25 . The angles in Fig. 4 achieve a minimal mean squared distance at D 2 ≈ 3.6/N . This means a statistical error 0.46 times smaller than in Ref. [5], but requires seventeen different rotations with a maximal sequence depth of four gates. As in the case of perfect measurement, the number of rotations can be further reduced to thirteen at the cost of a sequence depth of seven gates.
In analogy with the case with perfect measurements treated in Sec. 4, the number of rotations can be reduced by considering symmetries of the optimal mean squared distance. We have numerically shown that the minimal˜ D 2 is invariant under folding transformation as well as global and local reflection of the optimal angles. After considering the folding transformation, the number of rotations reduces to twelve without any change in the mean squared distance and with a maximal sequence depth of four gates.
In summary, we propose to calibrate a perturbed CNOT gate using GSC with the sequences in Tab. 3 and θ = 0.62208π. This version of GSC requires a maximal sequence depth of five gates and a set of allowed gates consisting of {CNOT, θ }, which contains two more single-qubit gates than the set proposed in Ref. [5]. Nevertheless, it reduces the statistical error by a factor of 0.46 for perfect measurements as well as for imperfect measurements with F + = 0.99 and F − = 0.98. All results are summarized in Tab Table 4: Summary of numerical results, where the statistical error is measured by the mean squared distance, D 2 , and the forth column shows the number of single-qubit rotations required.

Simulation
The original GSC protocol was designed with the in-situ tuneup of GaAs based S − T 0 qubits in mind. In this section, we perform simulations of the refined GSC algorithm on this qubit type and validate its convergence behaviour following Ref. [5].
We follow the overall model presented in Ref. [7]. Spin qubits in GaAs are created by placing metal electrodes on top of a semiconductor heterostructure, allowing for local control of the chemical potential and the exchange interactions (J j,j+1 , j ∈ {1, 2, 3}) within an array of four linear adjacent quantum dots. Each site is occupied by one electron, whose spin experiences the magnetic field B j , j ∈ {1, 2, 3, 4} which can be different for each site. This results in the Hamiltonian, with = 1, where σ (j) is the Pauli operator acting on the spin on site j. The {|↑↓ , |↓↑ } ⊗ {|↑↓ , |↓↑ } subspace is chosen as the qubit encoding.
The states |↑↑↓↓ and |↓↓↑↑ are considered leakage states but their occupation can be largely suppressed by choosing J 23 /|b 23 | 1, where b j,j+1 = B j − B j+1 is the difference in local magnetic field between neighboring sites. The gradients achievable in experiments using dynamic nuclear polarization are within the range 0.1 ns −1 to 7 ns −1 and are chosen to be b 23 = 7 ns −1 and b 12 = −b 34 = 1ns −1 in this simulation. The exchange interaction J j,j+1 is related to the detuning voltages between neighboring sites using the phenomenological relation J j,j+1 ( j,j+1 ) = J 0 exp ( j,j+1 / 0 ), with 0 = 0.272 mV and J 0 = 1 ns −1 [8]. The detuning voltages can be controlled using arbitrary waveform generators with a sample rate of about 1 GS/s, with the exact value depending on the specific hardware used. Each gate applied to the qubit is therefore parameterized in three detuning sequence with typical length of N samp = 20 to 50 samples.
These sequences are convoluted with a typical impulse response of the experimental setup [7]. Hence we can approximate the time-dependence of each J j,j+1 (t) and numerically calculate the time evolution of the two qubit system using a piece-wise constant approximation. Using the unitary obtained in this fashion we can quantify the infidelity by comparing to the unitary of the desired operation U t , which is then given by I u ( ) = 1−F u [U ( ), U t ], where F u is the fidelity of the operation [12]. Similarly the leakage out of the computational subspace is given by L = 1−Tr (V † c V c /4), where V c is the truncation of U ( ) into the computational subspace.
We also take into account effects of charge noise affecting and hyperfine noise affecting b j,j+1 on the fidelity and leakage by averaging them over 100 computer generated noise realizations. Hyperfine noise in GaAs is assumed to have a standard deviation of σ b = 0.3 mT when stabilized using dynamic nuclear polarization [6]. For charge noise we use a combination of quasistatic noise with σ = 8 µV and white noise with a strength of 4 × 10 −20 V 2 Hz −1 following experimentally determined values [8].
We use the initial stateρ i = |↑↓↑↓ ↑↓↑↓| = |00 00| native to this qubit type [7]. The inability to discern the three possible triplet states leads to the following measurement operatorsM 1 and M 2 [3], [2] when the basis states (| ↓↓↑↑ , | ↑↓↑↓ , | ↑↓↓↑ , | ↓↑↑↓ , | ↓↑↓↑ , | ↑↑↓↓ ) are taken into account:M For the new GSC protocol we need the full gate set {CNOT, X θ } given above. Physical realizations assuming the above model have already been proposed in Ref. [7] for the first five gates in this gate set and used to validate the original GSC sequences. We use the same numerical optimization from Ref. [7] to obtain realizations of the additional X (1) θ and Y (1) θ gates. The pulse sequence for the former is shown in Fig. 5, where the programmed sequence is shown in addition to the exchange as seen by the qubit after filtering effects of the cryostat wiring and AWG bandwidth. A summary of the performance of all gates used in the following simulations are given in Tab. 5.  Figure 5: (a) Sketch of the qubit system as implemented for the simulation. (b) Pulse sequence for a X θ gate to be programmed on the AWG (blue) and seen by the qubit (orange). Exchange between the two qubit is turned off for this simulation (J 23 = 0) to reduce complexity. Figure adapted from Ref. [7].
Since the sequences in Tab. 3 are designed to calibrate the CNOT gate only, we leave all other gates in the gate set fixed. We perturb the sequences of the perfect CNOT by random voltages in order to obtain a set of starting values with initial infidelities I initial of up to 20 % due to systematic errors. We can now numerically evaluate and minimize |∆R| = | R( ) − R 0 | = | R( p) − R 0 |, where R 0 is the outcome of the sequences with perfect gates, assuming that our error parameters p are related to our experimental parameters with some unknown transformation. We bound the detuning to values achievable in experiments −5.4 0 < < 2.4 0 and perform the optimization numerically using the Levenberg-Marquardt algorithm. In each iteration we use the suggested values of to construct a unitary using the procedure lined out before and calculate the measurement responses when applying the GSC sequences.
We then optimize these responses as a function of the detunings . In order to control decoherence, in each iteration the infidelity of the CNOT gate is calculated and mapped to a depolarizing channel [7]. Two additional sequences G dec = CNOT × CNOT = 1 followed by a measurement on one of the qubits are performed at each iteration. Optimizing towards the measurement outcome without decoherence R s ( p) = 1 allows us to incentivize the optimization towards results with minimal decoherence. Fig. 6 shows the final infidelity I final following the GSC procedure as a function of the initial infidelity I initial after the errors are introduced for the optimized (a) and for the original (b) GSC procedure. The optimized sequences perform as well or better then the original ones. The level reached for the final infidelity is slightly better for the optimized procedure as the new gates X (1) θ and Y (1) θ have slightly better infidelities then the X (1) π/2 and Y (1) π/2 used for the original sequences. Systematic (unitary) errors can reliably be eliminated and the final infidelity is limited by incoherent errors due to noise. Leakage is still strongly suppressed after the GSC procedure due to the choice of b 23 . The optimized sequences need the same number of iterations to converge as the original ones as can be seen from the error syndromes and the fidelity as a function of iteration number in Fig. 6 (e)-(f). Since the convergence behaviour remains unchanged with the optimized sequences, we conclude that a careful experimental design can lead to a significant reduction in measurement time caused by the decrease in averaging needed under realistic conditions.

Experimental Considerations
In the following we give a brief introduction in the implementation of GSC on the physical experiment. Pulses are executed on an arbitrary waveform generator connected to dedicated high frequency (RF) gates on the qubit chip using coaxial lines. After each pulse the qubit is parked at its predetermined measurement position and a measurement is triggered for a certain amount of time (usually about 4 µs). Pulses are grouped into scanlines which are executed together on the AWG. Since the nuclear magnetic field needs to be constantly stabilized in GaAs based systems, GSC pulses are interleaved with DNP pulses keeping the Overhauser field gradients between the spins at the desired level. Typical scanlines will contain about 1000 pulses with about half of them for DNP and GSC respectively. Scanlines are usually repeated about 10 times directly on the AWG in order to reduce the overhead. The time in between these groups of scanlines is used for additional tasks such as data transfer, processing and plotting. The process of executing a scanline 10× and performing all the necessary post-processing took about 1 s on past experiments with a pure measurement time of 40 ms. In order to gain the necessary accuracy for GSC this entire process is then repeated about 100 times, with earlier iterations requiring a less accuracy and therefore less averaging. Therefore, a typical GSC iteration takes a few tenths of seconds of wall time with only about 4 % of actual measurement time. Although it could be improved in principle, this discrepancy has an advantage in GaAs. While being approximately quasistatic on the scale of a single gate duration, the stabilized nuclear spin field is still subject to variation on the scale of the repetition time of DNP cycles. This introduces a systematic deviation from the programmed field gradient with a distribution of about 0.3 mT in width for each gate. As the starting points for the GSC algorithm are numerically optimized to decouple from the nuclear field for a given mean of the distribution, a longer runtime of the algorithm translates to a more exhaustive sampling of the field distribution, which in turn ensures that the dynamical decoupling properties of the starting gates is retained throughout the calibration procedure.
While this seems to contradict the proposed speedup of the GSC procedure using the optimized sequences in Tab. 3, we would like to point out that these sequences will still reduce the required averaging time (the outermost repetitions in Fig. 7 significantly). This means that in the same amount of wall time we can tune an even larger number of gates simultaneously, outweighing the increased number of single qubit gates in our new gate set. Additionally, we would like to point out that this issue is only relevant for spin qubits in GaAs, where DNP is necessary. GSC itself, and our optimized protocol in particular, can be deployed independent of the specific qubit type. Assuming that computational overhead in between measurements can be reduced by performing tasks in parallel or using specialized hardware, time saved due to lower averaging caused by optimized statistical error can translate directly to faster GSC calibration.  Considering purely measurement time the above algorithm will lead to a 2.1-fold improvement in needed measurement time for the CNOT optimization, at the cost of two additional single qubit gates that need to be optimized beforehand. Assuming these need to be tuned for each qubit individually, we need a set of 6 sequences for each pair. Without an improvement due to design of experiment for the single qubit gates, this leads to a pure measurement time of 40 ms × 6 sequences × 10 iterations = 2.4 s for each gate pair, using a typical iteration count observed in experiments. For the CNOT we get 40 ms × 15 sequences × 10 iterations = 6.0 s and 2.76 s with the optimized sequences. This allows us to compare the total time for the improved GSC with 6 single-qubit gates and the CNOT giving 3 × 2.4 s +2.76 s = 9.96 s to the time needed without improvements 2 × 2.4 s +6.0 s = 10.8 s showing a clear improvement in run time. This effect should be even more prominent if single qubit gates are also subject to improved sequences or tuned self consistently in a set of sequences that is designed with the above considerations in mind.

Conclusions and outlook
We have seen that optimising the design of an experiment is crucial for minimising statistical errors. In particular, we have proposed a new version of GSC that reduces the statistical error by a factor of 0.46 for perfect measurements as well as for imperfect measurements. To achieve this, one initial state, two Pauli measurements and six single-qubit rotations must be available.
Several questions remain open. Although we have managed to reduce the statistical error here, a physical explanation of the optimal sequences is still missing. We also do not know why the mean squared distance is degenerate for perfect measurements and why the degeneracy breaks down for imperfect measurements (even when F + = F − = 1).
Our optimisation has been based on parameterising the GSC sequences, but different initial states and measurements could also be considered. Furthermore, we have used fifteen settings to solve fifteen error parameters. Considering additional settings, however, and making a statistical treatment of the redundant information could further reduce the statistical error.
Finally, it would also be interesting to put our results into practice, and thus experimentally calibrate aCNOT with the version of GSC proposed in this article.

A Supplementary material A.1 Responses
In Sec. 4, we have considered GSC with the settings summarized in Tab. 2. We present here the measurement responses corresponding to this protocol.

B Optimal angles
Sec. 4 has been devoted to optimize the calibration of aCNOT via GSC with sequences in Tab. 2     gates. The columns list the infidelity and leakage contributions for the spectral noise density S ,α (f ) ∝ 1/f α , with the experimental value S ,α (1 MHz) = 4 × 10 −20 V 2 /Hz. The figures are calculated using 1000 Monte Carlo time traces with 3 % relative error. The total fidelities calculated with all noise sources applied simultaneously are (from left to right) 99.93 % and 99.94 %. Note that I includes interaction effects between the noise sources, and is thus not equal to the sum of the first 4 rows. Leakage is much smaller than the infidelity mainly since there is virtually no coupling between the qubits since b 23 J 23 = 0.