Week 13 | simulation, variational algorithms, what they can and cannot do yet, and how to read a quantum-advantage claim | reading: IBM Quantum Learning, "Variational algorithm design", lessons 1–2; de Wolf Ch. 9
The algorithms of Block II need error-corrected machines. This lecture asks what can be done before then, and how to tell a real result from a press release. By the end you should be able to estimate the number of Trotter steps a simulation needs, explain why the variational principle makes VQE an upper-bound method, compute a gradient by the parameter-shift rule, estimate the number of shots an energy measurement costs, set up QAOA for MaxCut and read its landscape, explain barren plateaus, and apply a checklist to a quantum-advantage claim.
Feynman's original argument for quantum computers (1982) was simulation: a classical description of \(n\) interacting quantum particles needs \(2^n\) numbers, but a quantum computer could imitate the system directly. The task is to apply the time-evolution operator \(e^{-iHt}\) of a Hamiltonian \(H\), a Hermitian matrix whose eigenvalues are the system's energy levels. Physical Hamiltonians are sums of local terms, each acting on a few particles, and each term's exponential is a small circuit. The terms do not commute, so \(e^{-i(A+B)t}\ne e^{-iAt}e^{-iBt}\) in general; the fix is to alternate in small steps.
For \(H=A+B\), time \(t\) and \(r\) steps, the first-order Trotter formula is \(S_1=\big(e^{-iAt/r}e^{-iBt/r}\big)^r\), and the second-order (symmetric) formula is \(S_2=\big(e^{-iAt/2r}e^{-iBt/r}e^{-iAt/2r}\big)^r\).
\(\big\|e^{-i(A+B)t}-S_1\big\|\le\dfrac{t^2}{2r}\,\big\|[A,B]\big\|\), where \(\|\cdot\|\) is the operator norm and \([A,B]=AB-BA\).
Proof. One step first, with \(\delta=t/r\). Let \(U(s)=e^{-i(A+B)s}\) and \(W(s)=e^{-iAs}e^{-iBs}\). Since \(W(0)=U(0)=I\), \(W(\delta)-U(\delta)=\int_0^\delta\frac{d}{ds}\big[U(\delta-s)W(s)\big]\,ds=\int_0^\delta U(\delta-s)\big(W'(s)+i(A+B)W(s)\big)ds.\) Now \(W'(s)=-iAW(s)-ie^{-iAs}Be^{-iBs}\), so \(W'(s)+i(A+B)W(s)=i\,[B,e^{-iAs}]\,e^{-iBs}\). Writing \([e^{-iAs},B]=-i\int_0^se^{-iAu}[A,B]e^{-iA(s-u)}du\) shows \(\|[B,e^{-iAs}]\|\le s\|[A,B]\|\). Unitaries have norm 1, so \(\|W(\delta)-U(\delta)\|\le\int_0^\delta s\,\|[A,B]\|\,ds=\tfrac{\delta^2}{2}\|[A,B]\|\). For \(r\) steps, telescope: \(W^r-U^r=\sum_{j=0}^{r-1}W^{j}(W-U)U^{r-1-j}\), so \(\|W^r-U^r\|\le r\,\|W-U\|\le r\cdot\frac{t^2}{2r^2}\|[A,B]\|\).
So the error falls like \(1/r\), and a target accuracy \(\epsilon\) needs \(r\approx t^2\|[A,B]\|/(2\epsilon)\) steps. The second-order formula cancels the leading error term by symmetry and its error falls like \(1/r^2\); higher orders exist, as do methods with even better scaling (qubitization, linear combinations of unitaries), which are beyond this course.
For some splitting \(H=A+B\), \(\|[A,B]\|=4\). How many first-order Trotter steps does Proposition 24.1 require to simulate time \(t=3\) with error at most \(0.02\)?
Take \(H=Z_0+Z_1+\tfrac12X_0X_1\) (used throughout this lecture), split as \(A=Z_0+Z_1\), \(B=\tfrac12X_0X_1\), and \(t=1\). Compute \(\|[A,B]\|\), the number of first-order steps the bound requires for error \(0.01\), and compare with the actual errors.
\([Z_0,X_0]=2iY_0\), so \([A,B]=\tfrac12\big([Z_0,X_0]X_1+X_0[Z_1,X_1]\big)=i\,(Y_0X_1+X_0Y_1)\). The two terms commute (they differ at two positions), so the eigenvalues of \(Y_0X_1+X_0Y_1\) are sums of \(\pm1\)'s: \(\pm2\) and \(0\). Hence \(\|[A,B]\|=2\), and the bound asks for \(r\ge t^2\cdot2/(2\cdot0.01)=100\) steps. The actual errors (verify_L24.py, exact matrix exponentials):
| steps \(r\) | first order | bound \(t^2\|[A,B]\|/2r\) | second order |
|---|---|---|---|
| 1 | 0.613 | 1 | 0.292 |
| 4 | 0.109 | 0.25 | 0.0113 |
| 16 | 0.0268 | 0.0625 | 0.00069 |
| 32 | 0.0134 | 0.0313 | 0.00017 |
The first-order error halves when \(r\) doubles, as the bound predicts, but sits a factor of about 2.3 below it: 43 steps already give error \(0.01\). The second-order error falls by 4 per doubling. Bounds like Proposition 24.1 are worst-case over all states; resource estimates that use them are conservative.
Simulation of molecules and materials is the most widely expected source of useful quantum advantage. The honest caveat is the same as for Shor: the interesting instances (for example, catalysts with dozens of strongly correlated electrons) need millions to billions of gates, which means error correction.
Many questions about a quantum system reduce to its ground-state energy \(E_0\), the smallest eigenvalue of \(H\): chemical reaction energies are differences of ground-state energies. Phase estimation (Lecture 14) can find \(E_0\), but needs long coherent circuits. Variational methods trade that for many short circuits and a classical optimizer.
For every state \(|\psi\rangle\), \(\langle\psi|H|\psi\rangle\ge E_0\), with equality exactly when \(|\psi\rangle\) is a ground state.
Proof. Expand in an orthonormal eigenbasis, \(|\psi\rangle=\sum_kc_k|E_k\rangle\) with \(\sum|c_k|^2=1\) (spectral theorem, Lecture 2). Then \(\langle\psi|H|\psi\rangle=\sum_k|c_k|^2E_k\ge\sum_k|c_k|^2E_0=E_0\), with equality iff all the weight sits on eigenvalue \(E_0\).
A Hamiltonian has eigenvalues \(-3\), \(-1\) and \(2\). A state puts weights \(|c_k|^2=0.5,\ 0.25,\ 0.25\) on the three eigenvectors, in that order. What is \(\langle\psi|H|\psi\rangle\)?
The variational quantum eigensolver (VQE) (Peruzzo et al., 2014) runs a loop: a parametrized circuit, the ansatz \(U(\theta)\), prepares \(|\psi(\theta)\rangle=U(\theta)|0\cdots0\rangle\); the quantum computer estimates \(E(\theta)=\langle\psi(\theta)|H|\psi(\theta)\rangle\) from measurements; a classical optimizer chooses new parameters; repeat. By Proposition 24.2, every value it reports is an upper bound on \(E_0\). Whether it gets close depends on three things: whether the ansatz can represent a state near the ground state, whether the optimizer finds the best parameters, and whether the energy estimates are accurate enough.
For \(H=Z_0+Z_1+\tfrac12X_0X_1\): (a) find \(E_0\). (b) Use the product ansatz \(R_y(\theta)\otimes R_y(\theta)\) on \(|00\rangle\) and find its best energy. (c) Use the entangling ansatz "\(R_y(\theta)\) on qubit 0, then a CNOT from qubit 0 to qubit 1" and find its best energy.
(a) \(H\) maps \(\mathrm{span}\{|00\rangle,|11\rangle\}\) to itself, where it is \(\begin{pmatrix}2&\tfrac12\\ \tfrac12&-2\end{pmatrix}\), with eigenvalues \(\pm\sqrt{4.25}\); on \(\mathrm{span}\{|01\rangle,|10\rangle\}\) it is \(\begin{pmatrix}0&\tfrac12\\ \tfrac12&0\end{pmatrix}\), eigenvalues \(\pm\tfrac12\). So \(E_0=-\sqrt{4.25}=-2.0616\), and the ground state lies in \(\mathrm{span}\{|00\rangle,|11\rangle\}\): it is entangled.
(b) Each qubit is in \(\cos\tfrac\theta2|0\rangle+\sin\tfrac\theta2|1\rangle\), with \(\langle Z\rangle=\cos\theta\) and \(\langle X\rangle=\sin\theta\); for a product state expectations multiply, so \(E(\theta)=2\cos\theta+\tfrac12\sin^2\theta\). The minimum is \(-2\) at \(\theta=\pi\), the state \(|11\rangle\). Even with two independent angles the best product state has energy \(-2\) (verify_L24.py checks this numerically).
(c) The circuit gives \(\cos\tfrac\theta2|00\rangle+\sin\tfrac\theta2|11\rangle\). Then \(\langle Z_0+Z_1\rangle=2\cos^2\tfrac\theta2-2\sin^2\tfrac\theta2=2\cos\theta\) and \(\langle X_0X_1\rangle=2\cos\tfrac\theta2\sin\tfrac\theta2=\sin\theta\), so \(E(\theta)=2\cos\theta+\tfrac12\sin\theta\). This is \(R\cos(\theta-\phi)\) with \(R=\sqrt{4+\tfrac14}\), so its minimum is \(-\sqrt{4.25}=E_0\), reached at \(\theta=\pi+\arctan\tfrac14=3.3866\). The entangling ansatz is exact.
The product ansatz misses by \(0.0616\), about 3%, even though its best state \(|11\rangle\) has 98.5% overlap with the ground state. In chemistry, errors are measured against "chemical accuracy", about \(1.6\times10^{-3}\) hartree: small energy differences decide what reacts. The ansatz must be expressive enough to reach the answer, but (Section 6) not so expressive that the optimizer gets lost.
Is VQE guaranteed to find the ground state?
Classical optimizers need gradients or many function values. On a quantum computer, a finite difference \(\big(E(\theta+h)-E(\theta)\big)/h\) is a bad idea: each \(E\) carries shot noise of size \(\sigma/\sqrt N\), and dividing by a small \(h\) amplifies it. For the gates used in most ansatze there is an exact alternative.
If \(\theta\) enters the circuit through a single gate \(e^{-i\theta P/2}\) with \(P\) a Pauli (for example \(R_y(\theta)=e^{-i\theta Y/2}\)), then $$\frac{dE}{d\theta}=\frac{E(\theta+\tfrac\pi2)-E(\theta-\tfrac\pi2)}{2}.$$
Proof. Since \(P^2=I\), \(e^{-i\theta P/2}=\cos\tfrac\theta2\,I-i\sin\tfrac\theta2\,P\). The energy is quadratic in the gate's entries, so it is a combination of \(\cos^2\tfrac\theta2\), \(\sin^2\tfrac\theta2\) and \(\cos\tfrac\theta2\sin\tfrac\theta2\), that is, \(E(\theta)=a+b\cos\theta+c\sin\theta\). For such a function, \(E(\theta+\tfrac\pi2)-E(\theta-\tfrac\pi2)=-2b\sin\theta+2c\cos\theta=2E'(\theta)\).
A circuit has one \(R_y(\theta)\) gate. At the current angle \(\theta_0\) the shifted circuits give \(E(\theta_0+\tfrac\pi2)=0.42\) and \(E(\theta_0-\tfrac\pi2)=-0.18\). What is \(E'(\theta_0)\)?
Both shifted energies are measured on the same hardware as \(E\) itself, with a shift large enough that shot noise is not amplified. A circuit with \(m\) parameters needs \(2m\) energy estimates per gradient. For example 24.2(c), starting at \(\theta=1\) with step size \(0.4\), gradient descent \(\theta\leftarrow\theta-0.4\,E'(\theta)\) visits \(\theta=1,\ 1.565,\ 2.364,\ 3.068,\ 3.326,\ 3.376\), with energies \(1.501,\ 0.511,\ -1.074,\ -1.958,\ -2.058,\ -2.061\): five steps reach \(E_0\) to three decimals. Try it below, then switch on shot noise.
Real VQE runs use optimizers designed for noisy function values (SPSA, COBYLA, natural-gradient methods) and spend most of their budget on the energy estimates themselves, which is the next section's subject.
A quantum computer measures in the computational basis. To estimate \(\langle H\rangle\) for \(H=\sum_jc_jP_j\), we rotate each qubit so that a Pauli string becomes diagonal (Lecture 4: \(H\) before measuring turns \(X\) into \(Z\)) and average the \(\pm1\) outcomes. Strings that agree on every qubit where both are non-identity (qubit-wise commuting) can be measured together from the same shots. Our \(H\) needs two groups: \(\{Z_0,Z_1\}\), measured directly, and \(\{X_0X_1\}\), measured after Hadamards.
\(Z_0X_1\) and \(Z_0\) be measured from the same shots. \(X_0X_1\) and \(Z_0Z_1\) be measured from the same shots by rotating each qubit separately.
If the groups \(G_1,\dots,G_m\) are measured with \(N_1,\dots,N_m\) shots, the estimate \(\hat E=\sum_i\overline{G_i}\) is unbiased with standard error \(\sqrt{\sum_i\operatorname{Var}(G_i)/N_i}\), where \(\operatorname{Var}(G_i)=\langle G_i^2\rangle-\langle G_i\rangle^2\). For a total budget \(N\), the error is smallest when \(N_i\propto\sqrt{\operatorname{Var}(G_i)}\), and then a standard error \(\epsilon\) needs $$N=\frac{\big(\sum_i\sqrt{\operatorname{Var}(G_i)}\big)^2}{\epsilon^2}\ \text{shots.}$$
Proof. Independent sample means have variances \(\operatorname{Var}(G_i)/N_i\), which add. Minimizing \(\sum_i v_i/N_i\) subject to \(\sum N_i=N\) with a Lagrange multiplier gives \(v_i/N_i^2=\lambda\), so \(N_i\propto\sqrt{v_i}\), and the minimum is \((\sum\sqrt{v_i})^2/N\).
An energy is measured in two groups with \(\operatorname{Var}(G_1)=0.36\) and \(\operatorname{Var}(G_2)=0.04\). With the best allocation of shots, how many shots in total give a standard error of \(0.02\)?
At the optimum of example 24.2(c), find the variance of each group and the number of shots for a standard error of \(0.01\).
At \(\theta^*=3.3866\) the state is \(\cos\tfrac{\theta^*}2|00\rangle+\sin\tfrac{\theta^*}2|11\rangle\). \(G_1=Z_0+Z_1\) is \(+2\) or \(-2\) with probabilities \(\cos^2\tfrac{\theta^*}2\) and \(\sin^2\tfrac{\theta^*}2\), so \(\operatorname{Var}(G_1)=4-4\cos^2\theta^*=4\sin^2\theta^*=0.2353\). \(G_2=\tfrac12X_0X_1\) is \(\pm\tfrac12\) with mean \(\tfrac12\sin\theta^*\), so \(\operatorname{Var}(G_2)=\tfrac14\cos^2\theta^*=0.2353\) as well. (Not a coincidence: the state is an eigenvector of \(H=G_1+G_2\), so \(\operatorname{Var}(G_1+G_2)=0\), which forces the two variances to be equal.) Then \(N=(2\sqrt{0.2353})^2/0.01^2=9{,}412\) shots. The ground state has zero energy variance, but because \(H\) is measured in two pieces, each piece fluctuates.
Since \(N\propto1/\epsilon^2\), each extra decimal digit costs 100 times more shots. Chemical accuracy for a molecule whose Hamiltonian has thousands of Pauli terms can need \(10^8\) or more shots per energy, and an optimization needs many energies. Reducing this cost (better grouping, classical shadows, smarter estimators) is a large part of current research.
MaxCut: given a graph, split the vertices into two sides to cut as many edges as possible. It is NP-hard in general. Encode a split as a bit string \(z\), with one bit per vertex; edge \((i,j)\) is cut when \(z_i\ne z_j\). As an operator, the number of cut edges is $$C=\sum_{(i,j)\in E}\tfrac12\big(I-Z_iZ_j\big),$$ diagonal in the computational basis with \(C|z\rangle=\mathrm{cut}(z)|z\rangle\).
The star graph has a centre vertex 0 joined to three leaves 1, 2, 3 (and no other edges). Find the maximum cut, and the expected cut of a uniformly random bit string.
The quantum approximate optimization algorithm with \(p\) layers (Farhi, Goldstone and Gutmann, 2014) prepares $$|\gamma,\beta\rangle=e^{-i\beta_pB}e^{-i\gamma_pC}\cdots e^{-i\beta_1B}e^{-i\gamma_1C}\,|+\rangle^{\otimes n},\qquad B=\sum_jX_j,$$ estimates \(F(\gamma,\beta)=\langle\gamma,\beta|C|\gamma,\beta\rangle\), and maximizes it over the \(2p\) angles. Sampling the final state gives candidate cuts.
The cost layer \(e^{-i\gamma C}\) is a product of two-qubit \(ZZ\) rotations, one per edge, which puts phases on the bit strings according to their cut values; the mixer \(e^{-i\beta B}\) is an \(R_x\) on every qubit, which lets amplitude flow between strings that differ in one bit. Like Grover (Lecture 11), QAOA alternates a phase oracle with a diffusion-like step, but with tunable angles. As \(p\to\infty\) it can reach the optimum (it approximates adiabatic evolution); for small \(p\) it is a heuristic.
For the 4-cycle 0–1–2–3–0, find the maximum cut, the expected cut of a uniformly random string, and the best \(p=1\) QAOA value.
The alternating strings 0101 and 1010 cut all 4 edges. Each edge is cut by a random string with probability \(\tfrac12\), so a random guess cuts 2 on average; this is also \(F(0,0)\), since \(|+\rangle^{\otimes4}\) is the uniform distribution. A direct computation (on a grid, in verify_L24.py) gives the \(p=1\) landscape \(F(\gamma,\beta)=2+\sin4\beta\,\sin2\gamma\). Its maximum is \(3\), at \(\gamma=\pi/4\), \(\beta=\pi/8\): an approximation ratio \(F/C_{\max}=3/4\). At that point the probability of measuring a maximum cut is \(0.531\) (against \(2/16=0.125\) for random guessing), a cut of 2 has probability \(0.4375\), and a cut of 0 has probability \(0.031\).
How good is this? For MaxCut, the classical Goemans–Williamson algorithm (1995) guarantees a ratio of at least \(0.878\) on every graph, in polynomial time, and on a 4-cycle a classical computer finds the optimum instantly. Farhi et al. proved that \(p=1\) QAOA achieves at least \(0.6924\) on every 3-regular graph. Larger \(p\) does better, but no proof or experiment so far shows QAOA beating the best classical methods on a problem of practical size. It remains a useful laboratory for studying optimization on quantum hardware, and a popular final project.
Why not use a large, generic ansatz that can represent anything? Because of the cartoon at the top. McClean et al. (2018) showed that for circuits deep enough to be "random" (formally, unitary 2-designs), the gradient of the energy with respect to any parameter has mean zero and a variance that decreases exponentially in the number of qubits. The landscape is a barren plateau: flat almost everywhere. Resolving a gradient of size \(\sigma\) needs about \(1/\sigma^2\) shots (Proposition 24.4), so the cost of even one optimization step grows exponentially.
Suppose the gradient variance is proportional to \(2^{-n}\), and the typical gradient size is its square root. Going from 10 to 20 qubits multiplies the shots needed to resolve one gradient component by about .
The figure measures this for a hardware-efficient ansatz (layers of \(R_y\), \(R_z\) and a line of CZ gates; bp_data.py). With \(2n\) layers and a global cost (\(Z\) on every qubit) the variance halves with every added qubit, matching \(2^{-n}\). With a local cost (\(Z_0Z_1\)) it decays more slowly at these sizes, and with a shallow circuit (2 layers) and a local cost it does not decay at all. This is the "cost-function-dependent" picture of Cerezo et al. (2021): shallow circuits and local costs avoid plateaus. The catch, studied by Cerezo et al. (Nature Communications, 2025), is that many of the architectures provably free of barren plateaus have enough structure to be simulated efficiently on a classical computer. Trainability and quantum advantage pull in opposite directions, and finding variational algorithms that have both is an open problem.
Quantum machine learning attracts more hype per result than any other area. A sober summary of the main ideas:
The statistical-learning half of this story (generalization, sample complexity, inference) is the subject of courses in statistical learning and data science.
Three terms are used, not always carefully:
A noisy device samples from random circuits far faster than the best known classical method, but the samples answer no question anyone needed answered. Which term fits the claim?
The history so far is a back-and-forth. In 2019, Google's 53-qubit Sycamore sampled from random circuits in about 200 seconds, and the team estimated that a supercomputer would need 10,000 years (Arute et al., Nature 574, 505). In 2022, Pan, Chen and Zhang produced comparable samples with tensor networks in about 15 hours on 512 GPUs, and later work shortened that further; newer, larger random-circuit experiments restored the gap. IBM's 2023 utility experiment was reproduced classically within weeks (Lecture 19). In October 2025, Google reported in Nature a "verifiable" advantage on its Willow chip, measuring an out-of-time-order correlator ("Quantum Echoes") about 13,000 times faster than its estimate for the best classical supercomputer algorithm, and, in a companion preprint, a proof-of-principle application to molecular structure from NMR data. In July 2026 IBM and its partners (the University of Chicago, Algorithmiq and Qedma) released three preprints from its 156-qubit Heron processors, using up to 74 qubits, that claim verifiable advantage or results beyond current classical simulation; outside experts called them good science but cautioned that two of the three do not yet show a clear advantage, and none had been peer reviewed (IEEE Spectrum, July 2026). Whether such claims survive is decided over the following months by classical algorithm designers. Use the checklist below on them.
Near-term algorithms do not threaten cryptography: VQE, QAOA and quantum ML have no known attack on RSA, ECC or AES. The threat is Shor on fault-tolerant hardware (Lecture 17), and the milestones that matter are the ones in the checklist's items 4–5: physical error rates near \(10^{-3}\), suppression factors \(\Lambda\) well above 2 sustained to large distances, logical operations with magic states, and machines with of order a million physical qubits. Track those, not qubit counts or advantage headlines, when advising on migration timelines. The migration itself (NIST's ML-KEM and ML-DSA, Lecture 17) should not wait for them.
import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit import Parameter
from qiskit.quantum_info import SparsePauliOp
from qiskit.primitives import StatevectorEstimator
H = SparsePauliOp.from_list([("IZ", 1.0), ("ZI", 1.0), ("XX", 0.5)]) # Z0 + Z1 + 0.5 X0X1 (rightmost = q0)
th = Parameter("theta")
ansatz = QuantumCircuit(2); ansatz.ry(th, 0); ansatz.cx(0, 1) # cos(th/2)|00> + sin(th/2)|11>
thetas = [0.0, np.pi / 2, np.pi, np.pi + np.arctan(0.25)]
job = StatevectorEstimator().run([(ansatz, H, thetas)]) # one PUB: circuit, observable, parameter values
for t, e in zip(thetas, job.result()[0].data.evs):
print(f"theta = {t:.4f}: <H> = {float(e):+.4f}")
print("exact ground energy:", round(float(np.linalg.eigvalsh(H.to_matrix())[0]), 4))
print("measurement groups:", [list(g.paulis.to_labels()) for g in H.group_commuting(qubit_wise=True)])
theta = 0.0000: <H> = +2.0000 theta = 1.5708: <H> = +0.5000 theta = 3.1416: <H> = -2.0000 theta = 3.3866: <H> = -2.0616 exact ground energy: -2.0616 measurement groups: [['XX'], ['IZ', 'ZI']]
A SparsePauliOp holds \(H\) (labels are written \(q_1q_0\), as always). One PUB (circuit, observable, list of parameter values) returns all the energies at once; on hardware the same call goes to an IBM EstimatorV2, which does the grouping and basis changes of Section 4 for you. group_commuting(qubit_wise=True) shows the two groups.
import numpy as np from qiskit import QuantumCircuit from qiskit.primitives import StatevectorSampler edges = [(0, 1), (1, 2), (2, 3), (3, 0)] # the 4-cycle def qaoa_circuit(gamma, beta, n=4): qc = QuantumCircuit(n); qc.h(range(n)) for i, j in edges: qc.rzz(-gamma, i, j) # exp(-i gamma (1 - Z_i Z_j)/2), up to a global phase qc.rx(2 * beta, range(n)) # exp(-i beta X) on every qubit qc.measure_all(); return qc cut = lambda s: sum(s[3 - i] != s[3 - j] for i, j in edges) # bit strings are printed q3 q2 q1 q0 counts = StatevectorSampler(seed=24).run([qaoa_circuit(np.pi / 4, np.pi / 8)], shots=4000).result()[0].data.meas.get_counts() F = sum(cut(s) * c for s, c in counts.items()) / 4000 print("expected cut from 4000 shots:", round(F, 3)) for s, c in sorted(counts.items(), key=lambda kv: -kv[1])[:4]: print(s, "cut", cut(s), "count", c)
expected cut from 4000 shots: 3.04 1010 cut 4 count 1110 0101 cut 4 count 1079 1100 cut 2 count 315 1001 cut 2 count 312
Each edge's cost factor \(e^{-i\gamma(I-Z_iZ_j)/2}\) is, up to a global phase, rzz(-gamma), since rzz(t) is \(e^{-itZZ/2}\). At the optimal angles, 4,000 shots give an average cut of about 3, and the two maximum cuts are by far the most frequent strings.
The course in one page. We began with probabilistic bits and asked what changes when probabilities become amplitudes (Lectures 1–8): superposition, measurement, entanglement, no-cloning, teleportation. Interference turned into algorithms (Lectures 9–16): query separations, Grover's quadratic speedup, the Fourier transform, phase estimation, and Shor, which breaks RSA and elliptic-curve cryptography. Lecture 17 turned that into resource estimates and a migration plan. Then we faced reality: noise and density matrices (18–19), key distribution whose security rests on physics (20), and error correction, from three-bit codes to surface codes running below threshold (21–23). This lecture closed the loop: what noisy machines can do now, and how to judge the claims.
Where to go next. Programs change each year, so check current dates and eligibility:
Next: the project workshop (S1) and final-project presentations (S2). HW12 (Lectures 23–24) is due at the start of Week 14; the Lab 7 report is due at the end of Week 14.
all numbers and figures in these notes are computed in python (verify_L24.py, bp_data.py) and follow the page theme