HomeQuantum ComputingBernstein–Vazirani Algorithm: One Query, Full String

Bernstein–Vazirani Algorithm: One Query, Full String

Watch the Bernstein–Vazirani algorithm recover a hidden n-bit string in a single quantum query. A 3D amplitude-bar grid shows superposition, oracle phase-kickback and the final Hadamard interference that collapses onto the answer.

Quantum Computing3DAdvanced60 FPS📱 Mobile-adapted
qe-topic-48 ↗ Open standalone

The Bernstein–Vazirani algorithm is the cleanest demonstration that a quantum computer can beat any classical algorithm's query complexity — not by a constant factor, but by a full factor of n. Given oracle access to a hidden n-bit string s hidden inside the function f(x) = s·x mod 2, a classical computer needs n separate queries (one per bit) to learn s, while a quantum computer learns all of it from a single call. This simulator renders every computational basis state 0..2ⁿ−1 as a bar in a live 3D amplitude grid and steps through the four real stages of the algorithm — uniform superposition, oracle phase-kickback, the interfering final Hadamard transform, and measurement — so you can watch destructive interference erase every wrong answer and leave probability 1 sitting exactly on the hidden string.

⚙ Under the hood

Watch the Bernstein–Vazirani algorithm recover a hidden n-bit string in a single quantum query, visualized as a live 3D amplitude-bar grid through superposition, oracle phase-kickback and interference.

quantum computingquantum algorithmqubitsinterferencephase kickbackoracle

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)