Precise ultra fast single qubit control using optimal control pulses

Ultra fast and accurate quantum operations are required in many modern scientific areas - for instance quantum information, quantum metrology and magnetometry. However the accuracy is limited if the Rabi frequency is comparable with the transition frequency due to the breakdown of the rotating wave approximation (RWA). Here we report the experimental implementation of a method based on optimal control theory, which does not suffer these restrictions. We realised the most commonly used quantum gates - the Hadamard (\pi/2 pulse) and NOT (\pi pulse) gates with fidelities ($F^{\mathrm{exp}}_{\pi/2}=0.9472\pm0.01$ and $F^{\mathrm{exp}}_{\pi}=0.993\pm0.016$), in an excellent agreement with the theoretical predictions ($F^{\mathrm{theory}}_{\pi/2}=0.9545$ and $F^{\mathrm{theory}}_{\pi}=0.9986$). Moreover, we demonstrate magnetic resonance experiments both in the rotating and lab frames and we can deliberately"switch"between these two frames. Since our technique is general, it could find a wide application in magnetic resonance, quantum computing, quantum optics and broadband magnetometry.

Ultra fast and accurate quantum operations are required in many modern scientific areas -for instance quantum information, quantum metrology and magnetometry. However the accuracy is limited if the Rabi frequency is comparable with the transition frequency due to the breakdown of the rotating wave approximation (RWA). Here we report the experimental implementation of a method based on optimal control theory, which does not suffer these restrictions. We realized the most commonly used single qubit rotations -the Hadamard (π/2 pulse) and NOT (π pulse) gates with fidelity (F exp π/2 = 0.95 ± 0.01 and F exp π = 0.99 ± 0.016), in an excellent agreement with the theoretical predictions (F theory π/2 = 0.9545 and F theory π = 0.9986). Moreover, we demonstrate magnetic resonance experiments both in the rotating and lab frames in this strong driving regime and we can deliberately "switch" between these two frames. Since our technique is general, it could find a wide application in magnetic resonance, quantum computing, quantum optics and broadband magnetometry.
The ability to manipulate spins very fast allows to increase the number of qubit operations before detrimental effects of decoherence take place, and it may further increase the bandwidth of spin based magnetometers. Optimal control theory [1,2] provides powerful tools to work in this regime by finding the optimal way to transform the system from the initial to the desired state with a high fidelity. Here we demonstrate precisely controlled ultra-fast (beyond RWA) single electron spin gates using specially designed microwave fields, without resorting to the standard RWA condition. To achieve this we employ optimal control namely the Chopped Random Basis (CRAB) quantum optimization algorithm [2,3]. It is used to numerically design and optimize our microwave control (see Supplementary information for more details). Our current algorithm uses a simple derivative-free direct search method to perform a multivariable function optimization [2], and hence offers enhanced computational flexibility such as parallel numerical calculations.
Here we implement this method using the electron spin associated with a single Nitrogen-Vacancy center (NV) in diamond as a test system. NV shows remarkable physical properties: optical spin initialization and readout of a single center at room temperature [5], coherent spin control via microwaves (MW) [6], and a coherence time of several milliseconds [7]. This system is very promising as a nano-scale ultra sensitive magnetometer [8][9][10][11] and solid state qubit [12,13]. Strongly driven dynamics of NV using conventional pulses has been also reported [14], where fast flipping of the NV's electron spin has been demonstrated.
The NV consists of a substitutional nitrogen atom and an adjacent vacancy with a triplet ground state (S = 1) and a strong optical transition, enabling the detection of single centers. Its fluorescence depends on the electron spin state, allowing one to perform coherent single spin control [5,6]. The Hamiltonian of the NV's ground state in the presence of MW control Γ x (t) can be written as: where D ≈ 2.87 GHz is the NV's electron zero-field splitting (ZFS),Ŝ x andŜ z are the x and z components of the electron spin operator and ω z = gµ B B 0 / is the Zeeman splitting due to a constant magnetic field B 0 along the NV axis (z axis) with g the electron gyromagnetic ratio and µ B the Bohr magneton [15]. For the description of our experiments the Hamiltonian has to be written in the lab frame since the control amplitude is comparable to the Larmor frequency of the spin max{|Γ x (t)|} ∼ ω L (where ω L = D − ω z ), i.e. the counter-propagating term of the control can not be neglected [14]. To fulfill this condition beyond the RWA and to approximate a two-level spin system of |m s = 0 and |m s = −1 , we apply a magnetic field B 0 = 1017.3 G (101.73 mT) and set the working transition frequency ω L = 30 MHz (Fig. 1a). B 0 is aligned along the NV crystal axis in order to suppress mixing between the |0 and |1 states. We begin by measuring Rabi oscillations at different MW amplitudes and observe the spin dynamics (Fig. 1c). When the driving field Ω < ω L /2 the system is in the RWA regime and a nice harmonic signal is obtained (figure 1c, lower right inset). However, when Ω > ω L /2 the signal becomes anharmonic as shown in Fig. 1c (upper left inset) and the precise control over the spin rotations is not trivial. Moreover, often the spin is not flipped within certain time as it can be seen from the upper left inset of Fig. 1c, where the normalized fluorescence does not go to zero and the |m s = −1 state is not reached. To perform a desired transformation of the spin state |ψ(t) , which follows the Schrödinger equation, d|ψ(t) /dt = −iĤ|ψ(t) (assuming =1), we optimally engineer the time dependence of the control Γ x (t), such that at the final time T the state fidelity between the final spin state |ψ(T ) and the target |ψ T is maximized (see also the supplementary information). The fidelity F is defined as [16]: with ψ target and ρ CRAB being respectively the target state and the state expected after the CRAB pulse.
Here we used CRAB controls to implement the two most important single-qubit rotations: flipping the qubit (NOTgate, π pulse) and creating a superposition between the qubit states (Hadamard gate, π/2). The latter requires an additional rotation around the z axis by π/4, which leads to phase change, irrelevant for a quantum algorithm [17]. The experimental realization of these rotations is shown schematically in Fig. 1(b) while Fig. 2 shows the calculated trajectory of the spin during the CRAB-π pulse. We set the pulse lengths T π = 15.4 ns and T π/2 = 7.7 ns, shorter than T Rabi π = 1/2Ω = 16.67 ns and T Rabi π/2 = 1/4Ω = 8.33 , where Ω = 30 MHz is the extrapolated Rabi frequency, see Fig. 1. It is important to note that the latter cannot be used for qubit rotations due to the breakdown of the RWA (see Fig. 1). The shortest possible pulse length for the π pulse is given by the Bang-Bang condition T Bang π = π/ (πω L ) 2 + (2πΩ) 2 = 14.9 ns [1]. We are not able to reach this value due to the limited bandwidth and gain curve of the amplifier (see also Supplementary Information). At the beginning we apply a laser pulse to polarize the NV in |ms = 0 and at the end again to read out the state of the electron spin. This is followed by the optimized π pulse (CRAB-π, top) and π/2 (CRAB-π/2,bottom) pulses. The tomography is performed by applying π/2 pulses along the x and y axis of the rotating frame. (c) Rabi frequency as a function of the amplitude of the AWG signal. The circles denote the region where harmonic behavior is observed as shown in the lower right inset. The red line is a linear fit, its dashed part shows the region where the spin dynamics is anharmonic. The upper left inset shows a typical signal in this region. We chose a MW amplitude which corresponds to a Rabi frequency of Ω = 30 MHz.
We performed a density matrix tomography in order to determine the quality of the optimized pulses. Both offdiagonal elements have been measured by applying a low power (Ω = 8 MHz) π/2 pulse along the x and y axis of the rotating frame, followed by a laser pulse for read out (see Fig. 1b). To measure the diagonal elements the MW pulses have been omitted. After the CRAB-π pulse the theoretically expected and the experimentally measured density matrices are: After the CRAB-π/2 pulse we expect: This is the state of the system expected directly after the MW pulse. However, due to limited time resolution of our apparatus, the measurement can be performed only after some dead time. We set this time to t evol = 100 ns during which the spin rotates in the xy plane in the lab frame and acquires a phase φ = e −iωLt evol (see Fig. 2, right). The density matrix after t evol is then: From the tomography we obtain: The trajectory of the spin magnetization (blue curve) during the application of the CRAB-π pulse. The initial state is ms = 0 (red dashed arrow) and the target state is ms = −1 (red solid arrow). (right) After the CRAB-π/2 the spin magnetization lays in the xy plane of the lab frame, parallel to the x axis. Then it rotates around the z axis with an angular velocity ωL (Larmor frequency), acquiring a phase φ = e −iω L t .
The expected fidelities of the CRAB pulses are F π theory = 0.9986 and F π/2 theory = 0.9545, whilst from the experiment we obtain F π exp = (0.993 ± 0.016) and F π/2 exp = (0.947 ± 0.007). We find an excellent agreement between the theoretical prediction and the experimental result. The theoretical values are lower than 1 due to the constrains set on the pulse duration. If the pulse length is increased, much higher numerical fidelities can be achieved [19]. The deviation from the prediction can be explained by distortion of the pulse shape, mainly due to the limited bandwidth of the MW amplifier and measurement error (see supplementary information). The pulses we have developed in this study are important not only for quantum information processing, but also for most of the pulsed Nuclear Magnetic Resonance (NMR) and Electron Spin Resonance (ESR) experiments. Although they were not specifically designed as gates, only to transfer the spin from |m s = 0 to some desired state, they are also very robust and can be used for magnetic resonance as we show below. One of the most important NMR (and ESR) pulse sequences consists of a single π/2 pulse, where the spin magnetization is rotated from the z-axis to the xy plane in the rotating frame. The spins then precess and can be detected by the NMR detector thus giving a Free Induction Decay (FID) signal. The Fourier transform of the latter is the spectrum of the sample [20,21]. This experiment has been already implemented using NV and can be applied for detecting DC magnetic fields [22][23][24].
Here, we show that we can perform it both in the lab and in the rotating frame by using both CRAB and conventional rectangular pulses. The main difference here compared to previously reported studies, e.g. [24][25][26], is that we can perform these experiments beyond the RWA. All sequences begin with a laser pulse for polarizing the NV (Fig. 3a). Then we apply a CRAB-π/2 pulse, which aligns the spin magnetization along the x axis of the lab frame. After a free evolution time τ we apply another CRAB-π/2 pulse to rotate the spin back to the z axis and we then read out the spin state. The signal oscillates with the Larmor Frequency ω L (Fig. 3a, see also Fig. 2, right). Here we measure the signal in the laboratory frame. Now, if we replace the second CRAB-π/2 pulse with a low power rectangular π/2 pulse (here ω L = 4193 MHz and Ω = 48 MHz) and keep its phase fixed for all τ (equivalent to having the B 1 parallel to y), again the FID signal oscillates with ω L (Fig. 3b, blue curve). However, if we set the phase of the second pulse to φ = e −iωLt , we can "follow" the magnetization in the equatorial plane of the Bloch sphere (Fig. 2, right) and the measurement is performed in the rotating frame and the oscillations at ω L disappear (Fig. 3b, red markers). The same experiment can be performed using two rectangular pulses with low MW amplitude (within the RWA) where again the phase of the second pulse is kept constant. In this case the experiment is run in the laboratory frame and the FID again oscillates with the Larmor frequency (Fig. 3 c, blue markers). If the phase of the MW is not the same for different τ , then we obtain the typical FID in the rotating frame as shown in Fig. 3c (red markers). Thus we can on demand "switch" between the lab and rotating frames by using ultra-fast (beyond RWA) or conventional (lower power) pulses. Using this method in principle any oscillation of the spin signal can be "followed", while effectively canceling other unwanted frequencies. In the Supplementary Information we demonstrate this technique when the excitation is not in resonance.
Another important sequence is the Hahn echo [27], which has found wide application in NMR and ESR. It is the basis of all dynamical decoupling techniques since all static inhomogeneous shifts (and fluctuations on the time scale of the coherence time T 2 ) are effectively canceled out [20]. It has been implemented with NV [6] and also for NV based AC magnetometry [7,9]. The Hahn echo pulse sequence is depicted in Fig. 4b. After a CRAB-π/2 pulse and a free evolution time τ 0 a CRAB-π pulse is applied. After a time τ the spin state is rotated to the z axis by a CRAB-π/2 pulse and then it is read out by a laser pulse. The spin signal oscillates with the Larmor frequency of the NV transition (in this case ω L = 120 MHz) as shown in Fig. 4a since the experiment is performed in the lab frame. If we use rectangular pulses in the rotating frame we obtain the envelope of the echo without the oscillations at ω L (Fig. 4c, red markers). However, we can again "switch" to the lab frame by adjusting the phase φ of the last MW pulse (Fig. 4c, blue curve). ESR experiments in the lab frame with low power MW pulses have been already reported [28,29], but the "switching" between the two frames in the strong driving regime has not been yet demonstrated. Our method presented here allows us to obtain full control over the phase of a spin system and can be implemented with any other pulse sequences. In summary, we have developed a novel technique based on optimal control for precise spin qubit rotations in the ultra fast driving regime where standard pulses are not applicable. We design our qubit gates by using the quantum optimization algorithm CRAB and find an excellent agreement with the experimental implementation. Moreover, we show that the pulses developed here can be used for basic magnetic resonance experiments also in the case when the rotating frame approximation breaks down. Additionally we demonstrate on demand "switching" between the rotating and the lab frame, using both CRAB and conventional (low power) pulses. This provides a precise control over the spin evolution and can be easily transferred to any other two level system, e.g. trapped atoms, trapped ions or superconducting qubits. Our results can find wide application in quantum computation and broadband magnetometry. (a) FID measured by using two CRAB-π/2 pulses. The inset shows the first 160 ns of the signal (markers) and the calculated fidelity with respect to the |0 state (red solid line, see also text)(b) A combination of a CRAB-π/2 pulse and a low power π/2 pulse, where he phase of the latter is fixed for all values of τ (blue curve) and adjusted as φ = e −iω L t (red markers), see also the main text. The oscillations with ≈ 2 MHz come from a weakly coupled 13 C. (c) FID measured by using low power MW pulses (within RWA), where the phase of the second π/2 pulse is not in phase with the first pulse (blue markers). If both pulses are kept in phase then the experiment is performed in the rotating frame (red markers). The solid lines are fits to the data. The decay time here is shorter than in the above experiments because the sample is different.

