Reference

Quantum Gate Matrices Reference

Comprehensive reference for quantum gate matrix representations and their effects on qubit states.

Single Qubit Gates

X

Pauli-X Gate

The Pauli-X gate performs a bit flip operation, equivalent to a classical NOT gate.

01
10
|0⟩ → |1⟩, |1⟩ → |0⟩
Y

Pauli-Y Gate

The Pauli-Y gate performs a bit and phase flip operation.

0-i
i0
|0⟩ → i|1⟩, |1⟩ → -i|0⟩
Z

Pauli-Z Gate

The Pauli-Z gate performs a phase flip operation.

10
0-1
|0⟩ → |0⟩, |1⟩ → -|1⟩
H

Hadamard Gate

The Hadamard gate creates superposition by rotating the qubit state.

1/√21/√2
1/√2-1/√2
|0⟩ → (|0⟩ + |1⟩)/√2, |1⟩ → (|0⟩ - |1⟩)/√2
S

S Gate

The S gate applies a π/2 phase shift.

10
0i
|0⟩ → |0⟩, |1⟩ → i|1⟩
S†

S† Gate

The S† (S-dagger) gate applies a -π/2 phase shift.

10
0-i
|0⟩ → |0⟩, |1⟩ → -i|1⟩
T

T Gate

The T gate applies a π/4 phase shift.

10
0e^(iπ/4)
|0⟩ → |0⟩, |1⟩ → e^(iπ/4)|1⟩
T†

T† Gate

The T† (T-dagger) gate applies a -π/4 phase shift.

10
0e^(-iπ/4)
|0⟩ → |0⟩, |1⟩ → e^(-iπ/4)|1⟩
RX(θ)

RX Gate

The RX gate rotates the qubit around the X-axis by angle θ.

cos(θ/2)-i·sin(θ/2)
-i·sin(θ/2)cos(θ/2)
Rotates qubit state around X-axis
RY(θ)

RY Gate

The RY gate rotates the qubit around the Y-axis by angle θ.

cos(θ/2)-sin(θ/2)
sin(θ/2)cos(θ/2)
Rotates qubit state around Y-axis
RZ(θ)

RZ Gate

The RZ gate rotates the qubit around the Z-axis by angle θ.

e^(-iθ/2)0
0e^(iθ/2)
Rotates qubit state around Z-axis

Two Qubit Gates

CNOT

CNOT Gate

The Controlled-NOT gate flips the target qubit if the control qubit is |1⟩.

1000
0100
0001
0010
|00⟩ → |00⟩, |01⟩ → |01⟩, |10⟩ → |11⟩, |11⟩ → |10⟩
CZ

CZ Gate

The Controlled-Z gate applies a phase flip to the target qubit if the control qubit is |1⟩.

1000
0100
0010
000-1
|00⟩ → |00⟩, |01⟩ → |01⟩, |10⟩ → |10⟩, |11⟩ → -|11⟩
SWAP

SWAP Gate

The SWAP gate exchanges the states of two qubits.

1000
0010
0100
0001
|01⟩ ↔ |10⟩, other states unchanged

Mathematical Properties

Unitary Operations

All quantum gates are unitary operations, meaning they preserve the norm of quantum states and are reversible.

U†U = I

Matrix Multiplication

Multiple gates applied sequentially combine through matrix multiplication.

|ψ⟩ → U₂U₁|ψ⟩

Try It Yourself

See these gates in action with real-time state vector visualization.

Open Circuit Editor