In
quantum computing
A quantum computer is a computer that exploits quantum mechanical phenomena. On small scales, physical matter exhibits properties of wave-particle duality, both particles and waves, and quantum computing takes advantage of this behavior using s ...
, the quantum phase estimation algorithm is a
quantum algorithm
In quantum computing, a quantum algorithm is an algorithm that runs on a realistic model of quantum computation, the most commonly used model being the quantum circuit model of computation. A classical (or non-quantum) algorithm is a finite seq ...
to estimate the phase corresponding to an eigenvalue of a given
unitary operator
In functional analysis, a unitary operator is a surjective bounded operator on a Hilbert space that preserves the inner product.
Non-trivial examples include rotations, reflections, and the Fourier operator.
Unitary operators generalize unitar ...
. Because the eigenvalues of a unitary operator always have
unit modulus, they are characterized by their phase, and therefore the algorithm can be equivalently described as retrieving either the phase or the eigenvalue itself. The algorithm was initially introduced by
Alexei Kitaev in 1995.
Phase estimation is frequently used as a subroutine in other quantum algorithms, such as
Shor's algorithm,
the
quantum algorithm for linear systems of equations
The Harrow–Hassidim–Lloyd (HHL) algorithm is a quantum algorithm for numerically solving a system of linear equations, designed by Aram Harrow, Avinatan Hassidim, and Seth Lloyd. The algorithm estimates the result of a scalar measurement on t ...
, and the
quantum counting algorithm.
Overview of the algorithm
The algorithm operates on two sets of qubits, referred to in this context as
registers. The two registers contain
and
qubits, respectively. Let
be a
unitary operator
In functional analysis, a unitary operator is a surjective bounded operator on a Hilbert space that preserves the inner product.
Non-trivial examples include rotations, reflections, and the Fourier operator.
Unitary operators generalize unitar ...
acting on the
-
qubit
In quantum computing, a qubit () or quantum bit is a basic unit of quantum information—the quantum version of the classic binary bit physically realized with a two-state device. A qubit is a two-state (or two-level) quantum-mechanical syste ...
register. The eigenvalues of a unitary operator have unit modulus, and are therefore characterized by their phase. Thus if
is an
eigenvector
In linear algebra, an eigenvector ( ) or characteristic vector is a vector that has its direction unchanged (or reversed) by a given linear transformation. More precisely, an eigenvector \mathbf v of a linear transformation T is scaled by ...
of
, then
for some
. Due to the periodicity of the complex exponential, we can always assume
.
The goal is producing a good approximation for
with a small number of gates and a high probability of success. The quantum phase estimation algorithm achieves this assuming oracular access to
, and having
available as a quantum state. This means that when discussing the efficiency of the algorithm we only worry about the number of times
needs to be used, but not about the cost of implementing
itself.
More precisely, the algorithm returns
with high probability
In mathematics, an event that occurs with high probability (often shortened to w.h.p. or WHP) is one whose probability depends on a certain number ''n'' and goes to 1 as ''n'' goes to infinity, i.e. the probability of the event occurring can be m ...
an approximation for
, within additive error
, using
qubits in the first register, and
controlled-''U'' operations. Furthermore, we can improve the success probability to
for any
by using a total of
uses of controlled-U, and this is optimal.
Detailed description of the algorithm
State preparation
The initial state of the system is:
:
where
is the
-qubit state that evolves through
. We first apply the ''n-qubit''
Hadamard gate operation on the first register, which produces the state:
Note that here we are switching between binary and
-ary representation for the
-qubit register: the ket
on the right-hand side is shorthand for the
-qubit state
, where
is the binary decomposition of
.
Controlled-U operations
This state
is then evolved through the controlled-unitary evolution
whose action can be written as
for all
. This evolution can also be written concisely as
which highlights its controlled nature: it applies
to the second register conditionally to the first register being
. Remembering the eigenvalue condition holding for
, applying
to
thus gives
where we used
.
To show that
can also be implemented efficiently, observe that we can write
, where
denotes the operation of applying
to the second register conditionally to the
-th qubit of the first register being
. Formally, these gates can be characterized by their action as
This equation can be interpreted as saying that the state is left unchanged when
, that is, when the
-th qubit is
, while the gate
is applied to the second register when the
-th qubit is
. The composition of these controlled-gates thus gives
with the last step directly following from the binary decomposition
.
From this point onwards, the second register is left untouched, and thus it is convenient to write
, with
the state of the
-qubit register, which is the only one we need to consider for the rest of the algorithm.
Apply inverse quantum Fourier transform
The final part of the circuit involves applying the inverse
quantum Fourier transform
In quantum computing, the quantum Fourier transform (QFT) is a linear transformation on qubit, quantum bits, and is the quantum analogue of the discrete Fourier transform. The quantum Fourier transform is a part of many quantum algorithms, notably ...
(QFT)
on the first register of
:
The QFT and its inverse are characterized by their action on basis states as
It follows that
:
Decomposing the state in the computational basis as
the coefficients thus equal
where we wrote
with
is the nearest integer to
. The difference
must by definition satisfy
. This amounts to approximating the value of