Bernstein-Vazirani algorithm 2026-10-24
The Bernstein-Vazirani algorithm identifies the coefficient string of a linear Boolean function with one Boolean quantum oracle call. It contrasts with the calls required by the classical query complexity of linear Boolean function identification. Prepare the data qubits at and an ancilla qubit at , apply a Hadamard gate to every wire, query the function oracle, and apply the Hadamard gates again. The full output is .
The mechanism is Bernstein-Vazirani phase kickback. The Pauli X gate has eigenvector with eigenvalue . Thus the target flips become relative quantum phases on the data, givingThe final Hadamard transform maps this product to , so computational-basis measurement recovers every coefficient with certainty. The ancilla preparation for the Bernstein-Vazirani algorithm ensures the required minus sign, and the Hadamard-conjugated linear oracle gives an exact quantum circuit interpretation. One query is optimal for , since without a query the output cannot depend on the unknown string.
Bernstein-Vazirani decoding controlled by a quantum register Created 2026-10-06 Updated 2026-10-07
For a Boolean quantum oracle whose function is , place its target in . Conjugating the oracle by a Walsh-Hadamard transform on the register translates that register by . This is Bernstein-Vazirani phase kickback without measuring its output, so the index may remain in an arbitrary quantum superposition. A second application undoes the translation. A phase evaluation between the two calls therefore transfers a hidden-label-dependent phase to the index register while uncomputation returns the decoding register to zero.
Use the Bernstein-Vazirani algorithm: initialize n qubits in , apply , query the supplied phase oracle once, apply again, and measure all n computational bits. Immediately after the query the state iswhere the dot product in the exponent is taken modulo two. The Walsh-Hadamard transform gives amplitudeEvery factor is one if and zero otherwise. Thus the final state is exactly , and the measurement outputs a with certainty after one oracle query. This is the character cancellation behind Bernstein-Vazirani phase kickback; because access here is already to the reduced phase oracle, no extra target ancilla or conversion from a bit-flip oracle is required.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 47 2 Solution Created 2026-10-03 Updated 2026-10-14
The Walsh-Hadamard transform is the tensor product of one Hadamard gate on each qubit. Indeed,The network therefore consists of parallel Hadamard gates, with no interaction between wires. Applied to an all-zero quantum register, it produces the uniform quantum superposition of all input strings. This lets a Boolean quantum oracle act coherently on all those inputs; a subsequent operation can turn their relative phases into useful interference. It does not permit reading all oracle values from a single measurement in quantum mechanics.
Parallel Hadamard gates and the one-query Bernstein-Vazirani network
. Details. For the supplied linear-phase input, the amplitude on output isEach factor is obtained by summing over the independent bit . This directly proves the relevant orthogonality of the binary Fourier phases, and yields the output state exactly.
For exact classical identification, query the Boolean function at the standard unit vectors: . Hence oracle calls suffice. They are also necessary in the worst case, even with adaptive queries: every answer supplies one binary linear equation in the unknown string. With fewer than queries, their coefficient matrix has matrix rank at most the number of queries, so its null space contains a nonzero string . The strings and give identical answers along that adaptive transcript and cannot both be identified correctly. Equivalently, a depth- binary decision tree has at most leaves and must distinguish possibilities. Thus the exact classical query count is . This concerns exact recovery, rather than allowing an arbitrary error probability.
The quantum network in the lower panel starts its data quantum register in and its answer ancilla qubit in , which can be prepared as . Apply Hadamard gates to the data wires, make one Boolean quantum oracle call, then apply Hadamard gates again to all data wires. Quantum phase kickback producesA computational-basis measurement of the data wires gives all bits of with certainty. This is Bernstein-Vazirani phase kickback: one quantum query, data Hadamard gates, and one answer-state preparation suffice. The answer ancilla qubit stays separate from the data at the output.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 1 b Solution Created 2026-10-03 Updated 2026-10-07
Let . The positive-exponent quantum Fourier transform gives . Reindexing the cyclic shift operator givesThus is an eigenstate with eigenvalue , with this sign fixed by the printed quantum Fourier transform convention.
Prepare the first two qutrits in and the answer qutrit in . The modular-addition quantum oracle applies to the answer. Its eigenvalue produces quantum phase kickback, leavingApply to each input qutrit, then measure them in the computational basis. The result isThe preparation, inverse transforms and measurements are independent of , and there is exactly one use of . This is qutrit linear-function identification, the ternary version of Bernstein-Vazirani phase kickback.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 61 1 b i Solution Created 2026-10-03 Updated 2026-10-06
Prepare an additional qubit in by applying and then the Hadamard gate to . Apply to the data register. The Boolean quantum oracle then produces quantum phase kickback:A final Walsh-Hadamard transform gives an amplitude for equal toTo see this identity, the sum factors over the bits; any position at which and differ contributes . This is Bernstein-Vazirani phase kickback, and its output isThere is exactly one oracle query, fixed quantum gates, and no probabilistic intermediate step. The ancilla qubit can be left in or reset to using its known inverse preparation. The construction includes the case .
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 3 10D b ii Solution Created 2026-09-24 Updated 2026-10-03
In either promised case, construct by the one-query procedure in part (a), apply the Walsh-Hadamard transform to its two qubits, and perform a quantum measurement in the computational basis. The outcome is certainly for case (i) and certainly for case (ii). ThereforeThis is a two-bit instance of Bernstein-Vazirani phase kickback, and also a promised Deutsch-Jozsa test.
Past exam of the mathematics course of the University of Cambridge 2024 ii Paper 1 10E a i Solution Created 2026-09-24 Updated 2026-09-25
