Skip to main content
Log in

A low failure rate quantum algorithm for searching maximum or minimum

  • Published:
Quantum Information Processing Aims and scope Submit manuscript

Abstract

Although Durr and Hoyer have proposed state-of-the-art quantum algorithm (DHA) for searching minimum value, the lower limit of DHA’s successful probability is 1/2 . Also, DHA requires approximately \((\log _{2}N)^2\) copies of the initial state. In this paper, we propose a new quantum maximum or minimum searching algorithm (QUMMSA). In big data scenarios, according to sparse sampling with different densities, we can estimate the corresponding precision parameters. QUMMSA can improve the successful probability close to \(100\%\). Furthermore, with the quantum exact search algorithm, QUMMSA only requires approximately \(\log _2 N\) copies of the initial state to solve this problem. Since preparing an arbitrary quantum state is a problem with exponential complexity, our algorithm has a greater advantage with the increasing database size. In addition, we first propose a general method for circuits construction, which can be used in any database. An experiment implemented in an IBM superconducting processor and a numerical simulation of a 6-qubit system to solve a real issue indicate the feasibility and efficiency of QUMMSA. QUMMSA can serve as a subroutine in various quantum algorithms which involves searching maximum or minimum.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11

Similar content being viewed by others

References

  1. Cisco Visual Networking Index: Global Mobile Data Traffic Forecast Update 2016–2021 White Paper, Feb. 2017

  2. Feynman, R.P.: Simulating physics with computers. Theor. Phys. 21, 467–488 (1982)

    Article  MathSciNet  Google Scholar 

  3. Shao, C., Li, Y., Li, H.: Quantum algorithm design: techniques and applications. J. Syst. Sci. Complex. 32(1), 375–452 (2019)

    Article  MathSciNet  Google Scholar 

  4. Deutsch, D.: Quantum theory, the Church–Turing principle and the universal quantum computer. Proc. R. Soc. Lond. A Math. Phys. Sci. 1985(400), 97–117 (1818)

    MATH  Google Scholar 

  5. Deutsch, D., Jozsa, R.: Rapid solution of problems by quantum computation. Proc. R. Soc. Lond. A 1992(439), 553–558 (1907)

    MATH  Google Scholar 

  6. Shor, P.W.: Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Rev. 41(2), 303–332 (1999)

    Article  ADS  MathSciNet  Google Scholar 

  7. Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the 28th Annual ACM Symposium on Theory of Computing, vol. 6, pp. 212–219. ACM Press, New York, USA (1996)

  8. Grover, L.K.: Quantum mechanics helps in searching for a needle in a haystack. Phys. Rev. Lett. 79(2), 325 (1997)

    Article  ADS  Google Scholar 

  9. Grover, L.K.: Quantum computers can search rapidly by using almost any transformation. Phys. Rev. Lett. 80(19), 4329 (1998)

    Article  ADS  Google Scholar 

  10. Bishwas, A.K., Mani, A., Palade, V.: An all-pair quantum SVM approach for big data multiclass classification. Quantum Inf. Process. 17, 282 (2018)

    Article  ADS  MathSciNet  Google Scholar 

  11. Kerenidis, I., Prakash, A.: Quantum recommendation systems. In: 8th Innovations in Theoretical Computer Science Conference (ITCS 2017). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2017)

  12. Wiebe, N., Kapoor, A., Svore, K.M.: Quantum algorithms for nearest-neighbor methods for supervised and unsupervised learning. Quantum Inf. Comput. 15(3–4), 316–356 (2015)

    MathSciNet  Google Scholar 

  13. Lloyd, S., Mohseni, M., Rebentrost, P.: Quantum algorithms for supervised and unsupervised machine learning (2013). arXiv:1307.0411

  14. Durr, C., Hoyer, P.: A quantum algorithm for finding the minimum (1996). arXiv:quant-ph/9607014

  15. Boyer, M., Brassard, G., Høyer, P., et al.: Tight bounds on quantum searching. Progr. Phys. 46(4–5), 493–505 (1998)

    Google Scholar 

  16. Chuang, I.L., Gershenfeld, N., Kubinec, M.: Experimental implementation of fast quantum searching. Phys. Rev. Lett. 80(15), 3408 (1998)

    Article  ADS  Google Scholar 

  17. Vandersypen, L.M.K., Steffen, M., Sherwood, M.H., et al.: Implementation of a three-quantum-bit search algorithm. Appl. Phys. Lett. 76(5), 646–648 (2000)

    Article  ADS  Google Scholar 

  18. DiCarlo, L., Chow, J.M., Gambetta, J.M., et al.: Demonstration of two-qubit algorithms with a superconducting quantum processor. Nature 460(7252), 240 (2009)

    Article  ADS  Google Scholar 

  19. Brickman, K.A., Haljan, P.C., Lee, P.J., et al.: Implementation of Grover’s quantum search algorithm in a scalable system. Phys. Rev. A 72(5), 050306 (2005)

    Article  ADS  Google Scholar 

  20. Debnath, S., Linke, N.M., Figgatt, C., et al.: Demonstration of a small programmable quantum computer with atomic qubits. Nature 536(7614), 63 (2016)

    Article  ADS  Google Scholar 

  21. Figgatt, C., Maslov, D., Landsman, K.A., et al.: Complete 3-qubit Grover search on a programmable quantum computer. Nat. Commun. 8(1), 1918 (2017)

    Article  ADS  Google Scholar 

  22. Walther, P., Resch, K.J., Rudolph, T., et al.: Experimental one-way quantum computing. Nature 434(7030), 169 (2005)

    Article  ADS  Google Scholar 

  23. Long, G.L., Li, Y.S., Zhang, W.L., et al.: Phase matching in quantum searching. Phys. Lett. A 262(1), 27–34 (1999)

    Article  ADS  MathSciNet  Google Scholar 

  24. Diao, Z.: Exactness of the original Grover search algorithm. Phys. Rev. A 82(4), 044301 (2010)

    Article  ADS  Google Scholar 

  25. Long, G.L., Li, X., Sun, Y.: Phase matching condition for quantum search with a generalized initial state. Phys. Lett. A 294(3–4), 143–152 (2002)

    Article  ADS  MathSciNet  Google Scholar 

  26. Toyama, F.M., Van Dijk, W., Nogami, Y.: Quantum search with certainty based on modified Grover algorithms: optimum choice of parameters. Quantum Inf. Process. 12(5), 1897–1914 (2013)

    Article  ADS  MathSciNet  Google Scholar 

  27. Biham, E., Biham, O., Biron, D., et al.: Grover’s quantum search algorithm for an arbitrary initial amplitude distribution. Phys. Rev. A 60(4), 2742 (1999)

    Article  ADS  Google Scholar 

  28. Castagnoli, G.: Highlighting the mechanism of the quantum speedup by time-symmetric and relational quantum mechanics. Found. Phys. 46(3), 360–381 (2016)

    Article  ADS  MathSciNet  Google Scholar 

  29. Biham, E., Biham, O., Biron, D., et al.: Analysis of generalized Grover quantum search algorithms using recursion equations. Phys. Rev. A 63(1), 012310 (2000)

    Article  ADS  Google Scholar 

  30. Høyer, P.: Arbitrary phases in quantum amplitude amplification. Phys. Rev. A 62(5), 052304 (2000)

    Article  ADS  Google Scholar 

  31. Grover, L.K.: Fixed-point quantum search. Phys. Rev. Lett. 95(15), 150501 (2005)

    Article  ADS  Google Scholar 

  32. Younes, A., Rowe, J., Miller, J.: Quantum search algorithm with more reliable behaviour using partial diffusion. In: Proceedings of the 7th International Conference on Quantum Communication, Measurement and Computing (2004)

  33. Barz, S., Kashefi, E., Broadbent, A., et al.: Demonstration of blind quantum computing. Science 335(6066), 303–308 (2012)

    Article  ADS  MathSciNet  Google Scholar 

  34. Giovannetti, V., Lloyd, S., Maccone, L.: Quantum random access memory. Phys. Rev. Lett. 100(16), 160501 (2008)

    Article  ADS  MathSciNet  Google Scholar 

  35. Wackerly, D., Mendenhall, W., Scheaffer, R.L.: Mathematical Statistics with Applications. Cengage Learning, Boston (2014)

    MATH  Google Scholar 

  36. Barenco, A., Bennett, C.H., Cleve, R., et al.: Elementary gates for quantum computation. Phys. Rev. A 52(5), 3457 (1995)

    Article  ADS  Google Scholar 

  37. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information: 10th Anniversary (2011)

  38. Rigetti, C., Devoret, M.: Fully microwave-tunable universal gates in superconducting qubits with linear couplings and fixed transition frequencies. Phys. Rev. B 81(13), 134507 (2010)

    Article  ADS  Google Scholar 

  39. Havlíček, V., Córcoles, A.D., Temme, K., et al.: Supervised learning with quantum-enhanced feature spaces. Nature 567(7747), 209 (2019)

    Article  ADS  Google Scholar 

