Bernstein–Vazirani Algorithm 2D — Amplitude Bar Chart
2D canvas simulator: the Bernstein–Vazirani algorithm recovers a hidden n-bit string in a single quantum query. Watch a live amplitude bar chart step through superposition, oracle phase-kickback and interfering final Hadamard collapse — drag to pan, scroll to zoom.
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 2D simulator renders every computational basis state 0..2ⁿ−1 as a bar in a live amplitude chart 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 pan and zoom across the register and watch destructive interference erase every wrong answer, leaving probability 1 sitting exactly on the hidden string.
The 2D companion to the 3D amplitude-bar simulator: the Bernstein–Vazirani algorithm recovers a hidden n-bit string in a single quantum query, visualized as a live 2D bar chart you can pan and zoom through superposition, oracle phase-kickback and interference.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install