CRAB Microwave Control 10
Experimental Setup and Pulse Shapes 11

State tomography 11
Magnetic Resonance in an arbitrary frame -off resonant excitation 12 References 12

CRAB MICROWAVE CONTROL
In this section we shortly review the theoretical background of the chopped random basis (CRAB) method in the context of our current work, and furthermore describe the optimization procedures and the numerical results.
We recall the ground state Hamiltonian of the single electron NV spin in the presence of a single MW control Γ x (t), as discussed in the manuscript,Ĥ The CRAB method designs the control Γ x (t) by correcting an initial guess Γ 0 (t) with an optimized continuous function g(t), following Γ x (t) = Γ 0 (t) × g(t) [2,3]. We use here a simple constant initial guess Γ 0 (t) = g 0 . Following [2], the correcting function g(t) is expanded into a Fourier-like basis function, {a n sin (ω n t) + b n cos (ω n t)}, (4) where N denotes a number of basis expansion having N -randomized discrete frequencies. It is noteworthy to state that the range of frequencies (ω 1 , ω N ) directly corresponds to the real bandwidth of the apparatus. Therefore, we can pre-set in advance the frequency range for numerical optimization to meet the experimental limitations, e.g. the amplifier's or arbitrary waveform generator's working bandwidth. The additional function λ(t), is used to impose the control boundary such that Γ x (t) = 0 at the initial time t = 0, and the final time T . Here, we choose the bounding function λ(t) = h p /(h p − (t − h) p ), where h = T /2. Using this function we can also qualitatively vary the rising and falling times of the microwave control by adjusting the even-numbered parameter p. Our optimization objective is to find the set of CRAB parameters { a n , b n , ω n }, which minimizes the figure of merit, where the quantity f = | ψ(T )|ψ T | 2 is the fidelity of the final state |ψ(T ) , against the desired state |ψ T . A dimensionless parameter c f is incorporated in the figure of merit to limit the control amplitude during optimization. We employ the direct search simplex (Nelder-Mead) algorithm to find the optimal CRAB parameters.
The numerical optimization is initiated by setting some parameters obtained from the experimental preparations and apparatus calibrations: the measured Larmor transition ω L , the maximum control amplitude max{|Γ x (t)|} = Ω, and the CRAB frequency range. The control time is fixed (the same as the desired rotation time) to be faster than the extrapolated rotation time if the RWA would be valid, e.g. for the spin π−rotation we have T < 1 /2Ω −1 , where Ω is the extrapolated Rabi frequency (see figure 1c). However, the π−rotation time in our case is limited by the minimum time of the theoretically proposed optimal bang-bang control, T Bang π = π/ (πω L ) 2 + (2πΩ) 2 , where the control Γ x (t) takes only a constant value of ±Ω for a certain time interval [1].
To obtain the optimized pulse for one target rotation, we: 1. Perform the parallel simplex search algorithm with an S number of random initial values of the CRAB parameters for j small positive real numbers of {c j f }, and k positive small integers {N k }, typically {c j f } ∈ (0.01, 0.5) and {N k } ∈ (3, 7).

