Quiz: Quantum Classifiers
Answers with explanations at the end.
1. Why did this chapter not use Chapter 32's dataset?
2. What makes moons at noise 0.30 suitable, and what is the gap that matters on it?
3. Describe data re-uploading and say how it differs from a standard variational classifier.
4. Why can a single qubit represent a non-linear decision boundary with re-uploading, but not without it?
5. State the universality result, and say precisely what it does and does not promise.
6. On one split, a 1-qubit 6-parameter model reached 0.9091 and a 4-qubit 24-parameter model reached 0.7778. What is the correct next step?
7. Across ten splits, what did that 0.13 gap become?
8. What do the min and max columns reveal about split 0?
9. Given standard deviations near 0.04, why is a 0.13 difference between two single draws unremarkable?
10. What claim does survive replication, and why is it useful?
11. How does the quantum model compare against kNN, with numbers?
12. How does it compare against LogisticRegression, and why is that comparison damning?
13. Reconcile the universality theorem with the tie against a linear model.
14. What is the decision rule, and which samples are vulnerable to shot noise?
15. How many of the 99 test points sit within 0.05 of the boundary, and what follows?
16. How many shots per prediction does this data need? Why is that answer not transferable?
17. Compute the inference cost of 1 million predictions at 1,000 shots per prediction.
18. Compare that against the classical incumbent, with the measured number.
19. Why is inference cost more dangerous to omit than training cost?
20. Summarize what is and is not established about quantum classifiers.
Answers
1. Because on iris-binary LogisticRegression, SVC and RandomForest all reach 1.0000. On a dataset every model solves perfectly, no model can be shown better than any other — a comparison there can only fail to distinguish the methods.
2. Four classical models spread from 0.768 (LogReg) to 0.949 (kNN). LogisticRegression is linear and moons is not, so it underperforms by 0.1818 — and that gap is what a quantum model would have to close to mean anything.
3. A standard classifier encodes the data once and then applies trainable layers. Re-uploading injects the data again between every trainable layer, interleaving encoding and rotation.
4. Because encoding once gives a simple function of the data, and trainable rotations afterwards cannot change that. Re-injecting produces a nested composition $R(\theta_L)U(x)R(\theta_{L-1})U(x)\cdots$ — the same alternating structure a neural network's linear and non-linear layers provide. Width is not what limits expressibility; depth is.
5. Pérez-Salinas et al. (2020): with enough layers, one qubit approximates any bounded continuous function on the data. It promises what is representable. It does not promise that any particular training procedure finds it, or how many layers "enough" is in practice.
6. Run it again. The test set has 99 samples, so a 0.13 gap is thirteen samples — and Chapter 27 §27.5 and Chapter 28 §28.4 both established that a conclusion from one or two draws needs replication before it is a measurement.
7. $+0.0202 \pm 0.0170$ — not significant at 2σ. The gap shrank by more than a factor of six and its error bar covers zero.
8. Split 0 was the 1-qubit model's MAXIMUM (0.9091) and the 4-qubit model's MINIMUM (0.7778).
The single split paired one model's best result with the other's worst — not by anyone's choice, since
split 0 is random_state=0, the first thing anybody types.
9. Because 0.13 is roughly two standard deviations of each model's own spread, so seeing it between two independent single draws is an ordinary outcome. A result from one split is a draw from a distribution, not a measurement.
10. Indistinguishable accuracy at a quarter of the parameters and a quarter of the qubits. It is useful because on hardware where qubits are scarce and two-qubit gates dominate the error budget (Chapters 12, 29, 31), a model that matches on a quarter of the resources is the better model for that hardware — a claim about resources rather than a percentage point.
11. kNN − 1-qubit $= +0.0626 \pm 0.0067$ — significant at about nine standard errors. kNN wins decisively, on a dataset chosen specifically to leave room.
12. LogReg − 1-qubit $= +0.0071 \pm 0.0186$ — not significant. It is damning because LogisticRegression is a linear model on a dataset that is not linearly separable, which is exactly why it underperforms kNN. The quantum model has the theoretical capacity for a non-linear boundary and does not exploit it better than a model that has none.
13. The theorem is about what is representable with enough layers, not about what sixty Adam steps finds. Expressibility is necessary and not sufficient — Chapter 16 §16.6 made the same point from the trainability side and Chapter 29 §29.6 from the hardware side.
14. $\text{sign}\langle Z\rangle$. Samples whose $\langle Z\rangle$ is near zero are vulnerable — one shot-noise fluctuation from being classified the other way.
15. 1 of 99 (and 2 within 0.10); the median margin is 0.6281. It follows that most predictions are far from the boundary, so relatively few shots suffice — and that the shot requirement is set by the tail of the margin distribution, not its centre.
16. 1,000 shots gives $0.9101 \pm 0.0044$ against an exact 0.9091, and even 100 costs only 0.4% on average. It is not transferable because the penalty scales with how many points sit near the boundary, which is a property of the data — a harder or more balanced problem puts more there. Measure the margins; do not inherit a shot count.
17. $1{,}000 \times 1{,}000{,}000 = 10^9$ shots $=$ 27.8 QPU hours, per million predictions, recurring.
18. kNN.predict on 1,000,000 points took 1.1 seconds on a laptop, against 27.8 QPU
hours — a factor of roughly ninety thousand, for a model that is measurably less accurate.
19. Because a training budget is bounded — you pay it once and you are done — while inference is recurring, forever. For any model that reaches production the inference cost dominates lifetime total by orders of magnitude, and it is the number nobody computes at all. Chapter 32 established that total training shots is almost never reported; this is worse.
20. Established: data re-uploading is real and elegant — one qubit, six parameters, a non-linear boundary, proven universality, and circuit width is not what limits expressibility. It is significantly cheaper than the multi-qubit alternative at indistinguishable accuracy. Not established: any advantage over classical methods — kNN wins by $+0.0626 \pm 0.0067$ and the quantum model ties with logistic regression. And the costs are not comparable: milliseconds against QPU-days to train, 1.1 seconds against 27.8 QPU-hours per million to predict.