Skip to main content
Problem List
Q28.Bernstein-Vazirani 1-Bit Hidden String s = "1"Medium

Q28.Bernstein-Vazirani 1-Bit Hidden String s = "1"

Quantum ParallelismQubits: 2Q
Extract the 1-bit secret string s=1s = 1 in a single query using the Bernstein-Vazirani algorithm.
Target Objective:
Initialize ancilla q1q_{1} into ∣−⟩|-\rangle, put q0q_{0} in ∣+⟩|+\rangle, apply CNOT(0->1) to encode inner product s⋅xs \cdot x, and apply Hadamard on q0q_{0} to decode s=1s=1.
Judge Acceptance Criteria:

Measurement probability for designated basis state must reach ≥ 95%.

Gates:
q[0]|0⟩
S0
S1
S2
S3
S4
S5
S6
S7
q[1]|0⟩
S0
S1
S2
S3
S4
S5
S6
S7
Live Python / Qiskit Code (Edit to Update Circuit)
 
Type Qiskit Python code above to update gates on wires automatically0 gates · 2Q
0 gates placed2 Qubits · 8 Steps
State Measurement Distribution:4 non-zero basis states
|10⟩0.0%
|11⟩0.0%
|00⟩100.0%
|01⟩0.0%