Quantum Gate Simulator: Visualize Qubit Rotations in Real Time

simulator intermediate ~10 min
Loading simulation...
H|0⟩ = |+⟩ — equal superposition on equator

Applying the Hadamard gate to |0⟩ produces the |+⟩ state on the equator of the Bloch sphere, giving 50/50 measurement probability for |0⟩ and |1⟩.

Formula

H = (1/√2)[[1,1],[1,-1]]
X = [[0,1],[1,0]], Y = [[0,-i],[i,0]], Z = [[1,0],[0,-1]]
T = [[1,0],[0,e^{iπ/4}]]

Gates as Rotations

Every single-qubit quantum gate is a rotation on the Bloch sphere. The Pauli matrices X, Y, Z generate rotations around their respective axes, and any unitary can be decomposed into a sequence of such rotations. This geometric picture makes it possible to design gate sequences intuitively: want to flip a qubit? Rotate 180° around X. Want to create superposition? Apply a Hadamard, which is a 180° rotation around the diagonal (X+Z)/√2 axis.

The Standard Gate Library

Quantum computers implement a small set of native gates from which all others are composed. The Clifford gates (H, S, CNOT) are efficiently simulable classically, but adding the T gate makes the set universal. Each physical platform (superconducting, trapped ion, photonic) implements these logical gates differently, but the abstract circuit model remains the same. Gate fidelity — how closely the physical operation matches the ideal unitary — is the key quality metric.

Gate Composition and Circuits

Quantum circuits are read left to right: each wire represents a qubit, and gates are applied in sequence. Unlike classical circuits, quantum circuits cannot have fan-out (no-cloning theorem) and every gate must be reversible. A circuit of depth d applies d sequential layers of gates. Minimizing circuit depth is crucial because each gate introduces a small error, and decoherence limits the total computation time available.

Toward Fault Tolerance

Real quantum gates have error rates around 0.1–1%. For useful computation, these errors must be corrected faster than they accumulate. Fault-tolerant protocols encode logical qubits into many physical qubits and use only transversal gates that don't spread errors. The T gate requires a special technique called magic state distillation, making it the bottleneck of fault-tolerant quantum computing.

FAQ

What are quantum gates?

Quantum gates are unitary operations that transform qubit states. Each gate corresponds to a rotation on the Bloch sphere. Unlike classical logic gates, quantum gates are reversible and can create superposition and entanglement. Common gates include Pauli-X (NOT), Hadamard (superposition), and T (phase).

What makes the Hadamard gate special?

The Hadamard gate creates equal superposition from a basis state: H|0⟩ = (|0⟩+|1⟩)/√2. It is the gateway to quantum parallelism and appears at the start of nearly every quantum algorithm. Geometrically, it rotates 180° around the (X+Z)/√2 axis.

What is a universal gate set?

A universal gate set can approximate any unitary transformation to arbitrary precision. The set {H, T, CNOT} is universal: Hadamard and T generate all single-qubit gates (approximately), and CNOT entangles qubits. This is the standard gate set for fault-tolerant quantum computing.

Why are quantum gates reversible?

Quantum mechanics is governed by unitary evolution, which is inherently reversible. Every quantum gate U has an inverse U† (U-dagger). This means quantum computation never destroys information during gate operations — information loss only occurs at measurement.

Sources

Embed

<iframe src="https://homo-deus.com/lab/quantum-computing/quantum-gates/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub