Quantum-enhanced bosonic learning machine
Abstract
Quantum processors enable computational speedups for machine learning through parallel manipulation of high-dimensional vectors Biamonte et al. (2017). Early demonstrations of quantum machine learning have focused on processing information with qubits Cai et al. (2015); Trávníček et al. (2019); Havlíček et al. (2019); Johri et al. (2020); Bartkiewicz et al. (2020); Xin et al. (2021); Peters et al. (2021). In such systems, a larger computational space is provided by the collective space of multiple physical qubits. Alternatively, we can encode and process information in the infinite dimensional Hilbert space of bosonic systems such as quantum harmonic oscillators Braunstein and van Loock (2005); Ortiz-Gutiérrez et al. (2017); Flühmann et al. (2019). This approach offers a hardware-efficient solution with potential quantum speedups to practical machine learning problems. Here we demonstrate a quantum-enhanced bosonic learning machine operating on quantum data with a system of trapped ions. Core elements of the learning processor are the universal feature-embedding circuit that encodes data into the motional states of ions, and the constant-depth circuit that estimates overlap between two quantum states. We implement the unsupervised -means algorithm to recognize a pattern in a set of high-dimensional quantum states and use the discovered knowledge to classify unknown quantum states with the supervised -NN algorithm. These results provide building blocks for exploring machine learning with bosonic processors.
Machine learning techniques excel at finding patterns in data that are usually encoded as high dimensional feature vectors. As the size of these vectors grows, processing them classically requires enormous computational resources Lloyd et al. (2013). Recently proposed quantum algorithms show evidences of computational speedups, that comes from the exploitation of large Hilbert space of quantum systems Lloyd et al. (2013, 2014, 2016); Rebentrost et al. (2014). Demonstrations of quantum machine learning algorithms implemented on discrete variables platforms have shown tremendous potential Cai et al. (2015); Trávníček et al. (2019); Havlíček et al. (2019); Johri et al. (2020); Bartkiewicz et al. (2020); Xin et al. (2021). However, the number of gates and qubits must be increased for solving practical problems on near-term quantum processors.
An alternative approach is to utilize the infinite-dimensional Hilbert space of bosonic systems as the feature space for quantum machine learning Lau et al. (2017); Schuld and Killoran (2019). One advantage of the bosonic architecture is that a single operation, such as squeezing or displacement, is formally equivalent to processing infinitely-dimensional feature vectors Schuld and Killoran (2019). Furthermore, it allows for efficient use of physical resources. For discrete-variable schemes, approximately physical qubits are required to encode an -bit data string, whereas in the alternate approach, one bosonic mode is sufficient. As an example, in the ideal case the motion of a single trapped ion suffices to encode 3 infinitely dimensional feature vectors, whereas the internal state of an ion typically only encodes a single qubit Ortiz-Gutiérrez et al. (2017).

In this letter, we report a bosonic learning machine that consists of two building blocks for encoding and processing either quantum or classical data (see Fig. 1d). First, a universal embedding circuit implements a feature map of classical data to a quantum state . The map chosen in this work is amplitude encoding , where are the Fock states, denotes the dimension of the data, and is the Euclidean norm. The universal embedding circuit can be associated with a state preparation gate sequence , that prepares an arbitrary state satisfying Schuld and Killoran (2019); Lloyd et al. (2020).
Machine learning algorithms frequently rely on distance measures that can quantify the similarity between feature vectors Hastie et al. (2009). Here, we employ the Hilbert-Schmidt distance defined as , where is the overlap between two quantum states and Trávníček et al. (2019). The overlap measurement, reported throughout this work, can be efficiently realized with a constant-depth circuit implemented by a SWAP test Filip (2002); Gao et al. (2018); Gan et al. (2020); Nguyen et al. (2021).

In this work, the bosonic learning machine comprises two trapped 171Yb+ ions in a linear radio-frequency Paul trap, employing three motional modes denoted , , and . We start the experiment by preparing all the modes in the ground state of motion. Two of the modes, and , are used for storing information while acts as an auxiliary mode required for implementing the SWAP test. The hyperfine states of one ion mediate interaction between the motional modes, while the other ion is prepared in the metastable state and does not interact with optical fields during the experiment (See Fig.1). The Jaynes-Cumming interaction between the internal state and the motional modes enables deterministic preparation of an arbitrary state with dimension in steps, using methods presented in Law and Eberly (1996); Ben-Kish et al. (2003). Alternatively, we use displacement and squeezing operations to prepare coherent and squeezed vacuum states respectively. The SWAP test relies on controlled beam splitter gates of the form that enacts the Hamiltonian , depending on the internal state of the ions in the basis Filip (2002); Gao et al. (2018); Nguyen et al. (2021). Here and are the annihilation (creation) operator of the motional modes, is the coupling strength, an experimentally tunable phase, and the effective mixing angle for a gate duration (Methods).
Given two quantum states and prepared in mode and respectively, the SWAP test can be implemented with controlled beam splitter gates acting between modes and , and between modes and , followed by a projection measurement of the internal state. The overlap between two states is proportional to the probability to detect the internal state in : (Fig.1d). The SWAP test duration is independent from the dimension of the data and is significantly shorter than the coherence times of the motional modes Nguyen et al. (2021).
To highlight applications of our bosonic learning machine, we demonstrate the unsupervised -means clustering and supervised -NN algorithms using quantum states as the input data. We note that the input data may also be classical as it can be mapped to quantum states by using the universal embedding circuit. We begin with the description of implementing the unsupervised -means clustering algorithm. Consider two parties Alice and Bob. Alice prepares and sends Bob identical copies of quantum states. The quantum states can be expressed in the Fock basis , where runs from to . In this scenario, Bob is assumed to have no a priori information about the states that Alice prepares. Without resorting to a full tomography of the input states, Bob’s task is to sort the quantum states into clusters based on similarities among the states.
The algorithm begins with Bob making a guess of the number of clusters , and associates each cluster to a centroid state that are randomly initialized. The states are assigned to the cluster that has the nearest centroid. In step we implement a map , where denotes the centroids corresponding to the th cluster. Our quantum advantage comes from the reduction of complexity involved in estimating the distance of the two states and . This estimation takes approximately steps to perform classically, in comparison to the constant-time operation in our experiment. The centroids are subsequently updated by Alice to be the mean of the states contained in the corresponding cluster. The assignment and update are repeated until the clusters cease to change.