Download references

Acknowledgements

This research was supported by the National Basic Research Program of China. SW acknowledges support from The National Natural Science Foundation of China under Grant Nos. 11974205 and 11774197, the National Key Research and Development Program of China (2017YFA0303700), the Key Research and Development Program of Guangdong Province (2018B030325002); and Beijing Advanced Innovation Center for Future Chip (ICFC).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yanhu Chen.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix A: Review of Grover–Long algorithm

In this section, we have to review Grover–Long algorithm which is a key step of QUMMSA, so that we can understand how to calculate the parameters of Grover–Long algorithm and apply it to QUMMSA.

Firstly, the initial state can be prepared by W operator, which can be described as formula(A1):

$$\begin{aligned} \left| \Psi \right\rangle =W\left| 0^{\otimes n}\right\rangle =\frac{1}{\sqrt{N}}\sum _{i=0}^{N-1}\left| i\right\rangle =\sqrt{\frac{M}{N}}\left| \Psi _{\mathrm{good}}\right\rangle +\sqrt{\frac{N-M}{N}}\left| \Psi _{\mathrm{bad}}\right\rangle \end{aligned}$$
(19)

where \(\left| \Psi _{\mathrm{good}}\right\rangle \) stores solutions which we want to find and \(\left| \Psi _{\mathrm{bad}}\right\rangle \) stores other values. Specifically, if we want to find the minimum, \(\left| \Psi _{\mathrm{good}}\right\rangle \) stores all values of database that are less than or equal to \(d_0\); \(\left| \Psi _{\mathrm{bad}}\right\rangle \) stores all values of database that are greater than \(d_0\), in contrast. Especially, when \(N=2^n\), the initial state is a uniform superposition state, the W operator becomes \(H^{\otimes n}\), where H is the Walsh–Hadamard transformation; n is the number of qubits. In this special case, the complexity of preparing the initial state is \(\log _2 N\) (i.e., the initial state can be prepared by \(\log _2 N\) H operators).

