The Deutsch–Jozsa algorithm is a quantum algorithm, 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 practical use, it is one of the first examples of a quantum algorithm that is exponentially faster than any possible deterministic classical algorithm. It is also a deterministic algorithm, meaning that it always produces an answer, and that answer is always correct.
Contents
Problem statement
In the Deutsch-Jozsa problem, we are given a black box quantum computer known as an oracle that implements some function
Motivation
The Deutsch–Jozsa problem is specifically designed to be easy for a quantum algorithm and hard for any deterministic classical algorithm. The motivation is to show a black box problem that can be solved efficiently by a quantum computer with no error, whereas a deterministic classical computer would need exponentially many 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 and BPP.
Classical solution
For a conventional deterministic algorithm where n is number of bits,
History
The Deutsch–Jozsa Algorithm generalizes earlier (1985) work by David Deutsch, which provided a solution for the simple case.
Specifically we were given a boolean function whose input is 1 bit,
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
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
The Deutsch–Jozsa algorithm provided inspiration for Shor's algorithm and Grover's algorithm, two of the most revolutionary quantum algorithms.
Decoherence
For the Deutsch–Jozsa algorithm to work, the oracle computing f(x) from x has to be a quantum oracle which doesn't decohere x. It also mustn't leave any copy of x lying around at the end of the oracle call.
The algorithm begins with the n+1 bit state
We have the function f implemented as a quantum oracle. The oracle maps the state
For each x, f(x) is either 0 or 1. A quick check of these two possibilities yields
At this point the last qubit may be ignored. We apply a Hadamard transform to each qubit to obtain
where
Finally we examine the probability of measuring
which evaluates to 1 if f(x) is constant (constructive interference) and 0 if f(x) is balanced (destructive interference).
Deutsch's Algorithm
Deutsch's algorithm is a special case of the general Deutsch–Jozsa algorithm. We need to check the condition
We begin with the two-qubit state
We are given a quantum implementation of the function
We ignore the last bit and the global phase and therefore have the state
Applying a Hadamard transform to this state we have
Obviously