# Arbitrary Phase Rotation of the Marked State Can not Be Used for Grover’s Quantum Search Algorithm

## Abstract

A misunderstanding that an arbitrary phase rotation of the marked state together with the inversion about average operation in Grover’s search algorithm can be used to construct a (less efficient) quantum search algorithm is cleared. The $`\pi `$ rotation of the phase of the marked state is not only the choice for efficiency, but also vital in Grover’s quantum search algorithm. The results also show that Grover’s quantum search algorithm is robust.

Grover’s quantum search algorithm is one of the most important development in quantum computation. It achieves quadratic speedup in searching a marked state in an unordered list over classical search algorithms. As the algorithm involves only simple operations, it is easy to implement in experiment. By now, it has been realized in NMR quantum computers. Benett et al  have shown that no quantum algorithm can solve the search problem in less than $`O\sqrt{N}`$ steps. Boyer et al  have given analytical expressions for the amplitude of the states in Grover’s search algorithm and given tight bounds. Zalka has improved this tight bounds and showed that Grover’s algorithm is optimal. Zalka also proposed an improvement on Grover’s algorithm. In another development, Biron et al generalized Grover’s algorithm to an arbitrarily distributed initial state. Pati recast the algorithm in geometric language and studied the bounds on the algorithm.

In each iteration of the Grover’s search algorithm, there are two steps: 1) a selective inversion of the amplitude of the marked state, which is a phase rotation of $`\pi `$ of the marked state; 2) an inversion about the average of the amplitudes of all basis states. This second step can be realized by two Hadamard-Walsh transformations and an rotation of $`\pi `$ of the all basis states different from $`|0`$. Grover’s search algorithm is a series of rotations in an SU(2) space span by $`|n_0`$, the marked state and $`|c=\frac{1}{\sqrt{N1}}_{nn_0}|n`$. Each iteration rotates the state vector of the quantum computer system an angle $`\psi =2\mathrm{arcsin}\frac{1}{\sqrt{N}}`$ towards the $`|n_0`$ basis of the SU(2) space. Grover further showed that the Hadamard-Walsh transformation can be replaced by almost any unitary transformation. The inversions of the amplitudes can be instead rotated by arbitrary phases. It is believed that if one rotates the phases of the states arbitrarily, the resulting transformation is still a rotation of the state vector of the quantum computer towards the $`|n_0`$ basis in the SU(2) space. But the angle of rotation is smaller than $`\psi `$. From the consideration of efficiency, the phase rotation of $`\pi `$ should be adopted. This fact has been used to the advantage by Zalka recently to improve the efficiency of the quantum search algorithm. According to the proposal, the inversion of the amplitude of the marked state in step 1 is replaced by a rotation through an angle between 0 and $`\pi `$ to produce a smaller angle of SU(2) rotation towards the end of a quantum search calculation so that the amplitude of the marked state in the computer system state vector is exactly 1.

In this Letter, we show by explicit construction that the above concept is actually wrong. When the rotation of the phase of the marked state is not $`\pi `$, one can simply not construct a quantum search algorithm at all. Suppose the initial state of the quantum computer is

$`|\varphi =B_0|n_0+A_0{\displaystyle \frac{1}{\sqrt{N1}}}{\displaystyle \underset{nn_0}{}}|n.`$ (1)   
The modified quantum search algorithm now consists of the following two steps: 1) $`|n_0e^{i\theta }|n_0`$; 2) an inversion about the average operation $`D`$, whose matrix elements are:

$`D_{ij}=\{\begin{array}{cc}\frac{2}{N},\hfill & ij\hfill \\ \frac{2}{N}1,\hfill & i=j\hfill \end{array}`$ (4)   
After each iteration of the modified Grover’s quantum search, the state vector still has the form of (1). The recurrent formula for the amplitudes are

$`B_{j+1}`$ $`=`$ $`{\displaystyle \frac{N2}{N}}e^{i\theta }B_j+{\displaystyle \frac{2\sqrt{N1}}{N}}A_j,`$ (5)   
$`A_{j+1}`$ $`=`$ $`{\displaystyle \frac{2\sqrt{N2}}{N}}e^{i\theta }B_j+{\displaystyle \frac{N2}{N}}A_j.`$ (6)   
Denoting $`\mathrm{cos}\psi =\frac{N2}{N}`$, $`\mathrm{sin}\psi =\frac{2\sqrt{N1}}{N}`$, we can rewrite the recurrent relation in matrix form:

$`\left(\begin{array}{c}B_{j+1}\\ A_{j+1}\end{array}\right)=\left(\begin{array}{cc}\hfill \mathrm{cos}\psi e^{i\theta }& \hfill \mathrm{sin}\psi \\ \hfill \mathrm{sin}\psi e^{i\theta }& \hfill \mathrm{cos}\psi \end{array}\right)\left(\begin{array}{c}B_j\\ A_j\end{array}\right).`$ (13)   
It is not difficult to diagonalize the transformation matrix. The eigenvalues are:

$`\lambda _{1,2}=e^{i\gamma _{1,2}},`$ (14)   
with

$`\mathrm{sin}\gamma _{1,2}={\displaystyle \frac{\mathrm{sin}\theta \mathrm{cos}\psi \pm 2\sqrt{1\mathrm{cos}\psi ^2\mathrm{sin}^2\theta }\mathrm{sin}\frac{\theta }{2}}{2}}.`$ (15)   
It is worth pointing that the two eigen-phases satisfy $`\gamma _1+\gamma _2=\pi +\theta `$. The corresponding normalized eigenvectors are the column vectors of the matrix $`U`$,

