Introduction

Due to the increased difficulty in manipulating large arrays of individually addressable quantum systems, experimental efforts in quantum computing are limited in qubit number, typically at the scale of hundreds to thousands1,2. The challenge of scaling quantum systems is twofold. First, increasing the number of physical particles that encode quantum information while maintaining high-fidelity operations is complicated by control limitations3,4 or increased crosstalk5. Second, multi-qubit entangling gates required to perform quantum algorithms, such as Grover’s search or Shor’s factoring algorithm6,7, are expensive to implement on qubit-based systems. The n-qubit entangling gates typically need to be decomposed into \({{{\mathcal{O}}}}({n}^{2})\) two-qubit gates, when not using ancilla qubits, or into \({{{\mathcal{O}}}}(n)\) entangling gates with \({{{\mathcal{O}}}}(n)\) ancilla qubits7,8,9,10,11,12. It is therefore challenging to show an advantage over these algorithms’ classical counterparts, e.g., when applied to large datasets13.

Qudits with d > 2 levels could complement the effort to scale quantum information processors, providing new opportunities for hardware efficiency. This is due to their larger Hilbert space when compared to qubits, allowing for more efficient encoding of information using smaller physical systems14,15. Additionally, multi-particle entangling gates can be performed more straightforwardly, without the need for ancilla particles11,16,17,18,19. Recent theoretical and experimental demonstrations of the encoding of a logical qubit within a single qudit also show the potential for hardware efficiency in quantum error correction20,21,22.

