Self-Assessment Quiz: Setting Up

Twenty questions confirming the toolchain, the first circuit, and — most importantly — the difference between sampling noise and device noise. Aim for 16 or more.


Question 1

Which command guarantees a package installs into the environment belonging to the interpreter you will run? - A. pip install qiskit - B. python -m pip install qiskit - C. pip3 install qiskit - D. sudo pip install qiskit

Question 2

Which package provides local simulators, including noisy ones? - A. qiskit - B. qiskit-aer - C. qiskit-ibm-runtime - D. matplotlib

Question 3

Which package knows nothing about hardware at all? - A. qiskit - B. qiskit-aer - C. qiskit-ibm-runtime - D. All three talk to hardware

Question 4

Where should an IBM Quantum API token be stored? - A. In a constant at the top of your main script - B. In a config.py committed to the repository - C. Written to your home directory once via save_account, or injected from a secret store - D. In the notebook cell where you use it

Question 5

QuantumCircuit(3, 2) creates: - A. 3 classical bits and 2 qubits - B. 3 qubits and 2 classical bits - C. 3 qubits initialized randomly - D. a 3-by-2 grid of qubits

Question 6

Qubits in a newly created QuantumCircuit start in: - A. a random state - B. $|0\rangle$, always - C. an equal superposition - D. an undefined state until initialized

Question 7

The Bell circuit is: - A. h(0) then measure - B. h(0), cx(0, 1), then measure both - C. x(0), cx(0, 1), then measure both - D. h(0), h(1), then measure both

Question 8

An ideal (noiseless) Bell state measurement produces: - A. 00 and 11 with about 50% each, and no 01 or 10 - B. all four outcomes with 25% each - C. always 00 - D. 01 and 10 with about 50% each

Question 9

What does seed_simulator=1234 accomplish? - A. It makes the simulator faster - B. It makes the sampled results reproducible run to run - C. It removes noise from the simulation - D. It sets the number of shots

Question 10

shots=1024 means: - A. the circuit uses 1,024 qubits - B. the circuit is executed 1,024 times and the outcomes tallied - C. the simulation runs for 1,024 microseconds - D. results are accurate to 1/1024

Question 11

On real IBM hardware, which of your circuit's gates typically survives transpilation unchanged? - A. h - B. cx - C. neither — both are rewritten into the device's native basis - D. both, always

Question 12

Which is a plausible native basis for a current IBM processor? - A. {h, cx, measure} - B. {rz, sx, x, ecr} - C. {x, y, z} - D. {toffoli, swap}

Question 13

service.least_busy(operational=True, simulator=False) returns: - A. the fastest simulator - B. the real device with the shortest queue that is currently operational - C. the device with the lowest error rate - D. a random backend

Question 14

Which primitive answers "what measurement outcomes do I get?" - A. EstimatorV2 - B. SamplerV2 - C. AerSimulator - D. QiskitRuntimeService

Question 15

In the counts key '01' from a two-qubit Qiskit circuit, which qubit measured 1? - A. qubit 1 - B. qubit 0 - C. both - D. cannot be determined

Question 16

That ordering convention is called: - A. big-endian - B. little-endian - C. network byte order - D. lexicographic

Question 17

A hardware Bell run gives {'00': 468, '11': 452, '01': 58, '10': 46}. The 01 and 10 results are caused by: - A. a bug in the circuit - B. sampling noise from finite shots - C. device noise: readout error, gate error, decoherence, crosstalk - D. incorrect transpilation

Question 18

If you increase shots from 1,024 to 1,000,000 on that same hardware run, the fraction of results in 01 and 10 will: - A. shrink toward zero - B. converge to a nonzero value that you now measure precisely - C. grow - D. become exactly 25% each

Question 19

Your script raises AttributeError on result[0].data.c. The most likely cause is: - A. the job failed - B. the classical register has a different name - C. you forgot to transpile - D. your token expired

Question 20

QiskitError: 'No counts for experiment ...' most often means: - A. the backend was offline - B. the circuit has no measurement instructions - C. shots was set to zero - D. the transpiler failed silently


Answers

# Answer Why
1 B pip and python can resolve to different installs; python -m pip cannot. §2.1
2 B qiskit-aer is the simulator package, separate since the 1.0 reorganization. §2.2
3 A Core qiskit builds and compiles circuits; execution paths are the other two. §2.2
4 C Never in source. save_account writes outside the repo; CI uses a secret store. §2.3
5 B Qubits first, classical bits second. §2.4
6 B Always $\lvert 0\rangle$. There is no uninitialized quantum memory. §2.4
7 B Hadamard, then CNOT, then measure both. §2.4
8 A Amplitude for 01 and 10 is exactly zero. §2.4, §2.5
9 B Reproducibility. Every quoted simulator number in this book fixes a seed. §2.5
10 B Shots are repeated executions; the output is a tally. §2.5
11 C Neither h nor cx exists natively on current devices. §2.6
12 B rz, sx, x plus a two-qubit ecr (or cx on older generations). §2.6
13 B Availability, not quality. Choosing on quality is Chapter 12. §2.6
14 B Sampler = outcomes; Estimator = expectation values. §2.6
15 B Rightmost character is qubit 0. §2.7
16 B Little-endian, and it is the field's most common conceptual bug. §2.7
17 C Physical device noise, not a coding error. §2.6 Noise Report
18 B Device noise does not shrink with shots. You measure the wrong answer precisely. §2.7
19 B .c is the default register name; a named register changes it. §2.6 pitfall
20 B No measurement means no classical output. §2.8 Debug This

Topic Map

Questions Topic Section If you missed these
1–3 Environment and packages §2.1, §2.2 Reread §2.2; you will debug this stack, so knowing what each package owns pays off fast
4 Credentials §2.3 Reread the pitfall. This is the one with real-world consequences
5–8 The first circuit §2.4 Rebuild the Bell circuit from memory and predict its output before running
9–10 Shots and seeds §2.5 Do Exercise 2.7 — the convergence is worth seeing rather than reading
11–13 Hardware path and transpilation §2.6 Do Exercise 2.18, then preview Chapter 10
14 Primitives §2.6 Chapter 7 §7.6
15–16 Little-endian ordering §2.7 Do not move on until this is automatic. It causes more bugs than anything else in the book
17–18 Sampling noise vs. device noise §2.7 The most important idea in the chapter. Reread §2.7's comparison table
19–20 Error messages §2.6, §2.8 Do Exercise 2.23 — causing the errors deliberately beats reading about them

Score 16+: you are set up and you understand what you saw. Go to Chapter 3.

Score 12–15: check which cluster you lost points in. If it was 17–18, reread §2.7 carefully — the rest of the book assumes that distinction constantly. If it was 15–16, do Exercise 2.9 and trace the bitstrings by hand.

Score under 12: the setup material (1–4) is reference you can look up; do not let it block you. The conceptual questions (8, 17, 18) are the ones to go back for. Rerun the simulator and hardware comparison from §2.5 and §2.6 with your own data and study your own two histograms.