Quantum Algorithms: 51 Interactive Tutorials
Every tutorial on QuanBit follows the same six stages: a plain-language intuition, a step-by-step mathematical walkthrough, a live circuit you can step through gate by gate, a guided hands-on build, a knowledge check and a practice assessment. All of them run free in your browser, with nothing to install.
New to the subject? Start with Bell & GHZ States, then Deutsch-Jozsa and Grover's Search.
Foundations & Primitives
- Beginner3 Qubits
Bell & GHZ Entangled States
Creates two- and three-qubit maximally entangled states with one Hadamard and a chain of CNOTs — the resource behind teleportation, cryptography and error correction.
Start tutorial - Beginner3 Qubits
Quantum Random Number Generator
Turns superposition into perfectly unbiased random bits: one Hadamard and one measurement per bit.
Start tutorial - Beginner2 Qubits
Phase Kickback
Shows how a controlled gate acting on an eigenstate writes its eigenvalue onto the control qubit as a phase.
Start tutorial - Intermediate3 Qubits
Toffoli Gate from Clifford+T
Builds the three-qubit Toffoli (AND) gate exactly from Hadamard, T and CNOT gates, the way fault-tolerant hardware does.
Start tutorial - Intermediate3 Qubits
Quantum Half Adder
Adds two bits reversibly with one Toffoli (carry) and one CNOT (sum), the building block of quantum arithmetic.
Start tutorial - Beginner2 Qubits
The No-Cloning Theorem
Tests a CNOT "copy machine": it duplicates 0 and 1 perfectly but turns a superposition into entanglement instead of two copies.
Start tutorial - Intermediate1 Qubit
Quantum State Tomography
Reconstructs a qubit's Bloch vector by measuring many copies along the X, Y and Z axes.
Start tutorial
Search & Oracles
- Beginner2 Qubits
Deutsch-Jozsa Algorithm
Determines whether a mystery black-box function is Constant or Balanced in a single quantum query, whereas classical computers require exponential evaluations.
Start tutorial - Beginner4 Qubits
Bernstein-Vazirani Algorithm
Reveals an entire hidden bit string s from the function f(x) = s·x with a single oracle query, where any classical method needs n queries.
Start tutorial - Intermediate4 Qubits
Simon's Algorithm
Finds the hidden XOR period of a 2-to-1 function exponentially faster than any classical algorithm — the direct ancestor of Shor's algorithm.
Start tutorial - Intermediate2 Qubits
Hidden Shift Algorithm
Finds the secret offset s between two functions g(x) = f(x ⊕ s) with a single query to each, using Hadamard interference.
Start tutorial - Beginner2-3 Qubits
Grover's Search Algorithm
Finds a marked item in an unsorted database of N items with quadratic speedup (O(√N) vs classical O(N)) through phase inversion and diffusion.
Start tutorial
Fourier & Phase
- Intermediate3 Qubits
Quantum Fourier Transform (QFT)
Transforms computational basis amplitudes into frequency phase rotations with exponential speedup.
Start tutorial - Advanced3 Qubits
Quantum Phase Estimation
Estimates the unknown phase eigenvalue θ of an arbitrary unitary operator U using inverse QFT.
Start tutorial - Advanced2 Qubits
Iterative Phase Estimation
Reads an eigenphase one binary digit per round with a single ancilla qubit and classical feedback, replacing the QFT register.
Start tutorial - Advanced2 Qubits
Draper QFT Adder
Adds a constant to a quantum register by moving to the Fourier basis, applying phase gates, and transforming back.
Start tutorial - Advanced4 Qubits
Shor's Factoring Algorithm
Breaks RSA encryption by reducing prime factorization to quantum modular order finding in polynomial time.
Start tutorial
Variational, ML & Simulation
- Advanced2 Qubits
Variational Quantum Eigensolver (VQE)
Finds molecular ground state energies on NISQ quantum hardware via hybrid quantum-classical optimization.
Start tutorial - Advanced2 Qubits
Quantum Approximate Optimization Algorithm (QAOA)
Solves MaxCut with alternating cost and mixer layers whose angles are tuned by a classical optimizer — the leading near-term optimization algorithm.
Start tutorial - Advanced2 Qubits
Quantum Kernel Estimation
Encodes two data points into quantum states and measures their overlap, the kernel used by quantum support vector machines.
Start tutorial - Advanced2 Qubits
Hamiltonian Simulation (Trotterization)
Simulates the time evolution of two interacting quantum spins by alternating short bursts of each term of the Hamiltonian.
Start tutorial - Intermediate3 Qubits
The Swap Test
Uses one ancilla and a controlled-SWAP to measure how similar two quantum states are.
Start tutorial - Intermediate2 Qubits
The Hadamard Test
Estimates the expectation value of a unitary by interfering "apply U" with "do nothing" on one ancilla qubit.
Start tutorial
Quantum Phenomena
- Beginner1 Qubit
Mach-Zehnder Interferometer
Models a photon passing two beam splitters: a phase shift on one path decides which detector fires.
Start tutorial - Intermediate2 Qubits
Elitzur-Vaidman Bomb Tester
Uses an interferometer to detect a light-sensitive bomb without setting it off: interaction-free measurement.
Start tutorial - Intermediate2 Qubits
The Quantum Eraser
Shows interference vanishing when a marker records the path, and returning when that record is erased.
Start tutorial - Advanced3 Qubits
The GHZ Game
Three separated players share a GHZ state and win a cooperative game every time, which no classical strategy can do.
Start tutorial - Intermediate1 Qubit
Spin Echo & Dynamical Decoupling
Reverses unwanted phase drift by flipping the qubit halfway through, the trick behind MRI and dynamical decoupling.
Start tutorial - Advanced1 Qubit
Optimal State Discrimination
Finds the best possible measurement for telling apart two states that overlap, reaching the Helstrom limit.
Start tutorial
Quantum Communication
- Beginner3 Qubits
Quantum Teleportation
Transmits an unknown quantum state from Alice to Bob using 1 shared entangled Bell pair and 2 classical bits without violating the No-Cloning Theorem.
Start tutorial - Beginner2 Qubits
Superdense Coding
Sends two classical bits of information (00, 01, 10, or 11) by physically transmitting only a single quantum qubit through an entangled channel.
Start tutorial - Intermediate4 Qubits
Entanglement Swapping
Entangles two qubits that never interacted by performing a Bell measurement on their partners — the operating principle of quantum repeaters.
Start tutorial - Intermediate2 Qubits
One-Bit Teleportation
Transfers a quantum state to a neighbouring qubit using a single entangling gate and one classical correction bit.
Start tutorial - Advanced2 Qubits
Gate Teleportation & Magic States
Applies a T gate to a data qubit by consuming a pre-made "magic state", the way error-corrected quantum computers do.
Start tutorial - Advanced4 Qubits
Distributed (Non-Local) CNOT
Performs a CNOT between qubits on two separate processors by consuming one shared entangled pair and exchanging two classical bits.
Start tutorial - Advanced4 Qubits
Entanglement Purification
Sacrifices one entangled pair to test another, keeping only pairs that pass a parity check agreed over a classical channel.
Start tutorial - Advanced1 Qubit
Quantum Random Access Code
Packs two classical bits into one qubit so that either bit, but not both, can be recovered with 85.4% probability.
Start tutorial
Quantum Cryptography
- Beginner1 Qubit
BB84 Quantum Key Distribution
Alice and Bob grow a shared secret key from qubits sent in random bases; any eavesdropper unavoidably disturbs the states and is detected.
Start tutorial - Intermediate2 Qubits
E91 Protocol & the CHSH Bell Test
Uses entangled pairs and a CHSH inequality test to certify a secret key: correlations of 85% beat the 75% limit of every classical theory.
Start tutorial - Intermediate1 Qubit
B92 Quantum Key Distribution
A minimal key-distribution protocol: Alice sends one of just two overlapping states, and Bob keeps only the results that are conclusive.
Start tutorial - Intermediate1 Qubit
Six-State Quantum Key Distribution
Extends BB84 with a third basis, giving an eavesdropper less information and making her easier to detect.
Start tutorial - Intermediate2 Qubits
BBM92 Entanglement-Based Key Distribution
The entanglement-based form of BB84: both parties measure halves of entangled pairs in random bases and keep matching rounds.
Start tutorial - Intermediate2 Qubits
Wiesner's Quantum Money
The first idea in quantum cryptography: banknotes carrying qubits in secret bases, which a counterfeiter cannot copy without being caught.
Start tutorial - Intermediate1 Qubit
Quantum One-Time Pad
Encrypts a qubit with random X and Z flips chosen by a two-bit key, so that without the key it looks like pure noise.
Start tutorial
Error Correction
- Intermediate5 Qubits
Quantum Error Correction Codes
Protects one logical qubit inside three physical qubits and pinpoints bit-flip or phase-flip errors by measuring parity syndromes without disturbing the data.
Start tutorial - Advanced3 Qubits
Measurement-Free Error Correction
Completes the bit-flip code: decoding moves the error syndrome onto two qubits and a Toffoli gate repairs the data automatically.
Start tutorial - Advanced5 Qubits
The [[4,2,2]] Error-Detecting Code
Encodes two logical qubits in four physical ones and flags a bit-flip anywhere with a single parity check.
Start tutorial - Advanced5 Qubits
Stabilizer Measurement (Surface-Code Check)
Measures the X-type stabilizer of four data qubits with one ancilla, exactly as a surface-code plaquette does, to catch phase-flip errors.
Start tutorial
Sampling & Models
- Advanced3 Qubits
Cluster States & Measurement-Based Computing
Builds a linear cluster state with Hadamards and CZ gates and verifies its stabilizers, the resource for one-way quantum computing.
Start tutorial - Advanced3 Qubits
Random Circuit Sampling
Runs layers of scrambling gates to produce the speckled output distribution used in quantum-advantage experiments.
Start tutorial - Advanced3 Qubits
IQP Circuit Sampling
Sandwiches commuting phase gates between two Hadamard layers to produce an output distribution believed hard to sample classically.
Start tutorial