Obtain from
Step 1 (S × j × k) sets of CRAB parameters, than construct (S × j × k) numbers of control pulses {Γ x (t)}.
3. Investigate the numerical values of F and max{|Γ x (t)|} for each pulse, and pick the best one out of (S × j × k) pulses which satisfies F ≤ κ f and max{|Γ x (t)|} ≤ κ Γ . The preset quantities κ f and κ Γ are the numerical infidelity and the maximum control amplitude, respectively. If the best pulse can not be obtained, return to Step 1 with different values of {c j f } and increase {N k }) The actual numerical calculations were carried out on the bwGRiD cluster where we utilized its multi-nodes multicores (8 cores per node) computational features to run the parallel Nelder-Mead searches that corresponds to various experimental parameters and random initial values. To find a single parallel sample in one-core, i. e. one set of CRAB optimized parameters, the typical computational time required to meet the experimentally acceptable fidelity is approximately less than 30 minutes. This allows one to perform a single optimization run in just a decent commercial personal computer. Hence, it is feasible in the future to apply our numerical CRAB optimization in standard closeloop control system involving directly the control apparatuses. For both cases of π−rotation and π /2−rotation we set the parameters as the following: N = 5, S = 30, ω L = g 0 = max{|Γ x (t)|} = 30 MHz, and ω n ∈ (10, 100) MHz. We present the best obtained CRAB parameters for each rotation in Table I, while the corresponding MW pulses are shown in figure 5.

