EntangleLab
Modules/Quantum Gates
Ĥ

Quantum Gates

Operations that manipulate qubits to perform computations.

1

Quantum Gates Overview

Just like classical logic gates (AND, OR, NOT), quantum gates manipulate qubits. But quantum gates are:

Reversible — every gate can be undone

Unitary — they preserve the probability (total = 1)

• Represented by unitary matrices

Unlike classical gates that are irreversible (you can't recover inputs from an AND gate's output), quantum computation is always reversible.

2

Pauli Gates (X, Y, Z)

Pauli-X (NOT gate):

Flips |0⟩ ↔ |1⟩. The quantum equivalent of a classical NOT.

Matrix: [[0,1],[1,0]]

Pauli-Y:

Rotates around the Y-axis of the Bloch sphere.

Matrix: [[0,-i],[i,0]]

Pauli-Z:

Flips the phase: |0⟩→|0⟩, |1⟩→-|1⟩

Matrix: [[1,0],[0,-1]]

Each Pauli gate corresponds to a 180° rotation around its respective axis on the Bloch sphere.

Explore Gate Operations
3

The CNOT Gate

The Controlled-NOT (CNOT) is a 2-qubit gate:

• If the control qubit is |1⟩, it flips the target qubit

• If the control is |0⟩, the target is unchanged

Truth table:

|00⟩ → |00⟩

|01⟩ → |01⟩

|10⟩ → |11⟩ (target flipped!)

|11⟩ → |10⟩ (target flipped!)

CNOT is essential for creating entanglement and is a key building block for quantum algorithms.

Try in Circuit Builder
4

Universal Gate Sets

A set of gates is universal if any quantum computation can be built from them.

Common universal sets:

{H, T, CNOT} — commonly used

{H, Toffoli} — another universal set

With just the Hadamard gate, a phase gate, and CNOT, you can approximate ANY quantum operation to arbitrary precision!

This is analogous to how any classical circuit can be built from NAND gates.