De Seitn is no ned ibersetzt worn. Sie schaung de englische Originalversion o.
Deutsch's algorithm outperforms all classical algorithms for a query problem, but the advantage is quite modest: one query versus two.
The Deutsch-Jozsa algorithm extends this advantage — and, in fact, it can be used to solve a couple of different query problems.
Here's a quantum circuit description of the Deutsch-Jozsa algorithm.
An additional classical post-processing step, not shown in the figure, may also be required depending on the specific problem being solved.
Of course, we haven't actually discussed what problems this algorithm solves; this is done in the two sections that follow.
We'll begin with the query problem the Deutsch-Jozsa algorithm was originally intended to solve, which is known as the Deutsch-Jozsa problem.
The input function for this problem takes the form f:Σn→Σ for an arbitrary positive integer n.
Like Deutsch's problem, the task is to output 0 if f is constant and 1 if f is balanced, which again means that the number of input strings on which the function takes the value 0 is equal to the number of input strings on which the function takes the value 1.
Notice that, when n is larger than 1, there are functions of the form f:Σn→Σ that are neither constant nor balanced.
For example, the function f:Σ2→Σ defined as
f(00)f(01)f(10)f(11)​=0=0=0=1​
falls into neither of these two categories.
For the Deutsch-Jozsa problem, we simply don't worry about functions like this — they're considered to be "don't care" inputs.
That is, for this problem we have a promise that f is either constant or balanced.
Deutsch-Jozsa problem
Input: a function f:{0,1}n→{0,1}
Promise: f is either constant or balanced
Output: 0 if f is constant, 1 if f is balanced
The Deutsch-Jozsa algorithm, with its single query, solves this problem in the following sense:
if every one of the n measurement outcomes is 0, then the function f is constant;
and otherwise, if at least one of the measurement outcomes is 1, then the function f is balanced.
Another way to say this is that the circuit described above is followed by a classical post-processing step in which the OR of the measurement outcomes is computed to produce the output.
To analyze the performance of the Deutsch-Jozsa algorithm for the Deutsch-Jozsa problem, it's helpful to begin by thinking about the action of a single layer of Hadamard gates.
A Hadamard operation can be expressed as a matrix in the usual way,
H=(2​1​2​1​​2​1​−2​1​​),
but we can also express this operation in terms of its action on standard basis states:
Now suppose that instead of just a single qubit we have n qubits, and a Hadamard operation is performed on each.
The combined operation on the n qubits is described by the tensor product H⊗⋯⊗H (n times), which we write as H⊗n for conciseness and clarity.
Using the formula from above, followed by expanding and then simplifying, we can express the action of this combined operation on the standard basis states of n qubits like this:
Here, by the way, we're writing binary strings of length n as xn−1​⋯x0​ and yn−1​⋯y0​, following Qiskit's indexing convention.
This formula provides us with a useful tool for analyzing the quantum circuit above.
After the first layer of Hadamard gates is performed, the state of the n+1 qubits (including the leftmost/bottom qubit, which is treated separately from the rest) is