0% found this document useful (0 votes)
93 views

A Modification of Grover's Quantum Search Algorithm

We propose a quantum search method based on Grover’s algorithm. This algorithm is described and we show that to search for a single marked element from an unsorted search space of N elements, the number of queries are required using this algorithm O(N1/3)when compared to O(N1/2)for the Grover algorithm.

Uploaded by

SEP-Publisher
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

A Modification of Grover's Quantum Search Algorithm

We propose a quantum search method based on Grover’s algorithm. This algorithm is described and we show that to search for a single marked element from an unsorted search space of N elements, the number of queries are required using this algorithm O(N1/3)when compared to O(N1/2)for the Grover algorithm.

Uploaded by

SEP-Publisher
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Photonics and Optoelectronics P&O

P&O Volume 1, Issue 1 Apri 2012 PP. 20-24 www.jpo-journal.org

C World Academic Publishing


20
A Modification of Grovers Quantum Search
Algorithm
I. Ashraf
1
, T. Mahmood
2
, V. Lakshminarayanan
3

1
Department of Physics, Quaid-i-AzamUniversity
Islamabad, 45320, Pakistan

2
Department of Physics, Hazara University Mansehra, Pakistan
3
School of Optometry, Department of Physics and Electrical Engineering, University of Waterloo
200 University Avenue West, Waterloo, Ontario N2l 3G1Canada
1
[email protected];
2
[email protected];
3
[email protected]


