Deutsch's algorithm
Ang pahinang ito ay hindi pa naisalin. Nakikita mo ang orihinal na bersyon sa Ingles.
Deutsch's algorithm solves the parity problem for the special case that In the context of quantum computing this problem is sometimes referred to as Deutsch's problem, and we'll follow that nomenclature in this lesson.
To be precise, the input is represented by a function from one bit to one bit. There are four such functions:
The first and last of these functions are constant and the middle two are balanced, meaning that the two possible output values for the function occur the same number of times as we range over the inputs. Deutsch's problem is to determine which of these two categories the input function belongs to: constant or balanced.
If we view the input function in Deutsch's problem as representing random access to a string, we're thinking about a two-bit string:
When viewed in this way, Deutsch's problem is to compute the parity (or, equivalently, the exclusive-OR) of the two bits.
Every classical query algorithm that correctly solves this problem must query both bits: and If we learn that for instance, the answer could still be or depending on whether or respectively. Every other case is similar; knowing just one of two bits doesn't provide any information at all about their parity. So, the Boolean circuit described in the previous section is the best we can do in terms of the number of queries required to solve this problem.
Quantum circuit description
Deutsch's algorithm solves Deutsch's problem using a single query, therefore providing a quantifiable advantage of quantum over classical computations. This may be a modest advantage — one query as opposed to two — but we have to start somewhere. Scientific advances sometimes have seemingly humble origins.
Here is a quantum circuit that describes Deutsch's algorithm:
Analysis
To analyze Deutsch's algorithm, we will trace through the action of the circuit above and identify the states of the qubits at the times suggested by this figure:
The initial state is and the two Hadamard operations on the left-hand side of the circuit transform this state to
(As always, we're following Qiskit's qubit ordering convention, which puts the top qubit to the right and the bottom qubit to the left.) It may feel unintuitive to write this product state partly distributed (leaving the states of qubit 1 factored out), but this will make our later expressions more compact.
Next, the gate is performed. According to the definition of the gate, the value of the function for the classical state of the top/rightmost qubit is XORed onto the bottom/leftmost qubit, which transforms into the state
We can simplify this expression by observing that the formula
works for both possible values More explicitly, the two cases are as follows.
Thus, we can alternatively express like this:
Something interesting just happened! Although the action of the gate on standard basis states leaves the top/rightmost qubit alone and XORs the function value onto the bottom/leftmost qubit, here we see that the state of the top/rightmost qubit has changed (in general) while the state of the bottom/leftmost qubit remains the same — specifically being in the state before and after the gate is performed. This phenomenon is known as the phase kickback, and we will have more to say about it shortly.
With one final simplification, which is to pull the factor of outside of the sum, we obtain this expression of the state