Exact quantum search based on analytical multiphase matching for known number of target items and the experimental demonstration on IBM Q

Tan Li a,b , Xiang-Qun Fu a,b , Yang Wang a,b , Shuo Zhang a,b , Xiang Wang a,b , Yu-Tao Du a,b , and Wan-Su Bao a,b ∗

- a Henan Key Laboratory of Quantum Information and Cryptography, SSF IEU, Zhengzhou, Henan 450001, China
- b Synergetic Innovation Center of Quantum Information and Quantum Physics, University of Science and Technology of China, Hefei, Anhui 230026, China

## Abstract

In [Phys. Rev. Lett. 113, 210501 (2014)], to achieve the optimal fixedpoint quantum search in the case of unknown fraction (denoted by λ ) of target items, the analytical multiphase matching (AMPM) condition has been proposed. In this paper, we find out that the AMPM condition can also be used to design the exact quantum search algorithm in the case of known λ , and the minimum number of iterations reaches the optimal level of existing exact algorithms. Experiments are performed to demonstrate the proposed algorithm on IBM's quantum computer. In addition, we theoretically find two coincidental phases with equal absolute value in our algorithm based on the AMPM condition and that algorithm based on single-phase matching. Our work confirms the practicability of the AMPM condition in the case of known λ , and is helpful to understand the mechanism of this condition.

## Keywords:

Quantum search, Analytical multiphase matching, Known number of target items, 100% success probability, IBM quantum experience

∗ Corresponding author at: SSF IEU, Zhengzhou 450001, China. E-mail address: bws@qiclab.cn (W. -S. Bao).

## 1. Introduction

Grover quantum search algorithm [1, 2] is one of the great quantum algorithms, which achieves a quadratic speedup over classical search algorithms. Many generalizations and variants of Grover's algorithm have been studied [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], especially the multiphase matching methods. In 2008, Toyama et al. found the original multiphase matching condition [14] by means of numerical fitting, i.e.,

$$\phi _ { j } = \varphi _ { l + 1 - j },$$

to achieve success probability close to 100% over a wide range of λ through a small number of iterations ∏ l j =1 G φ ,ϕ ( j j ), where G is the generalized Grover operation defined by Eq. (5). However, the whole range of λ ∈ (0 , 1) cannot be covered [14, 15].

Fortunately, in 2014, Yoder et al. proposed the analytical multiphase matching (AMPM) condition [16] which gives the analytical forms of phases { φ , ϕ j j } (see Eq. (9) for details), and obtained an algorithm which can always maintain a success probability no less than 1 -δ 2 on the range of λ ∈ [ λ , 0 1), where δ ∈ (0 , 1] and λ 0 is an arbitrary lower bound of λ . This algorithm also possesses the fixed-point property and achieves a quadratic speedup over the original fixed-point quantum search algorithm [8], showing the great fascination of the AMPM condition.

However, Ref. [16] only aims to deal with the case of unknown λ . Then, in the case of known λ , what kind of performance will the AMPM condition have? In this paper, we expect to design a quantum search algorithm with 100% success probability for the known λ based on the AMPM condition and implement a proof-of-principle experiment, to reveal more applications of this condition.

The paper is organized as follows. Section 2 describes our analytical matched-multiphase quantum search algorithm with 100% success probability. Section 3 introduces the experimental implementation of the proposed algorithm on IBM's cloud quantum computing platform. Section 4 discusses the connection between the AMPM condition and the single-phase matching condition, followed by a brief conclusion in Section 5.

## 2. Exact quantum search based on the analytical multiphase matching condition

In order to characterize the performance of the AMPM condition [16] in case of known λ , we expect to design a quantum search algorithm with 100% success probability. The specific steps are described as follows (the corresponding flow diagram is shown in Fig. 1).

Step 1: Prepare the initial state | ψ 〉 = H ⊗ n | 0 , which can be written as 〉

$$\left | \psi \right \rangle = \sqrt { \lambda } \left | \alpha \right \rangle + \sqrt { 1 - \lambda } \left | \beta \right \rangle,$$

where H is the Hadamard transform, | α 〉 ( | β 〉 ) is the equal superposition of all target (nontarget) states, i.e.,

$$| \alpha \rangle \ = \ \frac { 1 } { \sqrt { M } } \sum _ { \substack { x \in f ^ { - 1 } ( 1 ) } } | x \rangle \,,$$

