Quantum Computing Past Paper

Lecture 1: Bits and qubits

Given a complex number c=a+bic = a + b i, where a,bRa, b \in \mathbb{R},

Valid qubit state ψ=a0+b1| \psi \rangle = a |0 \rangle + b |1 \rangle, where a2+b2=1|a|^2 + |b|^2 = 1.

Lecture 2: Linear algebra

Inner product ψ×ϕ=ψϕ=i=1nψiϕi\langle \psi | \times | \phi \rangle = \langle \psi | \phi \rangle = \sum_{i=1}^n \psi_i^* \phi_i. Outer product ψϕ=i=1nj=1nψiϕjij| \psi \rangle \langle \phi | = \sum_{i=1}^n \sum_{j=1}^n \psi_i \phi_j^* |i \rangle \langle j|.

Tensor / Kronecker product ψϕ=ψ1ϕ,ψ2ϕ,...,ψnϕ| \psi \rangle \otimes | \phi \rangle = | \psi_1 \phi, \psi_2 \phi, ... ,\psi_n \phi \rangle,

AB=[a11Ba1nBam1BamnB].A \otimes B = \begin{bmatrix} a_{11}B & \cdots & a_{1n}B \\ \vdots & \ddots & \vdots \\ a_{m1}B & \cdots & a_{mn}B \end{bmatrix}.

Hadamard / Element-wise product ψϕ=ψϕ=ψϕ=ψ1ϕ1,ψ1ϕ2,...,ψnϕn| \psi \rangle \circ | \phi \rangle = | \psi \rangle \odot | \phi \rangle = | \psi \phi \rangle = | \psi_1 \phi_1, \psi_1 \phi_2, ... ,\psi_n \phi_n \rangle,

AB=AB=[a11b11a1nb1nam1bm1amnbmn].A \circ B = A \odot B = \begin{bmatrix} a_{11}b_{11} & \cdots & a_{1n}b_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1}b_{m1} & \cdots & a_{mn}b_{mn} \end{bmatrix}.

Eigenvalues λi\lambda_i / (normalised) eigenvectors vi|v_i \rangle Uvi=λivi\boxed{U |v_i \rangle = \lambda_i |v_i \rangle}, for unitary matrix UU.

For diagonalisable matrix, spectral decomposition U=i=1nλivi  viU=\sum_{i=1}^n \lambda_i |v_i \rangle \; \langle v_i |.

Unitary \cap Hermitian: A2=IA^2=I (self-inverse), e.g. X,Y,Z,HX, Y, Z, H.

\subseteq Unitary AA=IA^{\dagger}A = I     \implies A1=AA^{-1} = A^{\dagger} (unique inverse) \lor Hermitian A=AA=A^{\dagger} (self-adjoint).

\subseteq normal matrices AA=AAA^{\dagger}A = AA^{\dagger}.

Lecture 3: Quantum mechanics postulates

Superposition Hadamard gate HH,

Hx=12(0+eiπx1)=12[0+(1)x1], since eiπx=(1)x.=12z{0,1}(1)xzz.\begin{aligned} H | x \rangle & = \frac{1}{\sqrt{2}} (| 0 \rangle + e^{i \pi x} | 1 \rangle) \\ & = \frac{1}{\sqrt{2}} [| 0 \rangle + (-1)^{x} | 1 \rangle] \quad \text{, since } e^{i \pi x} = (-1)^x. \\ & = \frac{1}{\sqrt{2}} \sum_{z \in \{0, 1\}} (-1)^{x \cdot z} | z \rangle . \end{aligned}

Interference discerns some global property of the state, e.g. Hadamard gate HH, QFT, QPE.

Entanglement non-separability via Hadamard-CNOT combination CNOT(HI)00=12(00+11)\boxed{\text{CNOT} (H \otimes I)|00 \rangle= \frac{1}{\sqrt{2}} (|00 \rangle + |11 \rangle)}, transferring from standard basis to Bell basis.

Three-qubit entanglement: collapse it to two-qubit via I2CNOTI_2 \otimes \text{CNOT} gate.

Measurement in computational basis or (|+>, |->) basis

Measuring entangled states: sum of the squared amplitudes of the states in the basis.

Lecture 4: Quantum mechanics concepts

Perfectly distinguish pair of orthogonal states.

