Quantum control landscape for generation of $H$ and $T$ gates in an open qubit with both coherent and environmental drive

An important problem in quantum computation is generation of single-qubit quantum gates such as Hadamard ($H$) and $\pi/8$ ($T$) gates which are components of a universal set of gates. Qubits in experimental realizations of quantum computing devices are interacting with their environment. While the environment is often considered as an obstacle leading to decrease of the gate fidelity, in some cases it can be used as a resource. Here we consider the problem of optimal generation of $H$ and $T$ gates using coherent control and the environment as a resource acting on the qubit via incoherent control. For this problem, we study quantum control landscape which represents the behaviour of the infidelity as a functional of the controls. We consider three landscapes, with infidelities defined by steering between two, three (via Goerz-Reich-Koch approach), and four matrices in the qubit Hilbert space. We observe that for the $H$ gate, which is Clifford gate, for all three infidelities the distributions of minimal values obtained with gradient search have a simple form with just one peak. However, for $T$ gate which is a non-Clifford gate, the situation is surprisingly different - this distribution for the infidelity defined by two matrices also has one peak, whereas distributions for the infidelities defined by three and four matrices have two peaks, that might indicate possible existence of two isolated minima in the control landscape. Important is that among these three infidelities only those defined with three and four matrices guarantee closeness of generated gate to a target and can be used as a good measure of closeness. We study sets of optimized solutions for this most general and not treated before case of coherent and incoherent controls acting together, and discover that they form submanifolds in the control space, and unexpected, in some cases two isolated submanifolds.