3

$$| \beta \rangle \ = \ \frac { 1 } { \sqrt { N - M } } \sum _ { x \in f ^ { - 1 } ( 0 ) } | x \rangle \,,$$

and λ = M/N M , is the number of target items in the database of size N . n n 

Step 2: Perform on | ψ 〉 the sequence of matched-multiphase Grover operations ∏ l j =1 G φ ,ϕ ( j j ), where G φ,ϕ ( ) is the Grover iteration with arbitrary phases, i.e., 0 qubits H   1 1 , G     2 2 , G     , l l G   

measure

Oracle workplace

$$G \left ( \phi, \varphi \right ) \ = \ - H S _ { 0 } ^ { \phi } H S _ { f } ^ { \varphi },$$

Figure 1: (Color online.) Schematic circuit for the exact matched-multiphase quantum search algorithm.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00269v1-figure-369a5c8e-b589-4b22-aaed-51110a3b87c7.jpg)

S ϕ f and S φ 0 represent the selective phase shifts,

$$S _ { f } ^ { \varphi } \ = \ I - \left ( - e ^ { i \varphi } + 1 \right ) \sum _ { x \in f ^ { - 1 } ( 1 ) } \left | x \right \rangle \left \langle x \right |,$$

$$S _ { 0 } ^ { \phi } \ = \ I - \left ( - e ^ { i \phi } + 1 \right ) \left | 0 \right \rangle \left \langle 0 \right |,$$

l is the number of iterations, satisfying

$$l \geq \left \lceil \frac { \pi } { 4 \arcsin \sqrt { \lambda } } - \frac { 1 } { 2 } \right \rceil \equiv l _ { \min },$$

and { φ , ϕ j j } meet the analytical multiphase matching condition [16], i.e.,

$$\phi _ { j } = \varphi _ { l - j + 1 } = - 2 \arccot \left ( \sqrt { 1 - \gamma ^ { 2 } } \tan \left ( 2 \pi j / L \right ) \right ), \, \text{for} \, 1 \leq j \leq l, \quad ( 9 )$$

where L = 2 l + 1, γ = T -1 1 /L (1 /δ ), T L ( x ) = cos[ L arccos ( x )] is the L th Chebyshev polynomial of the first kind [17], and

$$\delta = T _ { L } ^ { - 1 } \left ( \frac { \cos \left ( \frac { \pi } { 2 L } \right ) } { \sqrt { 1 - \lambda } } \right ).$$

Step 3: Measure the system. This will produce one of the marked states with 100% success probability.

Reasons for the selection of l of Eq. (8) and δ of Eq. (10) are as follows. First, according to Ref. [16], the final state of Step 2 can be written as

$$\left | C _ { L } \right \rangle = \sqrt { P _ { L } } \left | \alpha \right \rangle + \sqrt { 1 - P _ { L } } \left | \beta \right \rangle,$$

where P L denotes the success probability,

$$P _ { L } = 1 - \delta ^ { 2 } T _ { L } ^ { 2 } \left [ T _ { 1 / L } \left ( 1 / \delta \right ) \sqrt { 1 - \lambda } \right ],$$

Then, let P L = 1, we can obtain all the k maximum points of P L , denoted as

$$\lambda _ { l, j } ^ { \delta, \max } = 1 - \gamma ^ { 2 } \cos ^ { 2 } \left ( \frac { 2 j - 1 } { 2 L } \pi \right ), \, 1 \leq j \leq l,$$

and

$$\min \left \{ \lambda _ { l, j } ^ { \delta, \max } \colon 1 \leq j \leq k \right \} \ = \ \lambda _ { l, j = 1 } ^ { \delta, \max },$$

$$\min \left \{ \lambda _ { l, j = 1 } ^ { \delta, \max } \colon 0 < \delta \leq 1 \right \} \ = \ \lambda _ { l, j = 1 } ^ { \delta = 1, \max }.$$

Figure 2: (Color online.) Difference between the minimum number of iterations ( l min ) of our algorithm and the optimal number of iterations ( l G ) of the original Grover algorithm as a function of the fraction λ of target items.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00269v1-figure-d98043fd-db07-4013-b567-1d1edb87a62e.jpg)

