Keyboard: / notation search · ? shortcuts on practice pages. Settings are saved in this browser.
Lecture 4 · Dr Jonte Hance · about 60 min
Single-qubit operations
Doing things to qubits. The Pauli gates, Hadamard and the phase gates; why every gate must be unitary; Hermitian operators, eigenstates, and circuit notation.
How much help?
How well do you know this?
By the end you can
Apply I,X,Y,Z,H,S,T to any single-qubit state, by matrix or by rule
Multiply Paulis and write products like XY=iZ as scalar × operator
Test whether a matrix is unitary (U†U=I) or Hermitian (A=A†)
Name the eigenstates of each Pauli and the basis it stabilises
Every quantum operation except measurement is linear: doing it to a sum is the sum of doing it to each part. Any linear map on an n-dimensional space is an n×n matrix, and a qubit lives in 2 dimensions, so single-qubit gates are 2×2 matrices.
Linearity means you only need to know what a gate does to ∣0⟩ and ∣1⟩; everything else follows:
U(α∣0⟩+β∣1⟩)=αU∣0⟩+βU∣1⟩.
The gates
IdentityI=(1001): does nothing.
Pauli-X (the quantum NOT): X=(0110), so X∣0⟩=∣1⟩, X∣1⟩=∣0⟩, and X(α∣0⟩+β∣1⟩)=β∣0⟩+α∣1⟩: it swaps the amplitudes. Twice is nothing: X2=I.
Pauli-Z (phase flip): Z=(100−1), so Z∣0⟩=∣0⟩, Z∣1⟩=−∣1⟩. It flips the sign of β: Z∣+⟩=∣−⟩.
Pauli-Y: Y=(0i−i0), so Y∣0⟩=i∣1⟩, Y∣1⟩=−i∣0⟩. (Note Y=iXZ: a bit flip and a phase flip together.)
H turns a definite basis state into an equal superposition. Measure H∣0⟩ in 0/1 and you get a true random bit. H is its own inverse: H2=I, so H∣+⟩=∣0⟩.
Phase gates: S=(100i) and T=(100eiπ/4). They are “roots” of Z: S2=Z, T2=S. They only change the relative phase, rotating the Bloch vector around the vertical (Z) axis by 90° and 45°.
Explore · gates as rotations of the Bloch sphere
Start at |0⟩ and press H, then Z, then H. Where do you end up? Then try S four times from |+⟩. Every gate is a rotation of the sphere: X, Y, Z are half-turns about their axes, H is a half-turn about the diagonal between X and Z, S is a quarter-turn about Z.
Jump to:
Apply a gate:
Lock it in · answer in your head, then reveal
Pauli-X matrix and action
X=(0110), flips: X∣0⟩=∣1⟩, X∣1⟩=∣0⟩.
Pauli-Z matrix and action
Z=(100−1): Z∣0⟩=∣0⟩, Z∣1⟩=−∣1⟩ (phase flip).
Pauli-Y matrix
Y=(0i−i0): Y∣0⟩=i∣1⟩, Y∣1⟩=−i∣0⟩.
Hadamard matrix and action on basis states
H=21(111−1); H∣0⟩=∣+⟩, H∣1⟩=∣−⟩.
S and T gates
S=diag(1,i)=Z, T=diag(1,eiπ/4)=S. Unitary but not Hermitian.
Pauli algebra
Multiply different Paulis and you always get the third one times ±i:
XY=iZ,YZ=iX,ZX=iY,YX=−iZ,ZY=−iX,XZ=−iY.
The rule: going round the cycle X→Y→Z→X in order gives +i; against the cycle gives −i. Compactly, σaσb=δabI+iεabcσc, where εabc is +1 for cyclic order, −1 for anticyclic, 0 if any index repeats.
Eigenstates: which basis does each Pauli stabilise?
A gate stabilises a state if it leaves it unchanged apart from a factor: U∣v⟩=λ∣v⟩. That is exactly ”∣v⟩ is an eigenvector”.
Pauli
Eigenstates (eigenvalue)
Basis stabilised
Z
∣0⟩ (+1), ∣1⟩ (−1)
0 or 1
X
∣+⟩ (+1), ∣−⟩ (−1)
+ or −
Y
∣i⟩ (+1), ∣−i⟩ (−1)
i or −i
Every Pauli has eigenvalues exactly ±1. When an operator is used as a measurement, the eigenvalues are the possible results and the eigenstates are the only states with a definite result. So “measure Z” means “measure 0 or 1” with results reported as +1 / −1.
Lock it in · answer in your head, then reveal
XY = ? and YX = ?
XY=iZ, YX=−iZ. In general σaσb=iεabcσc for a=b.
Which basis does each Pauli stabilise?
Z: {∣0⟩,∣1⟩}. X: {∣+⟩,∣−⟩}. Y: {∣i⟩,∣−i⟩}. Each has eigenvalues ±1.
What is X2, Y2, Z2, H2?
All equal I: these gates are both unitary and Hermitian, so they are their own inverses.
HZH = ?
X. (And HXH=Z.) Sandwiching with H swaps the Z and X axes of the Bloch sphere.
Which matrices are allowed? Unitaries
Not every 2×2 matrix is a valid gate. A gate must keep the state normalised, ∣α∣2+∣β∣2=1, for every input. Matrices that preserve the length of every vector are called unitary.
Intuition: unitaries redistribute probability between basis states and change phases, but never create or destroy it.
Hermitian operators
Some operators equal their own adjoint: A=A†. These are Hermitian (self-adjoint). Their eigenvalues are always real, which is why measurable quantities (observables) are Hermitian. X,Y,Z,H are Hermitian and unitary, so U2=U†U=I: they undo themselves.
S and T are unitary but not Hermitian: S†=diag(1,−i)=S. So applying S twice does not undo it (S2=Z); you need S†.
Lock it in · answer in your head, then reveal
Necessary and sufficient condition for U to be unitary
U†U=I (equivalently U−1=U†). Unitaries preserve the norm, so probabilities still add to 1.
Necessary and sufficient condition for A to be Hermitian
A=A† (it equals its own conjugate transpose).
How do you compute A†?
Transpose (reflect in the diagonal), then complex-conjugate every entry.
Universality and circuits
Combining these gates you can rotate the Bloch vector any way you like. For example HSH is a rotation about the X axis. With these single-qubit gates plus one two-qubit gate (CNOT, Lecture 6) you can build any quantum computation: the gate set is universal (up to arbitrarily good approximation, using H and T).
Circuit notation: each horizontal line is a qubit, time flows left to right, boxes are gates, and a meter symbol is a measurement (normally in 0/1, since any other basis can be rotated to 0/1 by a gate first: to measure +/−, apply H then measure 0/1).
4.1 · Verify the Paulis on basis vectors
Lecture 4 exercise (a)
Verify X∣0⟩=∣1⟩, Y∣0⟩=i∣1⟩, Y∣1⟩=−i∣0⟩ and Z∣1⟩=−∣1⟩ by matrix multiplication.
Worked solution
X∣0⟩=(0110)(10)=(01)=∣1⟩.
Y∣0⟩=(0i−i0)(10)=(0i)=i∣1⟩. (Just the first column of Y.)
Y∣1⟩= second column =(−i0)=−i∣0⟩.
Z∣1⟩= second column of Z =(0−1)=−∣1⟩.
Answer: All four hold. Shortcut: U∣0⟩ is the first column and U∣1⟩ the second.
Answer: Unitary but not Hermitian. (It is Rx(π/2), a quarter-turn about the X axis.)
4.6 · Conjugating by H
Lecture 4: rotations
Show HZH=X.
Worked solution
ZH=(100−1)21(111−1)=21(1−111).
H(ZH)=21(111−1)(1−111)=21(0220)=X.
Answer:HZH=X. H swaps the roles of the Z and X axes; this is why “H, phase gate, H” rotates about X.
Check yourself
Which condition is both necessary and sufficient for an operator to be diagonal?
Write A=(acbd). Then AZ−ZA=(02c−2b0), which is zero exactly when b=c=0. More generally: a matrix is diagonal in a basis exactly when that basis consists of its eigenvectors, i.e. A∣k⟩=λk∣k⟩ for every basis vector. Check the quiz wording carefully, as it may phrase this as A=∑kλk∣k⟩⟨k∣.
↧ Go deeper: Rotations: every gate is exp(−iθ n·σ/2) MSc
Any single-qubit unitary is, up to global phase, a rotation Rn^(θ)=e−iθn^⋅σ/2=cos2θI−isin2θ(nxX+nyY+nzZ), which turns the Bloch vector by θ about the axis n^. The identity uses (n^⋅σ)2=I, which follows from the Pauli algebra above. Consequence: X=iRx(π), H=iR(x^+z^)/2(π). Any unitary also factors as eiγRz(β)Ry(γ′)Rz(δ) (Euler decomposition). Nielsen & Chuang §4.2.
↧ Go deeper: Hamiltonians generate gates MSc
Physically, a gate is what Schrödinger evolution does for a time t: U=e−iHt/ℏ for a Hermitian Hamiltonian H. Hermitian ⇒ U unitary. A spin in a magnetic field along z has H∝Z, so it precesses around the Z axis: that is how hardware implements phase gates. Pulses of microwaves (superconducting qubits) or lasers (trapped ions) implement X and Y rotations.
↧ Go deeper: Solovay–Kitaev and the Clifford+T gate set PhD
{H,S,CNOT} generates the Clifford group, which by the Gottesman–Knill theorem can be simulated efficiently on a classical computer. Adding T makes the set universal. The Solovay–Kitaev theorem guarantees any single-qubit gate can be approximated to accuracy ϵ with O(logc(1/ϵ)) gates; in fault-tolerant machines T gates are the expensive resource (“magic states”). Dawson & Nielsen, quant-ph/0505030.