Deutsch-Jozsa Algorithm
Part of Womanium Quantum + AI 2024 program
Definition
Deutsch-Jozsa algorithm is a generalization of Deutsch's Algorithm, where we generalize the definition of the function
We say
- Constant if it maps all possible strings to either 0 or 1.
- Balanced if it maps exactly half of the strings to 0 and the other half to 1.
Deutsch-Jozsa Algorithm
The algorithm is very similar to Deutsch's algorithm, in fact it is the same algorithm except that we apply the Hadamard gate on multiple input qubits instead of just one.
Again, we can see that we are still utilizing phase kickback for this algorithm, which works even with multiple qubits as the input.
Before we start applying the algorithm let's define the following:
Now we start applying the algorithm on the starting state
Now let's discard of the ancilla that is
Now we continue applying the Hadamard gates:
Now let's look at the amplitude for state state
If the function is constant then:
then we get the probability of measuring that state by squaring the amplitude (
That means if the function is constant we will measure the state
If the function
Conclusion
Deutsch-Jozsa algorithm generalizes Deutsch's algorithm to apply to a string of
After applying the algorithm, which uses a single query only, if we measure