EXPERIMENTAL SETUP AND PULSE SHAPES
The pulses optimized by the CRAB algorithm contain a superposition of ten sinusoidal functions. Experimentally these pulses are synthesized directly by an Arbitrary Waveform Generator (Tektronix, AWG7122C) with a sampling rate of 24 GS/s and than sent to an amplifier (Mini-Circuits, ZHL-42W-SMA). The pulse shapes measured with an oscilloscope (Tektronix, TDS6804B) are displayed in Fig. 5. Optical measurements were obtained via a self-made confocal microscope, the AWG triggered both the acousto-optic modulator for laser pulse control and the photon count card (FastComtec: P7887).

STATE TOMOGRAPHY
In order to determine the fidelity of the final state in respect to the target state we performed a state tomography. For this purpose we evaluated all three components of the Bloch vector.The z-component is measured directly from the fluorescence level.The x-and y-components have to be projected into the measurable z-component. This is done by applying a microwave with different phases and measure Rabi oscillations or in other words: rotate the Bloch vector around the x-axis to determine the y-component and vice versa, as shown in Fig. 6.
The density matrix of a single qubit can be written as follows: In this definition, x, y and z have values between -1 and 1. The first point of the measurements Rabi x (1) and Rabi y (1), where no microwave was applied, can be understood as the z-component. The three components of the Bloch vector are calculated in the following way: where x, y and z are the three components of the Bloch vector and Amp x,y are the amplitudes of the Rabi oscillations rotating around the y,x-axis respectively. In formula 7 and 8, values for x and y were set to 0 if the uncertainty was greater than the actual value. Another possibility to obtain the x-and y-component is to calculate Rabi x (π/2) and Rabi y (π/2) respectively.
To normalize the data we performed an additional, bare Rabi measurement. The normalization is done by Rabi x (1) = (rawdata(1) − (y 0 − A))/2A, where A is the amplitude and y 0 is the offset of the normalization measurement.
In order to calculate the fidelity between the experimental state ρ and the target state |Ψ the definition for pure states is used: F = Ψ| ρ |Ψ which in this case is equivalent to the general definition F = tr √ σρ √ σ [5]. Due to experimental limitations we had to wait for 100 ns between the CRAB-pulse and the Rabi measurement, hence the target state after the time evolution on the x, y plane becomes with the Pauli matrix σ z and the Larmor frequency ω L . For the error calculation of the fidelity the noise of the Poisson distributed photon collection and fitting errors were taken into account. The error was determined by using the general law of error propagation [4]:

