Generalization of Quantum Search Algorithm M.Sc. Project Report submitted to Indian Institute of Technology Bombay in partial fulfillment of the requirements for the degree of Master of Science in Physics By Debasis Sadhukhan M.Sc. Student Roll No.: 10512029 Under the Guidance of : Prof. T. A. Tulsi Department of Physics Indian Institute of Technology Bombay Mumbai 400076, India April 2012 PROJECT CERTIFICATE This is to certify that the Project work ‘Generalization of Quantum Search Algorithm’ is done under my supervision at Department of Physics, IIT Bombay by Debasis Sadhukhan (Roll No.- 10512029) in Spring Semester, 2012 has been found satisfactory. This report had not been submitted for any other examination and does not form a part of any other course undergone by the candidate. ····················· Signature Project Supervisor Prof. T. A. Tulsi Department of Physics IIT Bombay, Mumbai, India Date: i Acceptance Certificate ··········································································· Department of Physics, Indian Institute of Technology Bombay This M.Sc. project report entitled ‘Generalization of Quantum Search Algorithm’ submitted by Debasis Sadhukhan (Roll No-10512029) may be accepted. Date: ····················· Signature Project Supervisor Date: ····················· Signature Examinar Date: ····················· Signature Chairman ii Declaration I, hereby, declare that this written submission represents my ideas in my own words and where other ideas and words have been included; I have adequately cited and referenced the original sources. I also declare that I have adhered to all principles of academic honesty and integrity and have not mispresented or fabricated or falsified any idea/data/fact/source in my submission. I understand that any violation of the above will be cause for disciplinary action by the institute and can also evoke penal action from the sources which have thus not been properly cited or from whom proper permission has not been taken when needed. ····················· Signature Debasis Sadhukhan M.Sc. Student Department of Physics IIT Bombay, Mumbai, India Date: iii Acknowledgments At first and foremost I would like to express my sincere gratitude and humble respect to my project guide Prof. T. A. Tulsi for his valuable guidance and encouragement throughout my work. I am thankful to Prof. Apoorva Patel (CQIQC, Indian Institute of Science, Bangalore) from whom I learnt the some advanced topics of Quantum algorithms, that remains very useful in this project. I want take this opportunity to thank Prof. Dipan K. Ghosh (IIT Bombay) for his excellent instruction in the course ‘Introduction to Quantum Information and Computing’ that remains very useful for the entire project. It’s my pleasure to thank Dr. Aditi Sen (De) (QIC, Harish Chandra Research Institute, Allahabad) who introduced me to the fascinating field of quantum computation and motivated me to take up this project. I also wish to acknowledge the continuous supports of my friend Gyanendra Singh who remains very helpful throughout my project. iv Abstract Grover’s quantum search algorithm is an important landmark discovery in the area of quantum computing. Basically, it drives a quantum computer from a known initial state (source state) to an unknown final state (target state) by using selective phase inversions of these states. The algorithm is simply a successive iteration of the Grover’s search operator, which is a product of selective inversion operators of source and target states. In this project, we wish to generalize the concept of Grover’s search operator. In its original form, Grover’s operator performs the selective inversions only on a unique source state and a unique target state. In our generalized version, we make our search operator to perform selective inversions on more than one source and target states. First, we find that the case of selective inversions of two source and two target states can be easily analyzed somewhat similar to the case of Grover’s algorithm. But unlike Grover’s operator, the selective inversions of three source and three target states is not so easy to study analytically and hence we perform numerical calculations on some specific cases. We find that these generalized search operators also give us a successful quantum search as expected. v Contents Declaration iii Acknowledgments iv Abstract v 1 Introduction and Overview 1.1 Quantum Algorithms . . . . . . . . . . . . . . . . . . . . . . . 1.2 Overview of the thesis . . . . . . . . . . . . . . . . . . . . . . 1 1 3 2 Quantum Search Algorithm 2.1 The Database and the Classical Search . . . . . . . . 2.2 Grover’s Quantum Search Algorithm . . . . . . . . . 2.2.1 Mathematical Description of Quantum Search Problem . . . . . . . . . . . . . . . . . . . . . 2.2.2 The Grover’s Search Operator . . . . . . . . . 2.2.3 Geometric Visualization . . . . . . . . . . . . 2.2.4 Example . . . . . . . . . . . . . . . . . . . . . 2.2.5 Limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 5 . . . . . 5 6 7 8 9 . . . . . . . . . . . . . . . . . . . . 3 Generalized Quantum Search Operator: Selective Inversions of Two States 3.1 Formulation of the problem . . . . . . . . . . . . . . . . . . . 3.1.1 Analysis with specific example . . . . . . . . . . . . . . 3.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 10 11 16 4 Generalized Quantum Search Operator: Selective Inversion of Three States 17 4.1 Formulation of the problem . . . . . . . . . . . . . . . . . . . 17 vi 4.2 4.3 4.1.1 Analysis . . . . . . . 4.1.2 Numerical Simulation Example . . . . . . . . . . . 4.2.1 Example-1 . . . . . . 4.2.2 Example-2 . . . . . . 4.2.3 Example-3 . . . . . . 4.2.4 Example-4 . . . . . . Summery . . . . . . . . . . . . . . . . . . vii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 21 22 22 26 28 29 30 List of Tables 4.1 4.2 4.3 Result for the 512 different values of fij . . . . Data for optimal no of iteration for different n Data for optimal no of iteration for different n state |t1 i , |t1 i and |t3 i . . . . . . . . . . . . . . viii . . . . for . . . . . . . . . 22 . . . . . . . 25 the target . . . . . . . 27 List of Figures 2.1 2.2 2.3 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 A practical demonstration for the superiority of the quantum search over the classical search. . . . . . . . . . . . . . . . . . Geometric visualization of the Grover’s operator G = −Is It . . Final result after 5 Grover’s iteration. . . . . . . . . . . . . . . The variation of amplitude of |t2 i with the number of iteration for n = 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . The variation of amplitude of |t1 i with the number of iteration for n = 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . The variation of amplitude of target |t1 i with the number of iteration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . n vs. log2 p plot . . . . . . . . . . . . . . . . . . . . . . . . . The variation of amplitude of |t1 i with the number of iteration for n = 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . The variation of amplitude of |t2 i with the number of iteration for n = 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . The variation of amplitude of target states with the number of iteration. . . . . . . . . . . . . . . . . . . . . . . . . . . . The variation of amplitude of target state with the number of iteration for n = 16 . . . . . . . . . . . . . . . . . . . . . . . ix 5 7 8 . 23 . 24 . 24 . 25 . 26 . 27 . 28 . 29 Chapter 1 Introduction and Overview Quantum computation is a new paradigm created by reformulating information and computation in a quantum mechanical framework. One of the main motivation in the pursuit for quantum computation is the promising possibility that quantum algorithm can be more efficient than their classical counterpart. Quantum mechanics provides us useful computational resources that can be used to accelerate classical algorithms. Problems, that are considered to be hard to solve in a classical computer, can be solved efficiently with a polynomial or exponential quantum speed-up with the help of quantum computation. 1.1 Quantum Algorithms An algorithm is a well-defined procedure or a set of instructions to perform a information processing task and a computer is a physical device that helps in information processing. A computer requires a physical system that consists of some initial state, some final state, and some interaction in between, to execute an information processing task. Here, the initial state is the input, the final state is the output and interaction represents the appropriate logic operations to execute the algorithm[1]. Development in theoretical computer science are mostly based on the “particle-like” discrete digital framework. The prediction of Moore’s law[2] 1 and the shirking size of the elementary components in a chip suggests us that the computer technology will inevitably encounter the dynamics of atomic scale[3, 4]. We must apply the laws of quantum mechanics to analyze the computational framework because quantum objects are both “particle-like” and “wave-like”. Here, the superposition principle allows not only the discrete eigenstates that forms the Hilbert space basis, but also the simultaneous existence of multiple components. And that is where the advantage quantum algorithm lies. A quantum algorithm is nothing but an algorithm that uses quantum mechanical principles at the time of its execution1 . The superiority of quantum algorithm lies in the parallelism, gained from the superposition of quantum states. This allows a quantum algorithm to exploit an exponentially large number of quantum components using only polynomial resources. For example, a uniform superposition of 2n quantum components can be created using only n qubits and n rotations. ⊗n |0i −→ |0i + |1i √ 2 ⊗n −n/2 =2 n −1 2X |ii (1.1) i=0 So, a single execution of a quantum algorithm can take 2n superposed inputs to 2n superposed outputs and that is how a single quantum instruction applied to a superposed state processes all the quantum components together, resulting in a exponential advantage over the classical algorithms. In recent years, a lot of research effort has been given to discover quantum solution of those problems whose classical solution is in class NP (non-deterministic polynomial), while the quantum solution would be in class P (polynomial). But since our intuition lies in the classical world, it is hard to design a quantum algorithm. Also, one need to make sure that the new algorithm must be more efficient than the existing classical ones2 . That is why so less number of quantum algorithms has been discovered so far. As of now there are only two main class of quantum algorithm. One is 1 Note that, execution of a quantum algorithm requires a quantum computer. The full exponential advantage provided by the quantum superposition can not be always used to make the quantum solution to be exponentially faster than the classical one. 2 2 Shor’s algorithm for factoring large integers[5], based on an exponentially faster quantum Fourier transform to the period finding problem. And the other is Grover’s algorithm for searching an object in an unsorted database[6], which provides a quadratic speed-up. 1.2 Overview of the thesis In this thesis, we have studied further generalization of Grover’s search algorithm. Grover’s quantum search algorithm is an important landmark discovery in the area of quantum computing. Basically, it drives a quantum computer from a known initial state (source state) to an unknown final state (target state) by using selective phase inversions of these states. The algorithm is simply a successive iteration of the Grover’s search operator, which is a product of selective inversion operators of source and target states. In this project, we wish to generalize the concept of Grover’s search operator. In its original form, Grover’s operator performs the selective inversions only on a unique source state and a unique target state. In our generalized version, we make our search operator to perform selective inversions on more than one source and target states. First, we find that the case of selective inversions of two source and two target states can be easily analyzed somewhat similar to the case of Grover’s algorithm. But unlike Grover’s operator, the selective inversions of three source and three target states is not so easy to study analytically and hence we perform numerical calculations on some specific cases. We find that these generalized search operators also give us a successful quantum search as expected. 3 Chapter 2 Quantum Search Algorithm The problem of database search is to find an item with the desired properties from the collection. A search operator needs a oracle like that search for a specific items with the desired properties by checking every items with desired items in the database. An efficient search process is the one which can locate the desired item in the database using the least application of oracles. 2.1 The Database and the Classical Search A database is nothing but a collection of items. Suppose we have a database consists of N words. Now, we want to search for a specific word say “Computation”. To do that we have to go through every word and check whether this is “Computation” or not. To solve this problem, a classical computer would need N/2 database queries on average, and in the worst case it would need N − 1 queries. Now, if the word Computation occurs M N ) trial to succeed with times, then it is easy to show that we require O( M classical algorithm because any randomly chosen word will be Computation with the probability M/N . For M = 1, we require O(N ) trial to succeed. 4 2.2 Grover’s Quantum Search Algorithm Now, is it possible to improve the search algorithm? In the classical search we have an implicit assumption that we can search only one item at a time. But, we can overcome this limitation if we use quantum dynamics. In a quantum algorithm one can inspect many (even all) items in a quarry if we work with a superposition of states. Lov Grover first uses this superposition feature of quantum dynamics and discovered the optimal quantum search algorithm[6], which is quadratically faster that the classical search. Figure 2.1: A practical demonstration for the superiority of the quantum search over the classical search. 2.2.1 Mathematical Description of Quantum Search Problem The database is a set of N (= 2n ) items labeled by an index j. The database contains M solutions, where 1 ≤ M ≤ N . From now and onwards 5 we will call our solution to be target(t). Now, we define a binary function f (i), such that, f (i) = 1 =0 f or f or i=t i 6= t (2.1) Now, assume that we have a quantum oracle1 that will do the operation, specified by the function f (i). Uf : |ii |qi → |ii |q ⊕ f (i)i (2.2) where, |ii is the index register, ⊕ denotes addition modulo 2, |qi is the ancilla qubit, which is flipped if f (i) = 1 and is unchanged otherwise. Notice that, if we construct |qi such that |qif lipped = − |qi, then when f (i) = 1, we can write |qi = (−1)f (i) |qi. An example of such |qi will be |0i−|1i √ . The action of the oracle is then: 2 Uf : |ii |0i − |1i |0i − |1i √ = (−1)f (i) |ii √ 2 2 (2.3) Notice the ancilla bits remains unchanged. So, we can drop that part. So, the oracle may be written as: Uf : |ii = (−1)f (i) |ii 2.2.2 (2.4) The Grover’s Search Operator Consider a quantum system with an N-dimensional Hilbert space, whose basis states |ji , j 0, 1, · · · , N − 1, encode the N items. The target state |ji corresponds to the target item, while all other basis states are non-target states.To demonstrate the above operation, we begin our initial state with the uniform superposition of all states. n |ψi = 2 −1 1 X 2n/2 1 |ji (2.5) j=0 Oracle is a black box that will perform some operation, but we don’t know it’s internal hardware working principal. 6 So, one can write the uniform superposition to be, r r N −1 M N −M 1 X |ti + |t⊥ i |ψi = √ |ji = N N N j=0 (2.6) We will now define a unitary operator G = −Is It , such that, It : 1 − 2 |ti ht| Is : 1 − 2 |si hs| 2.2.3 (2.7) (2.8) Geometric Visualization Let us start with the uniform superposition of all the n qubit states i.e. |si. We will describe our two dimensional sub-space in terms of two orthogonal basis out of which one is parallel to |ti and the other is perpendicular to |ti i.e. along |t⊥ i. Figure 2.2: Geometric visualization of the Grover’s operator G = −Is It . Let us assume |si makes angle θ with |t⊥ i. After operation of It , the component of |si along |ti get flipped. So, It |si makes an angle 2θ with |si. Now, (−Is ) will flip the component perpendicular to |si. So, (−Is It ) |si will now make an angle 3θ with |t⊥ i. So, in one iteration we move an angle 2θ towards our desired state |ti. 7 Let’a say, after m iteration we will get our solution |ti, so π m(2θ) = − θ 2 π 1 So, m= − 4θ 2 (2.9) q Now, from figure 2.2, we can see that , cos( π2 − θ) = sin θ = hs| ti = N1 for q one solution and M for M solution. In general, N is very large compared N to M . So, we can assume that sin θ ≈ θ. Thus, no of iteration required is : r N 1 =O (2.10) m=O θ M 2.2.4 Example With a database of total√ 49 items and 1 target item, number of Grover’s iteration required = π4 ∗ 49 − 21 = 4.9977 ≈ 5. So, after 5 iteration we will Figure 2.3: Final result after 5 Grover’s iteration. get the target state with almost 100% probability. 8 2.2.5 Limitation For a problem with database size N and M target state,we have seen that we get a quadratic speed qupover the classical counterpart using the quantum N search i.e. we need O trials. Notice that if we do not know the exact M number of solutions i.e. M , we may may not reach to our desired solution state as no of iteration explicitly depend on M . To overcome this problem, we first need to estimate the no of solution in our database. By combining the phase estimation technique with the Grover’s algorithm we can count the no of solution state in our database. By estimating the the eigenvalues of the Grover’s iteration G, we can determine the no of solution M. It is easy to see that the result depends only on | ht| si | and not on ht| si. The phases of various components of |si can therefore be arbitrary[1]. The quantum algorithm for searching an unsorted database does not assume any specific structure or pattern as far as the input data are concerned. This makes it highly versatile with broad utility. The algorithm can be applied, either in full or in part, in the quantum solutions of a variety of problems such as square-root speed-up of solutions to NP-complete problems, finding mean and median of statistical distributions, locating minimum of a function, quantum counting, deciphering cryptographic codes, etc[7]. 9 Chapter 3 Generalized Quantum Search Operator: Selective Inversions of Two States 3.1 Formulation of the problem Grover’s search operator has been generalized in several ways ( see [8] and references therein). In this chapter, we generalize it to the case when the search operator involves the selective phase inversions of two source states and two target states. Mathematically, the search operator discussed in this chapter is, G2 = −Is1 ,s2 It1 ,t2 (3.1) where, Is1 ,s2 = 1 − 2 |s1 i hs1 | − 2 |s2 i hs2 | It1 ,t2 = 1 − 2 |t1 i ht1 | − 2 |t2 i ht2 | (3.2) Here, |t1 i , |t2 i are the basis states of the Hilbert space of dimension N, where N is taken to be 2n . |s1 i , |s2 i are the superposition of all the possible state in the search space. We can generate the source state with the WalshHadamard transform on any possible state1 in the 2n dimensional Hilbert 1 that corresponds to a particular item in the search space 10 space. So, |s1 i = W |j1 i = H ⊗n |j1 i ; |s2 i = W |j2 i = H ⊗n |j2 i ; (3.3) (3.4) Since, |t1 i, |t2 i and |j1 i, |j2 i are the basis states of our N dimensional Hilbert space, we can say, by the property of Walsh-Hadamard transform 1 hsi | tj i = (−1)fij √ N (3.5) where fij is either 0 or 1 and i, j runs from 1 to 2. In this chapter, for simplicity we have removed the subscript G2 and used G instead of G2 . 3.1.1 Analysis with specific example Let us take a specific example with f11 = f12 = f21 = 0 and f22 = 1. So, 1 1 1 1 hs1 | t1 i = √ , hs1 | t2 i = √ , hs2 | t1 i = √ , hs2 | t2 i = − √ , N N N N (3.6) Since, the operator (G = −Is It ) involves only |s1 i , |s2 i , |t1 i and |t2 i, we can predict that this operator must preserves at most a 4 dimensional subspace. First, we need construct a four dimensional orthonormal basis to analyze the operation of the generalized Grover’s operator for two source state and two target state. So, we want to write the operator G in the 4 dimensional subspace confined by the orthonormal basis vectors |t⊥1 i , |t⊥2 i , |t1 i and |t2 i . First, we define, 1 |s01 i = √ |s1 i + |s2 i 2 1 |s02 i = √ |s1 i − |s2 i 2 11 (3.7) So, ht1 | s01 i = q 2 N and ht2 | s02 i = q 2 . N To make |t⊥1 i and |t⊥2 i to be perpendicular to |t1 i and |t2 i respectively, we have taken |t⊥1 i and |t⊥2 i to be, q |s01 i − N2 |t1 i q |t⊥1 i = (3.8) 2 1− N q |s02 i − N2 |t2 i q |t⊥2 i = (3.9) 2 1− N So, |t⊥1 i, |t⊥2 i along with |t1 i and |t2 i forms a orthonormal basis. Now, since |t⊥1 i is perpendicular to |t1 i and |t2 i , It1 ,t2 can not make any change when applied on |t⊥1 i. So, r 2 1 0 |t1 i |s1 i − Is1 ,s2 It1 ,t2 |t⊥1 i = Is1 ,s2 q N 1 − N2 r r r r r 1 2 2 1 2 1 0 =q |t1 i + 2 |s1 i + +2 |s2 i − |s1 i − N N N N N 2 1− N r 1 4 2 0 =q − 1 |s1 i − |t1 i (3.10) N N 2 1− N We can now find out all the matrix element of the Grover’s operator G, in the orthonormal subspace, So, G11 = ht⊥1 | Is1 ,s2 It1 ,t2 |t⊥1 i 4 r 2 r 2 4 1 2 2 = −1 − − −1 + N N N N N N 1 − N2 4 = −1 N Similarly, it is very easy to show that, G21 = ht⊥2 | Is1 ,s2 It1 ,t2 |t⊥1 i = 0 and G41 = ht2 | Is1 ,s2 It1 ,t2 |t⊥1 i = 0. 12 Also, G31 = ht1 | Is1 ,s2 It1 ,t2 |t⊥1 i r r 2 4 1 2 −1 − =q N N N 1 − N2 r r 2 2 = −2 1− N N Similarly, r 2 |t2 i Is1 ,s2 It1 ,t2 |t⊥2 i = Is1 ,s2 q − N 1 − N2 r 1 2 4 0 =q − 1 |s2 i − |t2 i N N 1− 2 1 |s02 i (3.11) N So, G12 = ht⊥1 | Is1 ,s2 It1 ,t2 |t⊥2 i = 0 and G32 = ht1 | Is1 ,s2 It1 ,t2 |t⊥2 i = 0. Now, similarly one can show that, 4 − 1, Nr r 2 2 = ht2 | Is1 ,s2 It1 ,t2 |t⊥2 i = −2 1− N N G22 = ht⊥2 | Is1 ,s2 It1 ,t2 |t⊥2 i = & G42 Also, h i Is1 ,s2 It1 ,t2 |t1 i = Is1 ,s2 − |t1 i r h = − |t1 i − 2 2 0 i |s i N 1 So, r G13 = ht⊥1 | Is1 ,s2 It1 ,t2 |t1 i = 2 & G33 = ht1 | Is1 ,s2 It1 ,t2 |t1 i = 2 N 4 −1 N 13 r 1− 2 ; N (3.12) Also, G23 = ht⊥1 | Is1 ,s2 It1 ,t2 |t2 i = 0; & G43 = ht1 | Is1 ,s2 It1 ,t2 |t2 i = 0 it is easy to show that G14 = G34 = 0 and G24 = −G42 = q qSimilarly, 2 2 2 N 1 − N & G44 = N4 − 1. Now, the total matrix G in the new basis can be written as, q q −1 + N4 0 2 N2 1 − N2 0 q q 0 2 N2 1 − 0 −1 + N4 q q G≡ −2 N2 1 − N2 0 −1 + N4 0 q q 0 −2 N2 1 − N2 0 −1 + N4 2 N (3.13) Now, since actually G = (−Is1 ,s2 It1 ,t2 ), we should write, considering the phase factors q q 2 2 4 0 −2 N 1 − N 0 1− N q q 0 1 − N4 0 −2 N2 1 − N2 q q G≡ 2 2 4 2 N 1 − N 0 1− N 0 q q 0 2 N2 1 − N2 0 1 − N4 (3.14) Which is equivalent to cos θ 0 − sin θ 0 0 cos θ 0 − sin θ G≡ (3.15) sin θ 0 cos θ 0 0 sin θ 0 cos θ q q −1 4 −1 where, θ = cos (1 − N ) = sin (2 N2 1 − N2 ). Generally, N is very large, so θ will be very small, for these case. The eigenvalues for this matrix G will be e±iθ , e±iθ . So, we have got only one θ, instead of θ1 and θ2 2 . That means 2 Our expected eigenvalues was e±θ1 and e±θ2 14 the iteration is same in both the |t⊥1 i − |t1 i and |t⊥2 i − |t2 i search space. Now, we can see that the matrix G can be analyzed by the two disjoint matrices while the first matrix belongs to |t1 i − |t⊥1 i search space and the other belongs to |t2 i − |t⊥2 i search space. So, for the |t⊥1 i − |t1 i search space and |t⊥2 i − |t2 i search space, we have G1 and G2 respectively, cos θ − sin θ cos θ − sin θ G1 ≡ ; G2 ≡ (3.16) sin θ cos θ sin θ cos θ Result Notice that, for these case we can effectively reduce the search problem with two initial state and two target state, to two identical canonical Grover’s search problem with one initial state[6, 7]. Similarly, for other combinations of hsi | tj i(except all positive or all negative), one can use a similar treatment and can effectively reduce the problem with two Grover’s search problem[6]. Analysis for all hsi | tj i to be positive or negative: For all the hsi | tj i to be positive or negative, we have, r hs1 | t1 i = hs1 | t2 i = hs2 | t1 i = hs2 | t2 i = 1 N (3.17) We choose, 1 |s+ i = √ |s1 i + |s2 i 2 1 |s− i = √ |s1 i − |s2 i 2 (3.18) (3.19) (3.20) Now, one can see that |s− i is perpendicular to both |t1 i & |t2 i. Since |s− i is perpendicular to |t1 i , |t2 i , |s+ i, the search operator does not induce any coupling between these states and |s− i. Then the search problem effectively reduces to the conventional Grover’s search problem where we have one unique source states |s+ i and multiple target sates |t1 i and |t2 i 15 3.2 Summary In the analysis of the above mentioned search problem with two source state, our result can be classified in two main category: 1. For any arbitrary combination of hsi | tj i(except all positive or all negative), we can reduce the problem into two Grover’s search problem in two different subspace, confined by |t⊥1 i − |t1 i and |t⊥2 i − |t2 i. 2. If all the hsi | tj i are positive or negative, then the problem is nothing but a Grover’s search problem which can be analyzed in conventional |t⊥ i − |ti basis. But, we have checked with numerical simulation, that if we have two source state but more than two target state, we may get two different θ, depending upon the situation. 16 Chapter 4 Generalized Quantum Search Operator: Selective Inversion of Three States 4.1 Formulation of the problem Similar to the last case, here also, we assume each source state to be N (= 2n ) dimensional in the 2n dimensional Hilbert space. Firstly, we are interested in finding out the dimension of the subspace that is preserved under the new generalized Grover’s iteration G3 for the three source states and three target states. Let us first take three source state to be |s1 i , |s2 i and |s3 i, that can be generated by a similar treatment as presented in equation 3.4. |s1 i = W |j1 i = H ⊗n |j1 i ; |s2 i = W |j2 i = H ⊗n |j2 i ; |s3 i = W |j3 i = H ⊗n |j3 i (4.1) (4.2) (4.3) |t1 i, |t2 i , |t3 i and |j1 i, |j2 i , |j3 i are the basis states of our N dimensional Hilbert space. Since the source states are the Walsh-Hadamard transform of 17 the elements of the search space, we must have, 1 hsi | tj i = (−1)fij √ N (4.4) where fij is either 0 or 1 and i, j runs from 1 to 3. Similar to the previous case, we have defined the search operator to be Is1 ,s2 ,s3 = 1 − 2 |s1 i hs1 | − 2 |s2 i hs2 | − 2 |s2 i hs3 | It1 ,t2 ,t3 = 1 − 2 |t1 i ht1 | − 2 |t2 i ht2 | − 2 |t3 i ht3 | & G3 = Is1 ,s2 ,s3 It1 ,t2 ,t3 (4.5) (4.6) Since G3 involves 3 source state and 3 target state, we can intuitively say that the search operator G3 must confined to at most 6 dimensional vector space. In this chapter, for simplicity we have removed the subscript G3 and used G instead of G3 . 4.1.1 Analysis To find out the dimension of the subspace to be conserved under the generalized Grover’s iteration, we have simulated the search operation numerically with n = 5, i.e. in a 32 dimensional vector space. We can write the generalized Grover’s operator to be, G = W Ij1 ,j2 ,j3 W It1 ,t2 ,t3 (4.7) Here, W represent the Walsh-Hadamard transform and j1 , j2 , j3 are the wave functions corresponding to 3 different components of the search space. [Refer equation 3.4] After constructing the matrix G numerically, we search out the eigenvalues of G. After considering different values of j1 , j2 , j3 and t1 , t2 , t3 randomly, 18 we found that we can have at most 3 pairs of different eigenvalues in the eiθ form and all the other eigenvalues are one. So, we can conclude that the generalized search operator preserves at most a 6 dimensional vector space. So, we can write G in a 6 dimensional vector space. Similar to the previous case, we need to find the generalized search operator G for 3 source states in a orthonormal basis constructed from |s1 i , |s2 i , |s3 i and |t1 i , |t2 i , |t3 i. Now, in this case, it is very difficult to find orthonormal vectors in a similar manner like the previous case. So, we have used the Gram-Schmidt orthogonalization to construct a orthonormal basis from |s1 i , |s2 i & |s3 i. Notice that,hsi | tj i = htj | si i = (−1)fij √1N . So, |s01 i = |s1 i − ht1 | s1 i |t1 i − ht2 | s1 i |t2 i − ht3 | s1 i |t3 i (−1)f11 (−1)f12 (−1)f13 |t1 i − √ |t2 i − √ |t3 i = |s1 i − √ N N N Since, hs01 | s01 i = 1 − |t⊥1 i = q 1 1− h 3 N 3 , N (4.8) we define the first basis to be i (−1)f11 (−1)f12 (−1)f13 |s1 i − √ |t1 i − √ |t2 i − √ |t3 i N N N (4.9) Now, for the second basis, we find |s02 i = |s2 i − ht1 | s2 i |t1 i − ht2 | s2 i |t2 i − ht3 | s2 i |t3 i − ht⊥1 | s2 i |t⊥1 i (−1)f22 (−1)f23 (−1)f21 |t1 i − √ |t2 i − √ |t3 i = |s2 i − √ N N N h i 1 (−1)f11 +f21 + (−1)f12 +f22 + (−1)f13 +f23 |t⊥1 i + q N 1 − N3 (4.10) Now, 2 hs02 | s02 i = 1− N3 1 − N 2 (1− 3 ) N h i2 f11 +f21 f12 +f22 f13 +f23 (−1) +(−1) +(−1) = a (say). 19 So, the second orthonormal basis will be, " (−1)f22 (−1)f23 1 (−1)f21 |t1 i − √ |t2 i − √ |t3 i |t⊥2 i = |s2 i − √ a N N N # i h 1 + q (−1)f11 +f21 + (−1)f12 +f22 + (−1)f13 +f23 |t⊥1 i 3 N 1− N (4.11) Similarly, the third basis can be constructed as , |s03 i = |s3 i − ht1 | s3 i |t1 i − ht2 | s3 i |t2 i − ht3 | s3 i |t3 i − ht⊥1 | s3 i |t⊥1 i − ht⊥2 | s3 i |t⊥2 i So, the third orthonormal basis will be " 1 (−1)f31 (−1)f32 (−1)f33 |t⊥3 i = |s3 i − √ |t1 i − √ |t2 i − √ |t3 i b N N N h i 1 (−1)f11 +f31 + (−1)f12 +f32 + (−1)f13 +f33 |t⊥1 i + q N 1 − N3 1 h 1 (−1)f21 +f31 + (−1)f22 +f32 + (−1)f23 +f33 + (−1)f11 +f31 + 3 aN N (1 − N ) # i + (−1)f12 +f32 + (−1)f13 +f33 (−1)f11 +f21 + (−1)f12 +f22 + (−1)f13 +f23 |t⊥2 i (4.12) where b = p ht⊥3 | t⊥3 i Now, we want to find out the generalized grover operator G in the new basis, constructed by |t⊥1 i , |t⊥2 i , |t⊥3 i and |t1 i , |t2 i , |t3 i. For, this we first need to write the initial states |s1 i , |s2 i , |s3 i in the new orthonormal basis and then we will find out the unitary form of the matrix G in the new orthonormal basis using equation 4.5. h So, the initial states in |t⊥1 i will be, |t⊥2 i 20 |t⊥3 i |t1 i |t2 i |t3 i iT basis q h i 1 f11 +f21 f12 +f22 f13 +f23 3 √ − (−1) + (−1) + (−1) 1− N N 2 −3N a 0 0 0 f f11 ; |s i = |s1 i = (−1) 21 (−1) √ √N 2 N (−1)f12 f22 (−1) √ √ N N f (−1)f13 √ N (−1) 23 √ N (4.13) and h i − √N 21−3N (−1)f11 +f31 + (−1)f12 +f32 + (−1)f13 +f33 c b f |s3 i = (−1) 31 √ N (−1)f32 √ N f (4.14) (−1) 33 √ N where, 1 h (−1)f21 +f31 + (−1)f22 +f32 + (−1)f23 +f33 aN N (−1)f11 +f31 + (−1)f12 +f32 + (−1)f13 +f33 + 2 (N − 3N ) i (−1)f11 +f21 + (−1)f12 +f22 + (−1)f13 +f23 c=− 4.1.2 Numerical Simulation Our goal is to construct the matrix G using equation 4.5, 4.13 and 4.14. But, it is very laborious to construct and analyze the generalized operator G analytically for all the possible values of fij . That is why we have simulated 21 the matrix numerically for all the possible values of fij . Since i, j runs from 1 to 3, there will be a total of 9 different fij and each fij can have only two possible values i.e. 0 and 1. So, there will be a total of 29 = 512 cases for different values of fij . For all the 512 cases we have simulated the matrix G and found out the eigenvalues for each cases. We found that, Table 4.1: Result for the 512 different values of fij Case type Eigenvalue form 3 different θ 2 different θ 1θ e±iθ1 , e±iθ2 , e±iθ3 2 pairs of e±iθ1 , e±iθ2 3 pairs of e±iθ1 No. of cases 284 228 0 We also found out the eigenvectors for each cases. 4.2 Example For the next part, we want to find out the no of iteration needed to search out the target states with a significantly large probability. For that, we took some specific examples and analyze the results. 4.2.1 Example-1 For the first example, we have chosen, f11 = 1, f12 = 0, f13 = 1, f21 = 0, f22 = 1, f23 = 0, f31 = 1, f32 = 0, f33 = 1. For this combination, we found out that there will be 2 pairs of different eigenvalues of the matrix G, out of them 4 are same(1, i.e. e0 ) and the other pair is (e±.023 ). Now we have taken n = 16 i.e. the search space is 216 = 65536 dimensional. We applied the search operator on the source states and want to find out the variation of the amplitude of the target states with the number of 22 iteration. The plot of the amplitude of the target state |t2 i with the number of iteration is shown in Figure 4.1. Figure 4.1: The variation of amplitude of |t2 i with the number of iteration for n = 16 So, we can see from Figure 4.1 that the amplitude is maximum(0.5774) near the 67th iteration. Also, for target state |t1 i and |t3 i the result is exactly same to the Figure 4.1. So, if we started with three source state, we will be able to find out the target states with a probability of 0.57742 = 31 . Next, we repeat the problem with n = 24 i.e. N = 16777216. Plotting the amplitude of the target state |t1 i with the number of iteration, we got Figure 4.2. We found the maximum amplitude is 0.5774 and it is near to 1072th iteration. Here also for |t2 i and |t3 i, we got the same figure. Now for n = 28 i.e. N = 228 and for n = 32 i.e. N = 232 we got Figure 4.3a and Figure 4.3b , respectively. For n = 28, we found the maximum amplitude(0.5774) at 4289th iteration where as for n = 32 we got the maximum 23 Figure 4.2: The variation of amplitude of |t1 i with the number of iteration for n = 24 (a) n = 28 (b) n = 32 Figure 4.3: The variation of amplitude of target |t1 i with the number of iteration. 24 amplitude(0.5774) near about 17000th iteration. Notice that the maximum amplitude does not vary with the variation of n. So, the maximum amplitude that we got after optimal iterations does not depend on the dimension of the search space. In the Table 4.2, we have listed the optimal no of iteration for different n. Table 4.2: Data for optimal no of iteration for different n n 12 16 20 24 28 Optimal no of iteration(p) log2 (p) 17 67 268 1072 4289 4.087 6.066 8.066 10.066 12.066 Now, if we plot n vs. log2 p, we got a straight line shown in Fig 4.4. Figure 4.4: n vs. log2 p plot 25 From the plot, we got the formula n = 2 log2 p + 3.868. So, √ p=2 4.2.2 n −1.934 2 = N 21.934 (4.15) Example-2 For the second example, we have chosen, f11 = 1, f12 = 1, f13 = 0, f21 = 0, f22 = 1, f23 = 1, f31 = 0, f32 = 0, f33 = 1 .For this combination, we have three different pairs of eigenvalues - two complex ((e±0.7 , e±1.146 ) and one real(1 i.e. e0 ). Now, again, for n = 16, we want to see the variation of the amplitudes of the target states with the number of iteration. The plot for the amplitude of |t1 i with the number of iteration is shown in Figure 4.5. Figure 4.5: The variation of amplitude of |t1 i with the number of iteration for n = 16 26 So, we can see that the maximum amplitude is 0.6916 and it occurs in the 81th iteration. Now, for the target states |t3 i, we got the same result. But for the target state |t2 i, the variation of the amplitude of |t2 i is shown in Figure 4.6 where the maximum amplitude is 0.9573 and it occurs in 118th iteration. Figure 4.6: The variation of amplitude of |t2 i with the number of iteration for n = 16 Similarly, plotting the same graph for different n, we got the results listed in Table 4.3. Table 4.3: Data for optimal no of iteration for different n for the target state |t1 i , |t1 i and |t3 i . For |t1 i & |t3 i Optimal no of iteration(p) log2 (p) n 12 16 20 24 28 20 81 323 1291 5164 4.334 6.339 8.335 10.334 12.334 For |t2 i Optimal no of iteration(p) log2 (p) 29 118 472 1880 7660 Plotting this data, we got the results shown in Figure 4.7a and 4.7b. 27 4.882 6.882 8.882 10.882 12.882 (a) For |t1 i & |t3 i (b) For |t2 i Figure 4.7: The variation of amplitude of target states with the number of iteration. Now, from this results, we got the following relations of p and n. √ 2n/2 N p = 1.666 = 1.666 2 2√ n/2 2 N p = 1.118 = 1.118 2 2 (4.16) (4.17) Here, for target state |t1 i & |t3 i we got Equation 4.16 and for |t2 i we got Equation 4.17. Notice that here also the maximum amplitude does not vary with the dimension of the search space. So, for the both cases, the maximum amplitude is not a function of the dimension of the search space. 4.2.3 Example-3 For the third example, we have chosen, f11 = 1, f12 = 1, f13 = 1, f21 = 1, f22 = 1, f23 = 0, f31 = 1, f32 = 0, f33 = 1. For this combination, we have 28 two same and one different pair of eigenvalues (two e±0.8938 and e±4.46 ). For n = 16, plotting the amplitude variation with the no of iteration, we got Figure 4.8, same for all the target states. For this case, we got the maximum amplitude to be 0.9185, occurring at 108th iteration. Figure 4.8: The variation of amplitude of target state with the number of iteration for n = 16 4.2.4 Example-4 For the fourth example, we have chosen, f11 = 1, f12 = 0, f13 = 0, f21 = 1, f22 = 1, f23 = 0, f31 = 1, f32 = 1, f33 = 0 . For this combination, we have three different pairs of eigenvalues - two complex (e±0.7 , e±1.146 ) and one real (1 i.e. e0 ). For n = 16, plotting the amplitude variation with the no of iteration, we got Figure 4.5, same for |t1 i & |t3 i target states and Figure 4.6, same for |t2 i target states. So, this case is very similar to the Example-2. 29 4.3 Summery It is clear that for the three source problem, the results can be distributed in two main category. One is for three different pairs of eigenvalues and the other is for two different and one same pair of eigenvalue. For every cases we have got that the maximum amplitude of the target states is independent of the dimension of the search space. Now, for the first case, there is only two different pairs of eigenvalue. For this we got same amplitude after optimal number of iteration for all the three target states. For the first optimal no of iteration(67) we got each target states with a probability of 0.57742 ≈ 31 . By analyzing the result, we got that the probability of √ getting the target states will be nearly equal to 1, if we repeat the process 3 times. For example, for√n = 16, we will get the the target states with almost 100% probability after 3 ∗ 67 ≈ 116 number of iteration, which is clearly in agreement with the canonical Grover’s search algorithm’s results1 [6, 7]. For the second case, analyzing the numerical result, we got that the amplitude of target states |t1 i & |t2 i after the optimal number of iteration(81) is 0.6916. So, we will get the target state with 0.69162 = 0.4783 ≈ 12 . So, we √ have to repeat the process 2 times√to get nearly 100% probability. That means for this we need the iteration 2 ∗ 81 ≈ 114.55 times. For the target state |t2 i, we can see that the maximum amplitude is very near to 1 and it occurs after 118th iteration. So, here also we found that both the results are in agreement with the results obtained for canonical Grover’s search[6]. Since there are only two types of cases for three initial state, the result for example-3 and example 4 are very similar to the previous cases. Example-3 is very to example-1, since it has two same and one different pair of eigenvalues and example-4 is also similar to example-2 since it has three different pair of eigenvalues. So, for each cases, we have analyzed, we found that the number of iteration required to get the target states with almost 100% probability is the same as the time taken by the canonical Grover’s search operator. 1 For canonical Grover’s algorithm, optimal number of iteration = 30 π 4 ∗ 28 √ 3 ≈ 116 References [1] A. Patel, Quantum Algorithms: Database Search and its Variations, Physics News 40 (October 2010) 33-44, arXiv:quant-ph/1102.2058. [2] G. E. Moore, Cramming more components onto integrated circuits, Electronics, Volume 38, Number 8, (April 19, 1965). [3] R.P. Feynman, Feynman Lectures on Computation, Eds. A.J.G. Hey and R.W. Allen, (Perseus Books, 1996). [4] Feynman and Computation: Exploring the Limits of Computers, Ed. A.J.G. Hey, (Perseus Books, 1999). [5] P. Shor, Polynomial-time Algorithms for Prime Factorisation and Discrete Logarithms on a Quantum Computer, SIAM J. Comp. 26 (1997) 1484, arXiv:quant-ph/9508027. [6] L.K. Grover, A Fast Quantum Mechanical Algorithm for Database Search, Proceedings of the 28th Annual ACM Symposium on Theory of Computing, Philadelphia (1996), p.212, arXiv:quant-ph/9605043. [7] M.A. Nielsen and I.L. Chuang, Quantum Computation and Quantum Information, (Cambridge University Press, 2000). [8] Tulsi, Avatar, General framework for quantum search algorithms. arXiv:quant-ph/0806.1257 31
© Copyright 2026 Paperzz