Apply quantum gates and watch the Bloch sphere rotate in real time. Build gate sequences, discover why every gate is reversible, and master the CNOT that creates entanglement.
Every quantum gate has an inverse. X·X = I. H·H = I. This is required by quantum mechanics — information is never destroyed.
Each gate rotates the qubit state vector on the Bloch sphere. X = 180° flip. H = 90° rotation to equator. Z = phase rotation.
Two-qubit gate: flips target qubit if and only if control qubit is |1⟩. The key gate for creating entanglement between qubits.
Each gate is a unitary matrix. Applying the gate = matrix multiplication. The circuit = product of all gate matrices.
| In | Out | Reversible? |
|---|---|---|
| 0 | 1 | ✅ |
| 1 | 0 | ✅ |
| In | Out | X·X? |
|---|---|---|
| |0⟩ | |1⟩ | Back to |0⟩ ✅ |
| |1⟩ | |0⟩ | Back to |1⟩ ✅ |
| In A | In B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | C in | C out |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 |
You mastered quantum gates — the building blocks of every quantum algorithm!
Every quantum gate is reversible. This follows from the unitary nature of quantum evolution. No information is ever destroyed in a quantum computation.
Unlike multiplication (3×4 = 4×3), quantum gates don't commute. HX ≠ XH. This gives quantum circuits their computational power.
Just three gates — H, T, and CNOT — can approximate any quantum computation to any desired accuracy. This is quantum universality.
A quantum circuit is the matrix product of its gates applied in sequence. The output state = (last gate) × ... × (first gate) × (input state).