Our data is a set of 15 quantum states and consists of three clusters: the set of squeezed vacuum states , superposition of Fock states , and coherent states . We choose the parameters as , , and . Our simulations verify that -means algorithm can partition this data set correctly on a classical computer. The data states are prepared in the mode . For the first step, we choose the centroid states in mode C to be , , and . After each step the centroids, truncated to dimension 5, are updated and approximately synthesized using the embedding circuit. We characterize the state generation through measurements of Rabi oscillations on the to red-sideband transition (see Methods).
Figure 2a shows the overlap measurements between the data states and the centroids. We used on average 700 experimental runs for each measurement. With this particular choice of the initial centroids, the algorithm attains a stationary assignment after four steps. The final classification result is given in Fig. 2b, where the scatter plot of the amplitudes of the data states are shown for up to 5. The algorithm associates cluster 1 to , cluster 2 to , and cluster 3 to . The SWAP test measurements, albeit imperfect, produce classification results that agrees perfectly with the prior knowledge about the states sent to Bob. Stationary assignment of the centroids is evident from the step-by-step evolution shown in the inset of Fig. 2b. The assignment results after each step can be found in Extended Data.
We next demonstrate the -NN algorithm to classify unknown trial states, by using the three labelled clusters from the -means results as training states. The traditional approach to solving the problem of classifying unknown states is to perform a complete tomography, which requires a number of measurements that grows exponentially with the state dimension Haah et al. (2017). However, if complete information regarding the state is unnecessary, -NN algorithm could offer an efficient alternative, especially when is large. With a constant depth SWAP test, computational complexity of the -NN becomes independent of .
The -NN algorithm requires estimation of the overlap between each trial state and all training states. We identify the states having highest overlap with the trial state. The trial state is then assigned to the cluster that labels the majority of states. Figure 3 shows the experimental results of -NN classification with for a variety of trial states. The first three trial states utilize the same operation that prepares the three clusters, respectively, and are observed to be correctly classified. We further carry out the classification of trial states that are prepared with other operations (See Methods). Such examples are the two states and (up to a normalization factor), that are both classified to cluster 2. These results indicate that the outcome of the algorithm is determined by overlap of the quantum states, which can be visualized by the similarity of their Wigner functions. This can be interpreted as a form of Wigner function pattern recognition, much like applying -NN to handwriting recognition in classical ML Hastie et al. (2009).
In conclusion, we realize a bosonic learning machine using motional modes in a system of trapped ions. The core subroutine of the machine is the efficient SWAP test that estimates the overlap of two motional modes with a constant gate duration, a feature that is preferred in solving problems with large dimension such as quantum support vector machines. We expect that the experimentally accessible dimensions can be further increased by improving various technical aspects of the setup, such as the motional coherence time and coupling strength between modes. The same bosonic learning machine can also be used to implement several quantum kernels proposed in Schuld and Killoran (2019) and on different experimental platforms such as superconducting microwave cavities Hofheinz et al. (2009); Gao et al. (2018). These results provide a key primitive for developing advanced quantum-enhanced machine learning algorithms in infinite-dimensional feature spaces.
Acknowledgements.
We thank P.T. Le, H.N. Le, and L.C. Kwek for discussions. This research is supported by the National Research Foundation, Prime Ministers Office, Singapore, and the Ministry of Education, Singapore, under the Research Centers of Excellence program and NRF Quantum Engineering Program (Award QEP-P4)Author contributions
C.H.N. and D.M. conceived the experiment. C.H.N. K.W.T, G.M. and H.C.J.G. built and maintained the experimental apparatus. C.H.N. and K.W.T performed the experiments and analyzed the experimental data with assistance from G.M. and H.C.J.G. All authors contributed to the manuscript preparation.
Data availability
The data that support the findings of this study are available from the corresponding authors on reasonable request.
Author Information
The authors declare no competing financial interests. Correspondence and requests for materials should be addressed to C.H.N. ([email protected]) or D.M. ([email protected]).
Methods
Experimental setup. We trap two 171Yb+ ions in a four-rod linear radio-frequency Paul trap with single-ion secular trap frequencies MHz. The normal motional modes , , and are the out-of-phase motion in the direction, out-of-phase motion and in-phase in the direction with frequencies MHz, respectively. The transverse trapping frequencies are actively stabilized and drift less than 100 Hz/hour.
One of the ions, pumped to the metastable state by driving the transition at nm, does not interact with optical fields and is referred to as the “dark” ion. At the beginning of all experiments, the other ion is Doppler cooled by a 369.53 nm laser red-detuned from the to transition, and sympathetically cools the “dark” ion. The two hyperfine states used in the experiment are and , which are separated by GHz. The ion is initialized via optical pumping in the state . Resonance fluorescence state detection technique is used to detect the ion’s internal state Olmschenk et al. (2007).
A frequency-doubled, mode-locked Ti:Sapphire laser with a central wavelength of 372.85 nm is used to drive the stimulated Raman transitions. The mode-locked laser has a pulse duration of 3 ps and a repetition rate of 76.2 MHz. Two beams, R1 and R2 (Fig. 1a,b) with an average power of 60mW each, are sent through acoustic-optical modulators (AOMs) and focused to a beam waist of m at the ions. The beams R1 and R2 form 45∘ and 135∘ angles with respect to the -axis (Fig. 1a). The detuning of the Raman beams are controlled by the AOMs.
We begin all experiments with all the radial motional modes prepared in the ground state (residual ) using 10 ms Sisyphus cooling followed by 250 cycles of Raman sideband cooling.
Controlled beam splitter gates. We implement controlled beam splitter gates between modes and by applying a bichromatic Raman beatnote at , where . The resulting Hamiltonian is
(1) |
where , and and are the phases of the bichromatic fields. We let , where , and , . is the coupling strength.
The controlled beam splitter gate corresponds to the unitary evolution , where . In the experiment, we obtain a coupling strength Hz. This corresponds to implementing a beam splitter operation in s, much shorter than the motional phase coherence time for the superposition of which is approximately ms.
Preparation and characterization of quantum states. The universal embedding circuit relies on a series pairs of carrier and red-sideband:
(2) |
where () and () are the duration and phase for the -th carrier (red-sideband) pulse that are determined by the Eberly-Law algorithm Law and Eberly (1996). The additional phases compensate for the rotation of the internal states due to the AC Stark shifts of the red-sideband pulses (See Supplementary). The embedding circuit is used to prepare the centroid states of -means, the cluster state of -means experiment, and the trial state (up to a normalization factor) of -NN experiment. We use spin-dependent force to prepare all coherent states and the squeezed vacuum states Leibfried et al. (2003). For the trial state , we first prepare , followed by a displacement of .
The real and positive coefficients of the data states , shown in Fig. 2b, are the square root of population distribution , where . The population distribution is determined from a Fourier transform of the time evolution while driving the red-sideband transition
(3) |
where is the probability to detect the ion in the state , is the Rabi frequency of the red-sideband, and is the decoherence rate of motional states. To determine a fit constrained to be non-negative and is applied to Eq. 3 for to .
References
- Biamonte et al. (2017) J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, and S. Lloyd, Nature 549, 195 (2017).
- Cai et al. (2015) X.-D. Cai, D. Wu, Z.-E. Su, M.-C. Chen, X.-L. Wang, L. Li, N.-L. Liu, C.-Y. Lu, and J.-W. Pan, Physical Review Letters 114, 110504 (2015).
- Trávníček et al. (2019) V. Trávníček, K. Bartkiewicz, A. Černoch, and K. Lemr, Physical Review Letters 123, 260501 (2019).
- Havlíček et al. (2019) V. Havlíček, A. D. Córcoles, K. Temme, A. W. Harrow, A. Kandala, J. M. Chow, and J. M. Gambetta, Nature 567, 209 (2019).
- Johri et al. (2020) S. Johri, S. Debnath, A. Mocherla, A. Singh, A. Prakash, J. Kim, and I. Kerenidis, (2020), arXiv:2012.04145 .
- Bartkiewicz et al. (2020) K. Bartkiewicz, C. Gneiting, A. Černoch, K. Jiráková, K. Lemr, and F. Nori, Scientific Reports 10, 12356 (2020).
- Xin et al. (2021) T. Xin, L. Che, C. Xi, A. Singh, X. Nie, J. Li, Y. Dong, and D. Lu, Phys. Rev. Lett. 126, 110502 (2021).
- Peters et al. (2021) E. Peters, J. Caldeira, A. Ho, S. Leichenauer, M. Mohseni, H. Neven, P. Spentzouris, D. Strain, and G. N. Perdue, (2021), arXiv:2101.09581 [quant-ph] .
- Braunstein and van Loock (2005) S. L. Braunstein and P. van Loock, Reviews of Modern Physics 77, 513 (2005).
- Ortiz-Gutiérrez et al. (2017) L. Ortiz-Gutiérrez, B. Gabrielly, L. F. Muñoz, K. T. Pereira, J. G. Filgueiras, and A. S. Villar, Optics Communications 397, 166 (2017).
- Flühmann et al. (2019) C. Flühmann, T. L. Nguyen, M. Marinelli, V. Negnevitsky, K. Mehta, and J. P. Home, Nature 566, 513 (2019).
- Lloyd et al. (2013) S. Lloyd, M. Mohseni, and P. Rebentrost, (2013), arXiv:1307.0411 .
- Lloyd et al. (2014) S. Lloyd, M. Mohseni, and P. Rebentrost, Nature Physics 10, 631 (2014).
- Lloyd et al. (2016) S. Lloyd, S. Garnerone, and P. Zanardi, Nature Communications 7, 10138 (2016).
- Rebentrost et al. (2014) P. Rebentrost, M. Mohseni, and S. Lloyd, Physical Review Letters 113, 130503 (2014).
- Lau et al. (2017) H.-K. Lau, R. Pooser, G. Siopsis, and C. Weedbrook, Physical Review Letters 118, 080501 (2017).
- Schuld and Killoran (2019) M. Schuld and N. Killoran, Physical Review Letters 122, 040504 (2019).
- Lloyd et al. (2020) S. Lloyd, M. Schuld, A. Ijaz, J. Izaac, and N. Killoran, (2020), arXiv:2001.03622 .
- Hastie et al. (2009) T. Hastie, R. Tibshirani, and J. H. Friedman, The Elements of Statistical Learning: Data Mining, Inference, and Prediction, Springer series in statistics (Springer, 2009).
- Filip (2002) R. Filip, Physical Review A 65, 062320 (2002).
- Gao et al. (2018) Y. Y. Gao, B. J. Lester, Y. Zhang, C. Wang, S. Rosenblum, L. Frunzio, L. Jiang, S. M. Girvin, and R. J. Schoelkopf, Physical Review X 8, 021073 (2018).
- Gan et al. (2020) H. C. J. Gan, G. Maslennikov, K.-W. Tseng, C. Nguyen, and D. Matsukevich, Phys. Rev. Lett. 124, 170502 (2020).
- Nguyen et al. (2021) C.-H. Nguyen, K.-W. Tseng, G. Maslennikov, H. C. J. Gan, and D. Matsukevich, (2021), arXiv:2103.10219 [quant-ph] .
- Law and Eberly (1996) C. K. Law and J. H. Eberly, Physical Review Letters 76, 1055 (1996).
- Ben-Kish et al. (2003) A. Ben-Kish, B. DeMarco, V. Meyer, M. Rowe, J. Britton, W. M. Itano, B. M. Jelenković, C. Langer, D. Leibfried, T. Rosenband, and D. J. Wineland, Phys. Rev. Lett. 90, 037902 (2003).
- Haah et al. (2017) J. Haah, A. W. Harrow, Z. Ji, X. Wu, and N. Yu, IEEE Transactions on Information Theory 63, 5628 (2017).
- Hofheinz et al. (2009) M. Hofheinz, H. Wang, M. Ansmann, R. C. Bialczak, E. Lucero, M. Neeley, A. D. O’Connell, D. Sank, J. Wenner, J. M. Martinis, and A. N. Cleland, Nature 459, 546 (2009).
- Olmschenk et al. (2007) S. Olmschenk, K. C. Younge, D. L. Moehring, D. N. Matsukevich, P. Maunz, and C. Monroe, Physical Review A 76, 052314 (2007).
- Leibfried et al. (2003) D. Leibfried, R. Blatt, C. Monroe, and D. Wineland, Reviews of Modern Physics 75, 281 (2003).
Supplementary Material: Experimental quantum-enhanced machine learning over infinite dimensions
I Delay time between state preparation and the SWAP test
The two steps required for operation of the bosonic learning machine are the state preparation and the overlap measurement using the SWAP test. However, the quantum state of a harmonic oscillator evolves in time as where is the motional frequency. If the frequencies of motional modes and are different, care must be taken to calibrate waiting time between preparation and measurement to ensure that intended states are passed to the SWAP test. We set the delay time as . Otherwise, for example, the overlap of the two coherent states in modes and will oscillate as a function of the delay between the two steps, with a period of .
The trap frequency measurements done by scanning the motional sidebands are affected by the Stark shifts of the internal states. To obtain a frequency difference between the modes which is free from AC Stark shifts we measure the overlap as a function of the delay time , where . Figure S1 shows the results of overlap measurement. The period is obtained from the time difference between two peaks in the overlap measurement. We estimate s.

II Additional details on state preparation
The Fourier analysis of the time evolution while driving the red sideband can measure only the diagonal terms (phonon distribution) of the density matrix of the states. To verify that the universal embedding circuit can prepare states with desired off-diagonal terms, we carry out the following experiment. We prepare and compare the two overlaps and as a function of waiting time . Simulations predict that the second overlap is shifted in time, relative to , by if the states with correct off-diagonal terms are prepared. The experimental results shown in Fig. S1 agree with calculations.

The red-sideband pulse induces an AC Stark shift that gives rise to a rotation of the internal states. To compensate for this rotation, an additional phase is included to the next carrier pulses . We determine using the Ramsey experiment with an inserted red-sideband pulse described in Figure S2a. The second rotation pulse has a phase . We vary the red-sideband pulse duration while monitoring the probability of detecting the internal state in . When is set to and KHz, the measurement result (Fig. S2b) agrees with the expectation when the AC Stark shift is compensated.
III Extended Data


