|
Algorithm 2: Deutsch and Jozsa [10] |
Proceed with the following steps.
Prepare an n-qubit query register in the state , and an output qubit in .
Apply the Walsh-Hadamard transform to the query register and the output qubit.
Apply the oracle.
Apply the Walsh-Hadamard transform to the query register.
Test if the output state of the query register is by a measurement of the observable .
If the test is positive, output “constant,” otherwise “balanced”. |