Deutsch-Jozsa Algorithm: One Query, Certain Answer
Run the real Deutsch-Jozsa circuit — uniform superposition, oracle phase kickback, Walsh-Hadamard transform — on a hidden Boolean function and watch the all-zeros amplitude land on probability 1 (constant) or 0 (balanced) after exactly one query, versus the classical 2^(n-1)+1 worst case.
This simulator runs the actual Deutsch-Jozsa circuit on a real amplitude array of size N=2ⁿ: a uniform superposition, an oracle that applies a genuine phase kickback (−1)^f(x) to every basis state where your hidden function outputs 1, and a real Walsh-Hadamard transform back into the computational basis. Nothing about the outcome is pre-baked — build a constant function and the all-zeros amplitude always lands at probability 1; build a balanced one, by random assignment or by parity, and it always lands at exactly 0. Compare that single oracle call against the classical worst case, which needs 2ⁿ⁻¹+1 queries to reach the same certainty.
Explore the Deutsch-Jozsa algorithm with a quantum computer. Prepare superpositions, apply phase kickback via oracle U_f, and measure all-zeros outcomes to distinguish constant from balanced functions in one query, outperforming classical methods by orders of magnitude.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install