Algorithm 1: Bernstein and Vazirani [19,20] |
Proceed with the following steps.
Prepare an n-qubit query register and an additional answer qubit in the state .
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.
Measure the query register in the computational basis.
The measurement in the last step will reveal the secret string s. |