Introduction
Quantum computation is an actively developing field within the general area of quantum technologies [1,2].An important problem in quantum computation is the generation of single-qubit quantum gates such as the Hadamard (H) gate and π/8 (T ) gate, which are defined by unitary matrices These gates together with the two-qubit C-NOT gate, which, along with the H gate, is a Clifford gate and can be efficiently simulated classically according to the Gottesman-Knill theorem [3], form a universal quantum gate set sufficient for universal quantum computation [4].Therefore, the practical realization of H and T gates is of high importance for quantum computation.Qubits in experimental realizations of quantum computation devices are interacting with their environment.Therefore, they are open quantum systems whose dynamics are nonunitary and is described instead of the Schödinger equation by various master equations [5].The environment is often considered as an obstacle for manipulating the qubits.However, in some cases, it can serve as a useful resource.It can be used, for example, for quantum computing with mixed states and non-unitary quantum gates, which was proposed in [6,7].Engineered environments were suggested in a more general context for improving quantum computation [8], cooling translational motion [9], preparing entangled states [10,11], inducing multi-particle entanglement dynamics [12], making robust quantum memories [13], dissipative control of a quantum spin chain [14], the dissipative preparation of many-body quantum states in a superconducting qutrit array [15], and inducing stationary quantum memory effects [16].The control of one-and two-qubit systems under dissipative conditions was studied [17].Various results in the quantum control of open quantum systems are discussed in the review [18].
An early approach for using the environment and dissipation, generally with timedependent decoherence rates and time-dependent master equations, for controlling quantum systems was developed in 2006 and was called incoherent control [19].In this approach, spectral density of the environment is used as the control function (which is generally timedependent) to manipulate quantum systems.
This spectral density represents the distribution of the particles of the environment in their momenta and internal degrees of freedom.For example, for the environment formed by incoherent (and not necessarily thermal) photons, it describes the distribution of photons in their momenta and polarization.This distribution apparently affects the reduced dynamics of a quantum system immersed in this environment and enters in the master equation for the reduced density matrix.This is well known for two types of the environment weakly interacting with the system (weak coupling limit) [20,21,22], or interacting with the system strongly but rarely (low density limit) [23,24,25], which were both considered in [19].Master equations derived beyond secular approximation and for ultrastrong-coupling and the strong-decoherence limits [26,27] may also be of interest for an investigation.
If the spectral density depends on time, then the master equation for the reduced density matrix will also generally be time-dependent.For incoherent control, the master equations for the description of the dynamics of a quantum system controlled by the spectral density of the environment of the following form was proposed [19] as where H c (t) is some controlled Hamiltonian, γ k (t) are the generally controlled time-dependent decoherence rates, and D k are some dissipators.In [19], beyond the general approach, two particular physical forms of the GKSL dissipators D k were considered based on the derived in 1970th and 1980th master equations for the weak coupling and low density limits.A more detailed description of the concept of incoherent control is also provided in Section 3 of [28].
A natural question refers to how useful such incoherent control can be.In this regard, in [29], it was shown that incoherent control when combined together with coherent control using lasers can be used for the approximate generation of arbitrary mixed density matrices for generic (i.e., almost for all) quantum systems.It is important that this was shown within the physical class of D k , which describe the reduced dynamics of a quantum system weakly interacting with the environment (e.g., with incoherent photons or phonons).Coherent control alone cannot achieve the control goal of preparing arbitrary mixed quantum states for generic quantum systems.Moreover, the control scheme proposed in [29] also allows the implementation of all-to-one or universally optimal Kraus maps, i.e., Kraus maps, which steer all initial density matrices into the same one density matrix and were introduced and studied for quantum control in [30].In this work, these maps were shown to be important for quantum control, since they are inherently robust to variations in the system's initial state.The generation of some maps of this class was also discussed recently in [17].There was a non-trivial problem of the experimental realization of such all-to-one Kraus maps, which was recently solved for an open single qubit [31].Other various experimental works have been conducted using control by incoherent photons or the modification of relaxation rates.In particular, shaped incoherent light was used for the optimization of up-conversion hues in phosphors [32].The experimental control of the system-reservoir interaction and hydrogen spin relaxation rates was achieved [33].The low density limit case with collisional-type decoherence is less studied in this context, although it describes such important examples as a test particle in a quantum gas [34] or the quantum linear Boltzmann equation [25].
Recently, a surprising new result was obtained for a qubit interacting with the environment driven by coherent and incoherent controls [35].It was shown that inside of the Bloch ball, many states can be obtained exactly, except for states in some domain of size δ ≈ γ/ω, where γ is the decoherence rate and ω is the qubit transition frequency.Moreover, reachable sets of states for a qubit driven by coherent and incoherent controls were analytically described using geometric control theory.A reachable set of states is the set of states that can be obtained from a given state using all available coherent and incoherent controls and any time.A controllability analysis of the quantum systems immersed within an engineered environment was performed in [36].
The analysis of controllability and the description of reachable sets answers the question of what states can, in principle, be created from a given initial state for a particular quantum system.For any state in the reachable set, an optimal control that steers the initial state into this state exists.Thus, the analysis of reachable sets and controllability answers the question of the principle existence of optimal control for a given control problem, but does not say how to find such controls.As soon as the existence of an optimal control is established, the next question is how to find this optimal control.
A particular class of such optimization methods is that of local optimization methods, an example of which is the gradient ascent pulse engineering (GRAPE) approach [43].This approach was extended to open quantum systems driven by coherent and incoherent controls in [28], where, in addition to the general scheme for a qubit, a new exact analytical expression for gradients of various objectives for a single qubit were derived by solving a cubic equation via the Cardano method.It is important that the efficiency of gradient-based approaches depends on the existence or absence of traps local but not global maxima for the maximization of the objective, or minima for the minimization of the objective.The problem of the analysis of quantum control landscapes was posed first in [62].Many results have been obtained since then, including proof of the absence of traps for a single qubit [63,64], establishing the presence of trapping behavior in quantum systems with various symmetries [65,66,67,68], etc.
Motivated by this, here we considered the problem of generating single-qubit H and T gates for an open qubit using coherent and incoherent controls.The gradient-based approach for solving this problem was developed in [69].In the present work, we studied quantum control landscapes for this problem, which determines whether the GRAPE approach can be efficiently applied or its applications should take into account possible traps.In the latter case, runs from different starting points were performed for more efficient optimization.We considered three different landscapes for this problem, corresponding to three different objective functional defined by two, three, and four matrices, correspondingly, in the twodimensional qubit Hilbert space.For each gate and each objective functional, we performed runs of the GRAPE approach from multiple random initial starting points and, for each starting point, we computed the best (minimal, since we considered infidelities) objective value attained by the GRAPE approach.Then, we built the resulting distributions of the best obtained values.The observed results are surprising.For the Hadamard gate, which is a Clifford gate, the distributions of best objective values for the all three objective functionals have a simple form with just one peak.However, for the T gate, which is a non-Clifford gate, the situation is different the distribution for the objective functional defined by the two matrices also has one peak, whereas the distributions of the best obtained values for objective functionals defined by the three and the four matrices have two isolated peaks, which might indicate the possible existence of two isolated minima with different values of the infidelity.It is important that, among these three objective functionals, the smallness of the objective with two matrices does not guarantee the closeness of the generated process to the target gate.Only objectives defined with three and four matrices guarantee the closeness of the generated gate to a target and can be used as a good measure for the gate generation problem, and, exactly for these objectives, we observed two peaks.An important feature of quantum optimal control problems is that optimal solutions are not isolated points but multi-dimensional sub-manifolds in the control space, as was shown for the coherent control of finite-dimensional [70] and continuous-variable systems [71].We also studied manifolds of optimized solutions and found that, in the case of both coherent and incoherent controls, the optimized solutions also tend to form manifolds, but interestingly, in some cases, they form two isolated manifolds.
The structure of the paper is the following.In Section 2, the master equation for a qubit driven by coherent and incoherent controls is provided.In Section 3, three objective functionals for the single-qubit gate generation problem are defined and discussed, based on two, three, and four matrices in the qubit Hilbert space, and an objective functional defined directly in terms of quantum channels.The basic extension of the gradient-based optimization method for this optimization problem is provided in Section 4. The numeric analysis of the control landscapes is outlined in Section 5. Section 6 summarizes the results.

