Build and test simple quantum algorithms interactively. See how superposition and entanglement instantly affect complex amplitudes and measurement probabilities. See the Application User Guide.
This is a lightweight, client-side 2-qubit quantum circuit simulator, built to help users understand the fundamental principles of quantum computing. Unlike classical bits, which are strictly 0 or 1, the qubits simulated here can exist in a superposition of both states simultaneously. This interactive tool demonstrates how applying quantum gates modifies the system's state vector, which is composed of complex amplitudes rather than simple binary values. Observing these changing amplitudes is key to grasping quantum mechanics.
The core of the simulation relies on simple JavaScript to perform the necessary linear algebra—specifically, matrix multiplication of unitary matrices (the gates) against the 4-dimensional state vector. The final measurement probabilities for the basis states $|00\rangle, |01\rangle, |10\rangle,$ and $|11\rangle$ are calculated from the squared magnitude of these complex amplitudes, providing a clear visual link between the theoretical quantum state and the observable classical outcome.
Operating this interactive simulation is straightforward. Simply drag a gate from the Gate Palette onto an empty slot in the Quantum Circuit. You can remove an existing gate by dragging it off the track.
Experiment with different sequences of Hadamard gate, Pauli-X gate, and CNOT gate to explore complex quantum mechanics concepts through hands-on interactive simulation.