Note that, making the success probability at λ reach 100% is the equivalent of having λ happen to be a certain maximum point, and the range of maximum points { λ δ, max l,j } is [ λ δ =1 max , l,j =1 , 1 . ) Therefore, λ ≥ λ δ =1 max , l,j =1 is required, yielding the result of Eq. (8) of the number of iterations l . Let λ = λ δ, max l,j =1 , we can further obtain the condition Eq. (10) of δ . Finally, the phases { φ , ϕ j j } can be calculated from Eq. (9).

At this point, all the selection methods of parameters in our exact algorithm have been obtained. Figure 2 plots the minimum number of iterations ( l min ) of our algorithm and the optimal number of iterations ( ⌈ π 4 arcsin √ λ ⌉ -1 ≡ l G [18]) of the original Grover algorithm as a function of λ , which shows that the difference is up to one. In fact, it can be found that our minimum number of iterations l min of Eq. (8) is just the same as that of the existing exact quantum search algorithms [19, 20, 21, 22, 23], according to Eq. (7) of Ref. [19], Eqs. (15), (20) and (23) of Ref. [22], and Theorem 4 of Ref. [23].

## 3. Experimental implementation

We also conducted an experiment to demonstrate the proposed algorithm on the IBM's 5-qubit computer (ibmqx4) [24].

As shown in Fig. 1, our algorithm is mainly composed of the generalized Grover operation G φ,ϕ ( ), defined by Eq. (5). According to Ref. [16], a

Figure 3: (Color online.) Circuit for performing the generalized Grover operation G φ,ϕ ( ) of Eq. (5).

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00269v1-figure-d5aee9e3-69b2-4498-88a3-449562aae353.jpg)

quantum circuit for realizing G φ,ϕ ( ) is shown in Fig. 3, where U f is the Oracle operator, U f | x 〉 | y 〉 = | x 〉 | y ⊕ f ( x ) 〉 , H is the Hadamard transform, and U 1 ( x ) is the quantum gate defined by

$$U _ { 1 } \left ( x \right ) = \left [ \begin{array} { c c } 1 & 0 \\ 0 & e ^ { i x } \end{array} \right ].$$

Note that, for the single-qubit quantum search, S φ 0 can be implemented simply by U 1 ( -φ ), up to a global phase.

For the sake of simplicity, we chose the single-qubit ( N = 2) and singlesolution ( M = 1) example for experimentation. All the two possible Oracles are shown in Fig. 4.

From Eq. (8), it follows that the required number of iterations l ≥ 1 for λ = 0 5. . Here, we respectively choose l = 1, 2 and 3 to verify the results of the algorithm for the two possible Oracles. Corresponding parameters are shown in Table 1. As an example, the complete quantum circuit for l = 1 with the Oracle corresponding to f (1) = 1 is depicted in Fig. 5.

Figure 4: (Color online.) Circuits for all the possible Oracles in the single-qubit and single-solution quantum search, where (a) f (0) = 1 and (b) f (1) = 1.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00269v1-figure-3e4af290-538c-45ee-aeb0-7187c3a925c9.jpg)

Table 1: Parameters of our exact algorithm for λ = 0 5 with . l = 1, 2 and 3.

|   l |        δ | φ 1 , φ 2 , · · · , φ l   | ϕ 1 , ϕ 2 , · · · , ϕ l   |
|-----|----------|---------------------------|---------------------------|
|   1 | 0.272166 | π/ 2                      | π/ 2                      |
|   2 | 0.035103 | -0.904557                 | 2.237036                  |
|   2 | 0.035103 | 2.237036                  | -0.904557                 |
|   3 | 0.005398 | -1.717287                 | 2.501328                  |
|   3 | 0.005398 | 2.501328                  |                           |
|   3 | 0.005398 |                           | -1.717287                 |

Figure 5: (Color online.) Complete circuit for one iteration of the exact analytical matched-multiphase quantum search with the Oracle corresponding to f (1) = 1.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00269v1-figure-19281dc7-f468-4b10-b253-497928e0e6f2.jpg)

Figure 6 exhibits the obtained experimental results, where the white and red (grey) bars represent the theoretical and experimental probabilities, respectively. Ideally, when f (0) = 1, the output is in | 0 〉 with a probability of 100%, and another 0% probability yields | 1 . 〉 When f (1) = 1, probabilities are just the opposite. To characterize the overlap between experimental and theoretical results, we adopt the statistical fidelity [25, 26]

