Self-Assessment Quiz: Transpilation
Twenty questions. The routing and seed clusters are the ones that change practice. Aim for 16 or more.
Question 1
Which of these is not in a current IBM device's operation list?
- A. ecr
- B. rz
- C. cx
- D. sx
Question 2
A 127-qubit heavy-hex device has roughly how many qubit-to-qubit connections? - A. 127 - B. about 72 - C. about 8,000 - D. 16,000
Question 3
That sparsity is: - A. a manufacturing defect - B. deliberate — fewer couplings means less crosstalk and better coherence - C. a software limitation - D. temporary
Question 4
A SWAP gate costs how many CNOTs? - A. 1 - B. 2 - C. 3 - D. 6
Question 5
A 5-qubit all-to-all circuit with 10 logical CNOTs transpiled at optimization level 0 needed: - A. 10 two-qubit gates - B. 18 - C. 34 - D. 100
Question 6
The same circuit at level 2 needed: - A. 10 - B. 18 - C. 34 - D. 50
Question 7
A 5-qubit linear chain with 4 logical CNOTs transpiles to: - A. 4 two-qubit gates, at every optimization level - B. 12 - C. 18 - D. it varies unpredictably
Question 8
That means routing overhead is: - A. a constant tax on all circuits - B. proportional to how badly the circuit's connectivity mismatches the device's - C. always about 2× - D. only present at level 0
Question 9
The pass manager stage that decides which physical qubit each logical qubit maps to is: - A. init - B. layout - C. routing - D. translation
Question 10
FixedPoint and DoWhileController in the optimization stage mean the optimizer:
- A. runs once
- B. iterates until the circuit stops shrinking
- C. is disabled
- D. runs in parallel
Question 11
Optimization levels differ primarily in: - A. how many times they run the same passes - B. which algorithms they use - C. the random seed - D. nothing; they are aliases
Question 12
On a circuit whose connectivity already matches the device, higher optimization levels: - A. always reduce two-qubit gate count - B. leave two-qubit count unchanged and affect only depth - C. increase gate count - D. are required
Question 13
Can a higher optimization level produce a worse result? - A. never - B. yes — level 2 was measured producing a deeper circuit than level 1 - C. only at level 0 - D. only on simulators
Question 14
Which layout method assigns logical qubit $i$ to physical qubit $i$? - A. dense - B. sabre - C. trivial - D. VF2
Question 15
Compared with sabre routing, basic routing needed:
- A. the same number of gates
- B. about half as many
- C. more than twice as many
- D. it failed
Question 16
Routing to minimize SWAPs is: - A. solvable exactly in polynomial time - B. NP-hard, so all available methods are heuristics - C. handled by the hardware - D. unnecessary on modern devices
Question 17
A custom transpiler pass is a class implementing:
- A. __call__(circuit)
- B. run(dag)
- C. transpile(qc)
- D. optimize()
Question 18
Passes communicate through:
- A. global variables
- B. property_set
- C. the circuit's metadata
- D. they cannot communicate
Question 19
Transpiling one circuit at optimization level 3 with six different seeds produced two-qubit gate counts of: - A. all identical - B. 18 to 21 — a 17% spread - C. 10 to 100 - D. it does not depend on the seed
Question 20
Best-of-4-seeds on a routing-limited circuit bought: - A. nothing - B. about 10% fewer two-qubit gates for ~31 extra milliseconds - C. a 2× improvement - D. worse results
Answers
| # | Answer | Why |
|---|---|---|
| 1 | C | cx is not native; it is composed from ecr plus corrections. §10.1 |
| 2 | B | 144 directed edges, 72 connections — 0.90% of all-to-all. §10.1 |
| 3 | B | The routing overhead is the price of low gate error. §10.1 |
| 4 | C | No cheaper construction exists. §10.3, Ch. 4 §4.6 |
| 5 | C | Twenty-four extra gates: eight SWAPs. §10.3 |
| 6 | B | Nearly half, from compiler settings alone. §10.3 |
| 7 | A | Zero routing overhead — a chain maps onto a chain. §10.3 |
| 8 | B | And it widens with $n$ for a mismatched circuit. §10.3 |
| 9 | B | Routing then fixes what layout could not. §10.4 |
| 10 | B | Which is where higher levels spend their time. §10.4 |
| 11 | B | Not merely effort — different algorithms. §10.5 |
| 12 | B | Measured: 33 two-qubit gates at every level. §10.5 |
| 13 | B | Measured: depth 85 at level 2 vs 73 at level 1. §10.5 |
| 14 | C | Blind to both connectivity and error rates. §10.6 |
| 15 | C | 58 vs 28 — greedy, no lookahead. §10.6 |
| 16 | B | Which is why the method choice matters. §10.6 |
| 17 | B | Operating on the DAG, not the circuit. §10.8 |
| 18 | B | The pass manager's shared scratchpad. §10.8 |
| 19 | B | SABRE is randomized. §10.9 |
| 20 | B | The cheapest optimization in the book. §10.9 |
Topic Map
| Questions | Topic | Section | If you missed these |
|---|---|---|---|
| 1–3 | The target and topology | §10.1 | Do Exercise 10.6 on your own backend |
| 4–8 | Routing cost | §10.3 | Do Exercise 10.7. The chain-vs-all-to-all table is the chapter |
| 9, 10 | Pass manager stages | §10.4 | Reference; useful when a transpilation surprises you |
| 11–13 | Optimization levels | §10.5 | Level 2 as default; measure rather than assume |
| 14–16 | Layout and routing methods | §10.6 | Exercise 10.8; the 2× spread is worth seeing |
| 17, 18 | Custom passes | §10.8 | Exercise 10.10 |
| 19, 20 | The seed | §10.9 | Do Exercise 10.11. Then fix your seeds forever |
Score 16+: go to Chapter 11.
Score 12–15: the routing cluster (4–8) and the seed cluster (19–20) are the two that change what you do. If you missed either, run the corresponding exercise before continuing.
Score under 12: the pass and method details are reference you can look up. Three things to carry
into Chapter 11: a SWAP costs three CNOTs, your gate budget is in transpiled gates, and
always set seed_transpiler.