Abstract-We propose a quantum search method based on
Grovers algorithm. This algorithm is described and we show
that to search for a single marked element from an unsorted
search space of N elements, the number of queries are required
using this algorithm when compared to for the
Grover algorithm.
Keywords-Quantum Search Algorithm; Grovers Technique;
Sub-register
I. INTRODUCTION
A computation is a physical process. It may be performed
by a piece of electronics, on an abacus, or in our brain. But it
is a process that takes place in nature and as such, it is subject
to the laws of physics. Application of principles of quantum
mechanics in the development of techniques for computation
and information processing has given birth to thescience of
quantum computation. According to Feynman [1], the
computers based on laws of quantummechanics instead of
classical physics could be used to model quantummechanical
systems and other large scale computations. Quantum
computers are machines that rely on quantumphenomena
such as quantuminterference and quantumentanglement in
order to performthe computation [2-4].
The quantum mechanically produced computers will
speedup certain computations dramatically. But one of the
main difficulties of quantumcomputers is that de-coherence
destroys the information in the superposition of states
contained in a quantum computer, thus making long
computations impossible. It has been shown [5] how to reduce
the effect of de-coherence for information stored in quantum
memory. Quantum computers offer an essential speed
advantage over classical computers [6]. Some recent reviews
[7, 8] have attempted to explain how a quantumcomputer
differs froma classical, conventional computer.
In order to solve a particular problem, computers, be it
classical ones or quantum, follow a precise set of instructions
called an algorithm. But the kinds of search algorithms that
can be run on a quantumcomputer are qualitatively different
fromthose that run on classical computers [9].
Over the past years, several quantum algorithms have
emerged. Some are exponentially faster than their best
classical counterparts [10]; others are polynomial-faster [11].
While a polynomial speed up less than we would like ideally,
quantumsearch has proven to be considerably more versatile
than the quantumalgorithms exhibiting exponential speedups.
In this paper we propose a fast quantumsearch algorithm
inspired by Grovers search algorithm[11]. It has shown that
using the same technique as Grovers algorithm but by
dividing the register with elements into
3
2
n
M
(
(

=
sub-registers, we can find a marked element in
( ) | |
( )
1
3
2 / 4 O N + steps instead of
( )
O N as in
Grovers algorithm.
The contents of this paper can be summarized as follows.
Section II describes the Grovers quantumsearch algorithm
for an unsorted database. In Sec. III, we give the details of our
fast quantumsearch algorithmbased on the idea of sub-
registers. In the last section, we will explain and discuss our
results.
II. GROVERS QUANTUM SEARCH ALGORITHM
Quantum mechanics can speed up range of search
applications over unsorted data. Consider a search problem
having an unsorted database containing N elements, out of
which just one element satisfies a given condition that it is
marked. The problemis to find this marked element. Once an
element is examined, it is possible to tell whether or not it
satisfies the condition in one-step. However, there do not exist
any sorting on the database that would aid its selection.
Classically, searching an unsorted database requires linear
search, i.e, examine the items in database one by one. One has
to keep track of the examined elements so that it is not
checked again. To find marked elements with a probability of
50% any classical algorithm, deterministic or probabilistic,
will need to access the database a minimumof 0.5 N times
(and N times in the worst case). Quantummechanical systems
can be in a superposition of states and simultaneously
examine multiple elements; therefore, it can speed up the
search. Grovers quantumsearch algorithmshows that by
using the same amount of hardware as in the classical case,
but having input and output in superposition of states, we can
find an element in
( )
O N quantum mechanical steps
instead of ( ) O N classical steps. It provides a quadratic
speedup over its classical counterpart, which is considerable
when N is large. Grovers algorithmis probabilistic in the
sense that it gives the correct answer with high probability.
III. MODIFIED QUANTUM SEARCH ALGORITHM
Photonics and Optoelectronics P&O
P&O Volume 1, Issue 1 Apri 2012 PP. 20-24 www.jpo-journal.org

C World Academic Publishing


21
Consider a search space D of 2
n
N = elements. If there is
a single marked element in this search space, we can find that
element by applying
( )
O N number of Grovers iteration
on D. Assume that there is no marked element in the search
space. A basic question arises. What will be the number of
oracle queries required to know about the absence of the
marked element in the search space? Before doing Grovers
iteration, we have to initialize the search space, that is, to
create equal superposition of states. It is done by applying the
Walsh- Hadamard operator H. For a single qubit, it is
represented by the following matrix:

1 1
1
1 1
2
H =

(
(

(1)
i.e., a bit in state 0 is transformed into a superposition in
two states:
( )
1 1
,
2 2
. Similarly a bit in state 1 is
transformed to
( )
1 1
,
2 2
; i.e., the magnitude of the
amplitude in each state is
1
2
, but the phase of amplitude
in the state 1 is inverted. For a search space of
dimension , we can perform H on each bit
independently in sequence thus changing the state of the
system. This superposition can be obtained
in ( ) log O N steps. The matrix representing this operation
will be of dimension 2
n
x 2
n
. If all n bits are in state 0 , the
resultant configuration will have identical amplitude of 2
-n/2
in
each of the 2
n
states. Now start with Grovers iteration:

0 ( ) 1
n n
f x
Q H R H R

=
=
(2)
Each quantummechanical step consists of an elementary
unitary operation. The phase transformation operator
0
R

,
rotates the state 00...0 by radians. For single qubit state,
it takes the form:

0
0
0 0
x
R x x

= +

(3)
While the function of phase rotation operator
( ) 1 f x
R

=
is
to rotate the marked element by a phase of radians and is
defined by
( )
( )
( ) 1
1
f x
f x
x
R x x

=
=

(4)
If there is no marked element, the phase rotation operator
is just an identity operator i.e.

( ) 1 f x
x
R x x I

=
= =

(5)
Grovers iteration reduces to

0
n n
Q H R H

= (6)
Now if we apply Q on the search space, with same
amplitude of all the elements, it has no effect and the search
space remains in an equal superposition of states. Hence it
may be concluded that by using a single query it can be found
whether the marked element is present or not in the search
space. Our fast quantumsearch algorithmis based on this
observation. In this algorithm, we split the main register into
small sub-registers. First we look for the sub-register that
contains the marked element by linear search method. Once
we find the sub-register containing the marked element, then
we have to apply Grovers iteration only on that sub-register
and as result we require less number of queries to reach the
desired element as compared to the Grovers original quantum
search algorithm.
In order to describe the operation of the algorithmwe first
introduce a register,
1 2
,
n
x x x x = , of n-qubits, and an
ancillary qubit, q .We also introduce a quantumoracle, a
unitary operator O. The oracle performs the following unitary
operation on computational basis states of the register 0 and
of the ancillary q . That is,
( ) O x q x q f x = (7)
Where denotes the addition modulo 2. The oracle
recognizes marked state in the sense that if x is a marked
element of the search space, ( ) f x =1, the oracle flips the
ancillary qubit from 0 to 1 and vice versa, while for
unmarked state the ancillary is unchanged. Thus, the only
effect of the oracle is to apply a phase of -1 if x is a marked
state and no phase change if x is unmarked.
A. The Algorithm
This algorithmcan be summarized as follows:
Inputs: 1- A black box oracle O, whose action is defined
by Eq. (7)
2- n +1 qubits in the state x 0
q
.
Output: 1- A candidate for a marked m .
B. Procedure
1-Initialize the system to the
superposition ( ) 1 ,1 , 1 N N N ; that is
amplitude of all states is same. It is done by applying
Hadamard gate to each qubit in the register, and the gate HX
to the ancilla, where X is the NOT-gate. The matrices are
written with respect to the computational basis
( )
0 , 1 .
The resulting state is

0 1
1
2
x
q
x
N
| |
|
\ .

(8)
Photonics and Optoelectronics P&O
P&O Volume 1, Issue 1 Apri 2012 PP. 20-24 www.jpo-journal.org

C World Academic Publishing


22
This superposition can be obtained in ( ) log O N steps.
2- Split the register
1 2
,
n
x x x x = into M numbers
of equal size sub-registers, such that
1 2
,
M
x y y y = .
3- Search the sub-register having the marked element. It is
done by applying Grovers iteration Eq. (1) on each sub-
register one by one. First, apply the Grovers iteration on sub-
register y
1
and select y
1
, if the amplitude of elements is
changed. Reject it if remains in equal superposition state.
Continue this process successively on the sub-registers of the
register x , until a sub-register is found in which the
amplitude of one element is changed. On average, selection of
desired sub-register requires 2 M oracle queries.
4-Apply Grovers iterations on the selected sub-register k
times, where
4
k N M

= and at this point the


probability of finding the marked state will be a maximum.
Now the total number of queries required to search the
marked state is given by

4 2
N M
k
M

= + (9)
5- Measure the selected sub-register in the computational
basis.
FromEq.(7), it is clear that in step-2 the precise number of
sub-registers is important. Table 1 shows the required number
of queries, for different numbers of sub-registers and for
different sizes of registers.
TABLE I NUMBER OF QUERIES REQUIRED FOR DIFFERENT SIZED REGISTERS
AND NUMBER OF SUB-REGISTERS (SEE TEXT FOR DETAILS)

Analysis shows that required numbers of queries are
minimum for the number of sub-registers
3
2
n
M
(

= ,
where, | |
/3 n is the smallest integer value. Hence, each sub-
register will be consisting of elements
3
2
n n (

.
Now Eq. (9) takes the form

3
3
2
4 2 2
n
n
N
k

(

(

= + (10)
As 2
n
N = , so

( )
3
1
3
3
2 2
4 2 4 2
n
n
N
k N

(

(

+
= + = (11)
The above relation gives good results if the number of
qubits n in the search space is a multiple of 3. There is little
discrepancy in the result when n is not multiple of 3. It is due
to the fact that we take smallest integer value of
3
n (

in
selecting the number of sub-registers. This discrepancy can be
removed by introducing a factor in the Eq. (11) that is

( )
13 2
4
k N


+
= (12)
Analysis shows that the value of is
0.9943027 = for 1,4,7,10, n =
1.0144727 = for 2,5,8,11, n =
Hence, our Algorithmrequires fewer queries as compared
to Grovers algorithm, a comparison that is illustrated in Fig.
(1).

Fig. 1 Performance of Grovers algorithmand the one described in this paper
A comparison of Grovers algorithmand our modified
algorithmis given below:
GROVERS ALGORITH
1
Search Space of dimensions 2
n
N =
2
Register with n-qubits:
1 2
,
n
x x x x =
3 Prepare the initial state by applying Walsh-Hadamard operator in
( ) log O N steps
4
Apply Grovers Iteration
0 ( ) 1
n n
f x
Q H R H R

=
= to find
marked element
5
4
k N

= number of total queries needed to find marked


element
6 Measure the final state
MODIFIED ALGORITH
1
Search Space of dimensions 2
n
N =
Photonics and Optoelectronics P&O
P&O Volume 1, Issue 1 Apri 2012 PP. 20-24 www.jpo-journal.org

C World Academic Publishing


23
2
Register with n-qubits:
1 2
,
n
x x x x =
3 Prepare the initial state by applying Walsh-Hadamard operator in
( ) log O N steps
4
Split the register in
3
2
n
M
(

= numbers of sub-registers:

1 2
,
M
x y y y =

5
Each sub-register will have
3
2
n n (

number of elements
6
Apply Grovers iteration
0 ( ) 1
n n
f x
Q H R H R

=
= on each
sub-register
7
2 M number of queries needed to find the sub-register with
marked element
8
Apply Grovers iteration
0 ( ) 1
n n
f x
Q H R H R

=
= to the
selected sub-register
4
k N M

= times
9
( )
1
3
2
4
k N
+
= number of total queries needed to find
marked element
10 Measure the selected sub-register
IV. RESULTS AND DISCUSSION
Consider a search space of dimension N=2
n
. In order to
find the marked element one needs
( )
O N number of
queries, in its exact form
4
N

queries. Now if we divide


the register in M numbers of sub- registers, one of the sub
register will have a marked element. If for example there is no
marked element, the Phase Rotation Operator will just be an
identity operator, application of Grover's iteration will have
no effect, and search space will remain in an equal
superposition of states. But if we have a marked element only
one application of Grovers iteration, on M sub-registers, will
allow us identify the sub-register having the marked element.
Because only the sub-register has marked element, the Phase
rotation operator will change the phase of marked state by
and one application of Grovers iteration will increase the
amplitude of marked state. This process is like a linear search,
and on average by M/2 queries we can identify the sub-
register with the marked element. Now we have to apply
Grovers iteration only on the selected sub-register
4
N M

times. It is found that the required numbers of


queries are a minimumif the number of sub-registers is
3
2
n (

,
where [n/3] is the smallest integer value. It can be explained
with the help of Table 1. The first column of the table shows
number of sub-register from2
1
to 2
8
, while first row indicates
the size of register, which starts from2
9
to 2
20
, all other rows
show the number of queries required for different sizes of the
register. In the fourth row, for the number of sub- register
equal to 2
3
, number of queries are 10.28 for size of register
2
9
, 12.88 for 2
10
and 16.56 for 2
11
, second, third and forth
columns respectively. These are the minimumvalues for the
sizes of the register. The size of register 2
9
means n=9 which
implies M=9/3 =3, while n=10 means M=10/3= 3.33 and
similarly for n=11. For n=12 we get M=12/3=4 and one can
see fromforth row, for sub register M=2
4
, that number of
queries are minimumfor size of register 2
12
, 2
13
and 2
14
, given
in columns 5, 6 and 7, respectively. These minimumqueries
terms are highlighted with * as a superscript on each term.
Hence, we can say if the number of n is a multiple of 3, then
we get accurate result; but if it is not a multiple, then there is a
little discrepancy which is removed by introducing a factor of
in Eq. (12).
V. CONCLUSIONS
We studied the effect of Grovers iteration on a search
space, with same amplitude of all elements concluding that by
using a single query it can be known whether marked element
is present or not in the search space. Based on this finding, we
have proposed a fast quantumsearch algorithm. It has been
shown that by using the same technique as Grovers algorithm
but dividing the register with N elements into M sub-
registers, we can find a marked element in
( )
( )
1
3
2 / 4 O N + (

steps instead of
( )
O N as in
Grovers algorithm.
REFERENCES
[1] R. P. Feynman, Int.J. Theor. Phys. 21, 467-488 (1982).
[2] A. Elitzur and L. Vaidman, Found. Phys. 23, 987-997 (1993).
[3] D. P. Divincenzo, Science, 270, 255-261 (1995).
[4] V. Sahni and V. Lakshminarayanan, Quantum Information Science,
Tata McGraw Hill, New Delhi, (2010).
[5] P.W. Shor, Phys. Rev. A 52, 2493-2496, (1995).
[6] A. Barenco, quant-ph/9612014, (1996).
[7] L.K. Grover, Am. J. Phys. 69, 769-777 (2001).
[8] N.D. Mermin, Am. J. Phys. 71, 23-30 (2003).
[9] L.K. Grover, in Proceedings of the Twenty-Eight Annual Symposium
on the Theory of Computing, Philadelphia, Pennsylvania (ACM Press,
New York) 212-218, (1996).
[10] P.W. Shor, in proceedings of the Symposiumon the foundations of
Computer Science, 1994, Los Alamitos, California (IEEE Computer
Society Press, New York) 124-134, (1994).
[11] L.K. Grover, Phys. Rev. Lett. 79(2), 235-243, (1997).

Imrana Asharf is working as an Associate
Professor at the Department of Physics, Quaid -i-
Azam Uuniversity, Islamabad. She has done her
PhD in the field of QuantumOptics. The title of her
thesis is QUANTUM THEORY OF THE TWO-
PHOTON MICROMASER AND LASER . She is
winner of ICO/ICTP Prize for year 2004. She is a
regular visitor of ICTP and has been a Regular
Associate at ICTP from2000 -2008 and recently
awarded Senior Associate-ship at ICTP fromyear
2012 to 2017. Frompast many years she is actively
involved in Preparatory school to the Winter College on Optics at ICTP. Her
area of interest is QuantumOptics, Atomoptics and QuantumInformation.

Mr. Tariq Mahmood has done his M.Phil under
the supervision of Dr. Imrana Ashraf from
Department of Physics, Quaid-i-Azam University,
Islamabad Pakistan. Titleof his Thesis is STUDY
OF GROVERS QUANTUM SEARCH
ALGORITHM. He has permanent position at
Department of Physics, Hazara University
Mansehra, Pakistan, as Lecturer since April, 2006.
Presently he is enrolled as PhD student in the
Institute of Theoretical Physics, Leibniz University
Hannover Germany. His area of research is:
QuantumAlgorithms, QuantumChannels, QuantumCryptography.


Photonics and Optoelectronics P&O
P&O Volume 1, Issue 1 Apri 2012 PP. 20-24 www.jpo-journal.org

C World Academic Publishing


24
V. Lakshminaryanan is currently a full professor
of optometry (vision science), physics and
electrical and computer engineering at the
University of Waterloo. He is also an associate of
the Michigan Center for Theoretical Physics at Ann
Arbor. He has held research/ teaching positions at
the University of California at Berkeley and Irvine
campuses as well as the University of Missouri. He
has been a KITP Scholar at the Kavli institute for Theoretical Physics at Santa
Barbara.



































































He is a fellow of the American Physical Society, American Association for
the Advancement of Science, Optical Society of America, SPIE-The
international society for optical engineering, etc. He has received numerous
awards and honors, most recently the Educator award fromSPIE and the
Optics medal fromthe Optical Society of India. He is currently a topical
editor or section editor for Optics Letters, J ournal of Modern Optics, and
American J ournal of Bioengineering. He has published widely in areas
ranging from biomedical engineering, quantum chemistry, vision science,
ophthalmology as well as optical physics.

You might also like