$$F = \sum _ { j = 0 } ^ { 1 } \sqrt { p _ { j } ^ { \exp } p _ { j } ^ { \text{th} } },$$

where p th j and p exp j represent the theoretical and experimental output probabilities of the state | j 〉 , respectively. According to the data in Fig. 6 (a-f), the fidelities can be calculated as 0.9743, 0.9601, 0.9443, 0.9242, 0.9089 and 0.8966, which confirms the feasibility of our algorithm. The deviations between experimental and theoretical results are mainly related to errors in the readout and quantum gates. Calibration data provided by the IBM platform shows that readout error is 3 60 . × 10 -2 and gate error is 1 12 . × 10 -3 .

Figure 6: (Color online.) Experimental results. (a-c) and (d-f) correspond to f (0) = 1 and f (1) = 1, (a,d), (b,e) and (c,f) correspond to l = 1, 2 and 3, and the white and red (grey) bars correspond to the theoretical and experimental probabilities, respectively.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00269v1-figure-de4fab30-9e14-43b9-bf9a-c2eb5596ebd1.jpg)

## 4. Discussions

Although the AMPM condition [16] differs significantly from the singlephase matching condition [27, 28, 29, 30], we find out a coincidental connection between them. The specific discussions are as follows.

In the exact quantum search algorithm [19] based on the single-phase matching condition [27], the sequence of operations is given by G φ,ϕ l ( ), where φ and ϕ meet the condition

$$\phi = \varphi,$$

and the value of phase φ is given by

$$\pm \arccos \left ( 1 - \frac { 1 - \cos \left ( \frac { \pi } { 2 l + 1 } \right ) } { \lambda } \right ) \equiv \phi _ { s }.$$

When λ = 1 2, / φ s = ± π 2 , ± 0 904557 and . ± 0 640265 for . l = 1, 2 and 3. Compared with Table 1, we can see that in the case of same number of iterations, it seems that there is always a phase in the exact analytical multiphase

matching quantum search algorithm, of which the absolute value is exactly the same as that of phase φ s in the exact single-phase matching algorithm.

In fact, we can prove that there indeed exists a phase φ m in { φ j : 1 ≤ j ≤ } l , satisfying

$$\phi _ { m } = \begin{cases} | \phi _ { s } | \,, & \text{ if } l \, \text{ is odd}, \\ - \, | \phi _ { s } | \,, & \text{ if } l \, \text{ is even}, \end{cases}$$

where

$$m = \begin{cases} \left ( l + 1 \right ) / 2, & \text{if $l$ is odd,} \\ l / 2, & \text{if $l$ is even.} \end{cases}$$

Reasons are as follows. On the one hand, from Eq. (19) it follows that

$$\frac { \cot ^ { 2 } \left ( \frac { \phi _ { s } } { 2 } \right ) } { \lambda - \sin ^ { 2 } \left ( \frac { \pi } { 2 L } \right ) } = \frac { 1 } { \sin ^ { 2 } \left ( \frac { \pi } { 2 L } \right ) }.$$

On the other hand, from Eq. (9), we have

$$\phi _ { m } = - 2 \arccot \left ( \sqrt { 1 - \gamma ^ { 2 } } \tan \left ( 2 \pi m / L \right ) \right ),$$

where γ = T -1 1 /L (1 /δ ), L = 2 l + 1, and δ meets the condition of Eq. (10). Then, substitute δ and γ into Eq. (23), we obtain

$$\frac { \cot ^ { 2 } \left ( \frac { \phi _ { m } } { 2 } \right ) } { \lambda - \sin ^ { 2 } \left ( \frac { \pi } { 2 L } \right ) } = \frac { \tan ^ { 2 } \left ( \frac { 2 m \pi } { L } \right ) } { \cos ^ { 2 } \left ( \frac { \pi } { 2 L } \right ) }.$$

Note that, according to Eq. (21), 4 mπ = ( L ± 1) π , then we have

$$\tan ^ { 2 } \left ( \frac { 4 m \pi } { 2 L } \right ) = \cot ^ { 2 } \left ( \frac { \pi } { 2 L } \right ).$$

Therefore, based on Eqs. (22), (24) and (25), we can see that

$$| \phi _ { m } | = | \phi _ { s } | \,.$$

