  A quantum computer encodes information in quantum states and runs quantum
algorithms to surpass the classical counterparts by exploiting quantum
superposition and quantum correlation. Grover's quantum search algorithm is a
typical quantum algorithm that proves the superiority of quantum computing over
classical computing. It has a quadratic reduction in the query complexity of
database search, and is known to be optimal when no a priori information about
the elements of the database is provided. In this work, we consider a
probabilistic Grover search algorithm allowing nonzero probability of failure
for a database with a general a priori probability distribution of the
elements, and minimize the number of oracle calls by optimizing the initial
state of the quantum system and the reflection axis of the diffusion operator.
The initial state and the reflection axis are allowed to not coincide, and thus
the quantum search algorithm rotates the quantum system in a three-dimensional
subspace spanned by the initial state, the reflection axis and the search
target state in general. The number of oracle calls is minimized by a
variational method, and formal results are obtained with the assumption of low
failure probability. The results show that for a nonuniform a priori
distribution of the database elements, the number of oracle calls can be
significantly reduced given a small decrease in the success probability of the
quantum search algorithm, leading to a lower average query complexity to find
the solution of the search problem. The results are applied to a simple but
nontrivial database model with two-value a priori probabilities to show the
power of the optimized quantum search algorithm. The paper concludes with a
discussion about the generalization to higher-order results that allows for a
larger failure probability for the quantum search algorithm.
