Quiz: Quantum Machine Learning Fundamentals
Answers with explanations at the end.
1. State the hope that motivates QML, fairly.
2. What does Chapter 24's VQE have that a machine-learning task does not?
3. Name the three standard data encodings and the resource each spends.
4. Amplitude encoding puts $N$ features in $\log_2 N$ qubits. What does it cost, and what is the exact formula?
5. Why can no circuit prepare an arbitrary $N$-dimensional state in fewer than $\mathcal{O}(N)$ gates?
6. Loading 128 features takes 227 transpiled two-qubit gates. What is the survival probability at Chapter 12's measured error rate, and why does it matter?
7. What is QRAM, and what is its status?
8. How many state preparations does training on digits for 60 steps require, and why is that the
important number?
9. On iris-binary, what test accuracy do LogisticRegression, SVC, and RandomForest achieve?
10. A VQC also reaches 100% on that dataset. What has been demonstrated?
11. How much slower was the VQC, and under what conditions?
12. Write the training shot budget formula and evaluate it for 24 parameters, 70 samples, 60 steps, 10,000 shots.
13. Convert that to QPU time, and compare against the classical training time.
14. How does this chapter's budget relate to Chapter 24's VQE budget?
15. Gradient variance falls from 1.03e-01 to 1.17e-03 across 2 to 10 qubits. What is this, and where was it first measured in this book?
16. Roughly 40% of gradients were excluded from that variance. Why, and why is reporting the count mandatory?
17. Explain why barren plateaus and the shot budget multiply rather than add.
18. Is there a demonstrated quantum advantage in machine learning? Answer carefully.
19. Give three reasons to continue studying QML despite the answer to question 18.
20. List the seven questions to ask of a QML paper.
Answers
1. A circuit of $n$ qubits acts on a $2^n$-dimensional Hilbert space, so a parameterized circuit is a function class over an exponentially large space — and such a class might represent patterns classical models of comparable size cannot, or find them faster.
2. A well-posed target. VQE's ground-state energy is defined independently of the algorithm and verifiable by diagonalization at small sizes. Machine learning has no such anchor — a model is judged by test accuracy against alternatives, and the alternatives are very good.
3. Basis ($N \times$ bits qubits, one qubit per BIT); angle ($N$ qubits, constant depth, one qubit per FEATURE); amplitude ($\log_2 N$ qubits, $\mathcal{O}(N)$ gates — exponential qubits saved, exponential gates spent).
4. $\mathcal{O}(N)$ two-qubit gates, and with Qiskit's StatePreparation the count is exactly
$N - \log_2 N - 1$ — reproducing 1, 4, 11, 26, 57, 120 for $N = 4 \ldots 128$.
5. Because an arbitrary $N$-dimensional state vector has $N$ independent real parameters, and preparing it means specifying all of them. The information has to get in somehow. The $\log_2 N$ is about storage; the $\mathcal{O}(N)$ is about loading.
6. $(1-0.0075)^{227} \approx$ 0.18. It matters because that is the loading circuit before the model has done anything — most of the signal is gone before any computation.
7. A hypothetical device loading a classical vector into superposition in $\mathcal{O}(\log N)$ time. It does not exist, there is no credible proposal for building one at scale, and analyses suggest a QRAM robust enough to be useful would itself need error correction — at which point Chapter 25's overhead dominates again.
8. $1{,}797 \times 60 =$ 107,820 state preparations. It is the important number because encoding happens once per sample, per forward pass, per step — the exponential compression compresses one vector, and training uses thousands of them thousands of times. That is the dominant term, not a constant factor.
9. All three reach 1.0000, in 0.6 to 61 milliseconds. Iris-binary is linearly separable and it is the dataset most QML demonstrations use.
10. That a parameterized quantum circuit can express a linear decision boundary — which was never in doubt, and which a perceptron has done since 1958. A demonstration on a dataset the baseline solves perfectly cannot distinguish the two methods; it can only fail to.
11. Roughly 20,000× — and that was on an exact simulator, with no shots, no sampling, and no noise, the most favourable possible condition. It also reached lower training accuracy (0.9714 against 1.0000).
12. $(2n+1) \times \text{samples} \times \text{steps} \times \text{shots} = 49 \times 70 \times 60 \times 10{,}000 =$ 2,058,000,000 shots.
13. At 10,000 shots/second: 57.2 QPU hours = 2.38 days — to match a model that trained in 2.2 milliseconds.
14. They are the same order of magnitude ($2.1\times10^9$ against $3.9\times10^9$) — except Chapter 24's was for one molecule at one geometry and this is a 70-sample toy dataset. The training loop multiplies Chapter 24's budget by the dataset.
15. Barren plateaus — an 88× collapse across eight qubits. First measured in Chapter 16 §16.6 for randomly-initialized hardware-efficient ansätze in the chemistry setting; it arrives here unchanged.
16. Those parameters are structurally unable to affect a $\langle Z_0 \rangle$ measurement — mostly final-layer rotations on other qubits. Reporting the count is mandatory because Chapter 16's version of this mistake produced a beautiful exponential fit to an artifact, 18 orders of magnitude off, by leaving systematically-zero gradients in the sample. A filtered statistic whose exclusion count is not reported is not a statistic.
17. Because resolving a gradient of size $g$ needs $\mathcal{O}(1/g^2)$ shots (Chapter 24 §24.3). More qubits means a flatter landscape AND more parameters AND more shots per parameter — so the bill is a product, and every term grows the wrong way. Extrapolated, a 20-qubit model needs $6.6\times10^{12}$ shots for the same 70-sample problem.
18. Carefully: proven separations exist on constructed problems — real theorems about learning tasks a quantum learner solves efficiently and a classical one cannot, under standard assumptions, and without exception about problems built to exhibit the separation. There is no demonstrated advantage on a natural dataset, at any scale, against a tuned baseline; several claimed advantages were later reproduced classically via dequantization. And the input problem may be decisive — if loading $N$ numbers costs $\mathcal{O}(N)$, no exponential speedup on classical data survives it.
19. (a) The techniques are genuinely interesting and transferable — quantum kernels (Chapter 34) have a clean mathematical story. (b) The negative results are load-bearing: barren plateaus, the input problem, and dequantization are among the most useful things learned in the last decade, by people trying to make QML work — a field producing sharp impossibility results is doing science. (c) The quantum-data case is real: when the input is already a quantum state, the loading cost vanishes and every calculation changes.
20. (1) What is the classical baseline, and is it tuned? (2) Is the dataset one classical methods solve perfectly? (3) How was the data encoded, and what did it cost per sample? (4) What is the total shot count? (5) Hardware, or an exact simulator that hides all shot noise? (6) How does it scale — was gradient variance measured or assumed? (7) Is the data classical? If so the input problem applies and no exponential speedup survives it.