Introduction

Deutsch’s algorithm was not only the first quantum algorithm but also one of the simplest1. Although the algorithm was probabilistic in its original form, it has not been difficult to improve it to deterministic2,3. The Deutsch algorithm involves two qubits and distinguishes constant functions, which take both input values (0 or 1) to a single output value, from balanced functions in which output values are different. We introduce a simple algorithm that uses only a single qudit to determine the parity of chosen 2d permutations of a set of d objects. As in the case of Deutsch’s algorithm, we obtain a speedup relative to corresponding classical algorithms. For the particular computational task considered, the relative speedup starts from the case of a three-level quantum system, i.e., a qutrit.

What makes quantum algorithms interesting is that they can solve some problems faster than classical algorithms. Deutsch coined the term quantum parallelism to stress the ability of a quantum computer to perform two calculations simultaneously. How simple can a quantum circuit be? Or, what is the smallest quantum processor that can solve a problem faster than any classical algorithm? A closely related question is the origin of the power of quantum computation. Superposition, entanglement and discord are known to play essential roles in quantum computing and yet the origin of the power of the quantum algorithms is not completely clear4. Recently, it has been argued that quantum contextuality is a critical resource for quantum speedup of a fault tolerant quantum computation model5. We present an example where an unentangled but contextual system can be used to solve a problem faster than classical methods. A qutrit is the smallest system where the contextual nature of quantum mechanics can be observed, in the sense that a particular outcome of a measurement cannot reveal the pre-existing definite value of some underlying hidden variable6,7. Whether the origin of the speedup of our algorithm can be explained by contextuality is an open question.

We present an oracle based quantum algorithm constructed on a surprisingly simple idea, which solves a black-box problem using only a single qudit without any correlation of quantum or classical nature. The black-box maps d possible inputs to d possible outputs after a permutation. The 2d possible permutation functions of d objects are divided into two groups according to whether the permutation involves an odd or even number of exchange operations. The computational task is to determine the parity (oddness or evenness) of a given cyclic permutation. A classical algorithm requires two queries to the black-box. We show that a quantum algorithm can solve the problem with a single query. Even though the problem that the algorithm solves is not crucial, the algorithm is interesting in that it makes use of a single qudit, which means that neither entanglement nor any other correlation plays a role. Moreover, we present an experimental demonstration of this algorithm using a room temperature nuclear magnetic resonance (NMR) quadrupolar setup.

Results

Computational task and the quantum algorithm

Consider the case of three objects, where the six permutations of the set {1, 2, 3} are (1, 2, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1), (2, 1, 3) and (1, 3, 2). From the parity of the transpositions, the first three are even while last three are odd permutations. Our computational task is to determine the parity of a given permutation. If we treat a permutation as a function f(x) defined on the set x {1, 2, 3}, determination of its parity requires evaluation of f(x) for two different values of x. We will show there exists a quantum algorithm where evaluating the function once (rather than twice) suffices to identify whether f(x) is even or odd.

Since we are going to use standard spin operators in our discussion, let us denote the three states of a qutrit by , where m = 1, 0, −1 are the eigenvalue of Sz with . Rather than the permutations of the set {1, 2, 3}, we can then consider permutations of a possible m values. Our aim here is to determine the parity of the bijection f : {1, 0, −1} → {1, 0, −1}. We may define the three possible even functions fk using Cauchy’s two-line notation

and the remaining three odd functions are

Being a simple transposition of orthonormal states , the operator corresponding to fk is unitary and can be easily implemented. Direct application of on basis states does not bring any improvement on the classical solution, we still need to know the result of for two different values of m. However, quantum gates can act on any superposition state including the state . The state vector can be obtained from by the single qutrit Fourier transformation

in Sz–basis. We will show that this can be used to distinguish even and odd fk’s. Note that the state vectors defined by have the property that and similarly . Hence, application of on gives for even fk and for odd fk. Therefore, if we apply the inverse Fourier transformation on , we have the state (even fk) or (odd fk). Thus, a single evaluation of the function is enough to determine its parity.

In summary, the quantum circuit involves just three gates visited by a single qutrit. We start with and place UFT, and next to each other, as depicted in Fig. 1. The final state of the qutrit after gate is necessarily either or , while is never observed. Although we can modify our algorithm for a single qubit, where the Fourier transformation becomes a Hadamard operator, this case is not interesting since the classical solution requires only a single evaluation of the permutation function so the quantum algorithm does not provide any speedup. The qutrit case of our algorithm is one of the simplest quantum algorithms.

Figure 1
figure 1