Helstrom-Holevo bound p1+sinθ2p \leq \frac{1+\sin\theta}{2}, where ψaψb=cosθ|\langle \psi_a | \psi_b \rangle|= \cos\theta. Hence, sinθ=1ψaψb2\sin\theta = \sqrt{1-|\langle \psi_a | \psi_b \rangle|^2}.

Proof: ψava2=cos2(π2θ2)=1+cos(π2θ)2=1+sinθ2,|\langle \psi_a| v_a \rangle|^2 = cos^2(\frac{\frac{\pi}{2}-\theta}{2})=\frac{1+cos(\frac{\pi}{2}-\theta)}{2}=\frac{1+sin\theta}{2}, where the chosen measurement basis viv_i spread equally each side of the states ψi\psi_i to be distinguished.

No-signalling principle: impossible to use entanglement or any quantum operation to infer whether a distant party has measured their qubit. After measurement, the entanglement is collapsed, thus not possible to transmit information faster than light.

No-cloning principle: impossible to copy an unknown quantum state. U.U(ψ0)=ψψ\nexists U. U (| \psi \rangle |0 \rangle) = | \psi \rangle | \psi \rangle.

No-deleting principle: impossible to delete one of the unknown quantum state copies. U~.U~(ψψ)=ψ0\nexists \tilde{U}. \tilde{U} (| \psi \rangle |\psi \rangle) = |\psi \rangle | 0 \rangle.

Lecture 5: Quantum circuits

Universal gate set: {H,T,CNOT}\{H, T, CNOT\}. Pauli gates X=HZHX=HZH, Y=iXZ=SXSZY=iXZ=SXSZ.

Proof for Z=HXHZ=HXH (L8. quantum search)

Rotation Rk=diag(1,ei2π2k)R_k = \text{diag}(1, e^{i \frac{2\pi}{2^{k}}}), Rk=diag(1,ei2π2k)R_k^{\dagger} = \text{diag}(1, e^{-i \frac{2\pi}{2^{k}}}). R0=IR_0 = I, R1=ZR_1 = Z, R2=SR_2 = S, R3=TR_3 = T, ... .

Rz(θ)=diag(eiθ2,eiθ2)R_z (\theta) = \text{diag}(e^{-i \frac{\theta}{2}}, e^{i \frac{\theta}{2}}), ignoring the global phase.

T=diag(1,eiπ4)=R3=Rz(π4)=eiπ8diag(eiπ8,eiπ8).S=T2=diag(1,eiπ2=i)=R2=Rz(π2)=eiπ4diag(eiπ4,eiπ4).Z=S2=diag(1,eiπ=1)=R1=Rz(π)=eiπ2diag(eiπ2,eiπ2).I=Z2=diag(1,1)=R0=Rz(0).\begin{aligned} T & = \text{diag}(1, e^{i \frac{\pi}{4}}) &= R_3 & = R_z(\frac{\pi}{4}) = e^{i \frac{\pi}{8}} \text{diag}(e^{- i \frac{\pi}{8}}, e^{i \frac{\pi}{8}}) . \\ S & = T^2 = \text{diag}(1, e^{i \frac{\pi}{2}}=i) & = R_2 & = R_z(\frac{\pi}{2}) = e^{i \frac{\pi}{4}} \text{diag}(e^{- i \frac{\pi}{4}}, e^{i \frac{\pi}{4}}) . \\ Z & = S^2 = \text{diag}(1, e^{i \pi}=-1) & = R_1 & = R_z(\pi) = e^{i \frac{\pi}{2}} \text{diag}(e^{- i \frac{\pi}{2}}, e^{i \frac{\pi}{2}}) . \\ I & = Z^2 = \text{diag}(1, 1) & = R_0 & = R_z(0) . \end{aligned}

[T,ST, S are not self-invertible and ZZ is self-inverse].

Toffoli gate

SWAP can be decomposed into 3 CNOTs.

Design via standard quantum gates

Lecture 6: Quantum information

Teleportation, send a qubit via two bits.

Super_dense coding, send two bits via one qubit.

Past paper

QKD: BB84

Eve's (intercept, measure, resend) attack.

Lecture 7: Deutsch-Jozsa algorithm

f:{0,1}n{0,1}\boxed{f: \{0, 1\}^n \rightarrow \{0, 1\}}, which is either constant or balanced.

