The success probability of a search of
M targets from a database of size
N, using Grover's search algorithm depends critically on the number of iterations of the composite operation of the oracle followed by Grover's diffusion operation. Although the required number of iterations scales as
for large
N, the asymptote is not a good indicator of the optimal number of
... [Show full abstract] iterations when is not small. A scheme for the determination of the exact number of iterations, subject to a threshold set for the success probability of the search (probability of detecting the target state(s)), is crucial for the efficacy of the algorithm. In this work, a general scheme for the construction of n-qubit Grover's search algorithm with target states is presented, along with the procedure to find the optimal number of iterations for a successful search. It is also shown that for given N and M, there is an upper-bound on the success probability of the algorithm.