Schematic view of the quantum circuit implementing the proposed quantum algorithm.

We can generalize the algorithm to d dimensional (or equivalently spin (d − 1)/2) systems. In that case, the algorithm may be used to distinguish cyclic permutations according to their parity. For example, when d = 4 positive cyclic permutations of (1, 2, 3, 4) are (2, 3, 4, 1), (3, 4, 1, 2) and (4, 1, 2, 3) while the negative cyclic permutations are (4, 3, 2, 1), (3, 2, 1, 4), (2, 1, 4, 3) and (1, 4, 3, 2). As in the case of three elements, given one of the eight permutations, our aim is to determine its parity and this requires knowing at least two elements in the permutation, or, equivalently, knowing the values of the function for two variables classically.

For a four level quantum system (ququart), we can use the initial state where ’s are states of the ququart with vector representations , , and . In this case we can use the standard quantum Fourier transformation3 which can be viewed as a unitary matrix

in –basis, so that . Observe that, starting from (1, 2, 3, 4), the positive cyclic permutations (1, 2, 3, 4), (2, 3, 4, 1), (3, 4, 1, 2) and (4, 1, 2, 3) can be obtained with the corresponding unitary matrices,

respectively and they map onto , , and . On the other hand, the negative cyclic permutations result in , , and , which can be similarly realized by the unitary matrices,

respectively, where . Therefore, applying the inverse Fourier transformation and checking the final state of the ququart, we can determine the parity of the cyclic permutation. Final state indicates that the permutation is even, while means that the permutation is odd. As in the case of qutrit, the quantum algorithm allows us to determine the parity of a cyclic permutation with a single evaluation of the permutation function rather than the two that would be required classically. For four elements, we can formulate two more examples using other circular permutations and evaluate these new cases by redefining the Fourier transformation. For example, the positive (1, 3, 2, 4), (3, 2, 4, 1), (2, 4, 1, 3), (4, 1, 3, 2) and negative (4, 2, 3, 1), (2, 3, 1, 4), (3, 1, 4, 2) cyclic permutations can be distinguished with a single evaluation provided we start with the state . The last eight members of the total 4! = 24 permutations can also be used to set up a similar problem. Moving to a d–level quantum system (qudit), we can define

In this case, the positive cyclic permutations map onto itself while the negative permutations give .

From the above generalizations, we deduce that the essence of the algorithm is to design a circuit so that output states are grouped according to the computational task where final states are described by the same vectors up to a phase factor. For this type of generalization, the speedup factor will be two as in the case of a single qutrit. We can look for further generalizations of the algorithm with larger or perhaps exponential speedup factors by using many qudits together. However, the main purpose of the present work is to find the simplest quantum system which provides a computational speedup. Thus, we can identify the minimum system requirements for a useful quantum algorithm.

Experimental demonstration

In the following, we present an experiment which demonstrates the quantum algorithm for a ququart. Historically, many quantum algorithms were implemented in NMR systems8,9,10,11,12,13, especially those algorithms where entanglement is not required14,15,16,17. The implementation of the algorithm using a ququart is achieved using a spin– nuclei, which has been extensively used in NMR-QIP applications as exemplified in18,19,20,21,22,23,24,25,26,27,28,29,30 and reviewed in31. In such NMR systems, a strong static magnetic field is responsible for the Zeeman splitting, providing four energy levels. Since the nuclear spin is , the nuclei possess a quadrupole moment that interacts with the electric field gradient created by the surrounding charge distribution, i.e., quadrupolar interaction. When this interaction is much stronger than the quadrupolar one, we can use perturbation theory and express the Hamiltonian as32

where ωL is the Larmor frequency, ωQ is the quadrupolar frequency (|ωL|  |ωQ|), Iz is the z component of the nuclear spin operator and I is the total nuclear spin operator. The eigenstates of the system are by , , and , indexed as , , , , respectively. The corresponding NMR spectrum is composed by three spectral lines associated to the three single quantum transitions, Δm ± 1.

The initial state is prepared from the thermal equilibrium state using a time averaging procedure based on numerically optimized radio frequency (rf) pulses generally called strong modulating pulses (SMP)25,33,34. The technique consists of using blocks of concatenated rf pulses, with amplitudes, phases and durations optimized to provide a state preparation such that density matrix is , where ρ1 is a trace one density matrix corresponding to the state defined by the optimized SMP pulses35. The quantum gates in the circuit are also implemented using these SMP optimized pulses. Since NMR measurements are not sensitive to the identity part of the density matrix, the term is manipulated and read out selectively. The SMP optimization technique is based on the Nelder-Mead Simplex minimization method which is explained in detail in36.

