Self-Assessment Quiz: Building Complex Circuits

Twenty questions. The ordering-hazard cluster is the one that matters most. Aim for 16 or more.


Question 1

A circuit containing a free Parameter can be: - A. simulated but not transpiled - B. transpiled but not simulated - C. neither - D. both

Question 2

qc.parameters returns parameters: - A. in creation order - B. sorted lexicographically by name - C. in the order they appear in the circuit - D. in arbitrary order

Question 3

Parameters named theta1 through theta12 sort as: - A. theta1, theta2, ..., theta12 - B. theta1, theta10, theta11, theta12, theta2, ..., theta9 - C. theta12, theta11, ..., theta1 - D. randomly

Question 4

Binding [1, 2, ..., 12] by sequence to those twelve parameters puts the wrong value in: - A. none of the gates - B. one gate - C. eleven of twelve gates - D. all twelve gates

Question 5

The one-line fix is: - A. sort the parameters yourself - B. use a ParameterVector - C. rename them theta01theta12 - D. bind twice

Question 6

ParameterVector elements are sorted by: - A. the string form of the name - B. index - C. creation time - D. they are unsorted

Question 7

qc.compose(sub, inplace=True): - A. inserts one opaque instruction - B. inlines the subcircuit's instructions into the parent - C. only works for single-qubit circuits - D. requires transpilation first

Question 8

qc.append(sub.to_gate(), ...): - A. inlines the instructions - B. inserts one named instruction with a definition - C. is deprecated - D. flattens the circuit

Question 9

A circuit built from ten appended blocks reports qc.depth() of: - A. the true transpiled depth - B. 10 — one per block, regardless of block contents - C. zero - D. the sum of the blocks' depths

Question 10

Which comes free once you call .to_gate()? - A. .inverse(), .control(n), .power(k) - B. faster execution - C. automatic error correction - D. parameter binding

Question 11

The circuit-library classes EfficientSU2, TwoLocal, and QFT are: - A. current best practice - B. deprecated in Qiskit 2.1, to be removed in 3.0 - C. never existed - D. renamed but otherwise unchanged

Question 12

Their replacements are: - A. classes with different names - B. functions: efficient_su2(), n_local(), QFTGate - C. only available in qiskit-algorithms - D. removed with no replacement

Question 13

The functions are an improvement because they return: - A. faster circuits - B. plain QuantumCircuit objects rather than lazily-rebuilding blueprint circuits - C. transpiled circuits - D. fewer parameters

Question 14

efficient_su2(4) has 32 parameters while real_amplitudes(4) has 16 because: - A. efficient_su2 uses more qubits - B. efficient_su2 applies two rotations per qubit per layer instead of one - C. real_amplitudes is deprecated - D. of a bug

Question 15

zz_feature_map(4) has 4 parameters and 24 CNOTs because: - A. it is badly designed - B. a feature map's parameters are the data, not free variables to optimize - C. it is a 4-qubit ansatz - D. CNOTs do not take parameters

Question 16

Transpiling x; x at optimization level 3 produces: - A. two x gates - B. nothing — the optimizer notices $XX = I$ - C. one x gate - D. an error

Question 17

Adding a barrier between them: - A. changes nothing - B. makes both gates survive - C. doubles the error - D. raises

Question 18

Which entanglement pattern costs $n(n-1)/2$ CNOTs? - A. linear - B. pairwise - C. full - D. circular

Question 19

Compared with linear, pairwise has: - A. more CNOTs and more depth - B. the same CNOT count and lower depth - C. fewer CNOTs and more depth - D. more parameters

Question 20

Switching an ansatz from ry to ry+rz rotations, on IBM hardware: - A. roughly doubles the ISA depth and pulse count - B. costs essentially nothing in circuit terms — the cost is in the optimization - C. is impossible - D. halves the two-qubit gate count


Answers

# Answer Why
1 B Transpile-once/bind-many depends on exactly this. §8.1
2 B And sequence binding follows that order. §8.2
3 B Lexicographic: '1' < '2'. §8.2
4 C Measured. §8.2
5 B One line, hazard gone. §8.2
6 B So theta[2] correctly precedes theta[10]. §8.2
7 B What you see in count_ops is the truth. §8.3
8 B Encapsulates; can be inverted and controlled. §8.3
9 B Meaningless — only transpiled depth is the depth. §8.3 pitfall
10 A Which matters, because uncomputation is everywhere. §8.4
11 B Very recent, so nearly all online material uses the old form. §8.5
12 B Functions, lowercase. §8.5
13 B Blueprint circuits behaved subtly differently in composition and serialization. §8.5
14 B Twice the expressiveness, twice the optimization problem. §8.5
15 B Feature maps encode data; Ch. 33 §33.2. §8.5
16 B Verified. §8.6
17 B That is the entire mechanism. §8.6
18 C Quadratic — small circuits or all-to-all hardware only. §8.7
19 B Same count, parallelizable into two sub-layers. §8.7
20 B An arbitrary single-qubit gate is 3 rz + 2 sx regardless. §8.8

Topic Map

Questions Topic Section If you missed these
1 Parameters §8.1 Reread; it underpins Chapter 7's pattern
2–6 The ordering hazard §8.2 Do Exercise 8.7. Watching 11 of 12 gates get the wrong value is the point
7–10 compose / append / custom gates §8.3, §8.4 Exercise 8.8; depth() on appended blocks lies
11–15 The circuit library §8.5 Translate any tutorial you are following to the function form
16, 17 Barriers §8.6 Exercise 8.10 measures what your barriers cost
18, 19 Entanglement patterns §8.7 Exercise 8.11; full is quadratic
20 The ry/ryrz result §8.8 Exercise 8.12 — the surprise that should change your reasoning

Score 16+: go to Chapter 9.

Score 12–15: if you lost points on 2–6, fix that before writing another ansatz. It is the one failure in this chapter that produces a wrong answer with no error.

Score under 12: the library-API details (11–15) are reference. The two things to carry forward are: use ParameterVector, and only transpiled depth is the depth.