Environment-Assisted Control of a Qubit
We consider the master equation describing the evolution of an open two-level quantum system (qubit) driven by coherent and incoherent controls: where ρ(t) is a 2 × 2 density matrix representing a state of the system at time t ∈ [0, T ], and H 0 and V are the free Hamiltonian and the interaction Hamiltonian, respectively: where ω is the qubit frequency, µ > 0 is the dipole moment, γ is the decoherence rate coefficient, and the real-valued function u(t) is a coherent control.The dissipative superoperator L n(t) (ρ) describing the interaction with the environment is Here, matrices σ ± are and the non-negative function n(t) ≥ 0 is an incoherent control.This master equation can describe the physical situation of an atom interacting with a generally time-dependent laser field and immersed in a time-dependent bath of incoherent photons, for example, with a bath of photons with a time-dependent temperature or with shaped incoherent light dynamically tailoring the spectrum of a broadband incoherent source to control the atomic and molecular scale kinetics.In this case, incoherent control can physically be the spectral density of the (incoherent) environmental photons.This method was theoretically proposed in [19].An experimental realization for the optimal control of the evolving hue in near-IR to visible up-converting phosphors, which mimics various aspects of chemical reaction kinetics including non-linear behavior, was implemented in [32].Another approach that allows for the experimental modification of decoherence rates was realized via the experimental control of the system-reservoir interaction and hydrogen spin relaxation rates [33].Non-unitary control is also necessary for the experimental realization of all-to-one Kraus maps [31].
For a two-level system, it is convenient to use Bloch ball parameterization of the density matrix ρ using a vector r ∈ R 3 , r ≤ 1: where I is the identity matrix and σ i are Pauli matrices.The evolution of the Bloch vector in this parameterization takes the following inhomogeneous form: where r 0j = Trρ 0 σ j , j = 1, 2, 3, and We also use the extension of the Bloch ball representation (5) to a four-component vector using all four Hermitian 2 × 2 basis matrices as was the case in [28]: where σ 0 = I.Since q 0 = Trρ = 1, the 0-coordinate is always equal to unity.In this representation, q(t) = (1, r(t)) and the system (6) takes a homogeneous form Let us introduce the evolution operator Φ(t, u, n) (a dynamical map), which is a completely positive and a trace-preserving superoperator and is also called a quantum channel.It allows the solution of the system (3) to be written under control (u, n) at time t ∈ [0, T ] as: Denote Ψ(t, u, n) as a matrix representation of the operator Φ(t, u, n) in the basis σ i /2 (7): q(t, u, n) = Ψ(t, u, n)q(0).The matrix Ψ(t, u, n) is the solution of the system similar to (8): The evolution operator Φ(t, u, n) is trace-preserving: Tr(ρ(T, u, n)) = Tr(Φ(t, u, n)ρ 0 ) = Trρ 0 = 1.This property, in terms of the matrix Ψ(t, u, n), corresponds to preservation of the 0-coordinate: q 0 (t, u, n) = q 0 (0) = 1.Therefore, the matrix Ψ(t, u, n) has the following form: where Ψ ′ is a 3 × 1 matrix and Ψ ′′ is a 3 × 3 matrix.Since q = (1, r), for the evolution of the vector r(t), we have (notations of controls are omitted for brevity): Thus, in the Bloch ball representation, the evolution of the open quantum system is a composition of the linear map Ψ ′′ and translation by the vector Ψ ′ .If an evolution Φ is unital, i.e., preserving the maximally mixed state: Φ(I/2) = I/2, then the matrix Ψ in the Bloch parameterization preserves the (0, 0, 0) state; therefore, its inhomogeneous part equals zero, Ψ ′ = 0, and the evolution is linear for the vector r(t): 3 Objective Functionals for the Gate Generation Problem The problem of gate generation is to find a control (u, n) that will produce a dynamic map Φ(T, u, n) (9), which is an evolution operator at time t = T , that coincides or is as close as possible to the desired unitary (or more generally, non-unitary) gate U operation: It can happen that no admissible control gives an exact equality between the actual evolution and the target operation.For example, in [35], it was shown that the set of attainability for the system (3) from the poles does not fill the whole Bloch ball.
Particularly, Hadamard eigenstates |+ and |− are not reachable from the poles for the distance ∼ γ/ω due to the presence of decoherence.Therefore, the system (3) does not allow for the exact generation of, e.g., the Hadamard gate, or any other gate besides the rotation around the z-axis in the Bloch ball.Thus, the gate generation problem should be formulated as to find a control (u, n) that will produce a dynamic map Φ(T, u, n) that is as close as possible to the desired target (in our case, the unitary operation U • U † ) in the sense of some chosen metric or measure of distance.Then, the goal is to minimize a proper objective functional defined by Φ(T, u, n) and U .One of the possible options is to examine the action of the dynamic map Φ(T, u, n) on a chosen set of states or matrices in the qubit Hilbert space.
In this work, we considered four functionals.The first three are the objective functionals and have the form of a mean value of the squared Hilbert-Schmidt distance between actions of Φ(T, u, n) and U • U † on some set of density matrices {ρ 0 , . . ., ρ This class of objective functionals was also used in [69].We consider three different sets with K = 2, 3, and 4 matrices, which give the first F U,2 , the second F U,3 , and the third F U,4 objectives, respectively.
• The first set {ρ 0 } corresponds to basis states |0 and |1 in H = C 2 : • The second set corresponds to three states determining the implementation of the unitary operation among all dynamic maps [72]: We sometimes call the objective functional defined using this set as the GRK (Goerz-Reich-Koch)-type objective functional.
• The third set corresponds to four basis Hermitian matrices in the linear space in which the dynamic maps act: A more detailed discussion of these three sets is provided in Appendix A.
The fourth functional is used to analyze the implementation of the generated unitary gates and equals the squared Hilbert-Schmidt distance in the space of operators on C 2×2 : Unlike the objective functionals F U,2 , F U,3 , and F U,4 , this functional is defined by the true distance and allows one to define the closeness of an evolution operator of the system to the desired unitary operation.

Gradient-Based Optimization Method
For the optimization of the functional ( 14), we used our modification of the gradient-based GRAPE method, which was originally proposed for the generation of NMR sequences [43].
The gradient-based approach for controlling open quantum systems driven by both coherent and incoherent controls was developed recently in [28] for general N -level open quantum systems, where the exact solution for a qubit was found.The implementation of this method for the considered one-qubit quantum system was performed in [69].Here, we briefly present the concept and provide the basic expression for the gradient of our objective functionals.
To solve the optimization problem of a unitary gate U generation: 0 , . . ., ρ we used piecewise constant controls: where The new control w(t) is introduced in order to achieve the optimization of the space R 2M of control components u k and w k and to avoid dealing with the boundary n(t) ≥ 0. For brevity, we denote pair (u, w) as v = (v 1 , v 2 ).The use of piecewise constant control leads to a piecewise constant r.h.s of the evolution equation ( 6) so that the evolution is given by a sequence of states r(t k ): where Denote Bloch vectors of Φ(T, u, n)ρ (j) 0 and U ρ (j) 0 U † as r (j) (T, v) and r (j) U , respectively.For numeric optimization, it can be useful to use parametrization for the objective functional ( 14), which we provide in Appendix B. The gradient of the objective functional (14) with respect to controls (20) and ( 21) is [69]: The gradient of the final state is given by the following expressions [69,28]: The explicit expressions for the derivatives Finally, to numerically optimize the objective functional, we used the gradient descent method.The (i + 1)th iteration of the algorithm gives a control v (i) , starting from an initial guess v (0) : For the step length h (i) , we used the adaptive scheme proposed in [69].As a stopping criterion, we used the standard stop criterion corresponding to the first-order optimality condition; iterations continued until

Numeric Analysis of the Control Landscapes
We studied the properties of the quantum control landscape for the generation of unitary H and T gates ( 1) and ( 19), i.e., for minimizing the objective functionals F U,K for sets of the two (15), three (16), and four (17) matrices in the qubit Hilbert space.One of the important properties of quantum control landscapes is the local but not global minima, also called traps.To study the quantum control landscape of the objective functional F U,K u, n; ρ (1) 0 , . . ., ρ (K) 0 , we performed the following statistical experiment.For each l = 1, . . ., L, we generated a random initial guess u (0),l , n (0),l uniformly distributed in the hyper-rectangle (orthotope) Then, using the gradient descent method described in Section 4, we found an optimized control u * ,l , n * ,l .The obtained values of the functional F U,K u * ,l , n * ,l ; ρ (1) 0 , . . ., ρ (in the figures, they are denoted as F U,K , U ∈ (H, T ), K = 2, 3, 4) belong to a certain distribution on the range of all possible values of the objective functional.We built histograms approximating this distribution for each gate and each objective.For comparison, we also built a distribution of the obtained values of the objective functional (18) F U u * ,l , n * ,l (in the figures, they are denoted as F U , U ∈ (H, T ), K = 2, 3, 4) based on the Frobenius norm between the optimized evolution and the desired unitary gate operation.
Numerical simulations were performed by writing a Python program using the Numpy library for fast matrix operations, the SciPy library functions scipy.linalg.expmfor matrix exponential computation using the Padé approximation, and scipy.linalg.invfor matrix' inverse computation.The following values of the system parameters were used: the transition frequency ω = 1, the dipole moment µ = 0.1, the decoherence rate coefficient γ = 0.01, and the regular partition of the time segment [0, T ] with T = 5 into M = 10 segments, such that each segment has the length ∆t k = T /M = 0.5.The stopping parameter ε = 10 −5 , the parameters of the adaptive scheme of the step length [69] were h (0) = 1, c = 1.1, d = 0.5, L stuck = 20.Integral formulae were approximated using the trapezoidal rule with the number of partitions N partition = 20.
For gates H and T , in Figure 1 and Figure 2, respectively, for each of the three objective functionals, we built histograms of the distributions of best objective values (minimal infidelities) obtained with a gradient search starting from 1000 various randomly generated conditions in the hyper-rectangle initial conditions.These histograms approximate the distributions of best objective values.
The obtained centers and widths of each peak, which were computed as the mean value and doubled standard deviation for each peak, are presented in Table 1.
Table 1: Centers (C 1 , C 2 ) and widths (W 1 , W 2 ) of the obtained distributions for objective functionals defined with number of matrices j = 2, 3, 4. For cases with two peaks, the first is the peak shown as green in Fig. 3.
Func.The results are surprising.For the Hadamard gate, the distributions of the best objective values obtained with the gradient search for all considered objectives have a simple form with just one peak.However, for the T gate, the situation is completely different the distribution for the objective functional defined by two matrices also has one peak, whereas distributions of the best obtained values for the objective functionals defined by three and four matrices have two isolated peaks.This might indicate the possible presence of two isolated minima with different values of the infidelity for these two objective functionals.It is important that, as discussed above, among these three objective functionals, the smallness of the objective with two matrices does not guarantee the closeness of the generated process to the target gate.Only objectives defined with three and four matrices guarantee the closeness of the generated gate to a target and can be used as a good measure for the gate generation problem, and exactly for these objectives, we observe two peaks.
To study cases with two peaks if these peaks correspond to two different groups of controls, we analyzed the optimized controls used for sub-plots (c) and (e) in Figure 2 in more detail.For each of these two sub-plots, we plotted all 1000 optimized coherent and incoherent controls for the generation of the T gate in Figure 3, i.e., left and right sub-plots.The upper row corresponds to sub-plot (c) in Figure 2, and the bottom row to sub-plot (e).The coherent controls are clearly divided in two groups, which are symmetric with respect to u = 0 line and are separated in the functional space of controls.Incoherent controls are also divided in two distinct sub-manifolds, which are separated in the space of controls, although the controls in these subgroups do intersect.Solutions to quantum optimal control problems are known to not comprise isolated points, but form multi-dimensional sub-manifolds in the control space, as was shown for finite-dimensional [70] and continuous-variable systems [71].Our finding confirms these results for the most general and previously unexplored case when both coherent and incoherent controls are used.

Discussion and Open Problems
We studied several control landscapes for the problem of the optimal generation of singlequbit H and T gates using coherent control and the environment as a constructive resource acting on the qubit via incoherent control.We considered three different landscapes for this problem, corresponding to the three different objective functionals defined by steering between two, three, and four matrices in two-dimensional qubit Hilbert space.We built histograms of distributions of the best objective values (minimal infidelities) obtained with a gradient search starting from 1000 various randomly generated conditions in some hyperrectangle initial conditions.These histograms approximate the best obtained distributions from the GRAPE objective values.
The following observations were made from the obtained results.First, for the Hadamard gate, which is a Clifford gate, all the considered objective distributions of the best objective values obtained with the gradient search have a simple form with just a one peak.However, for the T gate, which is a non-Clifford gate, the situation is completely different the distribution of the best values for some objective functionals has one peak, whereas the distribution of the best values for the other objectives has two isolated peaks, which might indicate the possible existence of two isolated minima in the control landscape with different values of the fidelity.This finding, and the question as to whether there is a relationship between the fact that the H gate is a Clifford gate and the T gate is not, requires further analysis.
Second, a less obvious finding is that, for the T gate, the distribution of the GRAPEminimized GRK-type objective F T,3 with three matrices has two significantly separated peaks, whereas the distribution of the objective computed with the Frobenious norm for the same optimized controls has two overlapping peaks corresponding to two separate groups of controls.Moreover, a larger value peak in the F T,3 histogram has a lower value center in the Frobenius norm F T histogram.The same is true for the F T,4 and the F T histograms.
Third, the minimal infidelities obtained for the objective functional F U,2 defined with only two states are higher by one order of magnitude than the infidelities obtained for objective functionals F U,3 and F U,4 defined with three and four states.Naively, one could expect the opposite situation, since the objective functional F U,2 may even be minimized by gates that act as the target only on the two basis states, but which can act differently from the target gate in some other states.Moreover, the objective F U,4 includes 1/2F U,2 as a summand together with some non-negative term: where ρ (1) 0 , ρ is the third set of states (17).However, if we optimize F U,3 or F U,4 and substitute the obtained controls in F U,2 , then we obtain smaller values of F U,2 than if we optimize F U,2 directly.This finding is counterintuitive and may indicate that F U,3 and F U,4 not only more exactly represent the problem of gate generation, but that they are also more appropriate for efficient GRAPE optimization.
Fourth, in cases with two peaks, the controls corresponding to each of the peaks form subsets (sub-manifolds) in the space of controls.The fact that optimal controls form submanifolds in the space of controls was shown for the coherent control of finite-level and continuous systems in [70,71].Here, we discovered this feature for the most general situation when coherent and incoherent controls are used together, and moreover, we observed the existence of two such sub-manifolds separated by a large distance.
The physical meaning of the results is that an experimental local (e.g., gradient-based) search for optimal controls implementing a single-qubit T gate may converge to two maxima with different infidelities: one of which is higher and, therefore, worse; whereas for the H gate, we did not observe this behavior.This circumstance should be taken into account in such experiments on quantum controls.Another observation is that objectives defined using three or four states may be more suitable for optimization, as they provide lower values of the infidelities compared to the objective defined using two states (which may also give a non-unique solution).There is also a distinction between the behavior of minimal infidelities of these objectives and the objective defined by the Frobenious distance between the actual and the target maps the latter, to some degree, "hides" the two local peaks found for the former.The finding of two sub-manifolds of (probably locally) optimal controls with different infidelities implies the importance of a suitable choice of the initial controls for optimization.An incorrect choice may lead to the convergence of the algorithm to a control without the best infidelity.All of these factors have to be taken into account for the practical experimental realization of the optimal generation of H and T gates.
The quantum gates H and √ Y are particular cases corresponding to θ = 0 and π/2, respectively.
This non-uniqueness of unitary operations comes from the fact that the states |0 and |1 are orthogonal, i.e., their Bloch vectors are opposite.Indeed, in the Bloch ball, a unitary operation U is rotation φ U and, therefore, a linear map.If states are opposite, r and −r, then knowing the action of the rotation φ U on them only gives information about one action φ U (r) because of the linear dependence of the vectors.There are many rotations that act the same: they are all along the axis orthogonal to φ U (r) − r at the corresponding angle if φ U (r) = r, or along the axis r at any angle if φ U (r) = r.
According to [74], there are two states {ρ 1 , ρ 2 } that can distinguish any two unitary operations.This is equivalent to them having the commutant space K({ρ 1 , ρ 2 }) containing only the identity I.It can be satisfied if {ρ 1 , ρ 2 } is a complete and totally rotating set (see the definitions in [74]).This finding corresponds to the statement mentioned above.If we take two orthogonal pure qubit states |ψ and |ϕ , ψ|ϕ = 0, then the commutant space of their density matrices contains more than just the identity.For instance, the commutant space of |0 0| and |1 1| contains all the phase-shift gates U δ including the identity: Therefore, they cannot distinguish two unitary gates.Conversely, any two non-orthogonal qubit pure states |ψ and |ϕ , ψ|ϕ = 0, form a complete and totally rotating set {|ψ ψ|, |ϕ ϕ|}.Completeness is obvious and the set is totally rotated with respect to, e.g., the state 1 2 |ψ ψ| + 1 2 |ϕ ϕ|.Thus, any two nonorthogonal qubit pure states |ψ and |ϕ can distinguish two unitary operations.Recalling that two non-orthogonal qubit pure states correspond to two non-opposite vectors in the Bloch ball and unitary operations correspond to rotations in the Bloch ball, this statement means that two non-opposite unit vectors are necessary and sufficient to determine a unique rotation of the Bloch ball, which is a simple geometric statement to be proved.It can be generalized to any two non-parallel (not necessarily unit length) vectors.
Since we considered the dynamics of the open quantum system (3), a suitable set of states should distinguish not only two unitary operations, but also a unitary operation and a non-unitary operation.For this, three and more states might be used.

A.2 Second Set
The second set (16) corresponds to three special mixed states which, according to [72], are sufficient for the proper implementation of a unitary quantum gate in any N -level open quantum system.One cannot guarantee that the objective functional ( 14) will be minimized exactly to zero as a result of the optimization.It might be that the optimized evolution will act on the states not exactly as the desired unitary operation, but with a small error.Moreover, it is not evident that generated evolution will differ from the desired unitary operation with an error of the same order.Therefore, the optimized evolution should be post-checked by, e.g., the functional (18), as it is shown in Section 5.

A.3 Third Set
The third set (17) corresponds to the basis used in [69]: {ρ (j) 0 } 4 j=1 of 2×2 Hermitian matrices in the real four-dimensional linear space.For each unitary gate U , there exists a unique linear map that acts on these matrices as U • U † .Moreover, since these states form the basis, a small value of the optimized functional (14) means that the functional based on the Frobenius norm (18) also has a small value and the optimized evolution is close to the desired unitary operation.

C Gradient-Based Optimization Method
Here, we provide explicit expressions for derivatives used in Section 4: The expressions (40) and (42) are calculated using the integral formula [75]: e sA(x) dA(x) dx e (1−s)A(x) ds.(43)

Figure 1 :
Figure 1: Histograms describing distributions obtained by GRAPE values of the objective functionals for generating the H gate.The values obtained starting from L = 1000 random initial conditions uniformly distributed in some hyper-rectangle.Left column: for two (a), three (c), and four (e) matrices.Right column: the Frobenius norm F H with optimized controls for two (b), three (d), and four (f ) matrices.

Figure 2 :
Figure 2: Histograms describing distributions obtained by GRAPE values of the objective functionals for generating the T gate.The values obtained starting from L = 1000 random initial conditions uniformly distributed in some hyper-rectangle.Left column: for two (a), three (c), and four (e) matrices.Right column: the Frobenius norm F T with optimized controls for two (b), three (d), and four (f ) matrices.Two separate peaks are shown in green and red colors.

Figure 3 :
Figure 3: Plots of all 1000 coherent (a,c) and incoherent (b,d) controls obtained by GRAPE optimization for generation of the T gate.Sub-plots (a) and (b): for the objective functional F T,3 .Sub-plots (c) and (d): for the objective functional F T,4 .Green (resp., red) color shows all controls leading to the left (resp., right) peak on the corresponding histograms in Figure 2.Both coherent and incoherent controls are clearly combined in two groups.

∂ ∂v 2 ke A k ∆t k = ∂ ∂w k e A k ∆t k = 2w k ∆t k 0 e
A k t B n e A k (∆t k −t) dt, k = 1, . . ., M.