$`U=\left(\begin{array}{cc}\frac{\mathrm{sin}\psi }{\sqrt{2(1\mathrm{cos}\psi \mathrm{cos}\gamma _2)}}& \frac{\mathrm{cos}\psi +e^{i\gamma _2}}{\sqrt{2(1\mathrm{cos}\psi \mathrm{cos}\gamma _2)}}\\ \frac{\mathrm{cos}\psi e^{i\theta }+e^{i\gamma _1}}{\sqrt{2(1\mathrm{cos}\psi \mathrm{cos}\gamma _2)}}& \frac{\mathrm{sin}\psi e^{i\theta }}{\sqrt{2(1\mathrm{cos}\psi \mathrm{cos}\gamma _2)}}\end{array}\right).`$ (18)   
This $`U`$ matrix is unitary and diagonalizes the transformation matrix in (13), that is $`U^1TU`$ is diagonal. The amplitude of the marked state after $`j+1`$ iterations is

$`B_{j+1}`$ $`=`$ $`{\displaystyle \frac{\mathrm{sin}\psi }{2(1\mathrm{cos}\psi \mathrm{cos}\gamma _2)}}e^{i(j+1)\gamma _1}\left[\mathrm{sin}\psi B_0+(\mathrm{cos}\psi e^{i\theta }+e^{i\gamma _1})A_0\right]`$ (20)   
$`+{\displaystyle \frac{\mathrm{cos}\psi +e^{i\gamma _2}}{2(1\mathrm{cos}\psi \gamma _2)}}e^{i(j+1)\mathrm{cos}\gamma _2}\left[(\mathrm{cos}\psi +e^{i\gamma _2})B_0+\mathrm{sin}\psi e^{i\theta }A_0\right].`$   
When $`\theta =\pi `$ and $`B_0=\sqrt{\frac{1}{N}}`$, $`A_0=\sqrt{\frac{N1}{N}}`$, we recover the original Grover’s quantum search algorithm, and $`B_{j+1}=\mathrm{sin}((j+1+1/2)\psi )`$ as given by Boyer et al.

To see the effect of the rotation angle $`\theta `$ on the quantum search algorithm, we plot the norm $`|B_{j+1}|`$ with respect to $`\theta `$. As examples, we draw in Fig. 1. $`|B_4|`$, and $`|B_7|`$ in Fig. 2. For simplicity, $`N=100`$, $`B_0=\sqrt{\frac{1}{N}}`$ and $`A_0=\sqrt{\frac{N1}{N}}`$. From these studies, we see the following points:

1) as $`j`$ increases, $`|B_j|`$ increases too for small $`j`$ values for $`\theta =\pi `$. When $`\theta =\pi `$, Grover’s original quantum search algorithm is working.

2) For other values of $`\theta `$ between 0 and $`2\pi `$, the dependence of $`|B_{j+1}|`$ on $`\theta `$ is not monotonic. There are oscillations. There are peaks and valleys in the values of $`|B|`$ for a given $`j`$. What is more, when $`j`$ changes, the positions of these peaks and valleys change too. In other words, at a given $`\theta `$ value, $`|B_{j+1}|`$ does not always increase when $`j`$ increases. For instance, when $`j=3`$, there is only one peak for $`\theta `$ between 0 and $`\pi `$, whereas for $`j=6`$, there are 3 peaks. This is contrary to the common expectation that for small number of iterations, $`|B_{j+1}|`$ should monotonically increase, though not as big as the standard Grover’s quantum search algorithm.

3) For a $`\theta `$ different from $`\pi `$, even one increases the number of iterations, the norm of the amplitude of the marked state can not reach one. There is a limit at which the norm of the amplitude can reach. In Fig 3. and Fig. 4, we plot the $`|B_{j+1}|`$ versus $`j`$ for $`\theta =\frac{\pi }{4}`$ and $`\theta =\frac{\pi }{3}`$ respectively. The behavior is quite interesting. For $`\theta =\frac{\pi }{4}`$, there is rapid irregular oscillations in the norm. In particular, the maximum height is only about 0.15. The minimum is not zero, it is about 0.07. For $`\theta =\frac{\pi }{3}`$, the plot can be seen as three lines at an interval of 3 points. Again, the maximum height is small, only about 0.18. The norm of the amplitude is in a range between 0.06 and 0.18. Even if one increases the number of iterations, the norm can not be increased any further. In this case, we have ploted $`j`$ up to 100, which is equal to the number of items in the unsorted system.

4) In the vicinity of $`\pi `$, the algorithm still works, though the height of the norm can not reach 1. But it can still reach a considerably large value. This shows that Grover’s quantum search algorithm is robust with respect to $`\theta `$ at $`\pi `$. This is important as an imperfect gate operation may lead to a phase rotation not exactly equal to $`\pi `$. Grover’s quantum search algorithm has a good tolerance on the phase rotating angle near $`\pi `$. A small deviation from $`\pi `$ will not destroy the algorithm.

To summarize, we see that $`\theta =\pi `$ is not only a requirement for efficiency, but also a necessary condition for the algorithm. At this angle, the algorithm is also robust. To achieve a smaller increase in the marked state amplitude(or a smaller rotation towards the marked state basis in the SU(2) space), one has to resort to more complicated modifications to Grover’s quantum search algorithm.

Encouragement from Prof. Prof. Haoming Chen is gratefully acknowledged. We thank Prof. Grover for helpful email discussions regarding Grover’s quantum search algorithms and bringing our attention new references on the algorithm.