The Deutsch–Jozsa algorithm is a
deterministic
Determinism is a philosophical view, where all events are determined completely by previously existing causes. Deterministic theories throughout the history of philosophy have developed from diverse and sometimes overlapping motives and consi ...
quantum algorithm
In quantum computing, a quantum algorithm is an algorithm which 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 sequ ...
proposed by
David Deutsch and
Richard Jozsa in 1992 with improvements by
Richard Cleve,
Artur Ekert, Chiara Macchiavello, and
Michele Mosca in 1998.
Although of little current practical use, it is one of the first examples of a quantum algorithm that is
exponentially faster than any possible deterministic classical algorithm.
The Deutsch–Jozsa problem is specifically designed to be easy for a quantum algorithm and hard for any deterministic classical algorithm. It is a
black box problem that can be solved efficiently by a quantum computer with no error, whereas a deterministic classical computer would need a exponential number of queries to the black box to solve the problem. More formally, it yields an oracle relative to which
EQP, the class of problems that can be solved exactly in polynomial time on a quantum computer, and
P are different.
[
]
Since the problem is easy to solve on a probabilistic classical computer, it does not yield an oracle separation with
BPP, the class of problems that can be solved with bounded error in polynomial time on a probabilistic classical computer.
Simon's problem is an example of a problem that yields an oracle separation between
BQP
In computational complexity theory, bounded-error quantum polynomial time (BQP) is the class of decision problems solvable by a quantum computer in polynomial time, with an error probability of at most 1/3 for all instances.Michael Nielsen and Isa ...
and BPP.
Problem statement
In the Deutsch–Jozsa problem, we are given a black box quantum computer known as an
oracle
An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination.
Description
The word '' ...
that implements some function:
The function takes n-bit binary values as input and produces either a 0 or a 1 as output for each such value. We are
promised
A promise is a commitment by someone to do or not do something. As a noun ''promise'' means a declaration assuring that one will or will not do something. As a verb it means to commit oneself by a promise to do or give. It can also mean a capacity ...
that the function is either
constant (0 on all inputs or 1 on all inputs) or ''balanced'' (1 for exactly half of the input
domain and 0 for the other half).
The task then is to determine if
is constant or balanced by using the oracle.
Classical solution
For a conventional
deterministic
Determinism is a philosophical view, where all events are determined completely by previously existing causes. Deterministic theories throughout the history of philosophy have developed from diverse and sometimes overlapping motives and consi ...
algorithm where
is the number of bits,
evaluations of
will be required in the worst case. To prove that
is constant, just over half the set of inputs must be evaluated and their outputs found to be identical (because the function is guaranteed to be either balanced or constant, not somewhere in between). The best case occurs where the function is balanced and the first two output values are different. For a conventional
randomized algorithm
A randomized algorithm is an algorithm that employs a degree of randomness as part of its logic or procedure. The algorithm typically uses uniformly random bits as an auxiliary input to guide its behavior, in the hope of achieving good performan ...
, a constant
evaluations of the function suffices to produce the correct answer with a high probability (failing with probability
with
). However,
evaluations are still required if we want an answer that has no possibility of error. The Deutsch-Jozsa quantum algorithm produces an answer that is always correct with a single evaluation of
.
History
The Deutsch–Jozsa algorithm generalizes earlier (1985) work by David Deutsch, which provided a solution for the simple case where
.
Specifically, given a
boolean function whose input is 1 bit,
, is it constant?
[
]
The algorithm as Deutsch had originally proposed it was not, in fact, deterministic. The algorithm was successful with a probability of one half.
In 1992, Deutsch and Jozsa produced a deterministic algorithm which was generalized to a function which takes
bits for its input. Unlike Deutsch's algorithm, this algorithm required two function evaluations instead of only one.
Further improvements to the Deutsch–Jozsa algorithm were made by Cleve et al.,
resulting in an algorithm that is both deterministic and requires only a single query of
. This algorithm is still referred to as Deutsch–Jozsa algorithm in honour of the groundbreaking techniques they employed.
Algorithm
For the Deutsch–Jozsa algorithm to work, the oracle computing
from
must be a quantum oracle which does not
decohere . It also must not make a copy of
, because that would violate the
no cloning theorem.
The algorithm begins with the
bit state
. That is, the first n bits are each in the state
and the final bit is
. A
Hadamard transform is applied to each bit to obtain the state
:
.
We have the function
implemented as a quantum oracle. The oracle maps the state
to
, where
denotes addition modulo 2. Applying the quantum oracle gives;
:
.
For each
is either 0 or 1. Testing these two possibilities, we see the above state is equal to
:
.
At this point the last qubit
may be ignored and the following remains:
:
.
Next, we will apply the
Hadamard transform
:
(
is the sum of the bitwise product, where
is addition modulo 2) over the first register to obtain
:
From this, we can see that the probability for a state
to be measured is
:
The probability of measuring
, corresponding to
, is
:
which evaluates to 1 if
is constant (
constructive interference) and 0 if
is balanced (
destructive interference). In other words, the final measurement will be
(all zeros) if and only if
is constant and will yield some other state if
is balanced.
Deutsch's algorithm
Deutsch's algorithm is a special case of the general Deutsch–Jozsa algorithm where n = 1 in
. We need to check the condition
. It is equivalent to check
(where
is addition modulo 2, which can also be viewed as a quantum
XOR gate implemented as a
Controlled NOT gate), if zero, then
is constant, otherwise
is not constant.
We begin with the two-qubit state
and apply a
Hadamard transform to each qubit. This yields
:
We are given a quantum implementation of the function
that maps
to
. Applying this function to our current state we obtain
:
:
:
We ignore the last bit and the global phase and therefore have the state
:
Applying a Hadamard transform to this state we have
:
:
if and only if we measure
and
if and only if we measure
. So with certainty we know whether
is constant or balanced.
See also
*
Bernstein–Vazirani algorithm
References
External links
Deutsch's lecture about the Deutsch-Jozsa algorithm
{{DEFAULTSORT:Deutsch-Jozsa algorithm
Quantum algorithms