The steps of the protocol were implemented as follows: (i) we apply the SMP optimized gate UFT to the initial state to obtain ; (ii) we apply the SMP optimized gate UiUFT for i = 2, 6 to the initial state again; (iii) finally, starting once more from the initial state, we implement the SMP optimized gate for i = 2, 6 to obtain either or as an outcome of the algorithm, as schematically depicted in Fig. 1. Figure 2 shows a bar representation of the density matrices, after each step of the protocol, obtained by quantum state tomography.

Figure 2
figure 2

Experimental demonstration of the algorithm.

We create the initial state with a fidelity of 0.99. From left to right is a bar representation of the density matrix for the state after the application of the Fourier transformation, UFT. (a) Obtained by quantum state tomography. (b) Applying the pulses that implement U6. (c) Applying the pulses that implement U2 (c). The two possible outcomes of the algorithm (d) for negative and for positive cyclic permutations. The experimental errors were quantified by the relation between signal and signal-to-noise ratio. For all of the reconstructed density matrices, the errors are always smaller than 6% (see Supplementary Material for details).

Discussion

We have shown that a single qudit can be used to implement a quantum algorithm which provides a two to one speedup in determining parity of cyclic permutations. Even though the model problem is not one of the most important computational tasks and the speedup is not exponential when generalized to higher dimensional cases, the algorithm is still important since it provides a strikingly simple example for quantum computation without entanglement.

We have experimentally demonstrated the proposed algorithm using a quadrupolar NMR setup and showed that it deterministically decides whether a given permutation, from a set of eight possible functions, of four objects is positive or negative cyclic with a single query to the black-box.

Despite the simplicity of the algorithm, the origin of the speedup remains unclear. It is evident that quantum correlations do not supply the solution of the computational task since a single quantum system is considered. Regardless, the true resource behind the power of this algorithm remains an open question.

Methods

For our experimental system, as for all room temperature NMR, the density matrix can be expressed as , where is the ratio between the magnetic and thermal energies, ωL is the Larmor frequency, kB is the Boltzmann constant and T the temperature32,35. Measurements and unitary transformations only affect the traceless deviation matrix, Δρ, which contains all the available information about the state of the system. Unitary transformations over Δρ are implemented by radio frequency pulses and/or evolutions under spin interactions, with excellent control of rotation angle and direction. The full characterization of Δρ can be achieved using many available quantum state tomography protocols34,37,38,39. Since for NMR experiments only the deviation matrix is detected, density matrix elements are expressed in units of ε.

The experiment was performed using sodium nuclei, 23Na, in a lyotropic liquid crystal sample at room temperature. The sample was prepared with 20.9 wt% of Sodium Dodecyl Sulfate (SDS) (95% of purity), 3.7 wt% of decanol and 75.4 wt% of deuterium oxide, following the procedure in40. The 23Na NMR experiments were performed in a 9.4-T VARIAN INOVA spectrometer using a 5 mm solid state NMR probe head at T = 25 °C. We obtained the quadrupole frequency νQ = ωQ/2π = 10 kHz. Under the conditions of the experiment, the sample can be considered as an ensemble of isolated sodium nuclei, i.e., an ensemble of individual ququarts.

The reconstruction of density matrices was performed using the method described in34, based on a coherence selection procedure, i.e., read out pulses with specifically designed amplitudes, durations and phases were applied to obtain an NMR spectrum associated only with the density matrix elements of a specific coherence order. The three line intensities of this spectrum (Ii) were used as inputs to a set of equations, which provided the selected density matrix elements. To estimate the experimental uncertainties, we assumed the error associated to each spectral line (ΔI) to be the standard deviation of the spectral noise obtained from the signal-to-noise ratio. Hence, the maximum and minimum threshold of each line was calculated as Ii,max = Ii + ΔI and Ii,min = Ii − ΔI. We reconstructed the density matrix considering all possible combinations of maximum and minimum intensities, resulting in a set of reconstructed density matrices and the mean and standard deviation of each density matrix element were obtained. The elements of the average density matrices and their respective errors are shown in the Supplementary Material. All relative errors are smaller than 6%. The fidelities to the theoretical predictions are shown in Fig. 2.

After the completion of this work, we became aware of subsequent works, also implementing the quantum algorithm proposed here but in different experimental setups41,42,43.

Additional Information

How to cite this article: Gedik, Z. et al. Computational speed-up with a single qudit. Sci. Rep. 5, 14671; doi: 10.1038/srep14671 (2015).