A View on the Deutsch Algorithm
The Deutsch Algorithm is an excellent example of the application of quantum parallelism using superposition of states. The problem which is solved by the algorithm is the following: Given an unknown function f(x): {0:1} -> {0,1}, by using the minimum amount of queries to this function, determine if the function is constant (it always returns 0 or always returns 1) or balanced (on half of the inputs it returns 0 and the other half, 1).
In the classical case, we need to query the function twice, one for x=0 and a second for x=1. In case of the quantum algorithm, a single query can define if the function is balanced or constant.
There are many articles explaining how the algorithm works. Here I've taken a different approach: After a brief recap of the algorithm, the analysis of the algorithm follows by opening each state and showing how the problem definition and the function we want to classify contributes to the algorithm output.
On its simplest form, the algorithm utilizes two qubits, the first on state
The superpositions are used as an input for an Oracle function
Let's understand why it works!
To recap...
... and looking at
... regrouping the terms...
... and replacing
Note the operator
Let's have a closer look on the function f(x). The function is unknown, but as it is defined as having a binary input and output, there are only four possible functions, being:
for f(x) constant: for f(x) balanced:
f(0) = f(1) = 0 f(0) = 0; f(1) = 1f(0) = f(1) = 1 f(0) = 1; f(1) = 0
Let's look at each of the four possible functions, focusing on the states
1 - f(x) constant with f(0)=0; f(1)=0
2 - f(x) constant with f(0)=1; f(1)=1
3 - f(x) balanced with f(0)=0; f(1)=1
4 - f(x) balanced with f(0)=1; f(1)=0
The four states above show how each function f(x) changes the phases of the states in four distinct combinations, allowing the state
Here is the main reason for the algorithm to work...
The function has the effect of grouping states into two categories. These categories align with the concept of constant and balanced function. For example, note that in case 1) the function is constant and 0. Factoring and considering only the first qubit (the one on which Hadamard will be applied in the next step) gives
First, lets re-organize the four states above by factoring them. The factoring gives us the following results:
1 - f(x) constant with f(0)=0; f(1)=0
2 - f(x) constant with f(0)=0; f(1)=1
3 - f(x) balanced with f(0)=0; f(1)=1
4 - f(x) balanced with f(0)=1; f(1)=0
Obtaining
1 - f(x) constant with f(0)=0; f(1)=0
2 - f(x) constant with f(0)=0; f(1)=1
3 - f(x) balanced with f(0)=0; f(1)=1
The measurement of the first qubit is now given by:
1 - f(x) constant with f(0)=0; f(1)=0
2 - f(x) constant with f(0)=1; f(1)=1
3 - f(x) balanced with f(0)=0; f(1)=1
4 - f(x) balanced with f(0)=1; f(1)=0
As can be observed, if f(x) is constant, the Deutsch Algorithm returns 0, and if f(x) is balanced, it returns 1. All this in only one single query to the Oracle.
So, a quick recap...
- Using superposition allows the parallelism on the query
- The usage of phase is important to create a set of states that can be manipulated by the function
- Functions actuate in states in a specific way, nicely mapping constant functions to the state
and balanced functions to the state - The fact that global phases do not influence on measurements allow the measurements to always return 0 for constant functions and 1 for balanced functions.
References and Further Readings
- Nielsen, M., & Chuang, I. (2010). Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge: Cambridge University Press. doi:10.1017/CBO9780511976667
- https://learn.qiskit.org/course/ch-algorithms/deutsch-jozsa-algorithm
Comments
Post a Comment