Hnx=12nz{0,1}n(1)xzz\boxed{ H^{\otimes n} | x \rangle = \frac{1}{\sqrt{2^n}} \sum_{z \in \{0, 1\}^n} (-1)^{x \cdot z} | z \rangle }

Proof: as x=x1...xn| x \rangle = | x_1 ... x_n \rangle, where xi{0,1}x_i \in \{0, 1\} and

Hxi=12(0+(1)xi1)=12(z1=0+(1)xizj=1)=12((1)xi×0z1=0+(1)xi×1z2=1)=12((1)xi×z1z1=0+(1)xi×z2z2=1)=12zj{0,1}(1)xi×zjzj\begin{aligned} H |x_i \rangle & = \frac{1}{\sqrt{2}} (|0 \rangle + (-1)^{x_i} |1\rangle ) \\ & = \frac{1}{\sqrt{2}} (|z_1=0 \rangle + (-1)^{x_i} |z_j=1\rangle) \\ & = \frac{1}{\sqrt{2}} ((-1)^{x_i \times 0}|z_1=0 \rangle + (-1)^{x_i \times 1} |z_2=1\rangle) \\ & = \frac{1}{\sqrt{2}} ((-1)^{x_i \times z_1}|z_1=0 \rangle + (-1)^{x_i \times z_2} |z_2=1\rangle) \\ & = \frac{1}{\sqrt{2}} \sum_{z_j \in \{0, 1\}} (-1)^{x_i \times z_j} |z_j \rangle \end{aligned}

Hnx1...xn=i(Hxi)H^{\otimes n} | x_1 ... x_n \rangle = \otimes_i ( H |x_i \rangle), and the power of the function is ixi×zi=xz\sum_{i} x_i \times z_i = x \cdot z, we are done.

Past paper

ψ=1N[x s.t. f(x)=0x+x s.t. f(x)=1x]=1N[x s.t. f(x)=0x+M1Mx s.t. f(x)=1x]=1N[x s.t. f(x)=0x+Mxt]\begin{aligned} | \psi \rangle & = \frac{1}{\sqrt{N}} [ \sum_{x \text{ s.t. } f(x) = 0} | x \rangle + \sum_{x \text{ s.t. } f(x) = 1} | x \rangle] \\ &= \frac{1}{\sqrt{N}} [ \sum_{x \text{ s.t. } f(x) = 0} | x \rangle + \sqrt{M} \frac{1}{\sqrt{M}} \sum_{x \text{ s.t. } f(x) = 1} | x \rangle] \\ &= \frac{1}{\sqrt{N}} [ \sum_{x \text{ s.t. } f(x) = 0} | x \rangle + \sqrt{M} | x_t \rangle ] \end{aligned}

Past papers

Lecture 9: QFT & QPE

Quantum Fourier Transform (QFT)

QFT transforms a sequence of NN complex numbers {x}\{x\} into another {y}\{y\} of the same length,

x|x \rangle \rightarrow y|y \rangle: j=0N1xjj\sum_{j=0}^{N-1} x_j |j \rangle \rightarrow k=0N1ykk\sum_{k=0}^{N-1} y_k |k \rangle, where yk=1Nj=0N1wjkxj\boxed{y_k = \frac{1}{\sqrt{N}} \sum_{j=0}^{N-1} w^{jk} x_j} and w=ei2πNw = e^{i \frac{2\pi}{N}}.

Alternatively, we can express the QFT as a matrix transformation M\mathbf{M}, where NN is the dimension of the Hilbert space.

The DFT is thus y=Mxy = \mathbf{M} x, which in the matrix form is expressed as,

[y0ykyN1]=1N[11111ωω2ωN11ω2ω4ω2(N1)11ωN1ω2(N1)ω(N1)(N1)][x0xjxN1],where ω=ei2πN.\begin{bmatrix} y_0 \\ \dots \\ y_k \\ \dots \\ y_{N-1} \end{bmatrix} = \frac{1}{\sqrt{N}} \begin{bmatrix} 1 & 1 & 1 & \dots & 1 \\ 1 & \omega & \omega^2 & \dots & \omega^{N-1} \\ 1 & \omega^2 & \omega^4 & \dots & \omega^{2(N-1)} \\ 1 & \dots & \dots & \dots & \dots \\ 1 & \omega^{N-1} & \omega^{2(N-1)} & \dots & \omega^{(N-1)(N-1)} \end{bmatrix} \cdot \begin{bmatrix} x_0 \\ \dots \\ x_j \\ \dots \\ x_{N-1} \end{bmatrix}, \text{where }\omega = e^{i \frac{2\pi}{N}}.

