A Modification of Grover's Quantum Search Algorithm
A Modification of Grover's Quantum Search Algorithm
(
(
(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
= + (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
= 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