Quiz: Amazon Braket

Answers with explanations at the end.


1. What does LocalSimulator require that AwsDevice does not, and vice versa? How does Braket's hardware access model differ from IBM's?

2. Name the two local Braket backends and state which one you must use for noise, and why.

3. Apply X to qubit 0 of a two-qubit register in Braket. At which state-vector index does the amplitude land? Which other framework does Braket agree with, and which is the outlier?

4. Braket's amplitude(["00", "11"]) result type has no direct equivalent in the other frameworks' primitives. What does it return, and why is that useful?

5. What is the maximum interaction degree of an $n$-qubit star GHZ circuit? Of a chain GHZ circuit?

6. A heavy-hex lattice gives each qubit 2–3 neighbours. Explain, in graph terms, why a star circuit on 12 qubits cannot be embedded without routing.

7. A star GHZ circuit on 12 qubits requests 11 two-qubit gates and executes 35 on FakeSherbrooke. What are the other 24, and what do they contribute?

8. The same circuit has depth 136. Why is depth the more damaging number, and which chapter established that?

9. A chain GHZ circuit has overhead 1.00× at every size on the same device. What does this prove about whether the overhead is a compiler limitation?

10. State the break-even formula for comparing a lattice device against an all-to-all device.

11. With $\varepsilon_{\text{sc}} = 0.0075$ and an overhead of 3.18×, compute the break-even error rate for an all-to-all device. Does the threshold get easier or harder as the circuit grows?

12. Why do trapped ions have all-to-all connectivity? Give the physical mechanism, not just the fact.

13. What is the Mølmer–Sørensen gate, and what does MS(0, 0, π/2) do to $|00\rangle$?

14. What is the main disadvantage of trapped ions relative to superconducting qubits, and for which workload does it matter most?

15. Chapter 12 built device_health(), best_layout(), and preflight(). Why is that entire apparatus largely unnecessary on a trapped-ion machine?

16. What does a verbatim box do? Give two situations where you need one.

17. What is the danger of a verbatim box, and what is the good failure mode inside one?

18. Chapter 11 found phase damping invisible in the computational basis using Aer. Chapter 14 found the same in Cirq, and §17.3 in Braket. Why is this not a coincidence about software?

19. List three things a portable multi-vendor API preserves and three it does not.

20. State the general pattern that Case Study 2 identifies, and give two earlier instances of it from this book.


Answers

1. LocalSimulator requires no AWS account and runs locally. AwsDevice requires AWS credentials, a configured region, and charges per task and per shot. IBM offers an open free tier (Chapter 2's entire basis); Braket hardware is a paid service throughout.

2. braket_sv (state vector, the default) and braket_dm (density matrix). Noise requires braket_dm, because simulating a noisy channel means tracking a mixed state, which needs a density matrix — and Chapter 11 §11.2 measured the cost: $4^n$ rather than $2^n$, so roughly half the width.

3. Index 2 (binary 10). Braket agrees with Cirq (big-endian); Qiskit is the outlier (little-endian, index 1) — 1 of the 3 frameworks tested.

4. It returns specific state-vector entries selected by bitstring — here the amplitudes of |00⟩ and |11⟩. Useful because you can inspect a handful of amplitudes without materializing all $2^n$ of them.

5. Star: $n-1$ (qubit 0 interacts with every other qubit). Chain: 2 (each qubit interacts only with its immediate neighbours).

6. Embedding a graph with a degree-11 vertex into a graph whose maximum degree is 3 is impossible without paths: qubit 0's eleven partners cannot all be adjacent to it, so information must be routed along paths to reach them. Paths cost SWAP gates. This is a fact about graph embedding, not about the compiler.

7. SWAP gates — pure routing overhead, moving quantum information to positions where the lattice permits interaction. They contribute error and duration and nothing else; the algorithm never asked for them.

8. Because decoherence scales with wall-clock duration, and depth is the proxy for duration. Chapter 11 §11.7 established this by measuring thermal relaxation error growing with circuit duration (0.0021 at 533 ns versus 0.0225 at 5000 ns).

9. It proves the overhead is not a compiler limitation. Given a circuit the lattice can host — max interaction degree 2 — the compiler introduces zero overhead at every size. The overhead is a property of the mismatch between the circuit's interaction graph and the hardware's connectivity graph.

10. $\varepsilon_{\text{alt}} = 1 - (1 - \varepsilon_{\text{sc}})^{r}$, where $r$ is the two-qubit gate overhead. It follows from survival probability going as $(1-\varepsilon)^N$ and setting the two architectures' survival equal.

11. $1 - (1 - 0.0075)^{3.18} = 1 - (0.9925)^{3.18} \approx \mathbf{0.0237}$, about 2.4%. The threshold gets easier as the circuit grows, because the overhead $r$ grows — at $n=4$ it is 0.0075 and at $n=12$ it is 0.0237.

12. Ions in a trap share collective vibrational modes — the whole chain oscillates together, which is a global degree of freedom. The Mølmer–Sørensen gate couples two ions through that shared mode, and since the mode belongs to the entire chain, any ion can be coupled to any other directly. The connectivity graph is complete because the coupling bus is shared by construction, whereas superconducting couplers must be individually fabricated.

13. The native two-qubit entangling gate for trapped ions, mediated by the shared vibrational mode. MS(0, 0, π/2) takes $|00\rangle$ to $(|00\rangle - i|11\rangle)/\sqrt2$ — populations $[0.5, 0, 0, 0.5]$, a maximally entangled state from a single native gate, where a superconducting device needs H plus ECR plus single-qubit corrections.

14. Speed — ion gates take microseconds against superconducting nanoseconds, roughly 100× slower. It matters most for variational workloads, which run thousands of circuits (Chapter 16 §16.4: $2n+1$ executions per gradient, on every iteration), so wall-clock time dominates regardless of connectivity advantages.

15. Because that apparatus is a response to fabrication variability — a 288× spread in gate error, twelve unusable qubits, one stuck at a constant output, all consequences of etching circuits on a chip. Every ion of a given species is identical by the laws of physics, so there is no fabrication lottery and no "dead qubit 84" to route around.

16. A verbatim box runs its contents exactly as written — no gate translation, no routing, no optimization. Needed for (a) benchmarking, where you must measure the circuit you specified rather than the compiler's improvement of it (Chapter 30), and (b) error-correction circuits, whose structure carries meaning an optimizer would happily destroy.

17. The danger is that you are now the compiler: no routing, no translation, and no protection against writing something worse than the transpiler would have produced. The good failure mode is an error — a non-native gate or unavailable qubit pair is rejected outright. The bad case is a circuit that runs correctly and is slower or noisier than necessary, which nothing reports.

18. Because it is a fact about measurement, not about software. Phase damping destroys coherence between $|0\rangle$ and $|1\rangle$ without changing either population, and a computational- basis measurement only reads populations. Any correct simulator in any framework must reproduce it — so agreement across three frameworks is a consistency check, not independent evidence.

19. Preserves: circuit construction, result types, noise channel semantics, and the correctness of the output distribution. Does not preserve: the cost of running the circuit (3.18× versus 1.00×), which failure modes exist (fabrication variability versus none), and feasibility (a 100× speed difference can make a workload impractical).

20. An abstraction that unifies an interface implies the things behind it are interchangeable; when they are not, the abstraction is making an argument, and the argument is wrong. Earlier instances: Chapter 12's readout_error = 0.5, which averaged a stuck qubit into something that reads as a coin flip; and Chapter 13's dynamical_decoupling.enable = True, which reported success while inserting four gates and changing nothing. In every case the abstraction answered the question it was asked and declined to mention the question you should have asked.