Finally, due to φ l +1 2 &gt; 0 and φ l 2 &lt; 0, Eq. (20) holds.

## 5. Conclusion

In summary, we have studied the new application of the analytical multiphase matching (AMPM) condition specially for the case of known λ , i.e., based on the AMPM condition, we designed a quantum search algorithm with 100% success probability for any given λ ∈ (0 , 1). We derived all maximum points (value of 100%) of the success probability after applying the analytical matched-multiphase Grover operations l times, and further obtained the available number of iterations, phases, and other parameters, which ensure λ just fall at a certain maximum point. Moreover, as an example, we experimentally verified the single-qubit and single-solution algorithm for all possible Oracles. Experimental results agree well with the theoretical expectations, confirming the feasibility of the proposed algorithm. The number of iterations of our algorithm is up to 1 more than the original Grover algorithm, and achieves the optimal level of the existing exact quantum search algorithms. In addition, we theoretically proved that in our exact algorithm based on the AMPM condition there coincidentally exists a phase of which the absolute value is exactly equal to that of the phase in the exact algorithm based on the single-phase matching condition. Our study confirms the usefulness of the AMPM condition in the case of known λ , and also provides a guideline to understand the mechanism and expand more applications of this condition.

## Acknowledgements

We thank He-Liang Huang, Jing-Yi Cui, Jia-Ji Li and Jie Lin, for helpful discussions. We also acknowledge the use of IBM's Quantum Experience for this work. The views expressed are those of the authors and do not reflect the official policy or position of IBM or the IBM Quantum Experience team. This work was supported by the National Natural Science Foundation of China (Grants No. 11504430 and No. 61502526) and the National Basic Research Program of China (Grant No. 2013CB338002).

## References

## References

- [1] L. K. Grover, A fast quantum mechanical algorithm for database search, in: Proceedings of the Twenty-eighth Annual ACM Symposium on Theory of Computing, ACM, New York, 1996, pp. 212-219.

- [2] L. K. Grover, Quantum mechanics helps in searching for a needle in a haystack, Phys. Rev. Lett. 79 (2) (1997) 325-328.
- [3] L. K. Grover, Quantum computers can search rapidly by using almost any transformation, Phys. Rev. Lett. 80 (1998) 4329-4332.
- [4] M. Boyer, G. Brassard, P. Høyer, A. Tapp, Tight bounds on quantum searching, Fortschr. Phys. 46 (4-5) (1998) 493-505.
- [5] D. Biron, O. Biham, E. Biham, M. Grassl, D. A. Lidar, Generalized Grover search algorithm for arbitrary initial amplitude distribution, in: C. P. Williams (Ed.), Quantum Computing and Quantum Communications, Springer, Berlin, 1999, pp. 140-147.
- [6] P. Høyer, Arbitrary phases in quantum amplitude amplification, Phys. Rev. A 62 (2000) 052304.
- [7] A. Younes, J. Rowe, J. Miller, Quantum search algorithm with more reliable behaviour using partial diffusion, AIP Conf. Proc. 734 (1) (2004) 171-174.
- [8] L. K. Grover, Fixed-point quantum search, Phys. Rev. Lett. 95 (15) (2005) 150501.
- [9] T. Li, W.-S. Bao, W.-Q. Lin, H. Zhang, X.-Q. Fu, Quantum search algorithm based on multi-phase, Chin. Phys. Lett. 31 (5) (2014) 050301.
- [10] A. M. Dalzell, T. J. Yoder, I. L. Chuang, Fixed-point adiabatic quantum search, Phys. Rev. A 95 (1) (2017) 012311.
- [11] T. Byrnes, G. Forster, L. Tessler, Generalized Grover's algorithm for multiple phase inversion states, Phys. Rev. Lett. 120 (2018) 060501.
- [12] T. Li, W.-S. Bao, H.-L. Huang, F.-G. Li, X.-Q. Fu, S. Zhang, C. Guo, Y.-T. Du, X. Wang, J. Lin, Complementary-multiphase quantum search for all numbers of target items, Phys. Rev. A 98 (6) (2018) 062308.
- [13] F. Toyama, W. van Dijk, Additive composition formulation of the iterative grover algorithm, Can. J. Phys. 97 (7) (2019) 777-785.

