QUANTUM 04

Quantum
gates

Pauli, phase, and Hadamard gates as matrices and rotations, plus CNOT

Sinclair College - Dr. Mike Libassi

TODAY

What we will cover

01Gates as matricesMatrix × vector
02The catalogX, Y, Z, S, T, H
03IdentitiesHow gates combine
04CNOTConnecting two qubits
Quantum 04 · Quantum Gates2

01 · GATES AS MATRICES

Every gate is a matrix times a vector

X|0⟩=0  11  010=01=|1⟩
on the Bloch sphere, every single-qubit gate is a rotation

Quantum gates are unitary: they can always be run backward, so no information is ever destroyed.

Quantum 04 · Quantum Gates3

02 · THE CATALOG

The single-qubit gates

GateMatrixWhat it doesBloch rotation
X[[0, 1], [1, 0]]bit flip (quantum NOT)180° about x
Y[[0, −i], [i, 0]]bit flip + phase180° about y
Z[[1, 0], [0, −1]]phase flip: |+⟩ ↔ |−⟩180° about z
S[[1, 0], [0, i]]quarter-turn phase90° about z
T[[1, 0], [0, e^(iπ/4)]]eighth-turn phase45° about z
H1/√2 [[1, 1], [1, −1]]creates superposition180° about x+z
Quantum 04 · Quantum Gates4

03 · IDENTITIES

Gates combine in surprising ways

X · X = I

Flipping twice does nothing. Every Pauli gate is its own inverse.

H · H = I

The Hadamard undoes itself: interference in action.

HZH = X

A phase flip between Hadamards becomes a bit flip.

S · S = Z

Two quarter turns make a half turn.

T · T = S

Two eighth turns make a quarter turn.

Global phase

Y|0⟩ = i|1⟩. The factor i changes nothing measurable.

Quantum 04 · Quantum Gates5

04 · CNOT

CNOT: flip the target if the control is 1

Input |control target⟩OutputWhy
|00⟩|00⟩control is 0: nothing happens
|01⟩|01⟩control is 0: nothing happens
|10⟩|11⟩control is 1: target flips
|11⟩|10⟩control is 1: target flips
Quantum 04 · Quantum Gates6

WHY IT MATTERS

A small toolkit that builds everything

Universal set

H, T, and CNOT together can approximate any quantum circuit.

Reversible math

Shor's algorithm must do arithmetic with reversible gates, which costs many qubits.

The workhorses

H creates superposition; CNOT creates entanglement.

Quantum 04 · Quantum Gates7

WRAP-UP

Key takeaways

1

A gate is a 2×2 unitary matrix; applying it is matrix × vector

2

On the Bloch sphere, gates are rotations about an axis

3

Sequences multiply into one matrix: HZH = X, S·S = Z

4

CNOT is the two-qubit gate that makes entanglement possible

Quantum 04 · Quantum Gates8

DISCUSSION

A classical NOT gate has a quantum version. Why can't a classical AND gate be a quantum gate directly?

Hint: given only the output of AND, can you always recover the inputs?

Quantum 04 · Quantum Gates · Questions?  ·  Open the interactive page