One Grover iteration G can be divided into four operators  [25].

$$\begin{aligned} G = -WI_0W^{-1}O \end{aligned}$$
(20)

where O is an oracle which performs a phase inversion on \(\left| \Psi _{\mathrm{good}}\right\rangle \); \(I_0\) is a conditional phase shift operator which performs a phase inversion on \(\left| 0\right\rangle \).

Grover–Long algorithm is done by replacing the phase inversion with an adjustable angle \(\phi \) phase rotation. The rotation angle is given as:

$$\begin{aligned} \phi =2 \mathrm{arcsin}\left( \frac{\sin \frac{\pi }{4J+2} }{\sin \beta } \right) \end{aligned}$$
(21)

where \(\sin \beta =\sqrt{\frac{M}{N}}\). Upon measurement in Jth iteration, one of marked states is obtained with zero failure rate.

$$\begin{aligned} J\ge \mathrm{floor}\left( \frac{\frac{\pi }{2}-\beta }{\beta }\right) +1 \end{aligned}$$
(22)

By utilizing the number of solutions M and the database size N, we can calculate the exact value of \(\beta \), \(\phi \), J. Grover–Long algorithm will find a solution with zero failure rate.

Appendix B: Theoretical analysis for the failure rate

In this section, we given the theoretical failure rate of Grover–Long algorithm and QESA, when M/N is unknown.

