222 14 Quantum algorithms
O(
√
N) steps using this algorithm [199, 200]. Although less dramatic than the
speedup provided by quantum algorithms involving period finding (discussed
below),suchanimprovementis still significant, just as, for example, the clas-
sical Fast Fourier Transform is of practical importance as an improvement
over the standard Fourier transform. The database involved in a search can
be accessed, similarly to how the function in the Deutsch–Jozsa algorithm can
be queried, using a representative binary oracle function f. The function in
this case is defined over the pertinent set of states that takes the value 1 for
a given “marked” state and is 0 for all other states.
Database searching is an “NP-oracle problem,” a standard “oracle ideal-
ization” in which one has no internal access to the mechanism realizing the
black box function f. The quantum circuit corresponding to the Grover op-
erator, defined below, can “recognize” the target state but cannot directly
provide its location. Rather, with each iteration, the central quantum circuit
rotates the quantum register by increasing the magnitude of the quantum
amplitude representing the actual database state relative to the amplitudes
corresponding to all other possible database states, allowing it eventually to
be distinguished from them. The oracle can be queried in this way as many
times as necessary in the course of carrying out the algorithm which, however,
involves only a prescribed number of queries. The best classical algorithm re-
quires
N
2
oracle evaluations, on average, to solve the database search problem
for an N-element database, whereas this algorithm requires only O(
√
N)or-
acle evaluations. The full Grover algorithm takes only O(
√
N log
2
N)steps.
The Grover search is carried out primarily by repeatedly applying the
unitary Grover operator, U
G
≡−I(|Ψ
in
)H
n
I(|m)H
n
, involving one oracle
query per iteration, beginning with an initial register state, |Ψ
in
,ofwhich
a given component |m is sought; H
n
is an n-qubit operation performing an
individual Hadamard transformation on every qubit state within the total
quantum system on which it acts; each operator of the Householder form
I(|Φ) ≡ I −2P (|Φ) inverts the register state by flipping the sign of its vector
argument |Φ and leaving unchanged all the state-vectors orthogonal to it.
The oracle “marks” the target amplitude using I(|m)=I − 2P (|m).
I(|m) is a selective inversion about the hyperplane orthogonal to
the target state |m in a sense that is away from it within a plane S
defined by |Ψ
in
and |m; −I(|Ψ
in
) is a selective inversion in the op-
posite sense by a larger angle in S, back toward the target state. The
planar subspace S is invariant under the actions of both I(|m)and
I(|Ψ
in
). The net result of this pair of inversions is the pertinent rota-
tion in S, by twice the angle between the directions of |Ψ
in
and |m,
one step toward the target state: the effect of the (unitary) Grover
operator U
G
in each iteration is to provide a register superposition-
state rotated by fixed-angle θ in this plane to a direction making a
smaller angle with that of the target state.