Several physical platforms can support qudit encoding, including neutral atoms (23,24,25, high-spin nuclei26,27,28, superconducting circuits29,30,31,32, photonics33,34, and trapped ions35,36,37. For efficient control of qudits, it is not sufficient to simply adapt qubit-like, pairwise operations—namely, the Givens rotations38—as this control scheme suffers from a \({{{\mathcal{O}}}}({d}^{2})\) scaling in the number of pulses needed to implement an arbitrary unitary37. Recent demonstrations in transmon and solid-state qudits26,29,32 have shown efficient control using a multi-tone drive on qudits with up to 8 levels, requiring only \({{{\mathcal{O}}}}(d)\) pulses to implement an arbitrary unitary operation. Randomized benchmarking and the creation of spin-cat states have also been demonstrated using this multi-tone control scheme, suggesting that it may be possible to realize hardware-efficient, high-fidelity implementations of quantum algorithms using this technique.

A pioneering implementation of Grover’s search with qudits used a similar multi-tone control scheme for a nuclear spin (\(I=\frac{3}{2}\)) within a Tb3+ ion28. In this case, however, due to the lack of a pulse sequence capable of generating an equal superposition of four states with equal phases, the algorithm was implemented only on a d = 3 subspace and an algorithm success probability of ~80% was achieved, highlighting the challenge of scaling beyond d = 3.

A promising approach for addressing this challenge is the use of trapped ions, especially due to the record-high fidelity single- and two-qubit gates achievable in this system39,40. The rich atomic structure also allows for the encoding of high-dimensional qudits41. At the same time, to efficiently implement a quantum algorithm with high fidelity using multi-tone control of trapped-ion qudit systems, a suitable set of states and operations must be determined.

The control parameters need to be well calibrated, and unitary operations that map the desired algorithm to the qudit manifold must be determined.

In this paper, we employ the metastable state of 137Ba+, a well-established platform for encoding qudits where high-fidelity state preparation and measurement of up to twenty-four levels have been demonstrated35. We demonstrate the first multi-tone control of a single atomic qudit, utilizing up to eight levels within a 137Ba+ ion, to realize Grover’s search algorithm for d = 5 and d = 8 sized Hilbert spaces. We establish and utilize optimization criteria to select qudit computational basis states from the 24 available states in the long-lived, metastable D5/2 level. We apply randomized benchmarking sequences for calibration of the operation control parameters. By allowing non-constant pulse lengths, each step of the algorithm is realized with \({{{\mathcal{O}}}}(d)\) pulses, giving us an efficient and high-fidelity implementation. Compared with previous demonstrations of Grover’s search algorithm with qubit-based systems, the qudit-based approach provides competitive performance.

Results

Qudit choice

The experiment is performed with a single 137Ba+ ion trapped in a surface electrode trap42. Due to a nuclear spin of \(I=\frac{3}{2}\), the metastable 5D5/2 state has twenty-four levels available for the construction of qudits. The hyperfine interaction also provides the non-linearity needed for universal control26,29. To obtain states suitable for high-fidelity multi-tone control, we must identify an optimal subset of states coupled to each other through magnetic dipole transitions. These transitions should be relatively strong, with low sensitivity to magnetic field fluctuations, and well separated from any other transition that involves the qudit states or potential leakage paths. Based on these criteria, we numerically vary the strength of the quantization field and select a set of up to eight levels for encoding qudits. We determined a suitable field strength B0 to be ~7.2 Gauss, which is applied through a pair of coils in a near-Helmholtz geometry. The selected states are depicted in Fig. 1a. A slightly different set of states is chosen for the d = 5 and the d = 8 qudits, as we have to relax the constraint somewhat on the separation of the transitions for the latter case. The inter-state transition strength is plotted versus frequency in Fig. 1b, c. More details regarding the qudit states can be found in Supplementary Information.

Fig. 1: Qudit encoding and experimental setup.
Fig. 1: Qudit encoding and experimental setup.
Full size image

a The selected hyperfine states for the encoding of qudits up to either d = 5 (green) or d = 8 (orange). The (partial) energy spectrum for possible transitions within the D5/2 manifold is plotted in (b, c), where the corresponding transitions for multi-tone control are marked in green and orange for the d = 5 and d = 8 qudits, respectively. The blue lines represent transitions that involve some qudit states that are off-resonantly driven with a detuning smaller than 10 MHz when all tones are switched on. The gray lines represent all other transitions between the hyperfine levels. d The ion trap electrode configuration. The radio-frequency (RF) electrodes used for multi-tone control are indicated in blue and the ion is trapped 50 μm above the trap surface. The quantization axis is indicated by the direction of the external static magnetic field B0.

State preparation and measurement

A 1762 nm laser beam is applied to drive transitions between the 6S1/2 and 5D5/2levels for state preparation and measurement (SPAM)43. For qudit states not directly accessible due to selection rules, the population is first transferred to an accessible state via a π pulse on an accessible S-to-D transition; this is followed by a radio-frequency (RF) π pulse that transfers the population to the desired qudit state. More details regarding the SPAM procedure can be found in Supplementary Information. A similar procedure is implemented to sequentially transfer the population from the qudit states back to the ground state for measurement via fluorescence. The total time required to completely read out the qudit is ~8 ms; this is sufficiently short compared to the lifetime of the 5D5/2state such that decay during measurement leads to negligible error. We detect leakage out of the qudit state space during operations as follows: if the ion is never detected to be bright in any of the cyclical qudit-state-transfer measurement cycles, the experimental trial is discarded44. For the results presented in this letter, the average probability of null measurements is 2(1)%, limited by the SPAM fidelity.

Multi-tone control

To perform multi-tone operations, up to seven RF signals (each generated via direct-digital synthesis [DDS], and all relatively phase-coherent) are combined and directed through two RF electrodes in the trap, as shown in Fig. 1d. The oscillating magnetic field generated by the RF electrodes has components along both the x and z directions. Therefore, magnetic dipole transitions of any polarization can be driven among the sublevels of the 5D5/2 manifold. Concerted, independent control of the multi-tone phases allows for displacement and Selective Number-dependent Arbitrary Phase (SNAP) gates for universal control26.

For calibration of the multi-tone control, we first perform spectroscopy and Rabi-excitation experiments to locate the resonances of all the relevant transitions and characterize the approximate driving strength for each transition’s tone individually. The amplitudes of the DDS channels are adjusted so that the Rabi frequencies approximate those required for a spin-displacement operation (see “Methods”). However, this coarse calibration is not sufficient to guarantee low gate error, likely because driving all tones simultaneously introduces additional effects, such as AC Zeeman shifts, which are not taken into account at this level of calibration. Hence, coarse calibration is then followed by a finer calibration of the Rabi amplitudes using the Nelder-Mead method to maximize the fidelity of global Clifford gate sequences composed of the native π-pulses. These sequences are randomized benchmarking sequences and provide an optimization landscape for the multi-tone calibration with a local minimum at the optimal spin-displacement amplitudes as described in the “Methods” section. Averaging many of these sequences creates a global minimum within a reasonable tuning range from the coarse approximation (see Supplementary Information for further details). A fine calibration stage for the transition frequencies is conducted similarly (with a fixed set of amplitudes given by the previous calibration stage), and we repeat the amplitudes-frequencies calibration cycle a few times until the gate errors are minimized. The calibration process is repeated every few hours to compensate for slow drifts in the system.

Grover’s algorithm

Grover’s search algorithm provides quadratic speedup compared to classical brute-force search when querying an unsorted dataset. The circuit diagram for implementing this algorithm with a single qudit is shown in Fig. 2. A few straightforward modifications to the textbook Grover’s algorithm are needed when implemented with a single qudit, versus \({\log }_{2}d\) qubits. As in the standard algorithm, we begin by constructing the equal superposition over all states in the database

$$\left|s\right\rangle=\frac{1}{\sqrt{d}}{\sum }_{k=0}^{d-1}\left|k\right\rangle .$$
(1)

We then implement a phase oracle O which marks the desired state \(\left|m\right\rangle\) with a phase of −1; this is again just like in the qubit case. On the other hand, in the next step a change needs to be made to the reflection operator \(2\left|s\right\rangle \left\langle s\right|-{\mathbb{1}}\), which is applied to amplify the population in the marked state. In even dimensions of d > 2, one must scale the reflection operator by a phase factor of eiπ/d to ensure that the operator belongs to SU(d). The marking and reflection operations are then repeated \(N \sim \pi \sqrt{d}/4\) times, after which the algorithm success probability (ASP) is given by ref. 9

$$p(N)={\sin }^{2}\left[(2N+1){\sin }^{-1}\left(\frac{1}{\sqrt{d}}\right)\right].$$
(2)
Fig. 2: Grover’s algorithm implemented with a single qudit.
Fig. 2: Grover’s algorithm implemented with a single qudit.
Full size image

a The qudit is first prepared in the \(\left|0\right\rangle\) state, followed by a Hadamard transformation that generates the equal superposition state \(\left|s\right\rangle\). For each iteration, the oracle O is applied to mark the target state, and the reflection operator \(2\left|s\right\rangle \left\langle s\right|-I\) amplifies the population of the marked state. The phase factor of eiπ/d is needed if d is even; otherwise, the reflection operator cannot be implemented using SU(d) operations due to its negative determinant. A comparison of two circuits implementing the phase oracle with a d = 8 qudit (b), which consists of three displacement pulses \(D({{{\boldsymbol{\varphi }}}},\theta )\equiv {e}^{-i\theta {H}_{rot}({{{\boldsymbol{\varphi }}}})}\) where Hrot is defined in (5), and with three qubits (c), which requires a three-qubit Toffoli gate. In (b), the displacement pulse parameters {φiθi} are given in Supplementary Information and are found using a gradient-descent-based numerical optimization method (see “Method”s).

We implement and characterize the performance of Grover’s algorithm as follows. The sequence starts with the preparation of the ion in the \(\left|0\right\rangle\) state of the qudit, followed by the creation of the equal superposition state as given by Eq. (1), which takes two pulses for d = 5. For the oracle operation, two pulses are applied to mark the desired state. Lastly, four pulses are used to implement the reflection operator. The method for this decomposition of circuit operations into a series of pulses is further detailed in the Methods, and the pulse parameters are summarized in Supplementary Information. We perform state tomography45 to diagnose the density matrix after each stage of the algorithm, and the result is shown in Fig. 3a. The algorithm is repeated with oracles that mark different qudit states, and this result is shown in Fig. 3b. An average ASP of 96.8(3)% is achieved for N = 1, while the highest possible ASP is 96.8%, given by Eq. (2).

Fig. 3: Results for implementation of Grover’s algorithm in a d = 5 qudit.
Fig. 3: Results for implementation of Grover’s algorithm in a d = 5 qudit.
Full size image

a Density matrices reconstructed from state tomography of the qudit after each step of the algorithm. The qudit is initialized in the \(\left|0\right\rangle\) state, followed by the preparation of the equal superposition state, the oracle operation that marks the \(\left|2\right\rangle\) state, and the reflection operation that amplifies the amplitude of the marked state. The size (color) of the square blocks represents the magnitude (phase) of the corresponding entry of the density matrix. b Result of performing Grover’s search, with oracles that mark each qudit state, after one round of oracle-reflection operation. The measurement results are represented by the number within each block. The theoretically achievable fidelity is 96.8% and the average fidelity of the experiment is 96.8(3)%, where the error represents one standard deviation. The average SSO is 99.9(1)% and the highest possible SSO is 100%. c The success probability of the algorithm versus the number of repetitions N of the oracle-reflection operations. The yellow and blue markers represent the highest possible fidelity and the experimental result, respectively. The blue solid line represents a linear fit to the data points and the success probability per iteration is determined to be 99.28(2)%. The light-blue shaded region represents the expected fidelity determined from a master-equation-based simulation and the measured coherence time (see Supplementary Information for coherence time measurements).

We further evaluate the success of our experimental implementation using the squared statistical overlap (SSO), a metric that compares the population of each measured state with the theoretical prediction. The SSO is defined as \({({\sum }_{k=0}^{d}\sqrt{{e}_{k}{p}_{k}})}^{2}\), where ek is the predicted population, and pk is the measured population, of the k-th state. The average SSO for our d = 5 implementation is 99.9(1)%, while the highest possible SSO is 100%. To more precisely determine the fidelity per round, we perform multiple iterations of the oracle-reflection operation, and the result is shown in Fig. 3c. The highest possible fidelity is also plotted for reference. A linear fit to the decay of the success probability results in a fidelity of 99.28(2)% for each repetition.

To appreciate how well the results scale to larger qudit sizes, we also implement Grover’s algorithm with a d = 8 qudit, and evaluate the required control complexity and the obtained algorithm fidelity. We observe that certain algorithmic operations could be significantly simplified with qudits, as shown in Fig. 2b, compared with similarly sized qubit-based systems7,10,46. The Hadamard transformation, oracle, and reflection operations are implemented with three, two, and eight displacement pulses, respectively. The experimental result with N = 1 round of oracle-reflection operations is shown in Fig. 4. The average ASP is 69(6)% and the average SSO is 97.1(3)%, with the highest possible ASP, from Eq. (2) being 78%, and the highest possible SSO being 100%.

Fig. 4: Grover’s algorithm implemented on a d = 8 qudit.
Fig. 4: Grover’s algorithm implemented on a d = 8 qudit.
Full size image

The measured ASP and SSO are 69(6)% and 97.1(3)%, respectively. The errors represent one standard deviation. The highest theoretical ASP and SSO are 78% and 100%, respectively, with one round of oracle-reflection operation.

Discussion

A major source of error that limits the algorithm’s fidelity is decoherence. For the d = 5 and 8 cases studied here, the measured coherence times of the states utilized are 9(1) and 3(1) ms, respectively (see Supplementary Information for coherence time measurements), while the average pulse lengths for implementing the algorithm are 33 and 30 μs, respectively. Therefore, we expect decoherence to contribute approximately 0.4% and 1% error per pulse, respectively. We also simulate the expected fidelity versus the number of oracle-reflection repetitions for the d = 5 case using a master-equation approach, with a dephasing operator that is a diagonal matrix where the matrix elements are the magnetic field sensitivities of each level (assuming the magnetic field fluctuation is small and is the major source of decoherence, which is a good assumption in our system). The result of the simulation is plotted next to the measurements in Fig. 3c, showing reasonable agreement and confirming that decoherence is the dominant source of error. Sources of magnetic field noise could include AC line noise35 as well as fluctuations of the trap RF amplitude42, which can be mitigated by better shielding and active stabilization, respectively. These methods have been shown to significantly increase the coherence time of qubit systems47. Another source of error that also increases with the qudit dimension is the off-resonant coupling to non-qudit states. The off-resonant drive that couples state \(\left|i\right\rangle\) and \(\left|k\right\rangle\) results in a population \(\sim \frac{{\Omega }_{ik}^{2}}{{\delta }_{ik}^{2}}\), where Ωik is the coupling strength and δik is the detuning, each between states i and k. Summing over all possible couplings when the qudit drives are switched on gives an expected error of ~3 × 10−5 and ~2 × 10−4, respectively.

Grover’s search over a data size of eight has also been performed on qubit-based systems, including trapped ions7 and superconducting circuits10,46. For a single iteration with the phase oracle, the average ASP to identify the marked state was 43.7(2)%, 51(6)%, and 49.2(4)% for each of these referenced experiments, respectively, approximately 20% lower than our implementation with a single qudit. As noted earlier, a major challenge for the qubit-based implementation is the large number of two-qubit gates. In our case, no entangling gate is needed to implement Grover’s search algorithm for this database size. For solving problems with a larger database size, the qudit dimension could be increased by including more levels and RF/laser tones. So far, experimental demonstrations have been limited to dimensions on the order of ten, as it becomes increasingly challenging for high-fidelity operations in higher dimensions35. Using the methodology demonstrated here, there will only be a moderate increase in control overhead due to the \({{{\mathcal{O}}}}(d)\) scaling. However, there will likely be a more dramatic increase in the decoherence and off-resonant scattering rates for larger d, as the transitions between levels making up other qudit levels in a larger space have higher magnetic field sensitivities, as well as smaller minimum energy separations. In principle, one could also add a laser tone to the multi-tone control scheme, so that states from other manifolds, such as the S1/2 ground state, can be included to construct a larger qudit35. On the other hand, it could be more favorable to scale beyond a single ion with only a moderate size for each qudit (e.g., d ≈ 5–10), so that such issues do not pose significant challenges for high-fidelity operations. This approach would naturally require qudit entangling gates.

Efficiently implementing entangling gates is another challenge for quantum information processing using qudits. Such gates can be decomposed into multiple qubit entangling gates37, or by applying multiple laser tones to achieve qudit Mølmer-Sørensen (MS) gates48. On the other hand, laser-free entangling gates49,50 could provide favorable alternative schemes for entangling qudits. For example, the MS-type gates50 could be applied to Zeeman qudits, i.e., one encoded in the D5/2 manifold of 138Ba+ (and other isoelectronic, zero-nuclear-spin alkaline-earth[-like] ions), which consists of six levels with almost equal spacing. The σx σx interaction generated by the magnetic-field gradients would then result in a Jx Jx type interaction for the qudits, which could be used to create the maximally entangled state with a single gate application. For the hyperfine qudits presented in this work, such interactions could also be achieved with 2(d − 1) gradient tones, but this might be experimentally challenging to implement for larger d, as it requires an appreciable amount of current to generate each gradient tone. In this case, a scheme very similar to near-motional-mode-gradient gates49 could be more appropriate, as it only requires a single gradient drive along with 2(d − 1) much weaker drives. The feasibility of such gates still requires further study, but they could potentially provide a much more efficient method for entangling qudits.

With a system consisting of a few qudits, it would be interesting to experimentally explore fault-tolerant quantum computing and make a comparison with qubit-based approaches51,52. Such systems could be realized using the quantum charge-coupled device architecture53,54, with electrodes patterned to form dedicated gate zones consisting of current-carrying wires for single- or two-qudit gates, or by exploiting the spatial variation of the global fields generated by such wires39. For Zeeman qudits, a laser-induced light shift could be used to break the degeneracy, so that the multi-tone control technique can be used for universal control. When combined with integrated photonics55, scalable, addressed gates could be realized.

In conclusion, we have demonstrated efficient, high-fidelity multi-tone control of a single qudit of up to eight states encoded in a single trapped ion. This control scheme allows for the implementation of Grover’s search algorithm without entangling gates, and our implementation achieves a fidelity comparable to that obtained in qubit-based systems.

Method

Energy levels of 137Ba+ metastable states

For atoms with a non-zero nuclear spin I, the Hamiltonian is given by (neglecting higher-order contributions)

$${H}_{0}= A{{{\bf{I}}}}\cdot {{{\bf{J}}}}+B\frac{3{({{{\bf{I}}}}\cdot {{{\bf{J}}}})}^{2}+\frac{3}{2}({{{\bf{I}}}}\cdot {{{\bf{J}}}})-I(I+1)(\,J+1)}{2I(2I-1)\,J(2J-1)}\\ +{\mu }_{B}{B}_{z}(\,{g}_{j}{m}_{J}+{g}_{I}{m}_{I})$$
(3)

where A and B are the magnetic dipole and electric quadrupole hyperfine constants, respectively, gJ and gI are the Landé g-factor and the nuclear g-factor. Here, I and J are the nuclear and total angular momentum operator, and mI,mJ are their projection along the quantization axis. Bz is the strength of the magnetic field along the quantization axis (the z-axis). With a non-zero Bz, the eigenstates are linear superpositions of all states with the same mF, which is the component of the total angular momentum F = I + J along the quantization field. We select a good set of states in the 5D5/2level for the qudit. The states are labeled as \(\left|0\right\rangle,\left|1\right\rangle,...\left|d-1\right\rangle\) and mapped to an effective spin-\(\frac{(d-1)}{2}\) with an assigned Jz value for \(-\frac{d}{2}+i\) to state \(\left|i\right\rangle\).

Multi-tone control

When the atom interacts with a multi-tone magnetic field, with the k-th tone having drive frequency ωk, field strength Bk, and phase φk, the interaction Hamiltonian Hlab in the laboratory frame is given by

$${H}_{{{{\rm{lab}}}}}(t)={\mu }_{B}{g}_{j}\,{J}_{x}\mathop{\sum }_{k}{B}_{k}\cos ({\omega }_{k}t+{\varphi }_{k})$$
(4)

where Jx is the D5/2 electronic spin operator. After going into the generalized rotating frame defined by \(U={\sum }_{k}{e}^{i{E}_{k}t/\hslash }\left|k\right\rangle \left\langle k\right|\), where Ek is the energy of the kth level, and making the rotating-wave approximation, the Hamiltonian becomes time-independent and is given by ref. 56

$${H}_{rot}=\left[\begin{array}{cccc}0 & {\Omega }_{0}{e}^{i{\varphi }_{0}} & 0 & \ldots \\ {\Omega }_{0}{e}^{-i{\varphi }_{0}} & {\delta }_{0} & {\Omega }_{1}{e}^{i{\varphi }_{1}} & \vdots \\ 0 & {\Omega }_{1}{e}^{-i{\varphi }_{1}} & \ddots & {\Omega }_{d}{e}^{i{\varphi }_{d-1}}\\ \vdots & \ldots & {\Omega }_{d}{e}^{-i{\varphi }_{d-1}} & {\sum }_{k=0}^{d-2}{\delta }_{k}\\ \end{array}\right],$$
(5)

where \({\Omega }_{k}={\mu }_{B}{g}_{j}{B}_{k}| \left\langle k\right|{\sigma }_{x}^{k}\left|k+1\right\rangle |\), \({\sigma }_{x}^{k}\) is the Pauli operator that couples state \(\left|k\right\rangle\) and \(\left|k+1\right\rangle\), and δk = (Ek+1 − Ek) − ωk. When the amplitudes of each tone satisfy

$${\Omega }_{k-1}=\Omega \sqrt{k(d-k)}$$
(6)

we have Hrot(φ = 0) = ΩJx, where Ω is the Rabi frequency for the Jx rotation. These multi-tone spin-displacement pulses \(D({{{\mathbf{\varphi }}}},\theta) \equiv {e}^{-i\theta {H}_{rot}({{{\mathbf{\varphi }}}})}\), where θ = Ωt, offer universal control over the qudit and provide a natural construction for pulse sequences with linear depth scaling in d that approximate arbitrary unitary U in SU(d)29:

$$U\approx \mathop{\prod }_{n=1}^{d}D({{{{\mathbf{\varphi }}}}}_{n},{\theta }_{n})$$
(7)

This scheme is analogous to the SNAP-displacement29 operations where the phases φ can be understood as the effect of virtual SNAP gates57S(φ) interleaved with spin-displacements D(θ) = D(θφ = 0):

$$U=S({{{{\mathbf{\varphi }}}}}_{{{{\bf{0}}}}})\mathop{\prod }_{n=1}^{d}D({\theta }_{n})S({{{{\mathbf{\varphi }}}}}_{{{{\boldsymbol{n}}}}}).$$
(8)

Algorithm operation pulse sequence

The core challenge for mapping Grover’s algorithm onto a single qudit is the efficient realization of the d-dimensional unitary operators. With a structured universal gate set, an arbitrary unitary could be constructed using \({{{\mathcal{O}}}}({d}^{2})\) pulses58. In contrast, an unstructured gate set (readily available with the multi-tone control) can achieve \({{{\mathcal{O}}}}(d)\)29 scaling, at the cost of straightforward decompositions. To address this challenge, we use a gradient-descent-based numerical optimization method to search for pulse parameters that implement the desired unitary based on a defined ansatz. For example, the marking operations in the phase oracle are implemented using an ansatz consisting of two successive displacement pulses, each defined by the rotation angle and phases of each tone. The optimization method then minimizes a loss function defined by the distance from the unitary generated by the two pulses to the oracle. Short sequences are found in this way for each step of our Grover’s algorithm implementation; these sequences are summarized in Supplementary Information.