Firstly, we present a proof of Grover–Long algorithm’s failure rate \(\varepsilon _{\mathrm{GL}}\), when M is unknown. The performance is shown in Fig. 6. The initial quantum state is expressed as:

$$\begin{aligned} \left| \Psi \right\rangle = \left( \sqrt{ \frac{M}{N} } \left| \Psi _{\mathrm{good}}\right\rangle + \sqrt{ \frac{N-M}{N} } \left| \Psi _{\mathrm{bad}}\right\rangle \right) \end{aligned}$$
(23)

where \(\left| \Psi _{\mathrm{good}}\right\rangle \) includes M solutions. \(\left| \Psi _{\mathrm{bad}}\right\rangle \) includes \(N-M\) non-solutions. Each quantum state store a data value and their amplitude is expressed as \(\alpha _{\mathrm{good}}^{(0)}=\alpha _{\mathrm{bad}}^{(0)}=1/\sqrt{N}\), in the initial state. Otherwise, the amplitude will be 0, if no data value is stored.

Grover–Long algorithm is divided into 4 steps. The first step is the oracle operator. It makes solutions receive a phase shift \(\phi \):

$$\begin{aligned} O \left| \Psi \right\rangle = \left[ \begin{array}{c} {\mathrm{e}}^{i\phi } \quad \quad \\ \qquad 1 \end{array} \right] \left( \left| \Psi _{\mathrm{good}}\right\rangle + \left| \Psi _{\mathrm{bad}}\right\rangle \right) \end{aligned}$$
(24)

The steps (2), (3), (4) can be expressed as:

$$\begin{aligned} -W\left[ \left( {\mathrm{e}}^{i\phi }-1 \right) \left| 0\right\rangle \left\langle 0\right| \right] W^{-1} =\left( {\mathrm{e}}^{i\phi }-1 \right) \left| \Psi \right\rangle \left\langle \Psi \right| -I \end{aligned}$$
(25)

Therefore, Grover–Long algorithm can be expressed as:

$$\begin{aligned} G\left| \Psi \right\rangle \left\langle \Psi \right| = \left[ -\left( {\mathrm{e}}^{i\phi }-1 \right) \left| \Psi \right\rangle \left\langle \Psi \right| -I \right] \left( {\mathrm{e}}^{i\phi } \left| \Psi _{\mathrm{good}}\right\rangle +\left| \Psi _{\mathrm{bad}}\right\rangle \right) \end{aligned}$$
(26)

Because M/N is unknown in QUMMSA, we use the estimated value \(\widetilde{M} / \widetilde{N}\) to calculate the estimated parameters \(\widetilde{\beta }\), \(\widetilde{\phi }\), \(\widetilde{J}\) of Grover–Long algorithm. The gap between the exact parameters and the estimated parameters will lead the failure rate of Grover–Long algorithm. Meanwhile, it is noteworthy that all quantum states as less than or equal to \(d_0\) are marked, regardless of whether the quantum state stores a data value. Thus, \(\widetilde{M} \ge M\). Marking quantum states of 0 amplitude does not affect the iterative process. If the amplitude of a quantum state is 0, the amplitude will be still 0 after the amplitude amplification. Therefore, even if \(\widetilde{M} \ne M\), the oracle can still correctly mark the values in the database that are less than or equal to \(d_0\).

After G operator, we can get two results. For solutions, each quantum state’s amplitude \( \alpha _{\mathrm{good}}^{(j)}\) will be expressed as:

$$\begin{aligned} \alpha _{\mathrm{good}}^{(j)}= & {} -\alpha _{\mathrm{good}}^{(j-1)} \times \left( 1+ \frac{{\mathrm{e}}^{i \widetilde{\phi }}-1}{N} \right) - \alpha _{\mathrm{good}}^{(j-1)} (M-1) \times \frac{{\mathrm{e}}^{i \widetilde{\phi }}-1}{N} - \alpha _{\mathrm{bad}}^{(j-1)} \nonumber \\&\times (N-M) \times \frac{{\mathrm{e}}^{i \widetilde{\phi }}-1}{N} \end{aligned}$$
(27)

For non-solutions, each quantum state’s amplitude \( \alpha _{\mathrm{bad}}^{(j)}\) will be expressed as:

