{'fraction_non_alphanumeric': 0.03136389302397208, 'fraction_numerical': 0.01329500538986705, 'mean_word_length': 4.645320197044335, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Fidelity Between Unitary Operators and the Generation of Gates Robust Against Off-Resonance Perturbations

We perform a functional expansion of the fidelity between two unitary matrices in order to find the necessary conditions for the robust implementation of a target gate. Comparison of these conditions with those obtained from the Magnus expansion and Dyson series shows that they are equivalent in first order. By exploiting techniques from robust design optimization, we account for issues of experimental feasibility by introducing an additional criterion to the search for control pulses. This search is accomplished by exploring the competition between the multiple objectives in the implementation of the NOT gate by means of evolutionary multi-objective optimization.


Introduction
One of the challenges of coherent control of quantum systems is to achieve high fidelity in the presence of errors and/or noise that may be difficult or impossible to reduce by directly applying more precise controls. This situation is also exacerbated for systems with either complex underlying interactions or composed of heterogeneous ensembles. An example is the goal of achieving broadband inversion of spin ensembles [1,2] and more generally broadband excitation of spin systems. Such needs have lead to the development of composite pulses [3,4,5,6] which have been studied in the demanding field of quantum computing [7,8,9]. This technique was extended to include the use of shaped pulses [10,11]. A more systematic approach is through the application of quantum optimal control [12,13,14,15], with conceptual foundations lying in the control landscape topology for generating unitary transformations [16,17]. The Magnus expansion is commonly used [20] to assess the robustness of implementing a unitary gate, in contrast to utilizing the Dyson series. The reason for this preference seems to arise from the fact that the Magnus expansion maintains unitarity while the truncated Dyson series does not. However, the fidelity between unitary matrices as an objective function is more naturally expressed in terms of the Dyson series. The next section validates the use of the Dyson series as an appropiate method for the assessment of robustness and shows how this relates with the Magnus expansion and the series expansion of the fidelity.

Formulating Conditions for Robustness
The optimal control of quantum gates for a system of N discrete levels may be formulated in terms of the fidelity between two unitary operators as a scalar cost function where W is the target unitary operator [18], and the unitary evolution operator obeys the Schrödinger equation with absorbed in the Hamiltonian and T being the target time. A perturbation in the Hamiltonian H → H + δH implies a variation in U , which can be assimilated in an auxiliary operator V , defined such that The Schrödinger equation (2) implies with δĤ(t) = U † (t, 0)δH U (t, 0). The solution of this equation can be expressed in terms of the Dyson series as where P n are the time-ordered integrals with, for example P 1 = T 0 dt δĤ(t). Defining ∆U (T, 0) = U ′ (T, 0) − U (T, 0), the following expression can be obtained Equation (7) also can be written as a functional Taylor expansion, which implies the following identity δ n U (T, 0) = n! U (T, 0)(−i) n P n .
To proceed we define the action of the following brackets that specify the Hermitian and anti-Hermitian operators as well as the real trace such that we can verify the following identities With these definitions, the fidelity maybe written as and the functional Taylor expansion of the fidelity takes the form The first order term becomes which can be used to define the condition for the regular critical points of J (U ) [19,17] as Thus, only the Hermitian part of W † U (T, 0) remains at the critical points This implies that the expansion (19) evaluated at the regular critical points becomes which can be used to identify the relevant factors (−i) n P n H that depends on the control field. Elimination of the first order term characterizes a critical point and elimination of higher orders can be used as indicators of robustness. The robustness condition extracted from the second order term is The Magnus expansion of a unitary operator [23], around the target U (T, 0) can be written as where Ω k are Hermitian operators that can be written in terms of P n [24,25] according to the identity such that The criteria for robustness is based on sequential elimination of Ω k [20,21,22], starting from the leading term This condition implies P 1 = 0, which seems to be unrelated with the condition in (24). Applying condition (32) the leading terms of iΩ k become Extracting the Hermitian part of each term and recalling the anti-Hermiticity of each term of the the Magnus series iΩ n , one obtains indicating that Ω 1 = 0 implies (−i) 2 P 2 H = 0, showing the complete equivalence of conditions (32) and (24). Moreover, Ω 1 = 0 also implies (−i) 3 P 3 H = 0 and the relation (−i) 4 P 4 H = − 1 2 (−i) 2 P 2 2 H , which is useful for writing the two leading terms characterizing the robustness according with (23) as However, the last condition can be further simplified considering P 2 H = 0 from (24) leading to the conditions on the Dyson series Moreover, these conditions are consistent if and only if Convergence of the Dyson series for N-level systems is assured if the field is bounded for a finite interaction time T [26]. In contrast, convergence of the Magnus expansion demands more severe conditions [27]. The convergence is not relevant if the analysis is done in terms of the infinitesimal form of the perturbation Hamiltonian δH. However, in practice the perturbation Hamiltonian is finite, implying that the Magnus expansion may not necessarily converge. For this reason, any proposed robust implementation must be numerically verified for a finite range of small perturbations, as performed later in this paper, for a specific case.

NOT Gate
This section is concerned with the implementation of a robust NOT gate against off-resonant perturbations based on the lowest order condition P 1 = 0 for robustness. A general form for a single-qubit Hamiltonian with a resonant interaction is where Ω(t) is the time-dependent modulated Rabi frequency. The corresponding time dependent Schrödinger equation is A transformation to the rotating frame will remove the diagonal term of the Hamiltonian. In the present case we consider a more general transformation with a time-dependent phase that can be controlled using a chirped pulse. The proposed transformation is where Φ(t) is the accumulated off-resonant phase generated by chirping the pulse. The Schrödinger equation becomes The first term is explicitly given as The last term is highly oscillatory if ω 0 >> Φ(t). This leads to a generalized rotating wave approximation as Additional comments concerning the conditions specifying this approximation are found in A. The second term on the left side of (53) becomes and the final form of the Schrödinger equation in the rotating frame is 1 2 or, in a more expanded form where both the off resonance phase Φ(t) and the Rabi frequency Ω(t) are considered as the control functions. The term ν(t) = ∂Φ(t) ∂t is the shift of the resonant frequency as a function of time. It is important to note that the adiabatic condition was not required in the formulation above.
The simplest off-resonance perturbation is a constant, which can be modeled as taking the following form in the interaction picture Consideration of this constant perturbation is restrictive, but a significant degree of robustness remains even for more general off-resonance perturbations including the important case of random perturbations as shown at the end of this section. The NOT gate, up to a global phase, can be generated with the following unitary operator that may be implemented with a simple square pulse where the time of interaction occurs on the interval t ∈ [0, T ]. Implementation of the robust gate can be achieved by introducing a composite unitary operator, which can be written as with V (θ) = e i 2 L(θ)σ 1 e i 2 R(θ)σ 3 , such that the following boundary conditions are imposed in order to ensure that V (0) = V (π) = 1. The associated Hamiltonian can be determined as where the energy is measured in units of π T . This Hamiltonian may be explicitly evaluated as which can be compared with (59) to identify The boundary conditions (64) ensure that the target operator will be achieved, but it is necessary to impose additional conditions in order to assure that Ω(θ) is zero at the boundaries and therefore avoid sharp corners at the beginning and at the end of the pulse. The additional boundary conditions are Furthermore, we also require the modulation of the Rabi frequency Ω(θ) to be symmetric around π/2. The complete set of boundary conditions is satisfied by the following harmonic forms for integer n ≥ 1 and n k=1 a k = 1, where the coefficients are assumed to satisfy |a k | ≤ 2π and |b k | ≤ 2π. Dropping the symmetry of Ω(θ) would result in R(θ) = n k=1 b k sin(kθ). The minimization of P 1 can be carried out through the numerical minimization of the following associated objective function for a finite number of harmonics n J δĤ (a 1 , a 2 , ...a n , b 1 , b 2 with a n = 1− n−1 k=1 a k . The minimization of this cost function ensures a robust implementation of the target gate but there is the additional desire to implement the pulse with limited experimental resources. This problem can be addressed by introducing additional objective functions associated with the shape of Ω(θ) and ν(θ). It is natural to consider a Gaussian form as model for Ω(θ) due to its smoothness and analytical propertieŝ The Gaussian function obeys the following differential equation (74) The following integral of the residual measures the degree of dissimilarity with respect to a Gaussian, thus, it can be used as a cost function for minimization (75) The same technique can be applied to the chirp frequency ν(θ), but in this case the simplest chirp available in the laboratory is linear, which leads to the minimization of the following cost function In studies on robust design optimization, accounting for practical feasibility is typically carried out by introducing an additional criterion into the search for a control [28,29]. We choose to follow this scheme, and therefore strive to explore the competition between J δĤ and J Ω by means of Pareto optimization, employing the MO-CMA-ES algorithm (for details, see B). A series of runs, considering five control parameters (a 1 , a 2 , b 1 , b 2 , b 3 ) and a population of 100 candidate solutions, produced the Pareto front shown in Figure 1. The front has an interesting shape, revealing a non-trivial conflict between J δĤ and J Ω , yet allowing a reasonable trade-off, e.g., in the knee point shown in Figure 1 . Setting a threshold of J δĤ < 0.0005, the minimum value of J Ω in the distribution is found to be 3.33, which corresponds to the knee point. This point is characterized by the harmonics shown in Table 1. The corresponding plots of the Rabi modulation and chirp frequency are shown in Figures 2 and 3. The robustness of this implementation is evident in Figure 4, which shows the loss of fidelity  Table 1: Set of harmonics that produce J δĤ = 0.00023 and J Ω = 3.33.
as a function of the perturbation in comparison with an implementation with a square pulse (62). This figure also shows the response of the fidelity to a random Gaussian perturbation (instead of a constant perturbation) applied along the Pareto front. This figure implies that even though most random perturbations result in a fidelity lower than that obtained with a constant perturbation, there are some cases where the fidelity is actually higher.
Upon deploying the MO-CMA-ES algorithm on a second bi-criteria minimization problem, where the chirp objective J ν competes against the coherent average objective J δĤ , the redefined goal is observed to possess no conflict, which is not a priori evident. This is the case because the introduction of an additional objective usually leads to a conflict with the original objective(s). It is thus possible to obtain a robust implementation by practically ignoring the chirp. A solution of this kind is shown in Table 2. The respective plot of the Rabi frequency modulation is shown in Figure 5 and the response of the fidelity  Table 1.  Table 1.  Table 1. The fidelity is shown as a function of the perturbation amplitude normalized with respect to the maximum amplitude of Ω(θ). The dots show the response of the robust optimized implementation to a random Gaussian perturbation with mean ǫ and standard deviation |ǫ|/2. n a n b n 1 2.35701 5. × 10 −7 2 -1.56989 1. × 10 −7 3 0.21289 1. × 10 −8 Table 2: Set of harmonics that produce J δĤ = 10 −6 and J Ω = 0.00002.  Table 2.
to perturbation is practically identical to that in Figure 4. Overall, this is a good illustration of scenarios where Pareto optimization may confirm or dispute the existence of competition between objectives where intuition may be misleading.
In this section we proved that the robustness condition P 1 = 0 can be used to find a modulation of the Rabi frequency for a qubit system. This condition can in principle be applied to higher dimensions but in these cases the field cannot be directly extracted from the Schrödinger equation and more involved numerical techniques, such as D-MORPH [16], need to be applied.

Conclusions
We presented an analysis of the functional Taylor expansion of the fidelity between unitary operators with the aim of extracting conditions for the robust implementation of target gates. This expansion was written in terms of the Dyson expansion and compared with the Mag-nus expansion of unitary operators. The first order term of the fidelity expansion is zero when the target is achieved while higher orders are associated with the robustness of the implementation. The analysis of the Magnus expansion differs because the robustness is associated with all the higher order terms including the first one. We showed that the second order term of the fidelity expansion and the first order of the Magnus expansion are equivalent measures of the fidelity because eliminating either of them implies elimination of the other. This analysis was extended to the next leading order term showing additional connection between the fidelity and Magnus expansions.
Furthermore, we considered the implementation of the NOT gate as a case study, while taking into account an additional objective to obtain more desirable control pulse shapes. The competition between the objectives was successfully identified by means of an evolutionary multi-objective algorithm, allowing for a systematic exploration of the objectives and the nature of the conflicts. One case revealed an interesting Pareto front, with a promising trade-off area, while the competition in the other case was demonstrated to be non-existent despite initial expectations of conflict. This case study constitutes an example of a scenario where Pareto optimization is needed for balancing possibly conflicting gate control objectives, and at the same time assessing the validity of initial assumptions, often led by intuition.

A Generalized Rotating Wave Approximation
Section 3 makes use of a form of the rotating wave approximation. The justification of this approximation is best understood by analyzing the exact case and its limitations. The Schrödinger equation (53) without any approximation is 1 2 which can be identified with (66) to obtain such that the modulated Rabi frequency can be extracted as If the frequency of the free Hamiltonian ω 0 is on the order of the Rabi frequency, there are possible singularities due to the division by cos(ω 0 θ). These singularities can be lifted by proper selection of L(θ) and R(θ), but they are avoided altogether with a shorter pulse (larger Rabi frequency). Unfortunately, such a strong pulse may be difficult to implement experimentally and in extreme cases the conditions on the form of the dipole interaction may not be met. These situations are avoided in section 3 by taking a pulse which is weak enough to allow evolution under the free Hamiltonian to contain many cycles over the control interval.

B Pareto Optimization with Evolutionary Algorithms
Pareto optimization aims at simultaneously optimizing a number of conflicting objectives, and thereby revealing the Pareto optimal set or a region of interest in the trade-off surface between the objectives. In this appendix we summarize the principles of Pareto optimization, and especially provide some details on our employment of the method. Let a vector of objectives in R m , . . , f m ( x)) T , be subject to minimization, and let a partial order be defined in the following manner. Given any f (1) ∈ R m and f (2) ∈ R m , we state that f (1) strictly Pareto dominates f (2) , which is denoted as if and only if the following holds: The crucial claim is that for any compact subset of R m , there exists a non-empty set of minimal elements with respect to the partial order (see, e.g., [30]). Non-dominated points are then defined as the set of minimal elements with respect to the partial order . The aim of Pareto optimization is thus to obtain the non-dominated set and its pre-image in the control space, the so-called Pareto optimal set, also referred to as the efficient set. Finally, the Pareto front is defined as the set of all points in the objective space that correspond to the solutions in the Pareto-optimal set. Evolutionary Algorithms (EAs) [31,32], are powerful search methods, based on natural evolution, which have been successful in treating high-dimensional optimization problems. Here, we are especially interested in evolutionary multi-objective optimization algorithms (EMOA), which have undergone considerable development in the last two decades (see, e.g., [33,34,35]). Following the broad success of the Covariance Matrix Adaptation Evolution Strategy (CMA-ES) (see, e.g., [36]) in real-valued single-objective optimization, a multi-objective version has been released recently [37]. The Multi-Objective CMA-ES ( MO-CMA-ES) is the Pareto optimization approach used in our calculations.
In short, the CMA-ES is an evolution strategy variant that has been successful in treating correlations among decision (control) parameters by efficiently learning optimal mutation distributions. Explicitly, a set of µ search points comprise the evolving population of candidate solutions, which correspond to µ independently evolving single-parent CMA core strategies. The ultimate goal is thus to approximate the Pareto front of the given multi-objective optimization problem by means of these µ points. Given the i th search point in generation (g) of the MO-CMA-ES, x (g) i , an offspring is generated by means of a Gaussian variation: The covariance matrices, C , are initialized as unit matrices and are learned during the course of evolution, based on cumulative information of successful past mutations. The step-sizes, σ , are updated according to the so-called success rule based step-size control. The set of parents and offspring undergoes two evaluation phases, corresponding to two selection criteria: the first criterion is Pareto domination ranking, followed by the hypervolume contribution criterion. For more details we refer the reader to [37].