The matrix M\mathbf{M} can be expressed as a sum of outer products of the basis states k|k \rangle, and j\langle j|,

M=1Nj=0N1k=0N1ωjkkj.\mathbf{M} = \frac{1}{\sqrt{N}} \sum_{j=0}^{N-1} \sum_{k=0}^{N-1} \omega^{jk} |k \rangle \langle j|.

where the outer product maps the state from j|j \rangle to k|k \rangle,

Mj=1Nk=0N1ωjkkjj,jM1Nk=0N1ωjkk.{\mathbf{M}} |j \rangle = \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} \omega^{jk} |k \rangle \langle j | j \rangle, \\ |j \rangle \rightarrow^{\mathbf{M}} \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} \omega^{jk} |k \rangle. \\

inverse QFT (iQFT)

y|y \rangle \rightarrow x|x \rangle: k=0N1ykkj=0N1xjj\sum_{k=0}^{N-1} y_k |k \rangle \rightarrow \sum_{j=0}^{N-1} x_j |j \rangle, where xj=1Nk=0N1wjkyk\boxed{x_j = \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} w^{-jk} y_k} and wjk=ei2πNjkw^{-jk} = e^{-i \frac{2\pi}{N} jk }.

Quantum Phase Estimation (QPE)

If given the eigenvector u|u \rangle of UU and eigenvalue ei2πϕe^{i 2\pi \phi} with phase ϕ[0,1)\phi \in [0,1), we have Uu=ei2πϕuU |u \rangle = e^{i 2\pi \phi}|u \rangle, we can estimate the phase ϕ\phi via QPE with tt bits of precision.

Past papers: QFT

iQFT / QPE

Lecture 10: QFT & QPE: factoring

order finding: for coprime xx and NN, find xr1modNx^r \equiv 1 \mod N, where rr is the least positive integer.

Ur=(xr)modNU |r \rangle = |(x \cdot r) \mod N \rangle     \implies For eigenstates s[0,r1],s\in [0, r-1], we have eigenvectors us=1rj=0r1ei2πsrjxjmodN|u_s \rangle = \frac{1}{\sqrt{r}} \sum_{j=0}^{r-1} e^{-i 2\pi \frac{s}{r}}j |x^j \mod N \rangle with phase ϕ=sr\phi = \frac{s}{r}.

Use QPE, 2nd2^{nd} register prepared with equal superposition of unknown eigenvectors 1rj=0r1uj=1\frac{1}{\sqrt{r}} \sum_{j=0}^{r-1} |u_j \rangle = |1 \rangle (shallow-depth quantum circuit XX).

factoring: for composite integer NN, N=pqN=p \cdot q, where pp and qq are prime numbers.

Shor's algorithm

Lecture 11: QFT & QPE: quantum chemistry

Trotter formula: U=ei(H1+H2)t=U1U2=eiH1teiH2t+O(t2)U = e^{-i(H_1+H_2)t} = U_1 U_2 = e^{-iH_1 t} e^{-iH_2t} + O(t^2), where U1U_1 and U2U_2 don't commute.

Projective measurement with (normalized) eigenvectors

Ground state energy estimation e0| e_0 \rangle of a HH with eigenvalue λ0=E0\lambda_0 = E_0.

Use QPE, 2nd2^{nd} register should be prepared as close to the eigenvector such that it's sufficiently dominated by the ground state e0| e_0 \rangle

Lecture 12: Quantum automata and complexity

Trick: try different combinations of matrix multiplication for state transition.

Lecture 13: Quantum error correction

New addition of Practical QEC (Google implementation).

Lecture 14: Fault tolerance

bit-flip, phase-flip, Shor code, Steane code

Fault tolerance threshold pth=1cp_{th} = \frac{1}{c}, for suppressed error rate p=cpe2+O(pe3)p = c p_e^2 + O(p_e^3). Per-gate error rate (cpe)2kc\frac{(cp_e)^{2^k}}{c} after kk concatenation.

Lecture 15: Adiabatic quantum computing

The adiabatic quantum theory, as a universal computing model that is polynomially equivalent to gate-based.

Quantum annealing, D-Wave.

QAOA

Lecture 16: Near-term case studies

Superconduct, trapped-ion, silicon, optical.