$$\begin{aligned} \alpha _{\mathrm{bad}}^{(j)}= & {} -\alpha _{\mathrm{bad}}^{(j-1)} \times \left( 1+ \frac{{\mathrm{e}}^{i \widetilde{\phi }}-1}{N} \right) - \alpha _{\mathrm{good}}^{(j-1)} \times M \times \frac{{\mathrm{e}}^{i \widetilde{\phi }}-1}{N} - \alpha _{\mathrm{bad}}^{(j-1)} \nonumber \\&\times (N-M-1) \times \frac{{\mathrm{e}}^{i \widetilde{\phi }}-1}{N} \end{aligned}$$
(28)

where j is the current number of Grover–Long iteration and \(j \in [1,\widetilde{J}]\).

The failure rate is expressed as:

$$\begin{aligned} \varepsilon _{\mathrm{GL}} = 1- \left| \alpha _{\mathrm{good}}^{\widetilde{J}} \right| ^{2} \times M \end{aligned}$$
(29)

Secondly, we present proof of QESA’s failure rate \(\varepsilon _{\mathrm{ESA}}\). Due to the unknown M, different number of Grover iterations is selected in different possibility in once QESA iteration. Specially, Ref  [15] set a parameter \(\lambda \in (1,4/3]\). The number of Grover iterations v is a random number which is selected from \([0,\lambda ^{t-1}]\) and rounds down where t is the current number of QESA iteration.

In the first QESA iteration.

$$\begin{aligned} \varepsilon _{\mathrm{ESA}}^{(1)}=1- \frac{M}{N} \end{aligned}$$
(30)

If the algorithm does not find a correct solution, it will run forever. Meanwhile, \(\varepsilon _{\mathrm{ESA}}^{(t)}\) is decreased with the increase of t.

$$\begin{aligned} \varepsilon _{\mathrm{ESA}}^{(t)}= & {} \varepsilon _{\mathrm{ESA}}^{(t-1)} \times \left\{ \lambda ^{-t+1} \left( 1-\frac{M}{N} \right) + \sum _{v=1}^{\mathrm{floor}\left( \lambda ^{t-1} \right) -1} \left[ \lambda ^{-t+1} \cos ^2 \left( (2v+1) \times \arcsin \sqrt{ \frac{M}{N}} \right) \right] \right. \nonumber \\&+\left. \left[ \lambda ^{t-1} -\mathrm{floor}\left( \lambda ^{t-1} \right) \right] \times \cos ^2 \left[ \left( 2 \times \mathrm{floor} \left( \lambda ^{t-1} \right) + 1 \right) \times \arcsin \sqrt{\frac{M}{N}} \right] \right\} \end{aligned}$$
(31)

If \(\lambda ^{t-1}>\sqrt{N}\), then \(\sqrt{N}\) will replace \(\lambda ^{t-1}\).

Proving the failure rates of the two algorithm not only provides theoretical support for our experiments, but also we can obtain the theoretical failure rate of the two algorithms, when they are applied to any database.

Appendix C: The parameters of IBM quantum superconducting processor

In this section, we present some parameters of IBM quantum superconducting processor. The schematic and topology of this processor are shown in Fig. 12a, b, respectively. Two co-planar waveguide (CPW) resonators, acting as quantum buses, provide the device control and readout. Entanglement in IBM system is achieved via CNOT gates, which use cross-resonance  [38, 39]. Single qubit rotation gate with an arbitrary angle and CNOT are as primitive operators. Single qubit gate and multi qubit gate error of different qubits are shown in Table 3.

Fig. 12
figure 12

5-qubit superconducting processor: a schematic; b topology

Table 3 The detail parameters of IBM quantum superconducting processor

Appendix D: Data sources

This section shows data source of the second demo. Complete data can be obtained on Kaggle website (https://www.kaggle.com/c/titanic/data). The complete data we use are listed in Table 4.

Table 4 Titanic passengers age (excerpt)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chen, Y., Wei, S., Gao, X. et al. A low failure rate quantum algorithm for searching maximum or minimum. Quantum Inf Process 19, 270 (2020). https://doi.org/10.1007/s11128-020-02773-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11128-020-02773-8

Keywords

Navigation