MAGNETIC RESONANCE IN AN ARBITRARY FRAME -OFF RESONANT EXCITATION
Here we demonstrate that we are able to "switch" between different reference frames in the case of off-resonance excitation with an offset: where ω is the MW frequency and ω L = 40.8 MHz is the Larmor frequency. In these experiments we set ∆ω = 3 MHz. Now there are three coordinate frames, in all of them the z axis is fixed in space and parallel to the constant magnetic field B 0 . We distinguish between -laboratory frame (the x and y axis are fixed in space), rotating frame (xy plane rotates with the Larmor frequency) and following frame (xy plane rotates with the MW frequency ω = ∆ω + ω L ). We can measure FID in any of these frames by properly adjusting the phase of the second MW pulse (see also Fig.  3 in the main text). FID measured in the rotating frame at an off-resonant offset of ∆ω = 3 MHz is shown in Fig. 7 (left, blue curve), where the Fourier transform of the signal confirms the expected frequency of 3 MHz. If the phase of the second MW π/2 pulse is set as φ = ∆ωτ , we are detecting the FID in the following frame, where no oscillation is observed, see Fig. 7 (left, red curves). By keeping the phase of both MW pulses fixed for values of τ , we detect in the laboratory frame (Fig. 7, right, blue curve.) signal. An oscillation with the off-resonance shift ∆ω = 3 MHz is observed only when the experiment is performed in the rotating frame. (right) FID in lab and following frames. In the lab frame we observe a fast oscillation of the Larmor frequency and a slow beating due to the frequency shift ∆ω (blue curve). If we compensate both Larmor and the ω (red data) we obtain the envelope of the lab frame measurement. For the solid (dashed) red lines the rotation angle of the second MW pulse was set to π/2 (3π/2).