Efficient Quantum Algorithm for the Parity Problem of a Certain Function
Koji Nagata, Tadao Nakamura, Josep Batle & Ahmed Farouk
International Journal of Theoretical Physics ISSN 0020-7748 Int J Theor Phys DOI 10.1007/s10773-018-3827-y
1 23
Your article is protected by copyright and all rights are held exclusively by Springer Science+Business Media, LLC, part of Springer Nature. This e-offprint is for personal use only and shall not be self-archived in electronic repositories. If you wish to selfarchive your article, please use the accepted manuscript version for posting on your own website. You may further deposit the accepted manuscript version in any repository, provided it is only made publicly available 12 months after official publication or later and provided acknowledgement is given to the original source of publication and a link is inserted to the published article on Springer's website. The link must be accompanied by the following text: "The final publication is available at link.springer.com”.
1 23
Author's personal copy Int J Theor Phys https://doi.org/10.1007/s10773-018-3827-y
Efficient Quantum Algorithm for the Parity Problem of a Certain Function Koji Nagata1 · Tadao Nakamura2 · Josep Batle3 · Ahmed Farouk4
Received: 11 February 2018 / Accepted: 10 July 2018 © Springer Science+Business Media, LLC, part of Springer Nature 2018
Abstract Based on a particular mathematical structure of a certain function f (x) under our attention, we present a novel quantum algorithm. The algorithm allows one to determine the property of a certain function. In our study, it is f (x) = f (−x). Therefore, there would be a question here, “How fast can we succeed in this?” All we need to do is only the evaluation N
of a single quantum state | 0, 0, . . . , 0, 1 (N ≥ 2). Only using that with a little amount of information, we can derive the global property f (x) = f (−x). Our quantum algorithm overcomes a classical counterpart by a factor of the order of 2N . Keywords Quantum algorithms · Quantum computation
1 Introduction The advent of quantum information theory [1–5] leads to exciting new developments that are either superior to classical approaches or have no classical counterpart, such as quantum cryptographic key distribution [6], quantum teleportation [7], superdense coding [8], and
Koji Nagata
ko mi
[email protected] 1
Department of Physics, Korea Advanced Institute of Science and Technology, Daejeon 34141, Korea
2
Department of Information and Computer Science, Keio University, 3-14-1 Hiyoshi, Kohoku-ku, Yokohama 223-8522, Japan
3
Departament de F´ısica, Universitat de les Illes Balears, 07122 Palma de Mallorca, Balearic Islands, Spain
4
Department of Physics and Computer Science, Faculty of Science, Wilfrid Laurier University, Waterloo, Canada
Author's personal copy Int J Theor Phys
quantum computation [9, 10]. In particular, in the last of these cases, the combination of quantum correlation and the quantum superposition principle challenges the very concept of an algorithm as a sequence of deterministic orders a` la Turing. This is because the underlying hypotheses of algorithms as conventionally understood rely implicitly on the laws of classical physics. In fact, as Feynman [11] first suggests, computational devices behaving according to quantum mechanics could be qualitatively more powerful than classical computers. Bernstein and Vazirani [12, 13] are among the first to show (in 1993, although David Deutsch [14] introduced the Deutsch–Turing thesis earlier, in 1985) that a quantum Turing machine would be capable of simulating quantum mechanical systems in polynomial time, which constitutes an exponential improvement on classical approaches. Later, quantum algorithms developed by Shor [15] and Grover [16] provide a strong motivation for exploring the computational possibilities offered by quantum mechanics. The crucial ingredients in these algorithms, namely, amplitude amplification in the case of quantum search and phase estimation in the case of quantum factorization, are important elements that are common to many current quantum algorithms [3, 17, 18]. Many other quantum algorithms are developed since Feynman’s insight, notably the Deutsch–Jozsa algorithm [19, 20], its variations, and extensions. For instance, the Deutsch– Jozsa algorithm can be used for quantum key distribution [21] and for secure quantum key distribution based on the use of an entangled state [22]. Additionally, a method of secure quantum cryptography based on the Deutsch–Jozsa algorithm is proposed by Nagata et al. [23]. The ultimate goal of quantum algorithms is to provide results superior to those achievable by their classical counterparts, preferably with an exponential advantage. It is our aim here to introduce a new quantum algorithm that determines whether or not a function f (·) is even, i.e., f (x) = f (−x). We shall determine the number of steps required (how fast we can reach the answer). As we shall see, all we need is to evaluate the outcome N
of the measurement of the state | 0, 0, . . . , 0, 1, with N ≥ 2. As far as the speed-up is concerned, we shall prove that the algorithm is superior to its classical counterpart by an exponential factor O(2N ).
2 Quantum Algorithms are Determining the Property of a Certain Function In this section, we discuss a certain significant characteristic of quantum algorithms. Let us suppose that we are given the following function f : {−(2N − 1), −(2N − 2), . . . , 2N − 2, 2N − 1} → {0, 1, . . . , 2N − 2, 2N − 1}.
(1)
Assume that f (y) ≥ 0. Introduce a function g(x) that transforms binary strings into an integer. Define g −1 (f (g(x))) = F (x). The construction of F (x) is independent of the choice of the function g. Assume such a function F (x)(= g −1 (f (g(x)))) and such a function g indeed exist, for example to make precise, choose the function g such that for any string x = (xN , . . . , x0 ), g(x) = xN 2N + · · · + x1 21 + x0 . This function g is invertible and g −1 converts the integer x = xN 2N + · · · + x1 21 + x0 back to the bit-string (xN , . . . , x1 , x0 ). y = g(x) is the integer representation of the binary string x. For example, x = (1, 1) if
Author's personal copy Int J Theor Phys
y = 3. We shall assume, for the time being, that the given function is even. Thus, we have F (x) = F (−x) ∈ {0, 1}N x ∈ {0, 1}N .
(2)
We will see that the condition (2) holds in the quantum algorithm. What the function f (x) does in (1) is to map a set of discrete values onto another one. In (2), we assume that x is the binary representation of one element. x will be given by a N
binary string belonging to the Cartesian product {0, 1} × {0, 1} × . . . × {0, 1}, for instance, x = (0, 1, 1, 0, 0, 1, . . . , 1). We then define −x as −(0, 1, 1, 0, 0, 1, . . . , 1). Throughout the discussion, we will omit any normalization factor. Let us define | − x = −|x. The input state is N
N
|ψ1 = | 0, 0, . . . , 0, 1| 1, 1, . . . , 1.
(3)
The function F is evaluated by using the following unitary 2N -qubit gate UF : |x, z → |x, z + F (x)
(4)
with UF :
|x, z → |x, z + F (x) ⇔ −|x, z → −|x, z + F (x) ⇔ | − x, z → | − x, z + F (x) ⇔ | − x, z → | − x, z + F (−x)
(5)
and employing the fact that F (x) = F (−x). Here, z + F (x) = (z1 ⊕ F1 (x), z2 ⊕ F2 (x), . . . , zN ⊕ FN (x)) (the symbol ⊕ indicates addition modulo 2). We have the following fact N
N
UF | 0, 0, ..., 0, 1| 1, 1, ..., 1 N
= | 0, 0, ..., 0, 1|F (0, 0, ..., 0, 1).
(6)
Here, for example, if we have F (0, 0, ..., 0, 1) = (0, 1, 1, 0, 0, 1, . . . , 1), then F (0, 0, ..., 0, 1) = (1, 0, 0, 1, 1, 0, . . . , 0). From the definition in (5), we have N
UF |x| 1, 1, ..., 1 = |x|F (x).
(7)
This implies for x → −x, with x = 0 N
UF | − x| 1, 1, ..., 1 = | − x|F (−x).
(8)
We state that | − x = −|x. Then it follows that the minus sign on left and right hand side of (8) drop off. This implies N
UF |x| 1, 1, ..., 1 = |x|F (−x).
(9)
We furthermore assume such that |P = |Q ⇔ P = Q.
(10)
Author's personal copy Int J Theor Phys
Comparing (7) with (9) we see |F (x) = |F (−x). Hence, we cannot avoid the following property of the function in order to maintain consistency for the fundamental relation (6) F (x) = F (−x).
(11)
That is, the function under study is even F (x) = F (−x).
(12)
3 Efficient Quantum Algorithm for the Parity Problem of a Function We aim to determine whether f (−y) = f (y), i.e., to check the parity of the function. We shall assume that N ≥ 2 and f (y) ≥ 0. Classically, we have to evaluate 2N terms of the function to ascertain its parity, i.e., we need 2N calls or steps. However, we shall see that we require just a single query in the quantum case presented here. Let us follow the evolution of a quantum state through the main algorithm. The basic ingredient that we will employ to obtain a quantum speed-up is the superposition principle. The state |ψ1 (3) can be decomposed as follows N
−2
N
2 −1 |x| 1, 1, . . . , 1 + |x| 1, 1, . . . , 1. N
x=−(2N −1)
(13)
x=+1
Now, y = g(x) is the integer representation of the binary string x. For example, if y = 3, then we have x = (1, 1). Let us start the main algorithm from the following UF |ψ1 = |ψ2 −2
=
|x|F (x) +
x=−(2N −1)
N −1 2
|x|F (x).
(14)
x=+1
Hence we have |ψ2 =
=
−2
|x|F (x) +
x=−(2N −1)
x=+1
N −1 2
N −1 2
| − x|F (−x) +
x=+2
=
N −1 2
N −1 2
x=+2
|x|F (x)
|x|F (x)
x=+1
| − x|F (x) +
N −1 2
|x|F (x)
x=+1
= |0, 0, . . . , 0, 1|F (0, 0, . . . , 0, 1)
(15)
where F (x) = F (−x). Given the decomposition of |ψ1 as (13), in (14) we apply the unitary gate UF and obtain |ψ2 . What the relation (15) implies is that the unitary gate UF does indeed work and the function is even. If the function is not even or the unitary gate UF does not work, then we shall not get the result (15).
Author's personal copy Int J Theor Phys
Finally, we shall measure the first N -qubit state of the state |ψ2 . If we obtain the state |0, 0, . . . , 0, 1, then we can retrieve the parity of the function, F (x) = F (−x)
(16)
F (x) = F (−x).
(17)
or, equivalently,
If this is the case, then our algorithm works, because we can check the condition (2) in a straightforward manner. All we have to do is perform a single quantum measurement. Let us suppose that the outcome of our unique measurement is different, say |0, 0, . . . , 1, 0. Then, the parity of the function is not even (F (x) = F (−x)) or the unitary gate UF does not work correctly. In more detail, we cannot have N
N
UF | 0, 0, . . . , 0, 1| 1, 1, . . . , 1 N
= | 0, 0, . . . , 0, 1|F (0, 0, . . . , 0, 1)
(18)
when the condition F (x) = F (−x) does not hold or the unitary gate UF does not work correctly. Let us briefly summarize the requirements of our algorithm N
• • •
All we need to do is measure | 0, 0, . . . , 0, 1. Then, we can determine the parity of the function, f (y) = f (−y), for numbers y = 1. We have to check f (1) = f (−1).
If we proceed as before, our quantum algorithm is superior to its classical counterpart by a factor O(2N ). We introduce a new algorithm that determines whether or not a given function f (x) is even, and we show that it is superior to its classical counterpart by a factor O(2N ). In other words, we introduce a new type of algorithm that achieves an exponential speed-up over the best available classical algorithm. Although the preparation of the input state and the construction of the concomitant global unitary gate UF are not considered here, we believe that our results are meaningful, since they introduce a simple, new quantum algorithm that outperforms a simple classical task.
4 Conclusions and Discussions In conclusion, we have discussed a certain significant characteristic of quantum algorithms. Based on a particular mathematical structure of a function f (x) under our attention, we have presented a novel quantum algorithm. The algorithm has allowed one to determine the property of a function. In our study, it has been f (x) = f (−x). Therefore, there would have been a question here, “How fast can we succeed in this?” All we need to do has been only N
the evaluation of a single quantum state, | 0, 0, . . . , 0, 1 (N ≥ 2). Only using that with a little amount of information, we can have derived the global property f (x) = f (−x). Our quantum algorithm has overcome a classical counterpart by a factor of the order of 2N .
Author's personal copy Int J Theor Phys
1.
Quantum computer determines a function. The property of a function, is that it transforms an element from the domain into an element of the codomain. 2. So x in the domain, y = f (x), in the codomain. 3. The property of the “quantum determined function”, call it g, is as close as possible to the function itself. 4. So if |g(x) − f (x)| is less than epsilon, a small real number, then quantum computing determines a function close to f (x). We may say: Quantum algorithms are determining the property of a certain function when the property is close, as much as possible, to the one for the evaluation of the function. Acknowledgments
We thank Professor Han Geurdes for valuable discussions.
References 1. Lo, H.-K., Popescu, S., Spiller, T. (eds.): Introduction to Quantum Computation and Information. World Scientific, Singapore (1998) 2. Galindo, A., Mart´ın-Delgado, M.A.: Rev. Mod Phys. 74, 347 (2002) 3. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2000) 4. Williams, C.P., Clearwater, S.H.: Explorations in Quantum Computing. Springer, New York (1997) 5. Williams, C.P. (ed.): Quantum Computing and Quantum Communications. Springer, Berlin (1998) 6. Ekert, A.K.: Phys. Rev. Lett. 67, 661 (1991) 7. Bennett, C.H., Brassard, G., Crepeau, C., Jozsa, R., Peres, A., Wootters, W.K.: Phys. Rev. Lett. 70, 1895 (1993) 8. Bennett, C.H., Wiesner, S.J.: Phys. Rev. Lett. 69, 2881 (1993) 9. Ekert, A., Jozsa, R.: Rev. Mod. Phys. 68, 773 (1996) 10. Berman, G.P., Doolen, G.D., Mainieri, R., Tsifrinovich, I.: Introduction to Quantum Computers. World Scientific, Singapore (1998) 11. Feynman, R.: Int. J. Theor. Phys. 21, 467 (1982) 12. Bernstein, E., Vazirani, U.: Proceedings of 25th Annual ACM Symposium on Theory of Computing (STOC ’93), pp. 11. https://doi.org/10.1145/167088.167097 (1993) 13. Bernstein, E., Vazirani, U.: SIAM J. Comput. 26, 1411 (1997) 14. Deutsch, D.: Proc. R. Soc. Lond. A 400, 97 (1985) 15. Shor, P.W.: Proceedings of 35th IEEE Annual Symposium on Foundations of Computer Science, pp. 124 (1994) 16. Grover, L.K.: Proceedings of 28th Annual ACM Symposium on Theory of Computing, pp. 212 (1996) 17. Smith, J., Mosca, M.: Handbook of natural computing, pp. 1451 (2012) 18. Childs, A.M., Van Dam, W.: Rev. Mod. Phys. 82, 1 (2010) 19. Deutsch, D., Jozsa, R.: Proc. R. Soc. Lond. A 439, 553 (1992) 20. Cleve, R., Ekert, A., Macchiavello, C., Mosca, M.: Proc. R. Soc. Lond. A 454, 339 (1998) 21. Nagata, K., Nakamura, T.: Open Access Libr. J. 2, e1798 (2015) 22. Nagata, K., Nakamura, T.: Int. J. Theor. Phys. 56, 2086 (2017) 23. Nagata, K., Nakamura, T., Farouk, A.: Int. J. Theor. Phys. 56, 2887 (2017)