question="Comparing the ideal and noisy histograms: what is the main visible difference?",
options=[
"The noisy histogram has fewer bars",
"The noisy histogram spreads probability across many more bitstrings",
"They look identical",
],
correct=1,section="1. Ideal vs noisy",bloom="understand",
explanation="Noise causes probability to leak from the valid codewords to other basis states. This spreading is the visual signature of decoherence.")"""),
]))
# After cell 5 (backend metadata)
ins.append((5,[
code("""quiz(tracker, "q2_native_gates",
question="The hardware has native gates like CX, SX, RZ. What happens to non-native gates like H?",
options=[
"They are executed directly",
"The transpiler decomposes them into native gate sequences",
explanation="Optimization involves trade-offs. Reducing gates helps, but qubit routing decisions can place operations on noisier connections.")"""),
]))
# After cell 9 (cost model)
ins.append((9,[
code("""quiz(tracker, "q4_cost_driver",
question="What is the dominant cost driver for most quantum circuits?",
options=[
"Single-qubit gate count",
"Two-qubit (CX/CZ) gate count \\u2014 these are 10-100x noisier than single-qubit gates",
"Classical post-processing time",
],
correct=1,section="4. Cost model",bloom="apply",
explanation="Two-qubit gates have error rates 10-100x higher than single-qubit gates on current hardware. Minimizing 2Q count is the primary optimization target.")
checkpoint_summary(tracker,"4. Cost model")"""),
]))
# After cell 11 (acceptance rates)
ins.append((11,[
code("""quiz(tracker, "q5_acceptance_meaning",
question="Acceptance rate of 60% means:",
options=[
"60% of the circuit gates succeeded",
"60% of shots passed the stabilizer check \\u2014 40% had detectable errors",
"The state has 60% fidelity",
],
correct=1,section="5. Acceptance",bloom="apply",
explanation="40% of shots triggered a syndrome flag and were discarded. You need ~1.7x the shots to get the same number of clean data points.")
checkpoint_summary(tracker,"5. Acceptance")"""),
]))
# After cell 16 (failure modes)
ins.append((16,[
code("""order(tracker, "q6_failure_severity",
instruction="Rank failure modes from least to most severe:",
explanation="High cost is fixable (optimize gates). Poor acceptance wastes shots. Low witness means the T-state character is lost \\u2014 the experiment's purpose has failed.")
question="You see the score computed manually from quality, acceptance, and cost. Which component dominates and why?",
section="8. Scoring",bloom="evaluate",
model_answer="It depends on the noise regime. At low noise: cost dominates (quality and acceptance are both near 1). At high noise: acceptance dominates (many shots rejected). The score formula surfaces whichever factor is the bottleneck.")"""),
]))
# After cell 20 (factory scoring)
ins.append((20,[
code("""quiz(tracker, "q8_factory_vs_wac",
question="Two scorers rank experiments differently. What determines which to use?",
options=[
"Always use WAC \\u2014 it's the default",
"Your operational goal: quality per state (WAC) vs production rate (factory throughput)",
explanation="The choice of scorer encodes your priorities. WAC optimizes per-state quality. Factory throughput optimizes for a T-state production pipeline.")