- [14] F. M. Toyama, W. van Dijk, Y. Nogami, M. Tabuchi, Y. Kimura, Multiphase matching in the Grover algorithm, Phys. Rev. A 77 (4) (2008) 042324.
- [15] F. M. Toyama, S. Kasai, W. van Dijk, Y. Nogami, Matched-multiphase Grover algorithm for a small number of marked states, Phys. Rev. A 79 (1) (2009) 014301.
- [16] T. J. Yoder, G. H. Low, I. L. Chuang, Fixed-point quantum search with an optimal number of queries, Phys. Rev. Lett. 113 (21) (2014) 210501.
- [17] J. C. Mason, D. C. Handscomb, Chebyshev polynomials, CRC Press, Boca Raton, 2002.
- [18] M. A. Nielson, I. L. Chuang, Quantum computation and quantum information, Cambridge University Press, Cambridge, 2000.
- [19] G. L. Long, Grover algorithm with zero theoretical failure rate, Phys. Rev. A 64 (2) (2001) 022307.
- [20] F. M. Toyama, W. van Dijk, Y. Nogami, Quantum search with certainty based on modified Grover algorithms: optimum choice of parameters, Quantum Inf. Process. 12 (5) (2013) 1897-1914.
- [21] C. R. Hu, Family of sure-success quantum algorithms for solving a generalized Grover search problem, Phys. Rev. A 66 (4) (2002) 042301.
- [22] J. Y. Hsieh, C. M. Li, J. S. Lin, D. S. Chuu, Formulation of a family of sure-success quantum search algorithms, Int. J. Quantum Inf. 2 (3) (2004) 285-293.
- [23] G. Brassard, P. Høyer, M. Mosca, A. Tapp, Quantum amplitude amplification and estimation, in: S. J. Lomonaco, Jr., H. E. Brandt (Eds.), Quantum Computation and Information, American Mathematical Society, Providence, 2002, pp. 53-74.
- [24] IBM Q Experience. https://quantum-computing.ibm.com. Accessed: 1 July 2019.
- [25] H.-L. Huang, Y.-W. Zhao, T. Li, F.-G. Li, Y.-T. Du, X.-Q. Fu, S. Zhang, X. Wang, W.-S. Bao, Homomorphic encryption experiments on IBM's cloud quantum computing platform, Front. Phys. 12 (1) (2017) 120305.

- [26] H.-L. Huang, A. K. Goswami, W.-S. Bao, P. K. Panigrahi, Demonstration of essentiality of entanglement in a Deutsch-like quantum algorithm, Sci. China Phys. Mech. 61 (6) (2018) 060311.
- [27] G. L. Long, Y. S. Li, W. L. Zhang, L. Niu, Phase matching in quantum searching, Phys. Lett. A 262 (1) (1999) 27-34.
- [28] G. L. Long, C. C. Tu, Y. S. Li, W. L. Zhang, H. Y. Yan, An SO (3) picture for quantum searching, J. Phys. A 34 (4) (2001) 861.
- [29] G.-L. Long, X. Li, Y. Sun, Phase matching condition for quantum search with a generalized initial state, Phys. Lett. A 294 (3) (2002) 143-152.
- [30] C.-M. Li, C.-C. Hwang, J.-Y. Hsieh, K.-S. Wang, General phasematching condition for a quantum searching algorithm, Phys. Rev. A 65 (3) (2002) 034305.
Tan Li Xiang-Qun Fu Yang Wang Shuo Zhang Xiang Wang Yu-Tao Du Wan-Su Bao
Exact quantum search based on analytical multiphase matching for known number of target items and the experimental demonstration on IBM Q
In [Phys. Rev. Lett. 113, 210501 (2014)], to achieve the optimal fixed-point
quantum search in the case of unknown fraction (denoted by $\lambda$) of target
items, the analytical multiphase matching (AMPM) condition has been proposed.
In this paper, we find out that the AMPM condition can also be used to design
the exact quantum search algorithm in the case of known $\lambda$, and the
minimum number of iterations reaches the optimal level of existing exact
algorithms. Experiments are performed to demonstrate the proposed algorithm on
IBM's quantum computer. In addition, we theoretically find two coincidental
phases with equal absolute value in our algorithm based on the AMPM condition
and that algorithm based on single-phase matching. Our work confirms the
practicability of the AMPM condition in the case of known $\lambda$, and is
helpful to understand the mechanism of this condition.