Standard graduate textbook covering the single- and two-qubit gate definitions, matrix identities, and circuit primitives this record states.
doi.org/10.1017/cbo9780511976667 ↗Bernstein–Vazirani hidden-string circuit
A query circuit that recovers the hidden bit string in f(x) = s · x.
Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.
Bernstein–Vazirani is a useful companion to Deutsch–Jozsa because it returns the hidden string rather than only its promise class.
Circuit & simulation
What this takes and returns
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
How it works
Bernstein–Vazirani recovers a hidden bit string from an oracle for the parity function . The circuit prepares the output qubit in and the input register in superposition, queries once — phase kickback writes onto — and applies to the input register, which by the Hadamard/Fourier identity collapses it exactly to the basis state : measuring returns with certainty in the ideal circuit. Classically, determining an -bit from black-box parity queries requires queries (one per standard basis vector), so the quantum circuit gives an -to- query reduction under this promise, not a general search speedup. This record reviews the CX-based parity-oracle construction and its Deutsch–Jozsa-style readout; the one-query claim is scoped to this query/promise model, and oracle-construction and state-preparation costs stay visible rather than folded into the count.
Implementation
from qiskit import QuantumCircuit
secret = '101'
qc = QuantumCircuit(len(secret) + 1, len(secret))
qc.x(len(secret))
qc.h(range(len(secret) + 1))
for index, bit in enumerate(reversed(secret)):
if bit == '1':
qc.cx(index, len(secret))
qc.h(range(len(secret)))
qc.measure(range(len(secret)), range(len(secret)))
FINAL_CIRCUIT = qcQuantum vs classical
Classical baseline
Compare Quantum query algorithm with the strongest classical method for the same instance, input budget, and output metric.
Quantum claim
This reference exposes a quantum circuit pattern; it does not imply an application-level speedup without a matched benchmark.
How to compare
Report input loading, circuit depth, repetitions, classical preprocessing, post-processing, and wall-clock time together.
Declared gaps
Nobody has reviewed this record for gaps yet.