Amplitude + Amplitude −
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Bernstein–Vazirani Algorithm: One Query, Full String

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.