mirror of
https://github.com/saymrwulf/QuantumLearning.git
synced 2026-05-14 20:58:00 +00:00
Remove meta-level facultative clutter from route notebooks
This commit is contained in:
parent
8a4aaa312a
commit
da70f06279
64 changed files with 4445 additions and 780 deletions
|
|
@ -40,6 +40,7 @@ Use this the first time you open the platform, or anytime you want a clean local
|
|||
`lecture.ipynb -> lab.ipynb -> problems.ipynb -> studio.ipynb`
|
||||
10. Inside every notebook, complete the `MANDATORY` cells in order. Treat `FACULTATIVE` cells as optional extensions only.
|
||||
11. `META` cells are route/objective/pacing guidance, not the technical payload. They are intentionally colored differently inside the notebooks.
|
||||
12. The route notebooks `START_HERE`, `COURSE_BLUEPRINT`, and `COURSE_COMPLETE` should not contain facultative detours.
|
||||
|
||||
## Expected Local Behavior
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ Operational rule inside the notebooks:
|
|||
- complete `MANDATORY` cells in order
|
||||
- use `FACULTATIVE` cells only as optional extensions
|
||||
- read `META` cells as route/objective guidance, not as part of the technical payload
|
||||
- expect no facultative extensions inside the route notebooks `START_HERE`, `COURSE_BLUEPRINT`, or `COURSE_COMPLETE`
|
||||
|
||||
## Monitoring The Project
|
||||
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ The cell contract is now explicit:
|
|||
- `FACULTATIVE` cells are optional extensions only
|
||||
- difficulty `1-3` is reserved for mandatory cells
|
||||
- difficulty `4-10` is reserved for facultative cells
|
||||
- `START_HERE`, `COURSE_BLUEPRINT`, and `COURSE_COMPLETE` are route notebooks, so they do not contain facultative extensions
|
||||
|
||||
The full `Foundations` band is now rebuilt as module bundles:
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block(\n",
|
||||
|
|
@ -352,7 +359,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block(\n",
|
||||
|
|
@ -411,7 +425,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -457,114 +478,9 @@
|
|||
"\n",
|
||||
"Next notebook: [Principles and Circuit Literacy Lecture](foundations/module_01_principles_and_circuit_literacy/lecture.ipynb)\n",
|
||||
"\n",
|
||||
"Official walkthrough rule: once every mandatory cell above is complete, open the next notebook. Anything below this cell is facultative.\n"
|
||||
"Official walkthrough rule: after you finish the cells above, open the next notebook. There is no facultative material in this notebook.\n"
|
||||
],
|
||||
"id": "f18360b2"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "facultative_zone",
|
||||
"ql_track": "meta",
|
||||
"ql_role": "reading",
|
||||
"ql_difficulty": 1,
|
||||
"ql_note": "Optional-zone boundary. The official walkthrough is already complete above."
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #2563eb; background:#dbeafe; color:#1e3a8a; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>META READING</strong> · Difficulty 1/10 · Optional-zone boundary. The official walkthrough is already complete above.\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"<!-- QL_OPTIONAL_ZONE -->\n",
|
||||
"## Facultative Extension Zone\n",
|
||||
"\n",
|
||||
"You have already completed the mandatory walkthrough for **Course Blueprint**. Everything below is optional. Use it only if you want deeper consolidation or extra transfer work.\n"
|
||||
],
|
||||
"id": "d3640683"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "facultative",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "reading",
|
||||
"ql_difficulty": 4,
|
||||
"ql_note": "Optional extension reading."
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #ea580c; background:#ffedd5; color:#9a3412; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>FACULTATIVE READING</strong> · Difficulty 4/10 · Optional extension reading.\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"## Facultative Extension Reading\n",
|
||||
"\n",
|
||||
"You have already finished the mandatory route for **Course Blueprint**. Use this optional cell only if you want to tighten your study method. Write down which mandatory cell types help you most, which ones slow you down, and how you will keep the one official walkthrough intact without guessing from the filesystem.\n"
|
||||
],
|
||||
"id": "4805515b"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "badge",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "test"
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #ea580c; background:#ffedd5; color:#9a3412; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>FACULTATIVE TEST</strong> · Difficulty 4/10 · Optional multiple-choice extension.\n",
|
||||
"</div>\n"
|
||||
],
|
||||
"id": "ef2fa693"
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ql_injected": "facultative",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 4,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the only supported walkthrough rule?', 'options': ['Complete the mandatory cells in order and use facultative cells only as optional extensions', 'Mix mandatory and facultative cells in any order as long as every notebook opens once', 'Start from whichever folder looks most interesting'], 'correct_index': 0, 'explanation': 'The route is single-path. Facultative cells never replace the mandatory path.'}, {'prompt': 'Why are meta cells colored differently?', 'options': ['To separate route and motivation guidance from the actual technical payload', 'To mark the easiest cells only', 'To hide the course contract from advanced users'], 'correct_index': 0, 'explanation': 'The meta layer should never masquerade as technical content.'}], heading='Facultative Extension Test')\n"
|
||||
],
|
||||
"id": "5c28c6ba"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "badge",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "exercise"
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #ea580c; background:#ffedd5; color:#9a3412; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>FACULTATIVE EXERCISE</strong> · Difficulty 4/10 · Optional written exercise.\n",
|
||||
"</div>\n"
|
||||
],
|
||||
"id": "ebb31861"
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ql_injected": "facultative",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 4,
|
||||
"ql_note": "Optional written exercise."
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one sentence that explains how you will follow the mandatory route in Course Blueprint without losing the distinction between meta cells and technical cells.')\n"
|
||||
],
|
||||
"id": "30e47dd9"
|
||||
"id": "2cd865fe"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
|
|
@ -103,9 +103,9 @@
|
|||
"\n",
|
||||
"Next notebook: none. This notebook closes the official walkthrough.\n",
|
||||
"\n",
|
||||
"This is the end of the mandatory walkthrough. Anything below this cell is facultative.\n"
|
||||
"This is the end of the mandatory walkthrough.\n"
|
||||
],
|
||||
"id": "a6e37434"
|
||||
"id": "e815c7fa"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
|
|
@ -310,7 +310,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the main purpose of the markdown in these notebooks?', 'options': ['It is mostly decorative context around the code', 'It carries part of the actual course content and must be studied', 'It exists only so the notebooks look more polished'], 'correct_index': 1, 'explanation': 'The markdown is part of the teaching, not decoration.'}, {'prompt': 'Why does the course emphasize prediction before execution?', 'options': ['Because prediction is the fastest way to run a notebook', 'Because prediction reveals whether you actually understand the circuit', 'Because prediction removes the need for simulation'], 'correct_index': 1, 'explanation': 'Prediction turns passive reading into active reasoning.'}, {'prompt': 'What should you open immediately after this notebook?', 'options': ['The capstone review notebook', 'The README again', 'COURSE_BLUEPRINT.ipynb'], 'correct_index': 2, 'explanation': 'Course Blueprint is the next required notebook in the guarded mainline path.'}], heading='Start Here Quiz')\n"
|
||||
|
|
@ -335,7 +342,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should you do if a notebook feels dense or overwhelming?', 'options': ['Skim the markdown and hope later notebooks clarify it', 'Diagnose the exact friction point and use the interactive elements to test that weakness', 'Skip directly to advanced notebooks with more exciting topics'], 'correct_index': 1, 'explanation': 'Precise diagnosis is much more useful than vague frustration.'}, {'prompt': 'Why are editable labs important in this course?', 'options': ['They test whether your explanation survives deliberate circuit changes', 'They mainly make the notebooks look modern', 'They replace the need for written explanation'], 'correct_index': 0, 'explanation': 'Manipulation is one of the main ways the notebooks check for real understanding.'}, {'prompt': 'What does the course expect from foundational notebooks?', 'options': ['Fast completion', 'Respectful, detailed study because fundamentals shape later design judgment', 'Minimal attention because they are mostly syntax'], 'correct_index': 1, 'explanation': 'The course treats fundamentals as the place where professional habits begin.'}], heading='Start Here Quiz B')\n"
|
||||
|
|
@ -360,7 +374,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from quantum_learning.interactive import reflection_box\n",
|
||||
|
|
@ -413,114 +434,9 @@
|
|||
"\n",
|
||||
"Next notebook: [Course Blueprint](COURSE_BLUEPRINT.ipynb)\n",
|
||||
"\n",
|
||||
"Official walkthrough rule: once every mandatory cell above is complete, open the next notebook. Anything below this cell is facultative.\n"
|
||||
"Official walkthrough rule: after you finish the cells above, open the next notebook. There is no facultative material in this notebook.\n"
|
||||
],
|
||||
"id": "86c52238"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "facultative_zone",
|
||||
"ql_track": "meta",
|
||||
"ql_role": "reading",
|
||||
"ql_difficulty": 1,
|
||||
"ql_note": "Optional-zone boundary. The official walkthrough is already complete above."
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #2563eb; background:#dbeafe; color:#1e3a8a; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>META READING</strong> · Difficulty 1/10 · Optional-zone boundary. The official walkthrough is already complete above.\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"<!-- QL_OPTIONAL_ZONE -->\n",
|
||||
"## Facultative Extension Zone\n",
|
||||
"\n",
|
||||
"You have already completed the mandatory walkthrough for **Start Here**. Everything below is optional. Use it only if you want deeper consolidation or extra transfer work.\n"
|
||||
],
|
||||
"id": "76925f4f"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "facultative",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "reading",
|
||||
"ql_difficulty": 4,
|
||||
"ql_note": "Optional extension reading."
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #ea580c; background:#ffedd5; color:#9a3412; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>FACULTATIVE READING</strong> · Difficulty 4/10 · Optional extension reading.\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"## Facultative Extension Reading\n",
|
||||
"\n",
|
||||
"You have already finished the mandatory route for **Start Here**. Use this optional cell only if you want to tighten your study method. Write down which mandatory cell types help you most, which ones slow you down, and how you will keep the one official walkthrough intact without guessing from the filesystem.\n"
|
||||
],
|
||||
"id": "bddc14b2"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "badge",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "test"
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #ea580c; background:#ffedd5; color:#9a3412; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>FACULTATIVE TEST</strong> · Difficulty 4/10 · Optional multiple-choice extension.\n",
|
||||
"</div>\n"
|
||||
],
|
||||
"id": "c4a3ea8c"
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ql_injected": "facultative",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 4,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the only supported walkthrough rule?', 'options': ['Complete the mandatory cells in order and use facultative cells only as optional extensions', 'Mix mandatory and facultative cells in any order as long as every notebook opens once', 'Start from whichever folder looks most interesting'], 'correct_index': 0, 'explanation': 'The route is single-path. Facultative cells never replace the mandatory path.'}, {'prompt': 'Why are meta cells colored differently?', 'options': ['To separate route and motivation guidance from the actual technical payload', 'To mark the easiest cells only', 'To hide the course contract from advanced users'], 'correct_index': 0, 'explanation': 'The meta layer should never masquerade as technical content.'}], heading='Facultative Extension Test')\n"
|
||||
],
|
||||
"id": "9db293c0"
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"ql_injected": "badge",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "exercise"
|
||||
},
|
||||
"source": [
|
||||
"<!-- QL_BADGE -->\n",
|
||||
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #ea580c; background:#ffedd5; color:#9a3412; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
|
||||
"<strong>FACULTATIVE EXERCISE</strong> · Difficulty 4/10 · Optional written exercise.\n",
|
||||
"</div>\n"
|
||||
],
|
||||
"id": "02910a72"
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ql_injected": "facultative",
|
||||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 4,
|
||||
"ql_note": "Optional written exercise."
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one sentence that explains how you will follow the mandatory route in Start Here without losing the distinction between meta cells and technical cells.')\n"
|
||||
],
|
||||
"id": "655d4592"
|
||||
"id": "8b83aa05"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare the query wire in superposition and the ancilla in the |-> state.', 'diagram_effect': 'The left side of the diagram separates the question register from the phase-sensitive ancilla.', 'why_it_matters': 'Without this preparation, the oracle behaves like an ordinary reversible gadget instead of a phase-encoding query.'}, {'marker': '[2]', 'code_focus': 'Apply an oracle that represents a promise class rather than a single numerical answer.', 'diagram_effect': 'The middle region becomes the semantic core of the circuit.', 'why_it_matters': 'Algorithmic design starts when you think in contracts and promise structures rather than in isolated gates.'}, {'marker': '[3]', 'code_focus': 'Use a final Hadamard on the query wire to convert hidden phase information into a measurable bit.', 'diagram_effect': 'The right side of the circuit shows a deliberate interference stage instead of direct readout after the oracle.', 'why_it_matters': 'Interference is the mechanism that cashes out the query advantage.'}, {'marker': '[4]', 'code_focus': 'Measure only the wire that carries the decision information.', 'diagram_effect': 'The reporting layer stays narrow and intentional.', 'why_it_matters': 'Professional design protects the evidence path and avoids measuring wires that are not part of the claim.'}])\n"
|
||||
|
|
@ -199,7 +206,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef deutsch_oracle(kind: str) -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{kind}\")\\n if kind == \"balanced\":\\n oracle.cx(0, 1)\\n elif kind == \"constant_one\":\\n oracle.x(1)\\n elif kind != \"constant_zero\":\\n raise ValueError(\"kind must be constant_zero, constant_one, or balanced\")\\n return oracle\\n\\ncircuit = QuantumCircuit(2, 1)\\n# [1] Query wire in superposition, ancilla in |->\\ncircuit.h(0)\\ncircuit.x(1)\\ncircuit.h(1)\\n# [2] Oracle encodes the promise class\\ncircuit.compose(deutsch_oracle(\"balanced\"), inplace=True)\\n# [3] Final Hadamard turns phase into a measurable distinction\\ncircuit.h(0)\\n# [4] Only the decision wire needs to be reported\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -270,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'If you change the Deutsch oracle from balanced to constant_zero, what should happen to the measured query bit?', 'options': ['It should reliably flip to 1', 'It should move toward 0 because the phase distinction disappears', 'It should become uniformly random'], 'correct_index': 1, 'explanation': 'A constant oracle does not create the same phase relation, so the final interference returns the constant verdict.'}, {'prompt': 'What is the right way to inspect a circuit edit in this lab?', 'options': ['Change several lines at once so the effect is obvious', 'Change one causal feature at a time and compare the diagram and counts together', 'Ignore the diagram and focus only on the text representation'], 'correct_index': 1, 'explanation': 'Controlled editing is the only way to attach causes to outcomes.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -295,7 +316,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which lab edit most improved your understanding of why the ancilla must be prepared as it is?')\n"
|
||||
|
|
@ -336,7 +364,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef deutsch_jozsa_oracle(kind: str = \"balanced\") -> QuantumCircuit:\\n oracle = QuantumCircuit(3, name=f\"dj_{kind}\")\\n if kind == \"balanced\":\\n oracle.cx(0, 2)\\n oracle.cx(1, 2)\\n elif kind == \"constant_one\":\\n oracle.x(2)\\n elif kind != \"constant_zero\":\\n raise ValueError(\"kind must be constant_zero, constant_one, or balanced\")\\n return oracle\\n\\ncircuit = QuantumCircuit(3, 2)\\n# Put both query wires into superposition.\\ncircuit.h([0, 1])\\n# Prepare the ancilla in |->\\ncircuit.x(2)\\ncircuit.h(2)\\n# Query the oracle contract.\\ncircuit.compose(deutsch_jozsa_oracle(\"balanced\"), inplace=True)\\n# Interference reveals whether the promise is constant or balanced.\\ncircuit.h([0, 1])\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -423,7 +458,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef balanced_oracle() -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=\"balanced\")\\n oracle.cx(0, 1)\\n return oracle\\n\\ncircuit = QuantumCircuit(2, 1)\\n# Toggle these preparation choices to see phase kickback disappear.\\ncircuit.h(0)\\ncircuit.x(1)\\ncircuit.h(1)\\ncircuit.compose(balanced_oracle(), inplace=True)\\ncircuit.h(0)\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -495,7 +537,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What usually happens if you remove the ancilla Hadamard and keep the rest of the Deutsch circuit unchanged?', 'options': ['Phase kickback logic is broken, so the final decision bit loses its meaning', 'The query wire is automatically corrected by transpilation', 'Nothing changes because the ancilla is not measured'], 'correct_index': 0, 'explanation': 'The ancilla preparation is part of the mechanism, not optional decoration.'}, {'prompt': 'Why is Deutsch-Jozsa a useful engineering module and not only a historical algorithm?', 'options': ['It teaches how to scale promise-structured oracles and interference reasoning', 'It is the fastest route to hardware execution', 'It eliminates the need for later algorithm study'], 'correct_index': 0, 'explanation': 'The reusable lesson is how an oracle contract and interference stage compose.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -566,7 +615,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short review note about one Deutsch-Jozsa oracle candidate that looks plausible but does not clearly expose its promise class.')\n"
|
||||
|
|
@ -591,7 +647,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one additional prediction habit you want to carry into later modules.')\n"
|
||||
|
|
@ -682,7 +745,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -713,7 +782,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -252,7 +252,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare the query wire in superposition and the ancilla in the |-> state.', 'diagram_effect': 'The left side of the diagram separates the question register from the phase-sensitive ancilla.', 'why_it_matters': 'Without this preparation, the oracle behaves like an ordinary reversible gadget instead of a phase-encoding query.'}, {'marker': '[2]', 'code_focus': 'Apply an oracle that represents a promise class rather than a single numerical answer.', 'diagram_effect': 'The middle region becomes the semantic core of the circuit.', 'why_it_matters': 'Algorithmic design starts when you think in contracts and promise structures rather than in isolated gates.'}, {'marker': '[3]', 'code_focus': 'Use a final Hadamard on the query wire to convert hidden phase information into a measurable bit.', 'diagram_effect': 'The right side of the circuit shows a deliberate interference stage instead of direct readout after the oracle.', 'why_it_matters': 'Interference is the mechanism that cashes out the query advantage.'}, {'marker': '[4]', 'code_focus': 'Measure only the wire that carries the decision information.', 'diagram_effect': 'The reporting layer stays narrow and intentional.', 'why_it_matters': 'Professional design protects the evidence path and avoids measuring wires that are not part of the claim.'}])\n"
|
||||
|
|
@ -277,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef deutsch_oracle(kind: str) -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{kind}\")\\n if kind == \"balanced\":\\n oracle.cx(0, 1)\\n elif kind == \"constant_one\":\\n oracle.x(1)\\n elif kind != \"constant_zero\":\\n raise ValueError(\"kind must be constant_zero, constant_one, or balanced\")\\n return oracle\\n\\ncircuit = QuantumCircuit(2, 1)\\n# [1] Query wire in superposition, ancilla in |->\\ncircuit.h(0)\\ncircuit.x(1)\\ncircuit.h(1)\\n# [2] Oracle encodes the promise class\\ncircuit.compose(deutsch_oracle(\"balanced\"), inplace=True)\\n# [3] Final Hadamard turns phase into a measurable distinction\\ncircuit.h(0)\\n# [4] Only the decision wire needs to be reported\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -350,7 +364,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why is the ancilla prepared in the |-> state in the Deutsch circuit?', 'options': [\"So the oracle's bit flip appears as a phase on the query branch\", 'So the ancilla can be measured instead of the query wire', 'So the circuit uses fewer Hadamards'], 'correct_index': 0, 'explanation': 'The |-> preparation converts an oracle-controlled bit flip into phase kickback.'}, {'prompt': 'What does the final Hadamard on the query wire accomplish?', 'options': ['It compresses the circuit depth without changing meaning', 'It converts phase differences into a measurable basis distinction', 'It resets the ancilla before measurement'], 'correct_index': 1, 'explanation': 'Interference after the oracle is what reveals whether the promise is constant or balanced.'}, {'prompt': 'Why is it useful to describe the oracle as a contract?', 'options': ['Because the circuit depends on the exact gate library chosen by the backend', 'Because the algorithm reasons about a promise class, not an arbitrary implementation detail', 'Because all oracles must be measured to be trusted'], 'correct_index': 1, 'explanation': 'Oracle language keeps the emphasis on the function family and its promise, not on one ad hoc gate layout.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -433,7 +454,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What changes when you move from Deutsch to Deutsch-Jozsa?', 'options': ['You stop using interference and switch to repeated measurement', 'You ask the same style of promise question on a larger query register', 'You no longer need an ancilla'], 'correct_index': 1, 'explanation': 'Deutsch-Jozsa scales the same interference logic to a promise on multiple inputs.'}, {'prompt': 'What is the professional-design danger in copying an oracle from memory?', 'options': ['The circuit may still run while no longer implementing the promised function family', 'The simulator will always reject the circuit', 'The compiler will remove the oracle automatically'], 'correct_index': 0, 'explanation': 'A remembered diagram can be gate-correct yet semantically wrong if the oracle contract is not explicit.'}, {'prompt': 'Why does the course keep asking what is being measured and why?', 'options': ['Because measuring more wires always increases accuracy', 'Because the reporting contract should track the actual claim the circuit is making', 'Because Qiskit cannot draw unmeasured circuits'], 'correct_index': 1, 'explanation': 'Good circuit design protects the evidence path as carefully as the quantum body.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -458,7 +486,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a paragraph explaining phase kickback in the Deutsch circuit without using the word magic.')\n"
|
||||
|
|
@ -483,7 +518,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one way an oracle helper could be syntactically neat but semantically misleading in this module.')\n"
|
||||
|
|
@ -589,7 +631,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -620,7 +668,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -173,7 +173,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which statement best describes a Deutsch oracle in this module?', 'options': ['A reversible circuit implementing one member of a promised function family', 'Any two-qubit circuit with one CNOT', 'A measurement gadget that reveals the answer directly'], 'correct_index': 0, 'explanation': 'The oracle is defined by the function family and promise, not by a single gate mnemonic.'}, {'prompt': 'Why is copying a balanced-oracle diagram into a constant case a design error?', 'options': ['Because constants require more qubits', 'Because the circuit would no longer match the promise class being claimed', 'Because Qiskit forbids constant functions'], 'correct_index': 1, 'explanation': 'The semantic burden of the oracle changes with the promise class.'}], heading='Oracle Contract Check')\n"
|
||||
|
|
@ -213,7 +220,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What information is actually being combined by the final Hadamard in Deutsch?', 'options': ['The branch phases created by the oracle interaction', 'The counts collected during execution', 'The classical truth table of the function'], 'correct_index': 0, 'explanation': 'The last Hadamard converts branch-relative phase into basis amplitude.'}, {'prompt': \"Which explanation is strongest when a learner says 'the circuit just magically knows'?\", 'options': ['It does not know; the oracle encodes structure and interference exposes it', 'Quantum circuits know because amplitudes are hidden variables', 'The simulator precomputes the answer and returns it'], 'correct_index': 0, 'explanation': 'Mechanistic language matters if you want professional control rather than awe.'}], heading='Interference Reasoning')\n"
|
||||
|
|
@ -253,7 +267,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What survives when the circuit scales from Deutsch to Deutsch-Jozsa?', 'options': ['The oracle-contract idea, phase kickback, and final interference logic', 'Only the exact same two-qubit diagram', 'The need to measure the ancilla'], 'correct_index': 0, 'explanation': 'The pattern survives even though the specific wiring changes.'}, {'prompt': 'What is the strongest reason to inspect all-zero versus non-zero outcomes in Deutsch-Jozsa?', 'options': ['Those patterns are easier to draw', 'They encode the constant-versus-balanced promise distinction after interference', 'They avoid using classical registers'], 'correct_index': 1, 'explanation': 'The readout pattern is a claim about the promise class, not just a visual convenience.'}], heading='Scaling To Deutsch-Jozsa')\n"
|
||||
|
|
@ -293,7 +314,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which review comment is strongest?', 'options': ['This looks quantum enough', 'The oracle contract is unclear, so I cannot tell whether the circuit still distinguishes the promised cases', 'Please shorten the code by removing comments'], 'correct_index': 1, 'explanation': 'Professional review language targets the semantic burden of the circuit.'}, {'prompt': 'What evidence should support a claim that a Deutsch circuit is correct?', 'options': ['A clear oracle definition, a narrated interference mechanism, and counts that match the promise cases', 'Only a rendered diagram', 'Only a transpiler summary'], 'correct_index': 0, 'explanation': 'Correctness here is conceptual, structural, and empirical.'}], heading='Review Language')\n"
|
||||
|
|
@ -379,7 +407,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\"Explain why the phrase 'the circuit just knows' is pedagogically dangerous in this module.\")\n"
|
||||
|
|
@ -404,7 +439,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short design memo defending why only the decision wire should be measured in a minimal Deutsch implementation.')\n"
|
||||
|
|
@ -511,7 +553,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -542,7 +590,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef deutsch_oracle(kind: str) -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{kind}\")\\n if kind == \"balanced\":\\n oracle.cx(0, 1)\\n elif kind == \"constant_one\":\\n oracle.x(1)\\n elif kind != \"constant_zero\":\\n raise ValueError(\"kind must be constant_zero, constant_one, or balanced\")\\n return oracle\\n\\ncircuit = QuantumCircuit(2, 1)\\n# [1] Query wire in superposition, ancilla in |->\\ncircuit.h(0)\\ncircuit.x(1)\\ncircuit.h(1)\\n# [2] Oracle encodes the promise class\\ncircuit.compose(deutsch_oracle(\"balanced\"), inplace=True)\\n# [3] Final Hadamard turns phase into a measurable distinction\\ncircuit.h(0)\\n# [4] Only the decision wire needs to be reported\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -222,7 +229,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef deutsch_jozsa_oracle(kind: str = \"balanced\") -> QuantumCircuit:\\n oracle = QuantumCircuit(3, name=f\"dj_{kind}\")\\n if kind == \"balanced\":\\n oracle.cx(0, 2)\\n oracle.cx(1, 2)\\n elif kind == \"constant_one\":\\n oracle.x(2)\\n elif kind != \"constant_zero\":\\n raise ValueError(\"kind must be constant_zero, constant_one, or balanced\")\\n return oracle\\n\\ncircuit = QuantumCircuit(3, 2)\\n# Put both query wires into superposition.\\ncircuit.h([0, 1])\\n# Prepare the ancilla in |->\\ncircuit.x(2)\\ncircuit.h(2)\\n# Query the oracle contract.\\ncircuit.compose(deutsch_jozsa_oracle(\"balanced\"), inplace=True)\\n# Interference reveals whether the promise is constant or balanced.\\ncircuit.h([0, 1])\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -270,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef balanced_oracle() -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=\"balanced\")\\n oracle.cx(0, 1)\\n return oracle\\n\\ncircuit = QuantumCircuit(2, 1)\\n# Toggle these preparation choices to see phase kickback disappear.\\ncircuit.h(0)\\ncircuit.x(1)\\ncircuit.h(1)\\ncircuit.compose(balanced_oracle(), inplace=True)\\ncircuit.h(0)\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -302,7 +323,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What makes a good studio outcome in this module?', 'options': ['A small family of oracle-based circuits with a defensible explanation of what changed and what stayed invariant', 'A single copied textbook circuit with no notes', 'The most gates you can fit onto two qubits'], 'correct_index': 0, 'explanation': 'Studio work is about deliberate variation and justification.'}, {'prompt': 'Why is deliberate ablation useful in a design studio?', 'options': ['It identifies which circuit regions actually carry the mechanism and which are accidental', 'It makes the code shorter by default', 'It avoids the need for measurements'], 'correct_index': 0, 'explanation': 'Ablation is a disciplined way to test causal understanding.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -373,7 +401,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which family resemblance between Deutsch and Deutsch-Jozsa feels strongest to you now, and why?')\n"
|
||||
|
|
@ -398,7 +433,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What was the most useful deliberate failure you introduced in the studio, and what did it reveal?')\n"
|
||||
|
|
@ -423,7 +465,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one paragraph defending your preferred oracle helper style for this family.')\n"
|
||||
|
|
@ -448,7 +497,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('State one review criterion you would carry from this module into later algorithm notebooks.')\n"
|
||||
|
|
@ -539,7 +595,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -570,7 +632,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare every query wire in superposition and the ancilla in |->.', 'diagram_effect': 'The diagram begins with a wide preparation fan-out instead of a single branch.', 'why_it_matters': 'Bernstein-Vazirani asks one structured question about several bits at once.'}, {'marker': '[2]', 'code_focus': 'Route only the secret-controlled query wires into the ancilla.', 'diagram_effect': 'The oracle body visually highlights which secret bits are active.', 'why_it_matters': 'The hidden string is not mystical. It is literally the connectivity pattern inside the oracle.'}, {'marker': '[3]', 'code_focus': 'Apply final Hadamards to decode the hidden pattern back onto the query register.', 'diagram_effect': 'The second Hadamard layer closes the algorithmic sandwich.', 'why_it_matters': 'This is the moment where phase-encoded structure becomes classical evidence.'}, {'marker': '[4]', 'code_focus': 'Measure the query register in a bit order you can defend.', 'diagram_effect': 'The readout layer makes the interface contract explicit.', 'why_it_matters': 'Bit-order confusion is one of the easiest ways to sabotage an otherwise correct circuit.'}])\n"
|
||||
|
|
@ -199,7 +206,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bv_oracle(secret: str = \"101\") -> QuantumCircuit:\\n oracle = QuantumCircuit(4, name=f\"bv_{secret}\")\\n ancilla = 3\\n for index, bit in enumerate(reversed(secret)):\\n if bit == \"1\":\\n oracle.cx(index, ancilla)\\n return oracle\\n\\ncircuit = QuantumCircuit(4, 3)\\n# [1] Prepare the query register and phase-sensitive ancilla.\\ncircuit.h([0, 1, 2])\\ncircuit.x(3)\\ncircuit.h(3)\\n# [2] Query the structured oracle.\\ncircuit.compose(bv_oracle(\"101\"), inplace=True)\\n# [3] Decode the hidden pattern.\\ncircuit.h([0, 1, 2])\\n# [4] Measure only the recovered string.\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -268,7 +282,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'If the observed bitstring is reversed relative to the intended secret, what is the most likely cause?', 'options': ['A reporting-contract mismatch between qubit order and classical readout order', 'The oracle has too many Hadamards', 'The ancilla should have been measured'], 'correct_index': 0, 'explanation': 'This module trains you to treat bit order as interface design.'}, {'prompt': \"What is the best way to debug a BV circuit that 'almost works'?\", 'options': ['Inspect which query wires actually control the ancilla and then inspect the measurement mapping', 'Add more entangling gates until the counts change', 'Ignore the secret and only inspect circuit depth'], 'correct_index': 0, 'explanation': 'The hidden string lives in the oracle connectivity and the reporting contract.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -293,7 +314,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which bit-order experiment in the lab was most clarifying, and what did it teach you about interface design?')\n"
|
||||
|
|
@ -334,7 +362,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bv_oracle(secret: str = \"110\") -> QuantumCircuit:\\n oracle = QuantumCircuit(4, name=f\"bv_{secret}\")\\n ancilla = 3\\n for index, bit in enumerate(reversed(secret)):\\n if bit == \"1\":\\n oracle.cx(index, ancilla)\\n return oracle\\n\\ncircuit = QuantumCircuit(4, 3)\\ncircuit.h([0, 1, 2])\\ncircuit.x(3)\\ncircuit.h(3)\\ncircuit.compose(bv_oracle(\"110\"), inplace=True)\\ncircuit.h([0, 1, 2])\\n# Change the measurement order only if you can explain the reporting contract.\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -425,7 +460,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bv_candidate(secret: str = \"011\", add_barriers: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(4, 3)\\n circuit.h([0, 1, 2])\\n circuit.x(3)\\n circuit.h(3)\\n if add_barriers:\\n circuit.barrier()\\n for index, bit in enumerate(reversed(secret)):\\n if bit == \"1\":\\n circuit.cx(index, 3)\\n if add_barriers:\\n circuit.barrier()\\n circuit.h([0, 1, 2])\\n circuit.measure([0, 1, 2], [0, 1, 2])\\n return circuit\\n\\ncircuit = bv_candidate(secret=\"011\", add_barriers=True)\\n'\n",
|
||||
|
|
@ -507,7 +549,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why compare two BV candidates that produce the same output?', 'options': ['To judge readability, interface clarity, and how well the secret structure is exposed in the code', 'Because one of them must be mathematically invalid', 'Because Qiskit requires multiple implementations'], 'correct_index': 0, 'explanation': 'Engineering quality includes more than behavioral equivalence.'}, {'prompt': 'What would make a BV builder too clever?', 'options': ['Hiding secret-bit routing behind opaque indexing so the oracle contract is no longer reviewable', 'Using a helper function at all', 'Keeping the ancilla unmeasured'], 'correct_index': 0, 'explanation': 'Abstraction is useful only while the causal burden stays visible.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -578,7 +627,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short code-review note comparing the lean and structured BV candidates.')\n"
|
||||
|
|
@ -603,7 +659,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one additional prediction habit you want to carry into later modules.')\n"
|
||||
|
|
@ -694,7 +757,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -725,7 +794,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -252,7 +252,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare every query wire in superposition and the ancilla in |->.', 'diagram_effect': 'The diagram begins with a wide preparation fan-out instead of a single branch.', 'why_it_matters': 'Bernstein-Vazirani asks one structured question about several bits at once.'}, {'marker': '[2]', 'code_focus': 'Route only the secret-controlled query wires into the ancilla.', 'diagram_effect': 'The oracle body visually highlights which secret bits are active.', 'why_it_matters': 'The hidden string is not mystical. It is literally the connectivity pattern inside the oracle.'}, {'marker': '[3]', 'code_focus': 'Apply final Hadamards to decode the hidden pattern back onto the query register.', 'diagram_effect': 'The second Hadamard layer closes the algorithmic sandwich.', 'why_it_matters': 'This is the moment where phase-encoded structure becomes classical evidence.'}, {'marker': '[4]', 'code_focus': 'Measure the query register in a bit order you can defend.', 'diagram_effect': 'The readout layer makes the interface contract explicit.', 'why_it_matters': 'Bit-order confusion is one of the easiest ways to sabotage an otherwise correct circuit.'}])\n"
|
||||
|
|
@ -277,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bv_oracle(secret: str = \"101\") -> QuantumCircuit:\\n oracle = QuantumCircuit(4, name=f\"bv_{secret}\")\\n ancilla = 3\\n for index, bit in enumerate(reversed(secret)):\\n if bit == \"1\":\\n oracle.cx(index, ancilla)\\n return oracle\\n\\ncircuit = QuantumCircuit(4, 3)\\n# [1] Prepare the query register and phase-sensitive ancilla.\\ncircuit.h([0, 1, 2])\\ncircuit.x(3)\\ncircuit.h(3)\\n# [2] Query the structured oracle.\\ncircuit.compose(bv_oracle(\"101\"), inplace=True)\\n# [3] Decode the hidden pattern.\\ncircuit.h([0, 1, 2])\\n# [4] Measure only the recovered string.\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -346,7 +360,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the hidden string in Bernstein-Vazirani, from a circuit-design point of view?', 'options': ['A pattern of oracle-controlled interactions from query wires into the ancilla', 'A random measurement artifact', 'A post-processing choice made after simulation'], 'correct_index': 0, 'explanation': 'The secret is implemented structurally inside the oracle.'}, {'prompt': 'Why is the final Hadamard layer still necessary in BV?', 'options': ['It decodes phase-encoded structure back onto the query register', 'It reduces the number of classical bits needed', 'It prepares the ancilla for measurement'], 'correct_index': 0, 'explanation': 'The last Hadamards convert the hidden linear pattern into a classical report.'}, {'prompt': 'Why is bit-order discipline a central engineering lesson in this module?', 'options': ['Because a correct oracle can still be misreported by a sloppy measurement mapping', 'Because Qiskit requires alphabetical register names', 'Because secret strings must always be palindromes'], 'correct_index': 0, 'explanation': 'The circuit and the reporting interface have to agree on which bit is which.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -429,7 +450,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What generalizable design idea does BV teach beyond the specific hidden-string problem?', 'options': ['How to encode a structured linear rule in an oracle and recover it in one coherent pass', 'How to avoid ancillas in all algorithms', 'How to replace measurement with transpilation'], 'correct_index': 0, 'explanation': 'BV is useful because it exposes a reusable structure, not just a party trick.'}, {'prompt': \"Why is a barrier sometimes acceptable in this module's lab work?\", 'options': ['It can make the logical regions visible without changing the algorithmic claim', 'It improves the mathematics of the oracle', 'It changes the secret string automatically'], 'correct_index': 0, 'explanation': 'Barriers are presentation tools here, not algorithmic ingredients.'}, {'prompt': 'What is the strongest argument for testing multiple secrets in the same notebook?', 'options': ['It checks whether your builder really expresses a family rather than one lucky example', 'It forces the simulator to randomize less', 'It removes the need for comments'], 'correct_index': 0, 'explanation': 'Family-level reasoning is the real target of the module.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -454,7 +482,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why the hidden string in BV should be thought of as structure in the oracle rather than as a label added after execution.')\n"
|
||||
|
|
@ -479,7 +514,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one way to make a BV builder more reviewable without changing its behavior.')\n"
|
||||
|
|
@ -585,7 +627,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -616,7 +664,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -173,7 +173,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which change directly changes the hidden string implemented by a BV oracle?', 'options': ['Changing which query wires control the ancilla', 'Renaming the classical register', 'Adding a plot title'], 'correct_index': 0, 'explanation': 'The secret is the connectivity pattern into the ancilla.'}, {'prompt': 'What is the strongest description of the BV oracle?', 'options': ['A structured parity-like query on the input bits', 'A random entangling layer', 'A measurement-only gadget'], 'correct_index': 0, 'explanation': 'BV is organized around a structured linear rule.'}], heading='Oracle Structure')\n"
|
||||
|
|
@ -213,7 +220,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which statement is most defensible about bit order?', 'options': ['It can be ignored as long as counts look stable', 'It is part of the API between the circuit and the reader', 'It matters only in cloud execution'], 'correct_index': 1, 'explanation': 'If the learner cannot defend the mapping, the result is not well engineered.'}, {'prompt': 'What kind of bug is a reversed-secret report?', 'options': ['An interface bug that can mask a correct oracle', 'A hardware-only bug', 'A plotting bug with no circuit significance'], 'correct_index': 0, 'explanation': 'Interface bugs are still design bugs.'}], heading='Bit Order And Reporting')\n"
|
||||
|
|
@ -253,7 +267,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the professional value of recognizing BV as a motif?', 'options': ['You can reuse its structure when a task asks for hidden linear information in a circuit', 'You can stop learning other algorithms', 'You can avoid using classical post-processing forever'], 'correct_index': 0, 'explanation': 'The goal is transfer, not mere memorization.'}, {'prompt': 'What survives when the secret string changes?', 'options': ['The global circuit pattern and decoding logic', 'Only the exact same oracle wiring', 'The need to measure the ancilla'], 'correct_index': 0, 'explanation': 'The family structure is what matters.'}], heading='Reusable Motif')\n"
|
||||
|
|
@ -293,7 +314,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which review note is strongest?', 'options': ['The code runs, so the oracle is fine', 'The secret-bit mapping is hidden behind index tricks, so the builder is hard to verify', 'Please use more barriers so it looks quantum'], 'correct_index': 1, 'explanation': 'Review should target what makes the circuit auditable or opaque.'}, {'prompt': 'What evidence should accompany a claim that a BV notebook is correct?', 'options': ['Several secrets, explicit oracle definitions, and counts matched against the intended reporting order', 'A single screenshot of one circuit', 'Only a statevector plot with no explanation'], 'correct_index': 0, 'explanation': 'Correctness here includes structural, interface, and empirical evidence.'}], heading='Review Judgement')\n"
|
||||
|
|
@ -379,7 +407,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why family-level testing is more persuasive than a single successful BV example.')\n"
|
||||
|
|
@ -404,7 +439,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe a minimal checklist you would use before trusting a hidden-string notebook written by someone else.')\n"
|
||||
|
|
@ -511,7 +553,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -542,7 +590,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bv_oracle(secret: str = \"101\") -> QuantumCircuit:\\n oracle = QuantumCircuit(4, name=f\"bv_{secret}\")\\n ancilla = 3\\n for index, bit in enumerate(reversed(secret)):\\n if bit == \"1\":\\n oracle.cx(index, ancilla)\\n return oracle\\n\\ncircuit = QuantumCircuit(4, 3)\\n# [1] Prepare the query register and phase-sensitive ancilla.\\ncircuit.h([0, 1, 2])\\ncircuit.x(3)\\ncircuit.h(3)\\n# [2] Query the structured oracle.\\ncircuit.compose(bv_oracle(\"101\"), inplace=True)\\n# [3] Decode the hidden pattern.\\ncircuit.h([0, 1, 2])\\n# [4] Measure only the recovered string.\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -222,7 +229,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bv_oracle(secret: str = \"110\") -> QuantumCircuit:\\n oracle = QuantumCircuit(4, name=f\"bv_{secret}\")\\n ancilla = 3\\n for index, bit in enumerate(reversed(secret)):\\n if bit == \"1\":\\n oracle.cx(index, ancilla)\\n return oracle\\n\\ncircuit = QuantumCircuit(4, 3)\\ncircuit.h([0, 1, 2])\\ncircuit.x(3)\\ncircuit.h(3)\\ncircuit.compose(bv_oracle(\"110\"), inplace=True)\\ncircuit.h([0, 1, 2])\\n# Change the measurement order only if you can explain the reporting contract.\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -270,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bv_candidate(secret: str = \"011\", add_barriers: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(4, 3)\\n circuit.h([0, 1, 2])\\n circuit.x(3)\\n circuit.h(3)\\n if add_barriers:\\n circuit.barrier()\\n for index, bit in enumerate(reversed(secret)):\\n if bit == \"1\":\\n circuit.cx(index, 3)\\n if add_barriers:\\n circuit.barrier()\\n circuit.h([0, 1, 2])\\n circuit.measure([0, 1, 2], [0, 1, 2])\\n return circuit\\n\\ncircuit = bv_candidate(secret=\"011\", add_barriers=True)\\n'\n",
|
||||
|
|
@ -302,7 +323,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the best studio target for this module?', 'options': ['A small secret-recovery library where the oracle contract and reporting order are both reviewable', 'The shortest possible BV code cell', 'A notebook that uses only barriers and screenshots'], 'correct_index': 0, 'explanation': 'Studio work should promote reusable, auditable design rather than compression alone.'}, {'prompt': 'Why is it useful to compare two secrets of different Hamming weights?', 'options': [\"It shows how the oracle body's density changes while the global motif stays stable\", 'It changes the number of required classical bits', 'It removes the need for a final Hadamard layer'], 'correct_index': 0, 'explanation': 'Different secret densities stress the same design pattern in different ways.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -373,7 +401,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What secret family did you use in the studio, and why was it a good stress test for your builder?')\n"
|
||||
|
|
@ -398,7 +433,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which reporting convention did you choose, and how did you defend it?')\n"
|
||||
|
|
@ -423,7 +465,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What is the strongest review sentence you wrote in this studio?')\n"
|
||||
|
|
@ -448,7 +497,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one habit from the Deutsch family that carried forward unchanged into BV.')\n"
|
||||
|
|
@ -539,7 +595,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -570,7 +632,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Start with a small, fully explicit QFT instead of hiding it behind a library call.', 'diagram_effect': 'The circuit shows every controlled phase and swap directly.', 'why_it_matters': 'A professional designer needs to know which pieces are essential and which are optional approximations.'}, {'marker': '[2]', 'code_focus': 'Interpret each controlled phase as a graded correlation, not as a mysterious flourish.', 'diagram_effect': 'The middle of the circuit becomes a ladder of phase relationships.', 'why_it_matters': 'Controlled-phase structure is the real content of the QFT.'}, {'marker': '[3]', 'code_focus': 'Use swaps to state the intended output ordering explicitly.', 'diagram_effect': 'The end of the diagram makes the bit-reversal issue visible.', 'why_it_matters': 'Output ordering is part of the interface, not a postscript.'}, {'marker': '[4]', 'code_focus': 'Verify the transform with statevector or inverse-QFT checks instead of trusting the picture alone.', 'diagram_effect': 'The notebook connects circuit graphics to basis-change evidence.', 'why_it_matters': 'Basis-change circuits need stronger verification habits than simple compute-and-measure patterns.'}])\n"
|
||||
|
|
@ -199,7 +206,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom math import pi\\nfrom qiskit import QuantumCircuit\\n\\ndef qft3() -> QuantumCircuit:\\n circuit = QuantumCircuit(3, name=\"qft3\")\\n # [1] Start with explicit local structure.\\n circuit.h(2)\\n circuit.cp(pi / 2, 1, 2)\\n circuit.cp(pi / 4, 0, 2)\\n # [2] Continue the controlled-phase ladder.\\n circuit.h(1)\\n circuit.cp(pi / 2, 0, 1)\\n circuit.h(0)\\n # [3] State the output ordering explicitly.\\n circuit.swap(0, 2)\\n return circuit\\n\\ncircuit = qft3()\\n'\n",
|
||||
|
|
@ -268,7 +282,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'If you drop the final swap layer in a QFT notebook, what changes first?', 'options': ['The output ordering convention becomes different even if the phase logic is otherwise intact', 'All controlled phases disappear', 'The circuit can no longer be simulated'], 'correct_index': 0, 'explanation': 'Removing swaps changes the interface contract of the transform.'}, {'prompt': 'What is the best reason to edit one controlled-phase angle at a time?', 'options': ['So you can connect a visible change in structure to a specific representational consequence', 'So the notebook runs faster', 'So the circuit has fewer qubits'], 'correct_index': 0, 'explanation': 'Controlled ablation is how you learn what each phase layer is doing.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -293,7 +314,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which verification move felt most convincing in this lab, and why?')\n"
|
||||
|
|
@ -334,7 +362,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom math import pi\\nfrom qiskit import QuantumCircuit\\n\\ndef qft3() -> QuantumCircuit:\\n circuit = QuantumCircuit(3, name=\"qft3\")\\n circuit.h(2)\\n circuit.cp(pi / 2, 1, 2)\\n circuit.cp(pi / 4, 0, 2)\\n circuit.h(1)\\n circuit.cp(pi / 2, 0, 1)\\n circuit.h(0)\\n circuit.swap(0, 2)\\n return circuit\\n\\ncircuit = QuantumCircuit(3, 3)\\ncircuit.x(0)\\ncircuit.compose(qft3(), inplace=True)\\ncircuit.compose(qft3().inverse(), inplace=True)\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -423,7 +458,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom math import pi\\nfrom qiskit import QuantumCircuit\\n\\ndef qft3(drop_smallest_angle: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(3, name=\"qft3\")\\n circuit.h(2)\\n circuit.cp(pi / 2, 1, 2)\\n if not drop_smallest_angle:\\n circuit.cp(pi / 4, 0, 2)\\n circuit.h(1)\\n circuit.cp(pi / 2, 0, 1)\\n circuit.h(0)\\n circuit.swap(0, 2)\\n return circuit\\n\\ncircuit = qft3(drop_smallest_angle=True)\\n'\n",
|
||||
|
|
@ -496,7 +538,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why is QFT plus inverse-QFT a useful lab pattern?', 'options': ['It checks whether your custom transform preserves information when composed with its inverse', 'It makes all swaps unnecessary', 'It amplifies noise automatically'], 'correct_index': 0, 'explanation': 'Recovery checks are a disciplined way to verify basis-change code.'}, {'prompt': 'What does an approximate-QFT comparison teach best?', 'options': ['How structural simplification can be defended as a tradeoff instead of guessed at', 'How to avoid ever drawing the circuit', 'How to replace controlled phases with measurements'], 'correct_index': 0, 'explanation': 'Approximation should be justified, not mystified.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -567,7 +616,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short engineering note defending either the full or approximate 3-qubit QFT for a small local study.')\n"
|
||||
|
|
@ -592,7 +648,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one additional prediction habit you want to carry into later modules.')\n"
|
||||
|
|
@ -683,7 +746,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -714,7 +783,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -252,7 +252,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Start with a small, fully explicit QFT instead of hiding it behind a library call.', 'diagram_effect': 'The circuit shows every controlled phase and swap directly.', 'why_it_matters': 'A professional designer needs to know which pieces are essential and which are optional approximations.'}, {'marker': '[2]', 'code_focus': 'Interpret each controlled phase as a graded correlation, not as a mysterious flourish.', 'diagram_effect': 'The middle of the circuit becomes a ladder of phase relationships.', 'why_it_matters': 'Controlled-phase structure is the real content of the QFT.'}, {'marker': '[3]', 'code_focus': 'Use swaps to state the intended output ordering explicitly.', 'diagram_effect': 'The end of the diagram makes the bit-reversal issue visible.', 'why_it_matters': 'Output ordering is part of the interface, not a postscript.'}, {'marker': '[4]', 'code_focus': 'Verify the transform with statevector or inverse-QFT checks instead of trusting the picture alone.', 'diagram_effect': 'The notebook connects circuit graphics to basis-change evidence.', 'why_it_matters': 'Basis-change circuits need stronger verification habits than simple compute-and-measure patterns.'}])\n"
|
||||
|
|
@ -277,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom math import pi\\nfrom qiskit import QuantumCircuit\\n\\ndef qft3() -> QuantumCircuit:\\n circuit = QuantumCircuit(3, name=\"qft3\")\\n # [1] Start with explicit local structure.\\n circuit.h(2)\\n circuit.cp(pi / 2, 1, 2)\\n circuit.cp(pi / 4, 0, 2)\\n # [2] Continue the controlled-phase ladder.\\n circuit.h(1)\\n circuit.cp(pi / 2, 0, 1)\\n circuit.h(0)\\n # [3] State the output ordering explicitly.\\n circuit.swap(0, 2)\\n return circuit\\n\\ncircuit = qft3()\\n'\n",
|
||||
|
|
@ -350,7 +364,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the most useful first description of the QFT in this course?', 'options': ['A basis change that reorganizes phase information', 'A mysterious speedup box', 'A measurement replacement technique'], 'correct_index': 0, 'explanation': 'The QFT becomes legible when treated as an explicit basis transformation.'}, {'prompt': 'Why are the controlled-phase gates the conceptual heart of the QFT?', 'options': ['They progressively encode relative phase relationships across the wires', 'They are the only gates a simulator can draw', 'They replace swaps in all cases'], 'correct_index': 0, 'explanation': 'The ladder of controlled phases is where the transform actually lives.'}, {'prompt': 'Why should swaps be explained rather than dismissed as cleanup?', 'options': ['Because output ordering is part of the interface contract of the transform', 'Because swaps always improve fidelity', 'Because QFT cannot run without measuring every qubit'], 'correct_index': 0, 'explanation': 'Bit reversal is not housekeeping; it is a deliberate part of the output convention.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -433,7 +454,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does an approximate QFT change first?', 'options': ['It removes small-angle interactions to trade fidelity for structural simplicity', 'It replaces all Hadamards with X gates', 'It turns the transform into a classical FFT'], 'correct_index': 0, 'explanation': 'Approximation is a design tradeoff on controlled-phase detail.'}, {'prompt': 'What is the best verification habit for a small QFT notebook?', 'options': ['Use statevector evidence or inverse-QFT recovery checks, not just the circuit image', 'Trust the textbook diagram once it renders', 'Measure every qubit immediately after each gate'], 'correct_index': 0, 'explanation': 'Basis-change circuits need explicit evidence.'}, {'prompt': 'Why does the QFT belong in an algorithmic-design band?', 'options': ['Because it teaches a reusable basis-change motif that reappears inside larger algorithms', 'Because it is only useful as a historical example', 'Because it avoids all phase reasoning'], 'correct_index': 0, 'explanation': 'The module is about a transferable design pattern, not a museum piece.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -458,7 +486,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why basis-change language is more useful than speedup language for learning the QFT.')\n"
|
||||
|
|
@ -483,7 +518,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one paragraph defending why the swap layer should be treated as part of the interface contract.')\n"
|
||||
|
|
@ -589,7 +631,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -620,7 +668,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -173,7 +173,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which phrase best captures the QFT at beginner-professional level?', 'options': ['A basis change that reorganizes periodic structure into readable phase relationships', 'A black-box acceleration primitive with no circuit meaning', 'A measurement shortcut'], 'correct_index': 0, 'explanation': 'Mechanistic language matters if you want to design with the QFT later.'}, {'prompt': \"Why is 'basis change' better language than 'magic transform'?\", 'options': ['Because it points you toward verification and interface questions', 'Because it removes the need for phase reasoning', 'Because it implies all amplitudes stay real'], 'correct_index': 0, 'explanation': 'Good language anchors good engineering questions.'}], heading='Basis Change')\n"
|
||||
|
|
@ -213,7 +220,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does the smallest-angle controlled phase represent in a 3-qubit QFT?', 'options': ['A weaker but still real contribution to the final phase pattern', 'A gate that can be ignored without consequence in every setting', 'A measurement of the least significant bit'], 'correct_index': 0, 'explanation': 'Its contribution is smaller, not conceptually meaningless.'}, {'prompt': 'Why do QFT circuits deserve line-by-line explanation?', 'options': ['Because many later algorithms embed them, so shallow memorization becomes expensive later', 'Because QFT never appears in serious work', 'Because all controlled phases are interchangeable'], 'correct_index': 0, 'explanation': 'This module installs vocabulary for later reuse.'}], heading='Controlled-Phase Reading')\n"
|
||||
|
|
@ -253,7 +267,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the strongest reason to discuss swaps explicitly?', 'options': ['They encode a bit-order convention that affects how results are interpreted', 'They are visually attractive', 'They remove the need for inverse verification'], 'correct_index': 0, 'explanation': \"Ordering is part of the transform's external contract.\"}, {'prompt': 'Which evidence is most persuasive when validating a small QFT implementation?', 'options': ['Statevector plots or inverse-composition checks tied to a written explanation', 'Only a final count histogram', 'Only gate count totals'], 'correct_index': 0, 'explanation': 'Basis-change circuits need representational evidence, not only sampled readout.'}], heading='Ordering And Verification')\n"
|
||||
|
|
@ -293,7 +314,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why might an engineer drop the smallest controlled-phase term?', 'options': ['To trade some transform fidelity for structural simplification under a cost budget', 'To make the circuit classical', 'To eliminate all ordering issues'], 'correct_index': 0, 'explanation': 'Approximation belongs to explicit tradeoff reasoning.'}, {'prompt': 'Which review comment is strongest?', 'options': ['This approximation is acceptable because the omitted phase term is least significant and the verification notebook shows the recovery gap clearly', 'I removed some gates because the circuit looked busy', 'Approximate QFT means exact output with fewer gates'], 'correct_index': 0, 'explanation': 'A professional defense ties structural changes to evidence and scope.'}], heading='Approximation Tradeoffs')\n"
|
||||
|
|
@ -379,7 +407,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a beautiful circuit diagram is not enough evidence for a correct QFT implementation.')\n"
|
||||
|
|
@ -404,7 +439,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one concrete reason an engineer might choose a small approximate-QFT variant.')\n"
|
||||
|
|
@ -511,7 +553,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -542,7 +590,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom math import pi\\nfrom qiskit import QuantumCircuit\\n\\ndef qft3() -> QuantumCircuit:\\n circuit = QuantumCircuit(3, name=\"qft3\")\\n # [1] Start with explicit local structure.\\n circuit.h(2)\\n circuit.cp(pi / 2, 1, 2)\\n circuit.cp(pi / 4, 0, 2)\\n # [2] Continue the controlled-phase ladder.\\n circuit.h(1)\\n circuit.cp(pi / 2, 0, 1)\\n circuit.h(0)\\n # [3] State the output ordering explicitly.\\n circuit.swap(0, 2)\\n return circuit\\n\\ncircuit = qft3()\\n'\n",
|
||||
|
|
@ -222,7 +229,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom math import pi\\nfrom qiskit import QuantumCircuit\\n\\ndef qft3() -> QuantumCircuit:\\n circuit = QuantumCircuit(3, name=\"qft3\")\\n circuit.h(2)\\n circuit.cp(pi / 2, 1, 2)\\n circuit.cp(pi / 4, 0, 2)\\n circuit.h(1)\\n circuit.cp(pi / 2, 0, 1)\\n circuit.h(0)\\n circuit.swap(0, 2)\\n return circuit\\n\\ncircuit = QuantumCircuit(3, 3)\\ncircuit.x(0)\\ncircuit.compose(qft3(), inplace=True)\\ncircuit.compose(qft3().inverse(), inplace=True)\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -270,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom math import pi\\nfrom qiskit import QuantumCircuit\\n\\ndef qft3(drop_smallest_angle: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(3, name=\"qft3\")\\n circuit.h(2)\\n circuit.cp(pi / 2, 1, 2)\\n if not drop_smallest_angle:\\n circuit.cp(pi / 4, 0, 2)\\n circuit.h(1)\\n circuit.cp(pi / 2, 0, 1)\\n circuit.h(0)\\n circuit.swap(0, 2)\\n return circuit\\n\\ncircuit = qft3(drop_smallest_angle=True)\\n'\n",
|
||||
|
|
@ -302,7 +323,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the right studio objective for a QFT module?', 'options': ['Build and defend a small transform variant with explicit choices about ordering, verification, and approximation', 'Memorize one diagram and redraw it from memory', 'Avoid discussing phases so the notebook stays simpler'], 'correct_index': 0, 'explanation': 'Studio work should convert the transform into a design object.'}, {'prompt': 'Why compare full and approximate variants side by side?', 'options': ['Because design quality depends on explicit cost-benefit reasoning, not only on correctness in the abstract', 'Because the exact transform is never useful', 'Because approximate transforms cannot be verified'], 'correct_index': 0, 'explanation': 'Side-by-side comparison is how tradeoffs become concrete.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -373,7 +401,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What part of the QFT became most legible to you only after writing it out explicitly?')\n"
|
||||
|
|
@ -398,7 +433,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which verification workflow did you choose in the studio, and why was it appropriate?')\n"
|
||||
|
|
@ -423,7 +465,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('How did you describe the tradeoff in your approximate-QFT memo?')\n"
|
||||
|
|
@ -448,7 +497,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one later band where you expect this QFT vocabulary to matter directly.')\n"
|
||||
|
|
@ -539,7 +595,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -570,7 +632,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare the search register in a uniform superposition.', 'diagram_effect': 'The circuit opens with a clean equal-weight state over all candidates.', 'why_it_matters': 'Amplitude amplification starts from a fair baseline, not from a pre-biased guess.'}, {'marker': '[2]', 'code_focus': 'Implement the oracle as a phase-marking operation on the chosen target.', 'diagram_effect': 'The middle block identifies the marked state without directly measuring it.', 'why_it_matters': 'Grover oracles mark by phase, not by classical tagging.'}, {'marker': '[3]', 'code_focus': 'Apply the diffuser as a reflection about the mean amplitude.', 'diagram_effect': 'The circuit mirrors the oracle block with a deliberate inversion pattern.', 'why_it_matters': 'The diffuser is the engineering heart of amplitude amplification.'}, {'marker': '[4]', 'code_focus': 'Choose the iteration count as a design decision, then measure.', 'diagram_effect': 'The right edge of the circuit closes the amplification loop with a concrete reporting contract.', 'why_it_matters': 'Over-iteration is a real design failure, not a harmless extra pass.'}])\n"
|
||||
|
|
@ -199,7 +206,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef grover_oracle(target: str = \"11\") -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{target}\")\\n if target[0] == \"0\":\\n oracle.x(1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n oracle.cz(0, 1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n if target[0] == \"0\":\\n oracle.x(1)\\n return oracle\\n\\ndef diffuser() -> QuantumCircuit:\\n circuit = QuantumCircuit(2, name=\"diffuser\")\\n circuit.h([0, 1])\\n circuit.x([0, 1])\\n circuit.cz(0, 1)\\n circuit.x([0, 1])\\n circuit.h([0, 1])\\n return circuit\\n\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Uniform search state\\ncircuit.h([0, 1])\\n# [2] Mark the target by phase\\ncircuit.compose(grover_oracle(\"11\"), inplace=True)\\n# [3] Reflect about the mean\\ncircuit.compose(diffuser(), inplace=True)\\n# [4] Report the amplified candidate\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -276,7 +290,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'If you change the Grover target from 11 to 01, what should stay invariant?', 'options': ['The overall oracle-plus-diffuser pattern', 'The exact same X wrappers around the oracle', 'The measured winning bitstring'], 'correct_index': 0, 'explanation': 'The motif is stable even though the marking details change.'}, {'prompt': 'What is the right way to inspect a target-change edit?', 'options': ['Check whether the oracle wrappers match the new target and whether the counts peak moved accordingly', 'Only inspect circuit depth', 'Only inspect the diffuser block'], 'correct_index': 0, 'explanation': 'The target lives in the oracle mapping and the resulting readout distribution.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -301,7 +322,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What did the one-versus-two iteration comparison teach you about the geometric story of Grover?')\n"
|
||||
|
|
@ -342,7 +370,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef grover_oracle(target: str = \"10\") -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{target}\")\\n if target[0] == \"0\":\\n oracle.x(1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n oracle.cz(0, 1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n if target[0] == \"0\":\\n oracle.x(1)\\n return oracle\\n\\ndef diffuser() -> QuantumCircuit:\\n circuit = QuantumCircuit(2, name=\"diffuser\")\\n circuit.h([0, 1])\\n circuit.x([0, 1])\\n circuit.cz(0, 1)\\n circuit.x([0, 1])\\n circuit.h([0, 1])\\n return circuit\\n\\ndef grover_circuit(target: str = \"10\", iterations: int = 2) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h([0, 1])\\n for _ in range(iterations):\\n circuit.compose(grover_oracle(target), inplace=True)\\n circuit.compose(diffuser(), inplace=True)\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = grover_circuit(target=\"10\", iterations=2)\\n'\n",
|
||||
|
|
@ -428,7 +463,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef grover_oracle(target: str = \"10\") -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{target}\")\\n if target[0] == \"0\":\\n oracle.x(1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n oracle.cz(0, 1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n if target[0] == \"0\":\\n oracle.x(1)\\n return oracle\\n\\ndef diffuser() -> QuantumCircuit:\\n circuit = QuantumCircuit(2, name=\"diffuser\")\\n circuit.h([0, 1])\\n circuit.x([0, 1])\\n circuit.cz(0, 1)\\n circuit.x([0, 1])\\n circuit.h([0, 1])\\n return circuit\\n\\ndef grover_circuit(target: str = \"10\", iterations: int = 2) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h([0, 1])\\n for _ in range(iterations):\\n circuit.compose(grover_oracle(target), inplace=True)\\n circuit.compose(diffuser(), inplace=True)\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = grover_circuit(target=\"10\", iterations=2)\\n'\n",
|
||||
|
|
@ -509,7 +551,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does two iterations on a 2-qubit Grover problem often illustrate?', 'options': ['Over-rotation or unnecessary extra work relative to the one-iteration optimum', 'Guaranteed improvement over one iteration', 'Automatic error mitigation'], 'correct_index': 0, 'explanation': 'A small search space makes the iteration-choice tradeoff easy to see.'}, {'prompt': 'Why compare separate oracle implementations for different targets?', 'options': ['To see whether the target-selection code stays readable and reviewable as the marking logic changes', 'Because only one target is physically valid', 'Because the diffuser depends on the target string'], 'correct_index': 0, 'explanation': 'Readable target handling matters for maintainable search code.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -580,7 +629,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short review note about one oracle helper that would be too opaque for serious use.')\n"
|
||||
|
|
@ -605,7 +661,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one additional prediction habit you want to carry into later modules.')\n"
|
||||
|
|
@ -696,7 +759,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -727,7 +796,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -252,7 +252,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare the search register in a uniform superposition.', 'diagram_effect': 'The circuit opens with a clean equal-weight state over all candidates.', 'why_it_matters': 'Amplitude amplification starts from a fair baseline, not from a pre-biased guess.'}, {'marker': '[2]', 'code_focus': 'Implement the oracle as a phase-marking operation on the chosen target.', 'diagram_effect': 'The middle block identifies the marked state without directly measuring it.', 'why_it_matters': 'Grover oracles mark by phase, not by classical tagging.'}, {'marker': '[3]', 'code_focus': 'Apply the diffuser as a reflection about the mean amplitude.', 'diagram_effect': 'The circuit mirrors the oracle block with a deliberate inversion pattern.', 'why_it_matters': 'The diffuser is the engineering heart of amplitude amplification.'}, {'marker': '[4]', 'code_focus': 'Choose the iteration count as a design decision, then measure.', 'diagram_effect': 'The right edge of the circuit closes the amplification loop with a concrete reporting contract.', 'why_it_matters': 'Over-iteration is a real design failure, not a harmless extra pass.'}])\n"
|
||||
|
|
@ -277,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef grover_oracle(target: str = \"11\") -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{target}\")\\n if target[0] == \"0\":\\n oracle.x(1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n oracle.cz(0, 1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n if target[0] == \"0\":\\n oracle.x(1)\\n return oracle\\n\\ndef diffuser() -> QuantumCircuit:\\n circuit = QuantumCircuit(2, name=\"diffuser\")\\n circuit.h([0, 1])\\n circuit.x([0, 1])\\n circuit.cz(0, 1)\\n circuit.x([0, 1])\\n circuit.h([0, 1])\\n return circuit\\n\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Uniform search state\\ncircuit.h([0, 1])\\n# [2] Mark the target by phase\\ncircuit.compose(grover_oracle(\"11\"), inplace=True)\\n# [3] Reflect about the mean\\ncircuit.compose(diffuser(), inplace=True)\\n# [4] Report the amplified candidate\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -365,7 +379,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does a Grover oracle do in the small-search setting?', 'options': ['It marks the target state by phase', 'It measures the winning answer directly', 'It replaces the diffuser'], 'correct_index': 0, 'explanation': 'The oracle marks, the diffuser amplifies.'}, {'prompt': 'What is the diffuser best understood as?', 'options': ['A reflection about the mean amplitude', 'A generic entangling block with no geometric meaning', 'A noise-mitigation trick'], 'correct_index': 0, 'explanation': 'Grover becomes teachable once the diffuser has geometric meaning.'}, {'prompt': 'Why is iteration count part of the design story?', 'options': ['Because too many iterations rotate past the target instead of improving forever', 'Because each iteration changes the number of qubits', 'Because the oracle stops working after one pass'], 'correct_index': 0, 'explanation': 'Amplitude amplification is a controlled rotation, not monotone accumulation.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -448,7 +469,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the most important beginner-professional lesson in Grover?', 'options': ['How oracle marking and diffusion compose into a tunable amplification routine', 'How to avoid thinking geometrically', 'How to replace search with measurement'], 'correct_index': 0, 'explanation': 'The module is about composing two reflections into a controlled search routine.'}, {'prompt': 'Why should the oracle and diffuser often be implemented as separate helpers?', 'options': ['Because they play different roles and must be inspected independently during review', 'Because Qiskit forbids inline composition', 'Because the diffuser is always backend-specific'], 'correct_index': 0, 'explanation': 'Separation improves auditability and experimentation.'}, {'prompt': 'What would be a weak explanation of a good Grover result?', 'options': ['The probabilities went up because quantum is strong', 'One iteration reflected the marked amplitude and then the mean-reflection boosted it', 'The oracle marked a state and the diffuser redistributed amplitudes around that mark'], 'correct_index': 0, 'explanation': 'The course is trying to eliminate hand-waving explanations like this.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -473,7 +501,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain the difference between oracle marking and diffusion in Grover without collapsing them into one vague sentence.')\n"
|
||||
|
|
@ -498,7 +533,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Why is iteration count an engineering choice rather than a fixed ritual in this module?')\n"
|
||||
|
|
@ -604,7 +646,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -635,7 +683,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -173,7 +173,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which statement best distinguishes the oracle from the diffuser?', 'options': ['The oracle marks a target by phase; the diffuser amplifies relative to the mean', 'The oracle and diffuser are interchangeable', 'The diffuser measures while the oracle transpiles'], 'correct_index': 0, 'explanation': 'The routine only makes sense if the two blocks have distinct semantic roles.'}, {'prompt': 'Why is separating helpers useful in review?', 'options': ['You can inspect whether the target-marking logic or the amplification logic is at fault', 'It guarantees lower depth', 'It removes the need for tests'], 'correct_index': 0, 'explanation': 'Separation sharpens diagnosis and discussion.'}], heading='Oracle And Diffuser Roles')\n"
|
||||
|
|
@ -213,7 +220,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the professional value of describing Grover as a rotation?', 'options': ['It explains why more iterations are not automatically better', 'It means the circuit can only search circular data', 'It removes the need for oracle design'], 'correct_index': 0, 'explanation': 'The geometry explains the iteration tradeoff.'}, {'prompt': 'Which phrase should you reject in this module?', 'options': ['The routine just keeps getting stronger forever', 'The routine amplifies by composing two reflections', 'Iteration choice depends on search-space size'], 'correct_index': 0, 'explanation': 'That phrase hides the actual mechanism.'}], heading='Geometric Reasoning')\n"
|
||||
|
|
@ -253,7 +267,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the strongest reason to compare one and two iterations in a 2-qubit search?', 'options': ['It reveals the difference between useful amplification and over-rotation', 'It doubles the number of valid targets', 'It makes the oracle simpler'], 'correct_index': 0, 'explanation': 'Iteration choice is part of design, not just runtime length.'}, {'prompt': 'What evidence best supports the claim that one iteration is better here?', 'options': ['The count distribution peaks more strongly on the target under the intended search size', 'The circuit text looks shorter', 'The diffuser uses fewer comments'], 'correct_index': 0, 'explanation': 'Iteration claims should be supported by observed amplification behavior.'}], heading='Iteration Choice')\n"
|
||||
|
|
@ -293,7 +314,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which review comment is strongest?', 'options': ['The target-marking logic is hard to audit because the X wrappers are hidden behind ambiguous indexing', 'This circuit looks aggressive', 'Please add more Hadamards because Grover uses many Hadamards'], 'correct_index': 0, 'explanation': 'Professional comments focus on auditability and semantic burden.'}, {'prompt': 'What should accompany a final Grover recommendation?', 'options': ['A defense of the oracle, diffuser, and iteration count tied to search size and observed outcomes', 'Only a single final histogram', 'Only a screenshot of the circuit drawing'], 'correct_index': 0, 'explanation': 'The recommendation should be structurally and empirically grounded.'}], heading='Review Language')\n"
|
||||
|
|
@ -379,7 +407,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a strong Grover notebook must separate oracle logic from diffuser logic.')\n"
|
||||
|
|
@ -404,7 +439,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe the evidence you would use to justify an iteration count in a tiny local search problem.')\n"
|
||||
|
|
@ -511,7 +553,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -542,7 +590,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -174,7 +174,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef grover_oracle(target: str = \"11\") -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{target}\")\\n if target[0] == \"0\":\\n oracle.x(1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n oracle.cz(0, 1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n if target[0] == \"0\":\\n oracle.x(1)\\n return oracle\\n\\ndef diffuser() -> QuantumCircuit:\\n circuit = QuantumCircuit(2, name=\"diffuser\")\\n circuit.h([0, 1])\\n circuit.x([0, 1])\\n circuit.cz(0, 1)\\n circuit.x([0, 1])\\n circuit.h([0, 1])\\n return circuit\\n\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Uniform search state\\ncircuit.h([0, 1])\\n# [2] Mark the target by phase\\ncircuit.compose(grover_oracle(\"11\"), inplace=True)\\n# [3] Reflect about the mean\\ncircuit.compose(diffuser(), inplace=True)\\n# [4] Report the amplified candidate\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -222,7 +229,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef grover_oracle(target: str = \"10\") -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{target}\")\\n if target[0] == \"0\":\\n oracle.x(1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n oracle.cz(0, 1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n if target[0] == \"0\":\\n oracle.x(1)\\n return oracle\\n\\ndef diffuser() -> QuantumCircuit:\\n circuit = QuantumCircuit(2, name=\"diffuser\")\\n circuit.h([0, 1])\\n circuit.x([0, 1])\\n circuit.cz(0, 1)\\n circuit.x([0, 1])\\n circuit.h([0, 1])\\n return circuit\\n\\ndef grover_circuit(target: str = \"10\", iterations: int = 2) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h([0, 1])\\n for _ in range(iterations):\\n circuit.compose(grover_oracle(target), inplace=True)\\n circuit.compose(diffuser(), inplace=True)\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = grover_circuit(target=\"10\", iterations=2)\\n'\n",
|
||||
|
|
@ -270,7 +284,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef grover_oracle(target: str = \"10\") -> QuantumCircuit:\\n oracle = QuantumCircuit(2, name=f\"oracle_{target}\")\\n if target[0] == \"0\":\\n oracle.x(1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n oracle.cz(0, 1)\\n if target[1] == \"0\":\\n oracle.x(0)\\n if target[0] == \"0\":\\n oracle.x(1)\\n return oracle\\n\\ndef diffuser() -> QuantumCircuit:\\n circuit = QuantumCircuit(2, name=\"diffuser\")\\n circuit.h([0, 1])\\n circuit.x([0, 1])\\n circuit.cz(0, 1)\\n circuit.x([0, 1])\\n circuit.h([0, 1])\\n return circuit\\n\\ndef grover_circuit(target: str = \"10\", iterations: int = 2) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h([0, 1])\\n for _ in range(iterations):\\n circuit.compose(grover_oracle(target), inplace=True)\\n circuit.compose(diffuser(), inplace=True)\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = grover_circuit(target=\"10\", iterations=2)\\n'\n",
|
||||
|
|
@ -302,7 +323,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a strong studio deliverable for Grover?', 'options': ['A notebook comparing target choices and iteration counts with a written design recommendation', 'A single run of the textbook circuit', 'A list of gate names with no explanation'], 'correct_index': 0, 'explanation': 'The studio should convert the routine into a defended design decision.'}, {'prompt': 'Why is a tiny search space pedagogically useful here?', 'options': ['Because the mechanism and the over-rotation risk are both easy to see locally', 'Because Grover works only on two qubits', 'Because the oracle no longer matters'], 'correct_index': 0, 'explanation': 'Small systems make the geometry visible.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -373,7 +401,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which target family did you compare, and what did that reveal about your oracle helper?')\n"
|
||||
|
|
@ -398,7 +433,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What iteration recommendation did you make, and what evidence mattered most?')\n"
|
||||
|
|
@ -423,7 +465,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('How did you explain the diffuser in your own words in the final notebook?')\n"
|
||||
|
|
@ -448,7 +497,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one habit from this algorithmic-design band that should carry into the professional-design band.')\n"
|
||||
|
|
@ -539,7 +595,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -570,7 +632,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -202,7 +202,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare qubit 0 with a Hadamard gate.', 'diagram_effect': 'The upper wire branches into a superposition-generating event.', 'why_it_matters': 'This is the first step where the circuit stops behaving like a deterministic classical path.'}, {'marker': '[2]', 'code_focus': 'Use CNOT from qubit 0 to qubit 1.', 'diagram_effect': 'The second wire becomes correlated with the branching created above.', 'why_it_matters': 'This is the moment where local gate syntax becomes shared circuit structure.'}, {'marker': '[3]', 'code_focus': 'Measure both qubits into matching classical bits.', 'diagram_effect': 'The diagram turns a latent correlation into an empirical question.', 'why_it_matters': 'Measurement is not a camera; it is the question being asked of the prepared state.'}])\n"
|
||||
|
|
@ -227,7 +234,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare the branch point.\\ncircuit.h(0)\\n# [2] Correlate the second qubit with the first.\\ncircuit.cx(0, 1)\\n# [3] Ask the question in the computational basis.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -284,7 +298,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'If you remove the Hadamard from a Bell circuit but leave the CNOT, what broad result should you expect?', 'options': ['Only one deterministic outcome from the all-zero input', 'The same balanced Bell histogram as before', 'A completely uniform distribution over all bitstrings'], 'correct_index': 0, 'explanation': 'Without the branch point, the circuit stays on a single classical-looking path from the ground state.'}, {'prompt': 'Why does the lab ask you to compare the graphic and text rendering of the same circuit?', 'options': ['Because they reveal different structural truths and catch different mistakes', 'Because one of them is usually wrong and the other is correct', 'Because Qiskit requires both before simulation'], 'correct_index': 0, 'explanation': 'The pretty diagram and the text rendering support different kinds of inspection.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -309,7 +330,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -364,7 +392,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Create the same Bell-style preparation.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Rotate qubit 0 before asking the measurement question.\\ncircuit.h(0)\\n# [3] Measure both qubits and compare the change.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -451,7 +486,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -493,7 +535,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(3, 3)\\n# [1] Start the branching on the first qubit.\\ncircuit.h(0)\\n# [2] Fan the correlation outward.\\ncircuit.cx(0, 1)\\ncircuit.cx(0, 2)\\n# [3] Measure all wires in the computational basis.\\ncircuit.measure([0, 1, 2], [0, 1, 2])\\n'\n",
|
||||
|
|
@ -550,7 +599,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should a useful lab reflection contain?', 'options': ['Only whether the code ran successfully', 'A prediction, an observed result, and a revised explanation if the prediction failed', 'Mostly notes about notebook formatting and display quality'], 'correct_index': 1, 'explanation': 'The reflection is for diagnosing the model in your head, not merely logging execution success.'}, {'prompt': 'What is the most important consequence of inserting a Hadamard immediately before measuring qubit 0 in the Bell circuit?', 'options': ['You change the question being asked of that wire', 'You remove the need for the CNOT', 'You make the circuit noiseless'], 'correct_index': 0, 'explanation': 'A basis rotation before measurement changes the question, not just the syntax.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -669,7 +725,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -700,7 +762,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -251,7 +251,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare qubit 0 with a Hadamard gate.', 'diagram_effect': 'The upper wire branches into a superposition-generating event.', 'why_it_matters': 'This is the first step where the circuit stops behaving like a deterministic classical path.'}, {'marker': '[2]', 'code_focus': 'Use CNOT from qubit 0 to qubit 1.', 'diagram_effect': 'The second wire becomes correlated with the branching created above.', 'why_it_matters': 'This is the moment where local gate syntax becomes shared circuit structure.'}, {'marker': '[3]', 'code_focus': 'Measure both qubits into matching classical bits.', 'diagram_effect': 'The diagram turns a latent correlation into an empirical question.', 'why_it_matters': 'Measurement is not a camera; it is the question being asked of the prepared state.'}])\n"
|
||||
|
|
@ -291,7 +298,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare the branch point.\\ncircuit.h(0)\\n# [2] Correlate the second qubit with the first.\\ncircuit.cx(0, 1)\\n# [3] Ask the question in the computational basis.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -370,7 +384,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which sentence best describes what a circuit diagram is trying to show you?', 'options': ['A list of independent gate icons that happen to share a page', 'A time-ordered argument about how a state is being prepared, transformed, and questioned', 'A decorative rendering of code that mainly helps with presentation'], 'correct_index': 1, 'explanation': 'The course treats a circuit as a time-ordered process whose meaning must be narrated, not just executed.'}, {'prompt': 'Why is the spinning coin analogy useful but limited?', 'options': ['Because it proves that quantum states are really just classical ignorance', 'Because it helps introduce non-binary intuition but cannot capture amplitudes, phase, and measurement structure faithfully', 'Because it is mainly a historical story with no teaching value'], 'correct_index': 1, 'explanation': 'The analogy helps at the doorway, but quantum states require more disciplined language than classical randomness.'}, {'prompt': 'What is the main teaching reason to keep code, circuit graphic, and counts together?', 'options': ['So the notebook feels more interactive', 'So the same idea is forced to survive multiple representations', 'So matplotlib gets used early in the course'], 'correct_index': 1, 'explanation': 'Robust understanding survives translation across representations.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -446,7 +467,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -492,7 +520,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'In a Bell-style circuit, what conceptual role does the CNOT play after the Hadamard?', 'options': ['It measures the first qubit before the circuit finishes', 'It copies classical information from one wire to another', 'It turns the earlier branching into a structured correlation between wires'], 'correct_index': 2, 'explanation': 'The circuit is not copying a classical bit; it is creating structured correlation from the prepared branch.'}, {'prompt': 'What changes when you insert a basis rotation before measurement?', 'options': ['The underlying prepared state is reinterpreted through a different question', 'Nothing important changes because measurement is always the same', 'The qubit becomes classical before the rotation happens'], 'correct_index': 0, 'explanation': 'Measurement answers a basis-relative question, so basis changes matter profoundly.'}, {'prompt': 'Which habit is most aligned with professional circuit-design growth?', 'options': ['Run first, explain later', 'Predict, run, compare, and revise the story explicitly', 'Memorize gate names until the diagrams feel familiar'], 'correct_index': 1, 'explanation': 'Prediction and explanation are the key habits that distinguish passive exposure from design training.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -517,7 +552,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -625,7 +667,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -656,7 +704,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -211,7 +211,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which statement best distinguishes superposition from classical ignorance in this course?', 'options': ['Superposition is just not knowing which classical value is present', 'Superposition requires amplitude and phase language, not just hidden classical values', 'They are the same idea described by different communities'], 'correct_index': 1, 'explanation': 'The course insists on the amplitude-and-phase distinction rather than collapsing quantum reasoning into classical uncertainty.'}, {'prompt': 'Why is a barrier sometimes pedagogically useful?', 'options': ['It changes the quantum state substantially', 'It marks conceptual checkpoints in a circuit story', 'It is required before every measurement'], 'correct_index': 1, 'explanation': 'The barrier is often a reading aid that marks stages in the explanation.'}, {'prompt': 'What does the histogram of a measured circuit tell you directly?', 'options': ['The exact pre-measurement statevector', 'The empirical distribution produced by the chosen measurement question', 'The coupling map of the backend'], 'correct_index': 1, 'explanation': 'Counts summarize answers to the chosen measurement question, not the full underlying state by themselves.'}], heading='Problem Set A')\n"
|
||||
|
|
@ -251,7 +258,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the most dangerous beginner misreading of CNOT in an entangling circuit?', 'options': ['Treating it as a classical copy operation with no dependence on context', 'Thinking it always increases circuit depth', 'Assuming it cannot be simulated locally'], 'correct_index': 0, 'explanation': 'The gate’s meaning depends on the prepared input, not just on its classical truth-table summary.'}, {'prompt': 'Why do we ask for predictions before running the code?', 'options': ['Because predictions make the simulator faster', 'Because wrong predictions reveal the exact point where understanding is unstable', 'Because the notebook should avoid plotting too often'], 'correct_index': 1, 'explanation': 'Prediction creates diagnostic value when the result disagrees with your model.'}, {'prompt': 'Which description of measurement is most aligned with this module?', 'options': ['Measurement is a neutral camera that simply reads whatever is already there', 'Measurement is the final irreversible question chosen by the circuit designer', 'Measurement is mostly a plotting convenience for notebooks'], 'correct_index': 1, 'explanation': 'The chosen basis and readout structure determine which question is being asked.'}], heading='Problem Set B')\n"
|
||||
|
|
@ -291,7 +305,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'If a circuit prepares strong correlation but your counts disagree strongly with the intended story, what should you inspect first in this module?', 'options': ['Whether the register mapping, basis rotation, or measurement wiring changed the question', 'Only the color theme of the notebook', 'Whether the Hadamard symbol is drawn correctly'], 'correct_index': 0, 'explanation': 'The first debugging step is to inspect the question being asked, not to assume the preparation story survived unchanged.'}, {'prompt': 'What does it mean to own a circuit rather than merely see it?', 'options': ['You can execute it on your machine', 'You can reconstruct the design intention, alter it deliberately, and explain what changed', 'You can recognize the gate icons quickly'], 'correct_index': 1, 'explanation': 'Ownership means explanatory and design control, not simple familiarity.'}, {'prompt': 'Why is the Bell circuit used repeatedly in this module?', 'options': ['Because repetition around a sharp mechanism is stronger than shallow novelty', 'Because no other circuits exist at this level', 'Because Qiskit only supports two-qubit examples in beginner notebooks'], 'correct_index': 0, 'explanation': 'A recurring anchor example lets the same idea be revisited through richer lenses.'}], heading='Problem Set C')\n"
|
||||
|
|
@ -331,7 +352,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the best reason to annotate code with numbered reference markers?', 'options': ['To force translation between source code, circuit picture, and conceptual explanation', 'To reduce file size', 'To satisfy a Jupyter formatting requirement'], 'correct_index': 0, 'explanation': 'The markers make cross-representation reading deliberate instead of accidental.'}, {'prompt': 'Why does the course separate lecture, lab, problems, and studio?', 'options': ['Because one notebook cannot adequately train reading, manipulation, retrieval, and design at the same time', 'Because Jupyter does not allow long notebooks', 'Because the user asked for more files'], 'correct_index': 0, 'explanation': 'Different notebook types carry different pedagogical burdens.'}, {'prompt': 'What should happen after you miss a multiple-choice question in this course?', 'options': ['You should ignore it because the code matters more', 'You should use it to locate the exact distinction the prose or circuit story must reinforce', 'You should skip the rest of the module'], 'correct_index': 1, 'explanation': 'Missed retrieval is a diagnostic event, not just a score event.'}], heading='Problem Set D')\n"
|
||||
|
|
@ -384,7 +412,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -426,7 +461,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -547,7 +589,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -578,7 +626,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -205,7 +205,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
" editable_code = '''circuit = QuantumCircuit(1, 1)\n",
|
||||
|
|
@ -241,7 +248,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -283,7 +297,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
" editable_code = '''circuit = QuantumCircuit(2, 2)\n",
|
||||
|
|
@ -319,7 +340,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
" editable_code = '''circuit = QuantumCircuit(2, 2)\n",
|
||||
|
|
@ -381,7 +409,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which sentence best captures the purpose of the studio notebook?', 'options': ['To replay the lecture passively with nicer formatting', 'To make design choices under constraints and justify them in review language', 'To collect more plots without changing the circuits'], 'correct_index': 1, 'explanation': 'The studio is where explanation becomes design responsibility.'}, {'prompt': 'What distinguishes a design brief from a worked example?', 'options': ['A design brief leaves decisions open and expects justification', 'A design brief never includes code', 'A design brief avoids metrics completely'], 'correct_index': 0, 'explanation': 'In the studio, the learner must decide and defend, not just replay.'}], heading='Studio Review Check')\n"
|
||||
|
|
@ -406,7 +441,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -461,7 +503,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -536,7 +585,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\n",
|
||||
|
|
@ -629,7 +685,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -660,7 +722,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -158,7 +158,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Apply Hadamard to create equal-magnitude amplitudes on the computational basis states.', 'diagram_effect': 'The single wire leaves the all-zero path and enters a balanced branch structure.', 'why_it_matters': 'This is the first moment where the circuit meaning requires amplitude language rather than a hidden classical bit story.'}, {'marker': '[2]', 'code_focus': 'Apply Z to flip the phase of the |1> component without changing computational-basis probabilities.', 'diagram_effect': 'The diagram looks small, but the state description changes in a way that is invisible to a direct Z-basis probability check.', 'why_it_matters': 'This is the cleanest beginner example of information that lives in phase rather than in raw support.'}, {'marker': '[3]', 'code_focus': 'Apply a second Hadamard to convert the hidden phase difference into a visible population difference.', 'diagram_effect': 'The final gate changes the basis in which the hidden structure becomes empirically legible.', 'why_it_matters': 'The circuit teaches that phase can matter operationally even when it looked invisible one step earlier.'}, {'marker': '[4]', 'code_focus': 'Measure into a classical bit only after the phase has been translated into a basis-dependent question.', 'diagram_effect': 'The wire ends in a concrete experiment rather than an abstract state description.', 'why_it_matters': 'Counts are answers to a chosen question, not a full dump of the statevector.'}])\n"
|
||||
|
|
@ -183,7 +190,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(1, 1)\\n# [1] Create equal-magnitude amplitudes.\\ncircuit.h(0)\\n# [2] Flip the relative phase of the |1> branch.\\ncircuit.z(0)\\n# [3] Turn that hidden phase into a visible basis difference.\\ncircuit.h(0)\\n# [4] Ask the final measurement question.\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -260,7 +274,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the most useful first reaction when a modified circuit keeps the same probabilities but changes the statevector?', 'options': ['Conclude that nothing important happened', 'Ask whether the edit changed relative phase rather than support', 'Assume the simulator failed'], 'correct_index': 1, 'explanation': 'A stable probability table can still hide a meaningful phase change.'}, {'prompt': 'Why do the lab notebooks ask for one change at a time?', 'options': ['To create diagnostic evidence about which design move caused the observed change', 'To satisfy a Qiskit restriction', 'To reduce notebook size'], 'correct_index': 0, 'explanation': 'Controlled variation is what makes the resulting explanation trustworthy.'}], heading='Statevector Lab Checkpoint A')\n"
|
||||
|
|
@ -285,7 +306,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which edit produced the biggest conceptual surprise for you, and which sentence in your earlier explanation turned out to be inadequate?')\n"
|
||||
|
|
@ -325,7 +353,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Start a balanced branch on qubit 0.\\ncircuit.h(0)\\n# [2] Correlate qubit 1 with the branch.\\ncircuit.cx(0, 1)\\n# [3] Measure both wires in the computational basis.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -452,7 +487,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare both qubits in the X basis.\\ncircuit.h(0)\\ncircuit.h(1)\\n# [2] Insert a controlled phase.\\ncircuit.cz(0, 1)\\n# [3] Rotate back before measuring.\\ncircuit.h(0)\\ncircuit.h(1)\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -547,7 +589,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What makes the Bell state a good support-pattern example?', 'options': ['Its probability mass lives only on two basis labels, which makes the support structure easy to see and explain', 'It is the only two-qubit state Qiskit can draw', 'It avoids phase entirely'], 'correct_index': 0, 'explanation': 'A sparse support pattern is easy to inspect and reason about carefully.'}, {'prompt': 'What is the real lesson of the `CZ` parity lab?', 'options': ['Controlled phase can create meaningful structure that only becomes visible after a basis change', 'Controlled phase is just another spelling of CNOT', 'Two-qubit gates always produce uniform distributions'], 'correct_index': 0, 'explanation': 'Phase structure often needs a carefully chosen probe before it becomes visible in counts.'}], heading='Statevector Lab Checkpoint B')\n"
|
||||
|
|
@ -572,7 +621,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain the difference between a circuit that changed support and a circuit that changed only relative phase, using one concrete lab edit as evidence.')\n"
|
||||
|
|
@ -597,7 +653,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short note on why counts should be treated as lossy evidence rather than as the full story of the state.')\n"
|
||||
|
|
@ -688,7 +751,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -719,7 +788,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -228,7 +228,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Apply Hadamard to create equal-magnitude amplitudes on the computational basis states.', 'diagram_effect': 'The single wire leaves the all-zero path and enters a balanced branch structure.', 'why_it_matters': 'This is the first moment where the circuit meaning requires amplitude language rather than a hidden classical bit story.'}, {'marker': '[2]', 'code_focus': 'Apply Z to flip the phase of the |1> component without changing computational-basis probabilities.', 'diagram_effect': 'The diagram looks small, but the state description changes in a way that is invisible to a direct Z-basis probability check.', 'why_it_matters': 'This is the cleanest beginner example of information that lives in phase rather than in raw support.'}, {'marker': '[3]', 'code_focus': 'Apply a second Hadamard to convert the hidden phase difference into a visible population difference.', 'diagram_effect': 'The final gate changes the basis in which the hidden structure becomes empirically legible.', 'why_it_matters': 'The circuit teaches that phase can matter operationally even when it looked invisible one step earlier.'}, {'marker': '[4]', 'code_focus': 'Measure into a classical bit only after the phase has been translated into a basis-dependent question.', 'diagram_effect': 'The wire ends in a concrete experiment rather than an abstract state description.', 'why_it_matters': 'Counts are answers to a chosen question, not a full dump of the statevector.'}])\n"
|
||||
|
|
@ -268,7 +275,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(1, 1)\\n# [1] Create equal-magnitude amplitudes.\\ncircuit.h(0)\\n# [2] Flip the relative phase of the |1> branch.\\ncircuit.z(0)\\n# [3] Turn that hidden phase into a visible basis difference.\\ncircuit.h(0)\\n# [4] Ask the final measurement question.\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -379,7 +393,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does a statevector give you that a histogram does not?', 'options': ['Only prettier output formatting', 'Amplitude-level information before a particular measurement question is chosen', 'A direct picture of hardware noise'], 'correct_index': 1, 'explanation': 'Statevectors preserve amplitude structure that can be lost once you ask only one measurement question.'}, {'prompt': 'If two basis states have equal probability, what is still missing from that statement?', 'options': ['The relative phase information', 'The number of classical bits in the register', 'The transpiler optimization level'], 'correct_index': 0, 'explanation': 'Probability magnitudes alone do not tell you how amplitudes differ by phase.'}, {'prompt': \"Why is the phrase 'the qubit is really 0 or 1 underneath' dangerous here?\", 'options': ['Because it blocks basis and phase reasoning by forcing a classical hidden-value story onto a quantum object', 'Because it makes circuits larger', 'Because it prevents plotting'], 'correct_index': 0, 'explanation': 'The hidden-value story fails precisely where phase and basis dependence start to matter.'}], heading='Statevector Checkpoint A')\n"
|
||||
|
|
@ -474,7 +495,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why does the `Z` gate in the phase-probe circuit matter even though the intermediate probabilities stay balanced?', 'options': ['Because it changes the relative phase, which later gates can turn into different measurement behavior', 'Because it secretly performs measurement', 'Because it increases the shot count'], 'correct_index': 0, 'explanation': 'Relative phase can be operationally silent in one basis and visible in another.'}, {'prompt': 'What does the support of a statevector refer to in this course?', 'options': ['The basis states with nonzero amplitude weight', 'The hardware backends that accept the circuit', 'The number of markdown explanations around the code'], 'correct_index': 0, 'explanation': 'Support is about which basis labels actually participate in the state description.'}, {'prompt': 'Why is bitstring ordering worth discussing explicitly in a beginner module?', 'options': ['Because label order affects how you read multi-qubit probability dictionaries and can create false debugging stories if ignored', 'Because Qiskit changes the number of qubits based on label order', 'Because it determines whether Hadamard is allowed'], 'correct_index': 0, 'explanation': 'Ambiguity about labels creates fake confusion that should be removed early.'}], heading='Statevector Checkpoint B')\n"
|
||||
|
|
@ -499,7 +527,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one paragraph that explains why two circuits can share the same probabilities in one basis and still be different states.')\n"
|
||||
|
|
@ -524,7 +559,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\"Describe the exact role of the second Hadamard in the phase-probe circuit without using the phrase 'it undoes the first gate.'\")\n"
|
||||
|
|
@ -630,7 +672,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -661,7 +709,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -158,7 +158,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which statement best describes a basis amplitude?', 'options': ['A numerical weight whose magnitude and phase help determine later behavior', 'A classical bit that has not been measured yet', 'A routing instruction for the transpiler'], 'correct_index': 0, 'explanation': 'Amplitude language is the right starting point for statevector reasoning.'}, {'prompt': 'If a one-qubit state has support on both |0> and |1>, what can you already conclude?', 'options': ['Only that more than one basis label participates; you still need phase and magnitude detail for a full story', 'That the qubit will always measure 50/50 in any basis', 'That the circuit must contain a two-qubit gate'], 'correct_index': 0, 'explanation': 'Support is only one layer of the state description.'}, {'prompt': 'Why is prediction before simulation especially important in statevector work?', 'options': ['Because wrong predictions reveal exactly where amplitude or basis language is still unstable', 'Because the simulator cannot run without a prediction', 'Because it changes the final state'], 'correct_index': 0, 'explanation': 'Prediction turns the notebook into a diagnostic instrument rather than a slideshow.'}], heading='Statevector Problem Set A')\n"
|
||||
|
|
@ -198,7 +205,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does a relative phase change mean in practical terms?', 'options': ['It can alter interference and later measurement behavior even when immediate probabilities look unchanged', 'It only affects how the code is formatted', 'It changes the number of qubits'], 'correct_index': 0, 'explanation': 'Relative phase is operational when a later circuit stage makes it visible.'}, {'prompt': 'Why is global phase treated differently from relative phase?', 'options': ['Because a global phase does not change observable predictions for the same experiment', 'Because global phase is bigger than relative phase', 'Because global phase can be measured directly with one shot'], 'correct_index': 0, 'explanation': 'Only relative phase differences affect observable structure in the same setup.'}, {'prompt': 'If two circuits give the same Z-basis counts, what stronger check might distinguish them?', 'options': ['Inspect the statevector or measure after a basis change', 'Rename the registers', 'Increase the font size in the plot'], 'correct_index': 0, 'explanation': 'Counts in one basis can hide differences that appear elsewhere.'}], heading='Statevector Problem Set B')\n"
|
||||
|
|
@ -238,7 +252,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why does multi-qubit label order deserve attention?', 'options': ['Because otherwise you may assign the wrong story to the right probability dictionary', 'Because label order determines the backend noise profile', 'Because it disables entanglement'], 'correct_index': 0, 'explanation': 'Reading labels incorrectly creates fake bugs and false confidence.'}, {'prompt': 'What is the most honest summary of counts versus statevectors?', 'options': ['Counts are empirical answers to one chosen question; statevectors are pre-measurement descriptions that support many questions', 'They are interchangeable in all contexts', 'Counts are always better because they come from shots'], 'correct_index': 0, 'explanation': 'Each representation serves a different explanatory burden.'}, {'prompt': 'What is a support pattern?', 'options': ['The set of basis labels carrying nonzero weight in the state description', 'The order of markdown cells in the notebook', 'The coupling map of a backend'], 'correct_index': 0, 'explanation': 'Support patterns are a clean first lens for reading small states.'}], heading='Statevector Problem Set C')\n"
|
||||
|
|
@ -278,7 +299,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the best beginner description of the second Hadamard in the phase-probe circuit?', 'options': ['It changes basis so the earlier phase difference becomes visible to the final measurement question', 'It resets the qubit to zero', 'It copies the qubit into a classical bit'], 'correct_index': 0, 'explanation': 'The gate is not decoration; it is the bridge from hidden phase to visible outcome.'}, {'prompt': 'Which habit is most aligned with professional state reasoning?', 'options': ['Naming the basis, the support, and the phase story explicitly before trusting the output', 'Trusting the first histogram that looks plausible', 'Avoiding multi-representation checks'], 'correct_index': 0, 'explanation': 'Professional attention is explicit about representation and basis.'}, {'prompt': 'If your explanation works only for the exact worked example and breaks after a one-gate edit, what does that show?', 'options': ['That you remembered a pattern but did not yet own the mechanism', 'That the notebook is invalid', 'That statevectors are impossible for beginners'], 'correct_index': 0, 'explanation': 'Robust understanding survives controlled variation.'}], heading='Statevector Problem Set D')\n"
|
||||
|
|
@ -335,7 +363,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why equal computational-basis probabilities do not guarantee identical quantum states.')\n"
|
||||
|
|
@ -360,7 +395,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box(\"Write a two-part explanation of the phrase 'counts are evidence, statevectors are models.'\")\n"
|
||||
|
|
@ -466,7 +508,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -497,7 +545,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -158,7 +158,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(1, 1)\\n# [1] Create equal-magnitude amplitudes.\\ncircuit.h(0)\\n# [2] Flip the relative phase of the |1> branch.\\ncircuit.z(0)\\n# [3] Turn that hidden phase into a visible basis difference.\\ncircuit.h(0)\\n# [4] Ask the final measurement question.\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -190,7 +197,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Why is your chosen probe actually sensitive to relative phase rather than merely to a different preparation support?')\n"
|
||||
|
|
@ -230,7 +244,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Start a balanced branch on qubit 0.\\ncircuit.h(0)\\n# [2] Correlate qubit 1 with the branch.\\ncircuit.cx(0, 1)\\n# [3] Measure both wires in the computational basis.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -262,7 +283,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short design memo that names the intended support pattern and the weakest point in your current explanation.')\n"
|
||||
|
|
@ -302,7 +330,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare both qubits in the X basis.\\ncircuit.h(0)\\ncircuit.h(1)\\n# [2] Insert a controlled phase.\\ncircuit.cz(0, 1)\\n# [3] Rotate back before measuring.\\ncircuit.h(0)\\ncircuit.h(1)\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -334,7 +369,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the point of the statevector studio notebook?', 'options': ['To turn amplitude language into deliberate preparation and probing choices', 'To avoid writing explanations', 'To replace statevectors with pure measurement counts'], 'correct_index': 0, 'explanation': 'The studio asks for design responsibility, not passive recognition.'}, {'prompt': 'Which design move best distinguishes `|+>` from `|->` experimentally?', 'options': ['Insert a basis change before measurement so relative phase becomes visible', 'Rename the qubit', 'Add a barrier'], 'correct_index': 0, 'explanation': 'The difference is not visible in the same basis unless you choose the right probe.'}], heading='Statevector Studio Check')\n"
|
||||
|
|
@ -359,7 +401,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What would a careless reader misinterpret about one of your circuits, and how would you rewrite the explanation to prevent that?')\n"
|
||||
|
|
@ -384,7 +433,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which part of statevector reasoning now feels owned, and which part still feels too fragile for a larger circuit?')\n"
|
||||
|
|
@ -507,7 +563,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -538,7 +600,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -158,7 +158,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(1, 1)\\n# [1] Try changing the preparation gate sequence.\\ncircuit.x(0)\\ncircuit.h(0)\\n# [2] Optionally add Z or another H before measurement.\\n# circuit.z(0)\\n# circuit.h(0)\\n# [3] Measure the result.\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -237,7 +244,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the best reason to compare counts across different shot budgets?', 'options': ['To separate stable probability claims from normal sampling fluctuation', 'To reduce circuit depth', 'To change the prepared state'], 'correct_index': 0, 'explanation': 'Shot scaling teaches you how much statistical noise to expect from the same circuit.'}, {'prompt': 'What does swapping classical bit targets test?', 'options': ['Whether your explanation tracks the reporting layer instead of only the quantum layer', 'Whether CNOT still works', 'Whether the backend supports measurement'], 'correct_index': 0, 'explanation': 'Good reasoning follows the evidence all the way into the bitstring labels.'}], heading='Measurement Lab Checkpoint A')\n"
|
||||
|
|
@ -262,7 +276,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which one-qubit edit best exposed the difference between changing preparation and changing the final question?')\n"
|
||||
|
|
@ -302,7 +323,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare a Bell-style correlated state with `H` and `CX`.', 'diagram_effect': 'The first two operations create a structured two-wire object rather than two independent qubits.', 'why_it_matters': 'Measurement interpretation depends on what was prepared before the final question is asked.'}, {'marker': '[2]', 'code_focus': 'Rotate one qubit with `H` immediately before measurement.', 'diagram_effect': 'The final question changes on that wire without erasing the rest of the preparation story.', 'why_it_matters': 'Basis changes are part of the experiment design, not cosmetic extras.'}, {'marker': '[3]', 'code_focus': 'Measure into explicitly chosen classical bits.', 'diagram_effect': 'The circuit commits to a specific readout question and a specific reporting layout.', 'why_it_matters': 'Classical wiring is part of the evidence trail and can itself become a source of confusion.'}])\n"
|
||||
|
|
@ -327,7 +355,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare the correlated state.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Change the basis of the first measurement question.\\ncircuit.h(0)\\n# [3] Measure both qubits into the matching classical bits.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -413,7 +448,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare a Bell-style state.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Try swapping the classical wiring.\\ncircuit.measure([0, 1], [1, 0])\\n'\n",
|
||||
|
|
@ -475,7 +517,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'If a final Hadamard changes the counts drastically, what is the first serious question to ask?', 'options': ['Did I change the measurement basis rather than merely add decoration?', 'Did the notebook theme corrupt the circuit?', 'Did the number of qubits change automatically?'], 'correct_index': 0, 'explanation': 'The basis question is the right first interpretation, not panic.'}, {'prompt': 'Why keep counts and probabilities conceptually separate in the same notebook?', 'options': ['Because one is sampled evidence and the other is an idealized expectation derived from the model', 'Because they should never be compared', 'Because counts are only for advanced users'], 'correct_index': 0, 'explanation': 'Serious measurement reasoning compares the ideal story with sampled evidence carefully.'}], heading='Measurement Lab Checkpoint B')\n"
|
||||
|
|
@ -500,7 +549,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short explanation of how you would distinguish a basis mistake from a classical-wiring mistake in a notebook review.')\n"
|
||||
|
|
@ -525,7 +581,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What does shot noise change in your interpretation, and what does it not change?')\n"
|
||||
|
|
@ -616,7 +679,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -647,7 +716,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -226,7 +226,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare a Bell-style correlated state with `H` and `CX`.', 'diagram_effect': 'The first two operations create a structured two-wire object rather than two independent qubits.', 'why_it_matters': 'Measurement interpretation depends on what was prepared before the final question is asked.'}, {'marker': '[2]', 'code_focus': 'Rotate one qubit with `H` immediately before measurement.', 'diagram_effect': 'The final question changes on that wire without erasing the rest of the preparation story.', 'why_it_matters': 'Basis changes are part of the experiment design, not cosmetic extras.'}, {'marker': '[3]', 'code_focus': 'Measure into explicitly chosen classical bits.', 'diagram_effect': 'The circuit commits to a specific readout question and a specific reporting layout.', 'why_it_matters': 'Classical wiring is part of the evidence trail and can itself become a source of confusion.'}])\n"
|
||||
|
|
@ -251,7 +258,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare the correlated state.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Change the basis of the first measurement question.\\ncircuit.h(0)\\n# [3] Measure both qubits into the matching classical bits.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -364,7 +378,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the cleanest interpretation of a measurement basis change?', 'options': ['It changes the question asked of the prepared state', 'It deletes the earlier gates', 'It is only a formatting step for counts'], 'correct_index': 0, 'explanation': 'Measurement basis is part of the experiment design and the story of the circuit.'}, {'prompt': 'Why should classical register wiring be treated seriously?', 'options': ['Because wrong wiring can make correct quantum behavior look incorrect in the reported bitstrings', 'Because it changes the quantum state directly', 'Because it forces extra transpilation'], 'correct_index': 0, 'explanation': 'Evidence can be misread if the mapping from qubits to reported bits is not tracked carefully.'}, {'prompt': 'What does a shot-based histogram approximate?', 'options': ['The empirical distribution of answers to the chosen measurement question', 'The exact statevector amplitudes', 'The coupling map of the device'], 'correct_index': 0, 'explanation': 'Counts are sampled evidence, not a direct amplitude dump.'}], heading='Measurement Checkpoint A')\n"
|
||||
|
|
@ -483,7 +504,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why is `H` often described as a basis bridge?', 'options': ['Because it lets Z-basis measurement act like an X-basis probe', 'Because it adds extra classical bits', 'Because it removes phase from all circuits'], 'correct_index': 0, 'explanation': 'The Hadamard is often the simplest way to express a different measurement question.'}, {'prompt': 'What should you conclude if 64-shot and 4096-shot runs look similar but not identical?', 'options': ['Sampling variation exists, but both runs can still support the same underlying probability story', 'One of the runs is invalid', 'The circuit changed between runs even if the code stayed the same'], 'correct_index': 0, 'explanation': 'Shot noise is normal and should be discussed rather than dramatized.'}, {'prompt': 'What is the main beginner danger of treating gates as isolated icons?', 'options': ['You miss how their meaning depends on context, basis, and surrounding preparation', 'You will always get syntax errors', 'You stop using notebooks'], 'correct_index': 0, 'explanation': 'Gate meaning is contextual, not merely symbolic.'}], heading='Measurement Checkpoint B')\n"
|
||||
|
|
@ -508,7 +536,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a final Hadamard before measurement is often better described as a basis choice than as a mysterious last-minute state change.')\n"
|
||||
|
|
@ -533,7 +568,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short paragraph on why classical bit mapping belongs in a professional explanation of a circuit result.')\n"
|
||||
|
|
@ -639,7 +681,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -670,7 +718,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -158,7 +158,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a gate in the strongest sense used by this module?', 'options': ['A transformation whose role depends on the circuit context and the question being asked', 'A decorative icon', 'Only a line of code with no conceptual content'], 'correct_index': 0, 'explanation': 'This course treats gates as moves inside a structured argument.'}, {'prompt': 'Why is the sequence of gates important?', 'options': ['Because later operations act on the state produced by earlier ones', 'Because Qiskit sorts them alphabetically', 'Because measurement always happens first'], 'correct_index': 0, 'explanation': 'Circuit meaning is time ordered.'}, {'prompt': 'What is the best beginner definition of a measurement protocol?', 'options': ['The combined choice of basis, wiring, and shot-based evidence gathering', 'Only the final `measure` syntax', 'The color of the histogram bars'], 'correct_index': 0, 'explanation': 'Measurement is a designed protocol, not a final afterthought.'}], heading='Measurement Problem Set A')\n"
|
||||
|
|
@ -198,7 +205,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why can the same prepared state yield different-looking results under different basis choices?', 'options': ['Because the measurement question changed', 'Because the qubits became classical earlier', 'Because the simulator chooses random bases on its own'], 'correct_index': 0, 'explanation': 'Basis changes alter the question, so the evidence can change legitimately.'}, {'prompt': 'What should a careful engineer write down alongside a histogram?', 'options': ['What state was prepared, what basis was measured, and how qubits were mapped to classical bits', 'Only the backend name', 'Only whether the plot looked correct'], 'correct_index': 0, 'explanation': 'Evidence without protocol is easy to misread.'}, {'prompt': 'Why are `X`, `Z`, and `H` enough for many early measurement lessons?', 'options': ['They already expose preparation changes, phase changes, and basis changes cleanly', 'Because no other gates exist', 'Because two-qubit gates are illegal in beginner modules'], 'correct_index': 0, 'explanation': 'A small gate vocabulary can already teach the important distinctions.'}], heading='Measurement Problem Set B')\n"
|
||||
|
|
@ -238,7 +252,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does a mismatch between ideal probabilities and low-shot counts usually mean first?', 'options': ['Sampling variation or a changed measurement protocol should be examined before inventing deeper explanations', 'The statevector is false', 'The qubit count changed'], 'correct_index': 0, 'explanation': 'Start with the ordinary explanations and inspect the protocol carefully.'}, {'prompt': 'Why does swapped classical wiring deserve a dedicated exercise?', 'options': ['Because reporting mistakes can mimic conceptual mistakes if the mapping is not tracked', 'Because it changes the quantum amplitudes', 'Because it improves the histogram automatically'], 'correct_index': 0, 'explanation': 'Evidence pipelines can fail at the reporting stage too.'}, {'prompt': 'What professional habit is being built by basis-comparison exercises?', 'options': ['Separating preparation claims from question claims', 'Memorizing more gate names', 'Avoiding reflection writing'], 'correct_index': 0, 'explanation': 'A professional explanation states what changed and what stayed fixed.'}], heading='Measurement Problem Set C')\n"
|
||||
|
|
@ -278,7 +299,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should you do after a missed quiz question in this course?', 'options': ['Identify the exact distinction that failed and reinforce it in your written explanation', 'Ignore the mistake if the code ran', 'Skip the rest of the notebook'], 'correct_index': 0, 'explanation': 'Missed retrieval is a diagnostic event, not just a score event.'}, {'prompt': 'Which sentence most clearly marks measurement maturity?', 'options': ['I can describe what question this circuit asks and why the returned bitstrings count as evidence for that question', 'I can recognize the measurement symbol', 'I know that more shots are always better no matter the question'], 'correct_index': 0, 'explanation': 'The course is training explanation quality, not icon recognition.'}, {'prompt': 'What is the danger of trusting a plausible-looking Bell histogram without further thought?', 'options': ['You may miss basis mistakes, wiring mistakes, or a false story about what was actually measured', 'There is no danger once the bars look right', 'It guarantees a hardware failure later'], 'correct_index': 0, 'explanation': 'Good-looking evidence can still be incorrectly interpreted.'}], heading='Measurement Problem Set D')\n"
|
||||
|
|
@ -335,7 +363,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain the difference between changing a prepared state and changing the question asked of that state.')\n"
|
||||
|
|
@ -360,7 +395,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short review note describing one way a correct circuit could still be misread because of classical register wiring.')\n"
|
||||
|
|
@ -466,7 +508,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -497,7 +545,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -158,7 +158,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(1, 1)\\n# [1] Try changing the preparation gate sequence.\\ncircuit.x(0)\\ncircuit.h(0)\\n# [2] Optionally add Z or another H before measurement.\\n# circuit.z(0)\\n# circuit.h(0)\\n# [3] Measure the result.\\ncircuit.measure(0, 0)\\n'\n",
|
||||
|
|
@ -190,7 +197,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Why does your protocol count as a basis contrast rather than just a different state-preparation demo?')\n"
|
||||
|
|
@ -230,7 +244,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare the correlated state.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Change the basis of the first measurement question.\\ncircuit.h(0)\\n# [3] Measure both qubits into the matching classical bits.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -262,7 +283,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What evidence in the counts would actually support your claim, and what evidence would falsify it?')\n"
|
||||
|
|
@ -302,7 +330,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare a Bell-style state.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Try swapping the classical wiring.\\ncircuit.measure([0, 1], [1, 0])\\n'\n",
|
||||
|
|
@ -334,7 +369,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does the measurement studio demand that the lecture does not?', 'options': ['Deliberate protocol design and explicit justification of why a chosen measurement reveals what you claim', 'Less writing', 'No circuit edits'], 'correct_index': 0, 'explanation': 'The studio is where you own the protocol rather than merely understand it.'}, {'prompt': 'What is the hallmark of a good studio answer?', 'options': ['It separates preparation, basis choice, wiring, and evidence instead of blurring them together', 'It uses the most gates possible', 'It avoids comparison between alternatives'], 'correct_index': 0, 'explanation': 'Review language should make the protocol legible and falsifiable.'}], heading='Measurement Studio Check')\n"
|
||||
|
|
@ -359,7 +401,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What is the most subtle protocol mistake you can now imagine making in your own notebook work?')\n"
|
||||
|
|
@ -384,7 +433,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which part of measurement reasoning now feels reliable, and which part still feels too dependent on the exact example in front of you?')\n"
|
||||
|
|
@ -507,7 +563,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -538,7 +600,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Treat the question being asked of the circuit as configuration, not as a hidden side effect.', 'diagram_effect': 'The rendered circuit becomes one phase of a workflow rather than the whole workflow.', 'why_it_matters': 'Professional notebooks separate design brief, circuit body, and evaluation record.'}, {'marker': '[2]', 'code_focus': 'Keep basis adaptation or other query-specific logic in a clearly named layer.', 'diagram_effect': 'The middle of the circuit shows which part is core routine and which part customizes the question.', 'why_it_matters': 'Patterns become reusable only when stable and variable regions are visibly distinct.'}, {'marker': '[3]', 'code_focus': 'Make the reporting contract explicit instead of relying on later guesswork.', 'diagram_effect': 'The diagram ends with an auditable readout layer.', 'why_it_matters': 'Workflow quality includes trustworthy evidence, not only a correct quantum body.'}, {'marker': '[4]', 'code_focus': 'Pair the circuit with post-processing that produces a reviewable record rather than an isolated histogram.', 'diagram_effect': 'The circuit is now visibly part of a larger map-optimize-execute-post-process cycle.', 'why_it_matters': 'Patterns matter when circuits live inside applications, experiments, and reports.'}])\n"
|
||||
|
|
@ -204,7 +211,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef build_agreement_probe(basis: str = \"z\") -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n # [1] The workflow chooses the question before the circuit is built.\\n circuit.h(0)\\n circuit.cx(0, 1)\\n # [2] Basis adaptation belongs in its own visible layer.\\n if basis == \"x\":\\n circuit.h([0, 1])\\n elif basis != \"z\":\\n raise ValueError(\"basis must be \\'z\\' or \\'x\\'\")\\n # [3] Keep the reporting contract explicit.\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = build_agreement_probe(basis=\"x\")\\n'\n",
|
||||
|
|
@ -236,7 +250,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the safest way to edit a workflow-pattern notebook?', 'options': ['Change one boundary at a time and check what remained stable in the result record', 'Change the builder, scoring, and measurement map all at once', 'Ignore the report and watch only the circuit drawing'], 'correct_index': 0, 'explanation': 'Controlled edits are how workflow boundaries become understandable.'}, {'prompt': 'What does a swapped measurement map threaten first?', 'options': ['The interface between the circuit and its post-processing logic', 'The existence of the entangling gates', 'The ability to render the circuit'], 'correct_index': 0, 'explanation': 'Reporting order is part of the workflow contract.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -261,7 +282,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which workflow boundary became most visible to you in the lab, and why?')\n"
|
||||
|
|
@ -302,7 +330,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef build_probe(basis: str = \"z\", add_barrier: bool = True) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h(0)\\n circuit.cx(0, 1)\\n if add_barrier:\\n circuit.barrier()\\n if basis == \"x\":\\n circuit.h([0, 1])\\n elif basis != \"z\":\\n raise ValueError(\"basis must be \\'z\\' or \\'x\\'\")\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = build_probe(basis=\"z\", add_barrier=True)\\n'\n",
|
||||
|
|
@ -350,7 +385,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef build_probe(swapped_report: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h(0)\\n circuit.cx(0, 1)\\n if swapped_report:\\n circuit.measure([0, 1], [1, 0])\\n else:\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = build_probe(swapped_report=False)\\n'\n",
|
||||
|
|
@ -382,7 +424,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why compare a lean pattern and a more structured pattern if both run?', 'options': ['To judge which one keeps intent, evidence, and variation pressure most legible', 'Because one of them must be mathematically wrong', 'Because Qiskit requires barriers in all workflows'], 'correct_index': 0, 'explanation': 'Pattern quality is largely about reviewability under change.'}, {'prompt': 'What would make a pattern helper too clever?', 'options': ['It hides the question being asked and the reporting contract behind opaque defaults', 'It includes one short helper function', 'It uses a dataclass for configuration'], 'correct_index': 0, 'explanation': 'Pattern abstraction should reduce clutter without erasing the design brief.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -453,7 +502,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short review note about a notebook whose circuit is fine but whose reporting contract is ambiguous.')\n"
|
||||
|
|
@ -478,7 +534,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one prediction habit from this lab that you want to preserve in later professional work.')\n"
|
||||
|
|
@ -503,7 +566,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Qiskit Patterns and Workflow Design Lab Feedback Loop', prompt='Turn the lab into a review note: state the current claim, cite the strongest evidence, name the main remaining risk, and write the next comparison you would run.')\n"
|
||||
|
|
@ -528,7 +598,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -623,7 +700,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -654,7 +737,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -257,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Treat the question being asked of the circuit as configuration, not as a hidden side effect.', 'diagram_effect': 'The rendered circuit becomes one phase of a workflow rather than the whole workflow.', 'why_it_matters': 'Professional notebooks separate design brief, circuit body, and evaluation record.'}, {'marker': '[2]', 'code_focus': 'Keep basis adaptation or other query-specific logic in a clearly named layer.', 'diagram_effect': 'The middle of the circuit shows which part is core routine and which part customizes the question.', 'why_it_matters': 'Patterns become reusable only when stable and variable regions are visibly distinct.'}, {'marker': '[3]', 'code_focus': 'Make the reporting contract explicit instead of relying on later guesswork.', 'diagram_effect': 'The diagram ends with an auditable readout layer.', 'why_it_matters': 'Workflow quality includes trustworthy evidence, not only a correct quantum body.'}, {'marker': '[4]', 'code_focus': 'Pair the circuit with post-processing that produces a reviewable record rather than an isolated histogram.', 'diagram_effect': 'The circuit is now visibly part of a larger map-optimize-execute-post-process cycle.', 'why_it_matters': 'Patterns matter when circuits live inside applications, experiments, and reports.'}])\n"
|
||||
|
|
@ -282,7 +289,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef build_agreement_probe(basis: str = \"z\") -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n # [1] The workflow chooses the question before the circuit is built.\\n circuit.h(0)\\n circuit.cx(0, 1)\\n # [2] Basis adaptation belongs in its own visible layer.\\n if basis == \"x\":\\n circuit.h([0, 1])\\n elif basis != \"z\":\\n raise ValueError(\"basis must be \\'z\\' or \\'x\\'\")\\n # [3] Keep the reporting contract explicit.\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = build_agreement_probe(basis=\"x\")\\n'\n",
|
||||
|
|
@ -367,7 +381,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the main reason to separate workflow configuration from the circuit builder?', 'options': ['So the stable quantum routine and the changing experimental question can be reviewed independently', 'So the circuit always uses fewer gates', 'So Qiskit can avoid classical data structures'], 'correct_index': 0, 'explanation': 'Pattern design depends on making stable and variable responsibilities visible.'}, {'prompt': 'Why is an explicit reporting contract part of a pattern notebook?', 'options': ['Because the evidence layer is part of the design, not a last-minute add-on', 'Because all patterns must measure every qubit twice', 'Because plotting replaces analysis'], 'correct_index': 0, 'explanation': 'Professional workflow design includes trustworthy readout and post-processing.'}, {'prompt': 'What makes a notebook pattern reusable?', 'options': ['It keeps intent, circuit body, and evaluation record distinct enough to vary inputs without losing the story', 'It hides the circuit inside a large helper', 'It avoids any post-processing code'], 'correct_index': 0, 'explanation': 'Reusable patterns survive variation because their boundaries are clear.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -465,7 +486,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should a workflow record contain beyond raw counts?', 'options': ['The design brief, circuit or compile context, and a derived decision or score', 'Only the screenshot of the circuit', 'Only the token URL of the notebook server'], 'correct_index': 0, 'explanation': 'Pattern notebooks need enough context to be reviewed later.'}, {'prompt': \"Why is 'the code runs' a weak endpoint for this module?\", 'options': ['Because workflow design is about repeatable evidence and interfaces, not only execution success', 'Because workflows should never execute locally', 'Because classical preprocessing is irrelevant'], 'correct_index': 0, 'explanation': 'A runnable cell is not yet a professional workflow artifact.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -490,7 +518,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a paragraph explaining why a circuit builder and a workflow pattern are not the same thing.')\n"
|
||||
|
|
@ -515,7 +550,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one hidden assumption between execution and post-processing that you would want a professional notebook to state explicitly.')\n"
|
||||
|
|
@ -540,7 +582,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Qiskit Patterns and Workflow Design Lecture Revision Loop', prompt='State the judgement this lecture is training, the strongest evidence that would justify it, the current weakness in your own explanation, and the next revision you should make.')\n"
|
||||
|
|
@ -565,7 +614,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -675,7 +731,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -706,7 +768,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -178,7 +178,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which comment is strongest in a workflow review?', 'options': ['The pattern hides where the question changes and where the circuit stays stable', 'The circuit is quantum enough', 'Please make the code shorter regardless of meaning'], 'correct_index': 0, 'explanation': 'Workflow patterns are judged by the clarity of their boundaries.'}, {'prompt': 'What belongs outside the quantum routine in a good pattern?', 'options': ['Configuration of the experimental question and downstream scoring choices', 'All measurement logic', 'Every explanation cell'], 'correct_index': 0, 'explanation': 'The routine should stay stable while the surrounding workflow varies.'}], heading='Workflow Boundaries')\n"
|
||||
|
|
@ -218,7 +225,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why is a derived score often more useful than raw counts alone?', 'options': ['It makes the decision rule explicit and reviewable', 'It removes the need to keep counts', 'It always improves accuracy'], 'correct_index': 0, 'explanation': 'Good post-processing clarifies what the workflow is claiming.'}, {'prompt': 'What is the danger of no recorded compile or execution context?', 'options': ['A later reader cannot reconstruct which environment assumptions shaped the result', 'The circuit stops being unitary', 'The notebook cannot include plots'], 'correct_index': 0, 'explanation': 'Pattern notebooks should preserve enough context for re-interpretation and critique.'}], heading='Evidence Records')\n"
|
||||
|
|
@ -258,7 +272,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What tests whether a pattern is real rather than accidental?', 'options': ['Changing a small input condition and seeing whether the stable routine still makes sense', 'Adding more notebook themes', 'Removing every helper function'], 'correct_index': 0, 'explanation': 'Patterns become visible under controlled variation.'}, {'prompt': 'Why do pattern notebooks belong in the professional band?', 'options': ['Because circuits in real projects live inside larger workflows, not alone', 'Because basic gates no longer matter', 'Because algorithms are no longer relevant'], 'correct_index': 0, 'explanation': 'Professional work embeds quantum routines inside a broader engineering loop.'}], heading='Variation Pressure')\n"
|
||||
|
|
@ -298,7 +319,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which review statement is strongest?', 'options': ['The scoring logic depends on a readout order that the builder never states explicitly', 'The diagram looks nice', 'The notebook should remove every markdown explanation'], 'correct_index': 0, 'explanation': 'The issue is the hidden interface assumption between circuit and workflow record.'}, {'prompt': 'What should a good workflow pattern survive?', 'options': ['Controlled changes in inputs, basis choice, and scoring emphasis without losing clarity', 'Only the exact original notebook cell order', 'The absence of any documentation'], 'correct_index': 0, 'explanation': 'Patterns are valuable because they handle variation gracefully.'}], heading='Review Language')\n"
|
||||
|
|
@ -399,7 +427,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why an execution record with no design brief is weaker than it first appears.')\n"
|
||||
|
|
@ -424,7 +459,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe the minimum information a local-first workflow notebook should record so another engineer can rerun and critique it.')\n"
|
||||
|
|
@ -449,7 +491,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Qiskit Patterns and Workflow Design Problem-Set Review Loop', prompt='After the quizzes, write the claim you now trust most, the evidence pattern behind it, the phrasing that still feels weak, and the next rewrite you owe yourself.')\n"
|
||||
|
|
@ -474,7 +523,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -585,7 +641,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -616,7 +678,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef build_agreement_probe(basis: str = \"z\") -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n # [1] The workflow chooses the question before the circuit is built.\\n circuit.h(0)\\n circuit.cx(0, 1)\\n # [2] Basis adaptation belongs in its own visible layer.\\n if basis == \"x\":\\n circuit.h([0, 1])\\n elif basis != \"z\":\\n raise ValueError(\"basis must be \\'z\\' or \\'x\\'\")\\n # [3] Keep the reporting contract explicit.\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = build_agreement_probe(basis=\"x\")\\n'\n",
|
||||
|
|
@ -227,7 +234,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef build_probe(basis: str = \"z\", add_barrier: bool = True) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h(0)\\n circuit.cx(0, 1)\\n if add_barrier:\\n circuit.barrier()\\n if basis == \"x\":\\n circuit.h([0, 1])\\n elif basis != \"z\":\\n raise ValueError(\"basis must be \\'z\\' or \\'x\\'\")\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = build_probe(basis=\"z\", add_barrier=True)\\n'\n",
|
||||
|
|
@ -275,7 +289,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef build_probe(swapped_report: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n circuit.h(0)\\n circuit.cx(0, 1)\\n if swapped_report:\\n circuit.measure([0, 1], [1, 0])\\n else:\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = build_probe(swapped_report=False)\\n'\n",
|
||||
|
|
@ -307,7 +328,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a strong studio deliverable for this module?', 'options': ['A small, configurable workflow notebook with a clear circuit builder and a reviewable result record', 'A single screenshot of one circuit', 'A notebook with no post-processing because counts are enough'], 'correct_index': 0, 'explanation': 'The studio should produce a reusable local-first pattern artifact.'}, {'prompt': 'Why is explicit workflow prose still necessary here?', 'options': ['Because the professional value of the notebook lies in the interfaces and decision logic as much as in the circuit', 'Because the circuit is unimportant', 'Because prose replaces execution'], 'correct_index': 0, 'explanation': 'The prose tells reviewers how the pattern is meant to be used and judged.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -332,7 +360,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"evidence_checklist(['The notebook states the objective or decision clearly.', 'The relevant constraints are explicit and stable.', 'Evidence is tied to a concrete circuit, output, or metric.', 'At least one uncertainty or risk is named explicitly.', 'The notebook ends with a next action or defended judgement.'], title='Qiskit Patterns and Workflow Design Evidence Checklist')\n"
|
||||
|
|
@ -418,7 +453,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which part of your workflow shell would another engineer most likely need to change first?')\n"
|
||||
|
|
@ -443,7 +485,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('How did you make the reporting contract explicit in the final studio version?')\n"
|
||||
|
|
@ -468,7 +517,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What information did you decide belonged in the final result record?')\n"
|
||||
|
|
@ -493,7 +549,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one workflow habit from this module that should survive all later capstone work.')\n"
|
||||
|
|
@ -518,7 +581,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Qiskit Patterns and Workflow Design Studio Revision Loop', prompt='Write the decision or diagnosis the studio currently supports, the evidence carrying that weight, the main remaining uncertainty, and the next revision that would sharpen the notebook.')\n"
|
||||
|
|
@ -543,7 +613,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -638,7 +715,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -669,7 +752,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Write the abstract target circuit clearly before worrying about rescue by the transpiler.', 'diagram_effect': 'The first diagram states the ideal intent with no attempt to hide topology pressure.', 'why_it_matters': 'Human redesign starts by knowing what the unpressured circuit was trying to express.'}, {'marker': '[2]', 'code_focus': 'Expose basis-gate and coupling-map assumptions explicitly.', 'diagram_effect': 'The device pressure becomes a visible part of the experiment rather than a hidden environment fact.', 'why_it_matters': 'You cannot reason about hardware cost if the constraints remain implicit.'}, {'marker': '[3]', 'code_focus': 'Inspect the compiled rewrite and decide which costs were caused by your abstract layout.', 'diagram_effect': 'The compiled version shows extra structure, depth, or routing burden.', 'why_it_matters': 'Professional redesign begins where default compilation becomes expensive.'}, {'marker': '[4]', 'code_focus': 'Create and compare a human-aware alternative instead of treating the compiler as the final word.', 'diagram_effect': 'A second circuit appears whose structure anticipates the topology rather than suffering under it.', 'why_it_matters': 'Hardware awareness is redesign, not passive observation of transpiler output.'}])\n"
|
||||
|
|
@ -204,7 +211,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -247,7 +261,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should you inspect first when a compiled circuit gets much deeper?', 'options': ['Which abstract interactions violated the declared topology', 'The notebook font', 'Whether the simulator seed changed'], 'correct_index': 0, 'explanation': 'Depth inflation is usually tracing back to topology or basis pressure.'}, {'prompt': 'Why compare a naive star GHZ to a middle-root or chain version?', 'options': ['To see whether human-aware structure can reduce routing cost before compilation', 'Because only one can be entangling', 'Because the transpiler refuses to compile chain circuits'], 'correct_index': 0, 'explanation': 'The comparison reveals which costs were self-inflicted by the abstract layout.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -272,7 +293,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which candidate in the lab most clearly demonstrated self-inflicted compile cost, and why?')\n"
|
||||
|
|
@ -313,7 +341,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -372,7 +407,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -415,7 +457,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a strong redesign note?', 'options': ['I moved the root to the middle because the line topology can host those interactions more directly', 'I changed the circuit because it looked simpler', 'I let the compiler decide and stopped reading'], 'correct_index': 0, 'explanation': 'Good redesign language ties structure to topology-aware intent.'}, {'prompt': 'Why is it useful to keep basis gates fixed during candidate comparison?', 'options': ['So differences in cost are more attributable to circuit design than to a moving target backend model', 'Because basis gates never matter', 'Because fixed basis gates guarantee identical counts'], 'correct_index': 0, 'explanation': 'Stable constraints make comparison more interpretable.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -486,7 +535,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short redesign note defending one manual alternative under the fixed line-topology assumptions.')\n"
|
||||
|
|
@ -511,7 +567,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one prediction habit from this lab that you want to preserve in later professional work.')\n"
|
||||
|
|
@ -536,7 +599,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Hardware-Aware Redesign Studio Lab Feedback Loop', prompt='Turn the lab into a review note: state the current claim, cite the strongest evidence, name the main remaining risk, and write the next comparison you would run.')\n"
|
||||
|
|
@ -561,7 +631,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -656,7 +733,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -687,7 +770,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -257,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Write the abstract target circuit clearly before worrying about rescue by the transpiler.', 'diagram_effect': 'The first diagram states the ideal intent with no attempt to hide topology pressure.', 'why_it_matters': 'Human redesign starts by knowing what the unpressured circuit was trying to express.'}, {'marker': '[2]', 'code_focus': 'Expose basis-gate and coupling-map assumptions explicitly.', 'diagram_effect': 'The device pressure becomes a visible part of the experiment rather than a hidden environment fact.', 'why_it_matters': 'You cannot reason about hardware cost if the constraints remain implicit.'}, {'marker': '[3]', 'code_focus': 'Inspect the compiled rewrite and decide which costs were caused by your abstract layout.', 'diagram_effect': 'The compiled version shows extra structure, depth, or routing burden.', 'why_it_matters': 'Professional redesign begins where default compilation becomes expensive.'}, {'marker': '[4]', 'code_focus': 'Create and compare a human-aware alternative instead of treating the compiler as the final word.', 'diagram_effect': 'A second circuit appears whose structure anticipates the topology rather than suffering under it.', 'why_it_matters': 'Hardware awareness is redesign, not passive observation of transpiler output.'}])\n"
|
||||
|
|
@ -282,7 +289,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -389,7 +403,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the first mistake hardware-aware redesign tries to prevent?', 'options': ['Letting the transpiler quietly rescue a topology-hostile abstract circuit without inspecting the cost', 'Using any two-qubit gate at all', 'Running local simulation before cloud execution'], 'correct_index': 0, 'explanation': 'Hardware awareness begins by exposing compilation pressure, not ignoring it.'}, {'prompt': 'Why must coupling maps be explicit in a redesign notebook?', 'options': ['Because the constraints shape what counts as a good circuit', 'Because they increase the number of qubits in the circuit', 'Because Qiskit cannot run without them'], 'correct_index': 0, 'explanation': 'The whole redesign question depends on visible constraints.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -487,7 +508,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What makes a manual redesign better than passive transpiler inspection?', 'options': ['It anticipates the topology in the abstract design instead of paying routing cost after the fact', 'It removes the need to benchmark', 'It always lowers gate counts to the theoretical minimum'], 'correct_index': 0, 'explanation': 'Human redesign aims to reduce avoidable compiler burden.'}, {'prompt': 'Why keep the reporting layer stable while redesigning the entangling body?', 'options': ['So behavioral comparisons stay fair while structure changes', 'Because classical bits cannot be moved in Qiskit', 'Because metrics only work on measured circuits'], 'correct_index': 0, 'explanation': 'A stable objective is necessary for meaningful redesign comparison.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -512,7 +540,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a compiled circuit is evidence but not yet a final design verdict.')\n"
|
||||
|
|
@ -537,7 +572,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one structural feature that can make an abstract circuit needlessly hostile to a line topology.')\n"
|
||||
|
|
@ -562,7 +604,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Hardware-Aware Redesign Studio Lecture Revision Loop', prompt='State the judgement this lecture is training, the strongest evidence that would justify it, the current weakness in your own explanation, and the next revision you should make.')\n"
|
||||
|
|
@ -587,7 +636,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -697,7 +753,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -728,7 +790,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -178,7 +178,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which question belongs first in a hardware-aware review?', 'options': ['Which interactions in the abstract circuit stress the stated topology?', 'Which color theme does the notebook use?', 'How many markdown cells are present?'], 'correct_index': 0, 'explanation': 'Redesign starts with locating the structural source of cost.'}, {'prompt': 'Why is a coupling map a design object here?', 'options': ['Because it changes what circuit structure is cheap, awkward, or compiler-rescued', 'Because it determines the correct measurement result directly', 'Because it replaces basis gates'], 'correct_index': 0, 'explanation': 'The topology reshapes the engineering trade space.'}], heading='Constraint Reading')\n"
|
||||
|
|
@ -218,7 +225,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the weak attitude this module opposes?', 'options': ['The transpiler will fix everything, so I do not need to read the compiled circuit', 'I should compare alternative layouts', 'I should measure cost with the same constraints across candidates'], 'correct_index': 0, 'explanation': 'Passive trust in compilation is not hardware-aware design.'}, {'prompt': 'What is a strong reason to inspect `depth_after` and `ops_after` together?', 'options': ['They tell a more complete story about route-induced structural cost', 'They are interchangeable numbers', 'They eliminate the need to see the compiled circuit'], 'correct_index': 0, 'explanation': 'Multiple metrics help connect design moves to concrete burden.'}], heading='Compiler Versus Designer')\n"
|
||||
|
|
@ -258,7 +272,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What makes a manual alternative worth keeping?', 'options': ['It preserves the objective while reducing avoidable compile-time pressure', 'It simply has fewer lines of Python', 'It hides more logic inside helpers'], 'correct_index': 0, 'explanation': 'The best redesigns keep behavior while improving structural fit.'}, {'prompt': 'Why might a middle-root GHZ be better than a star-root GHZ on a line?', 'options': ['Because the central qubit can reach both sides with less routing strain', 'Because middle qubits are more quantum', 'Because it avoids measurement entirely'], 'correct_index': 0, 'explanation': 'Positioning the root can align the abstract circuit with the topology.'}], heading='Manual Alternatives')\n"
|
||||
|
|
@ -298,7 +319,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which review statement is strongest?', 'options': ['The abstract layout asks one qubit to talk nonlocally to two distant neighbors, so the compile cost is largely self-created', 'The transpiler output is ugly', 'The circuit should use more barriers'], 'correct_index': 0, 'explanation': 'Good review language names the structural reason for the cost.'}, {'prompt': 'What should support a final redesign claim?', 'options': ['Stable constraints, candidate metrics, and a narrative linking the better structure to those numbers', 'Only personal preference', 'Only the ideal-state intuition'], 'correct_index': 0, 'explanation': 'A redesign recommendation should be evidence-backed and constraint-aware.'}], heading='Review Language')\n"
|
||||
|
|
@ -399,7 +427,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a topology-aware alternative is not automatically better unless the objective is kept stable.')\n"
|
||||
|
|
@ -424,7 +459,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe the minimum evidence you would want before accepting a hardware-aware redesign recommendation.')\n"
|
||||
|
|
@ -449,7 +491,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Hardware-Aware Redesign Studio Problem-Set Review Loop', prompt='After the quizzes, write the claim you now trust most, the evidence pattern behind it, the phrasing that still feels weak, and the next rewrite you owe yourself.')\n"
|
||||
|
|
@ -474,7 +523,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -585,7 +641,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -616,7 +678,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -238,7 +245,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -297,7 +311,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -340,7 +361,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the right studio target for this module?', 'options': ['A constraint-aware redesign memo comparing multiple candidate circuits under the same local topology assumptions', 'A single ideal circuit with no compile study', 'A notebook that treats the coupling map as background trivia'], 'correct_index': 0, 'explanation': 'The studio should feel like local hardware-aware engineering.'}, {'prompt': 'Why is human critique still necessary after compilation?', 'options': ['Because the compiler shows what happened, but the designer still decides whether the original layout was wise', 'Because compiled circuits are never useful', 'Because metrics disappear after transpilation'], 'correct_index': 0, 'explanation': 'Compilation evidence is necessary, not sufficient, for redesign judgement.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -365,7 +393,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"evidence_checklist(['The notebook states the objective or decision clearly.', 'The relevant constraints are explicit and stable.', 'Evidence is tied to a concrete circuit, output, or metric.', 'At least one uncertainty or risk is named explicitly.', 'The notebook ends with a next action or defended judgement.'], title='Hardware-Aware Redesign Studio Evidence Checklist')\n"
|
||||
|
|
@ -451,7 +486,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which structural feature turned out to matter most in your final redesign recommendation?')\n"
|
||||
|
|
@ -476,7 +518,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What evidence from the constrained comparison most influenced your choice?')\n"
|
||||
|
|
@ -501,7 +550,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('How did you keep the reporting contract stable across the candidates?')\n"
|
||||
|
|
@ -526,7 +582,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one redesign habit from this module that should carry into the capstone.')\n"
|
||||
|
|
@ -551,7 +614,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Hardware-Aware Redesign Studio Studio Revision Loop', prompt='Write the decision or diagnosis the studio currently supports, the evidence carrying that weight, the main remaining uncertainty, and the next revision that would sharpen the notebook.')\n"
|
||||
|
|
@ -576,7 +646,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -671,7 +748,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -702,7 +785,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'State an invariant or expected signature before you look at noisy data.', 'diagram_effect': 'The circuit is linked to a claim, not only to a plot.', 'why_it_matters': 'Verification begins with a falsifiable expectation, not with vibes about whether the histogram looks plausible.'}, {'marker': '[2]', 'code_focus': 'Create an ideal reference case with a clear evidence path.', 'diagram_effect': 'The clean diagram becomes the baseline against which distortion is interpreted.', 'why_it_matters': 'Without an ideal baseline, noise and design bugs get mixed together.'}, {'marker': '[3]', 'code_focus': 'Inject or study noise while preserving the same reporting contract.', 'diagram_effect': 'The circuit body stays recognizably the same while the output distribution degrades.', 'why_it_matters': 'Good diagnosis compares like with like.'}, {'marker': '[4]', 'code_focus': 'Use invariants, filters, or postselection to separate structural failure from expected physical distortion.', 'diagram_effect': 'The notebook now includes verification logic alongside execution.', 'why_it_matters': 'Mitigation thinking starts with diagnosis, not magical hope.'}])\n"
|
||||
|
|
@ -204,7 +211,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"demo_noise = build_demo_noise_model(\n",
|
||||
|
|
@ -245,7 +259,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the best use of a noisy preview in this lab?', 'options': ['To compare it directly to the ideal baseline while keeping the same measurement contract', 'To replace ideal simulation completely', 'To prove the circuit is wrong whenever the counts change'], 'correct_index': 0, 'explanation': 'Noise is informative only relative to a stable baseline.'}, {'prompt': 'What distinguishes a missing-H bug from mild noise in the Bell example?', 'options': ['The bug destroys the intended 00/11 balance mechanism itself', 'The bug only changes the transpiler seed', 'Nothing, they are equivalent'], 'correct_index': 0, 'explanation': 'The design defect changes the causal story, not just the output quality.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -270,7 +291,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which comparison in the lab most clarified the difference between a defect and a distortion?')\n"
|
||||
|
|
@ -311,7 +339,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bell_candidate(bug: bool = True) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n if not bug:\\n circuit.h(0)\\n circuit.cx(0, 1)\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = bell_candidate(bug=True)\\n'\n",
|
||||
|
|
@ -359,7 +394,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"demo_noise = build_demo_noise_model(\n",
|
||||
|
|
@ -400,7 +442,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why use a simple correlated-outcome filter or postselection step?', 'options': ['To inspect whether the main failure is leakage outside the intended support or a deeper design mismatch', 'To guarantee perfect reconstruction', 'To remove the need to state invariants'], 'correct_index': 0, 'explanation': 'Filtering is most useful when tied to a clear diagnostic question.'}, {'prompt': 'What would make a mitigation claim weak?', 'options': ['It never says what invariant improved or what error mode it targeted', 'It compares ideal and noisy counts side by side', 'It preserves the reporting contract during diagnosis'], 'correct_index': 0, 'explanation': 'Mitigation needs targeted evidence, not generic optimism.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -471,7 +520,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short mitigation note that improves one statistic without overstating what was fixed.')\n"
|
||||
|
|
@ -496,7 +552,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one prediction habit from this lab that you want to preserve in later professional work.')\n"
|
||||
|
|
@ -521,7 +584,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Noise-Aware Verification and Mitigation Lab Feedback Loop', prompt='Turn the lab into a review note: state the current claim, cite the strongest evidence, name the main remaining risk, and write the next comparison you would run.')\n"
|
||||
|
|
@ -546,7 +616,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -641,7 +718,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -672,7 +755,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -257,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'State an invariant or expected signature before you look at noisy data.', 'diagram_effect': 'The circuit is linked to a claim, not only to a plot.', 'why_it_matters': 'Verification begins with a falsifiable expectation, not with vibes about whether the histogram looks plausible.'}, {'marker': '[2]', 'code_focus': 'Create an ideal reference case with a clear evidence path.', 'diagram_effect': 'The clean diagram becomes the baseline against which distortion is interpreted.', 'why_it_matters': 'Without an ideal baseline, noise and design bugs get mixed together.'}, {'marker': '[3]', 'code_focus': 'Inject or study noise while preserving the same reporting contract.', 'diagram_effect': 'The circuit body stays recognizably the same while the output distribution degrades.', 'why_it_matters': 'Good diagnosis compares like with like.'}, {'marker': '[4]', 'code_focus': 'Use invariants, filters, or postselection to separate structural failure from expected physical distortion.', 'diagram_effect': 'The notebook now includes verification logic alongside execution.', 'why_it_matters': 'Mitigation thinking starts with diagnosis, not magical hope.'}])\n"
|
||||
|
|
@ -282,7 +289,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"demo_noise = build_demo_noise_model(\n",
|
||||
|
|
@ -390,7 +404,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should come before noisy execution in a verification notebook?', 'options': ['A stated invariant or expected signature that can later be tested', 'A guess that the histogram will be messy', 'A transpiler seed with no explanation'], 'correct_index': 0, 'explanation': 'Verification needs a falsifiable expectation before it can diagnose anything.'}, {'prompt': 'Why is an ideal baseline essential?', 'options': ['It separates design defects from expected physical distortion', 'It eliminates the need for noise models', 'It guarantees balanced counts'], 'correct_index': 0, 'explanation': 'Without a clean reference, every failure mode gets mixed together.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -488,7 +509,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What makes mitigation thinking professional rather than magical?', 'options': ['It starts from diagnosis and explicit invariants instead of assuming every bad result can be rescued', 'It always restores exact ideal behavior', 'It never uses post-processing'], 'correct_index': 0, 'explanation': 'Mitigation is bounded, evidence-driven repair work.'}, {'prompt': 'Why is a buggy ideal circuit not the same as a noisy correct circuit?', 'options': ['Because one fails the intended mechanism and the other distorts it while preserving its overall target', 'Because both are equally random', 'Because noise models cannot affect entangled states'], 'correct_index': 0, 'explanation': 'The distinction matters if you want to fix the right problem.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -513,7 +541,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a verification notebook should state an invariant before executing a noisy simulation.')\n"
|
||||
|
|
@ -538,7 +573,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe the difference between a design defect and a noise effect using one concrete example.')\n"
|
||||
|
|
@ -563,7 +605,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Noise-Aware Verification and Mitigation Lecture Revision Loop', prompt='State the judgement this lecture is training, the strongest evidence that would justify it, the current weakness in your own explanation, and the next revision you should make.')\n"
|
||||
|
|
@ -588,7 +637,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -698,7 +754,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -729,7 +791,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -178,7 +178,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which invariant is useful for a Bell-style correctness check?', 'options': ['Support concentrated on correlated outcomes with limited imbalance between 00 and 11', 'Only total shot count', 'The number of markdown cells'], 'correct_index': 0, 'explanation': 'A good invariant captures the intended structure of the state.'}, {'prompt': \"Why is 'looks entangled' weak evidence?\", 'options': ['Because verification needs explicit criteria, not aesthetic impressions', 'Because entanglement can never be visualized', 'Because only hardware data matters'], 'correct_index': 0, 'explanation': 'A professional verifier states what will count as passing evidence.'}], heading='Invariants')\n"
|
||||
|
|
@ -218,7 +225,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the strongest sign that a result reflects a design bug rather than modest noise?', 'options': ['The ideal circuit already fails the intended invariant', 'The noisy histogram is not perfectly sharp', 'The transpiler changed gate names'], 'correct_index': 0, 'explanation': 'If the clean mechanism is broken, noise is not the primary story.'}, {'prompt': 'Why run both ideal and noisy variants of the same circuit?', 'options': ['To separate structural correctness from robustness', 'To avoid writing explanations', 'To guarantee mitigation works'], 'correct_index': 0, 'explanation': 'The comparison reveals which failure mode you are actually facing.'}], heading='Bug Versus Noise')\n"
|
||||
|
|
@ -258,7 +272,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a strong mitigation sentence?', 'options': ['Postselection raised the correlated-support rate, which suggests leakage was a major issue, but it did not repair the underlying circuit if the ideal invariant already failed', 'Postselection fixed quantum computing', 'Filtering makes every circuit correct'], 'correct_index': 0, 'explanation': 'Mitigation claims should stay bounded and mechanism-aware.'}, {'prompt': 'Why keep mitigation local-first in this project?', 'options': ['Because diagnosis and repair habits should be learnable without cloud dependencies', 'Because real hardware never matters', 'Because noise cannot be simulated locally'], 'correct_index': 0, 'explanation': 'Local-first makes the reasoning loop short and reproducible.'}], heading='Mitigation Reasoning')\n"
|
||||
|
|
@ -298,7 +319,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which review note is strongest?', 'options': ['The notebook compares noisy data to no stated invariant, so the diagnosis is under-specified', 'The histogram is ugly', 'Please remove the baseline because it is redundant'], 'correct_index': 0, 'explanation': 'The real issue is the missing diagnostic standard.'}, {'prompt': 'What should support a final verification claim?', 'options': ['Ideal reference, noisy comparison, explicit invariant, and a reasoned distinction between defect and distortion', 'Only a single noisy run', 'Only intuition about what should happen'], 'correct_index': 0, 'explanation': 'Verification requires a multi-layer evidence chain.'}], heading='Review Language')\n"
|
||||
|
|
@ -399,7 +427,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a noisy result without an ideal comparison is diagnostically weak.')\n"
|
||||
|
|
@ -424,7 +459,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one verification invariant you would want before trusting a more advanced circuit family.')\n"
|
||||
|
|
@ -449,7 +491,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Noise-Aware Verification and Mitigation Problem-Set Review Loop', prompt='After the quizzes, write the claim you now trust most, the evidence pattern behind it, the phrasing that still feels weak, and the next rewrite you owe yourself.')\n"
|
||||
|
|
@ -474,7 +523,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -585,7 +641,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -616,7 +678,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"demo_noise = build_demo_noise_model(\n",
|
||||
|
|
@ -236,7 +243,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bell_candidate(bug: bool = True) -> QuantumCircuit:\\n circuit = QuantumCircuit(2, 2)\\n if not bug:\\n circuit.h(0)\\n circuit.cx(0, 1)\\n circuit.measure([0, 1], [0, 1])\\n return circuit\\n\\ncircuit = bell_candidate(bug=True)\\n'\n",
|
||||
|
|
@ -284,7 +298,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"demo_noise = build_demo_noise_model(\n",
|
||||
|
|
@ -325,7 +346,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a strong studio outcome for this module?', 'options': ['A verification notebook that states an invariant, compares clean and noisy behavior, and writes a bounded mitigation note', 'A notebook that only declares the result noisy', 'A notebook that assumes any deviation is a design bug'], 'correct_index': 0, 'explanation': 'The studio should culminate in disciplined diagnosis, not generic complaint.'}, {'prompt': 'Why does this module belong in the professional band?', 'options': ['Because serious circuit work requires debugging and falsification habits, not only construction skill', 'Because noise makes design impossible', 'Because ideal simulation is obsolete'], 'correct_index': 0, 'explanation': 'Professional competence includes knowing how to test and challenge a design.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -350,7 +378,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"evidence_checklist(['The notebook states the objective or decision clearly.', 'The relevant constraints are explicit and stable.', 'Evidence is tied to a concrete circuit, output, or metric.', 'At least one uncertainty or risk is named explicitly.', 'The notebook ends with a next action or defended judgement.'], title='Noise-Aware Verification and Mitigation Evidence Checklist')\n"
|
||||
|
|
@ -436,7 +471,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which invariant anchored your final verification case study?')\n"
|
||||
|
|
@ -461,7 +503,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What evidence let you separate defect from distortion most confidently?')\n"
|
||||
|
|
@ -486,7 +535,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('How did you keep your mitigation note bounded and honest?')\n"
|
||||
|
|
@ -511,7 +567,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one verification habit from this module that must survive into the capstone.')\n"
|
||||
|
|
@ -536,7 +599,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Noise-Aware Verification and Mitigation Studio Revision Loop', prompt='Write the decision or diagnosis the studio currently supports, the evidence carrying that weight, the main remaining uncertainty, and the next revision that would sharpen the notebook.')\n"
|
||||
|
|
@ -561,7 +631,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -656,7 +733,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -687,7 +770,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'State the design brief and the constraints before generating any candidate.', 'diagram_effect': 'Every candidate diagram is read as an answer to a shared constrained question.', 'why_it_matters': 'Capstone work starts from explicit objective, not from attachment to a favorite circuit shape.'}, {'marker': '[2]', 'code_focus': 'Generate more than one plausible candidate family.', 'diagram_effect': 'The notebook contains alternatives instead of a single self-congratulatory path.', 'why_it_matters': 'Professional design requires comparison, not only construction.'}, {'marker': '[3]', 'code_focus': 'Benchmark ideal, compiled, and noisy behavior with the same reporting contract.', 'diagram_effect': 'Each candidate can be judged across several evidence layers.', 'why_it_matters': 'Recommendations are credible only when they survive more than one lens.'}, {'marker': '[4]', 'code_focus': 'Write a recommendation that names tradeoffs, risks, and why one candidate wins.', 'diagram_effect': 'The notebook ends as a design review, not a gallery.', 'why_it_matters': 'The capstone is about defended judgment under constraints.'}])\n"
|
||||
|
|
@ -204,7 +211,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -253,7 +267,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the right mindset when comparing candidate families?', 'options': ['Keep the brief fixed and ask which candidate best serves it under the same constraints', 'Change the objective whenever a favorite candidate looks weak', 'Ignore transpilation because the capstone is conceptual'], 'correct_index': 0, 'explanation': 'A fixed brief is what makes candidate comparison honest.'}, {'prompt': 'Why compare naive, chain, and middle-root GHZ candidates locally?', 'options': ['To see which structure survives line-topology and noise pressure most credibly', 'Because only one of them creates entanglement', 'Because local simulation can replace final judgement'], 'correct_index': 0, 'explanation': 'The local study gives a concrete engineering comparison under declared constraints.'}], heading='Lab Checkpoint A')\n"
|
||||
|
|
@ -278,7 +299,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which candidate stayed plausible the longest in your comparison, and why?')\n"
|
||||
|
|
@ -319,7 +347,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -384,7 +419,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -433,7 +475,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What would make a capstone comparison weak?', 'options': ['Selecting a winner before compiling or benchmarking the alternatives', 'Keeping the objective and constraints fixed', 'Comparing noisy-success support across candidates'], 'correct_index': 0, 'explanation': 'Premature attachment is the enemy of serious review.'}, {'prompt': 'What is a useful residual-risk sentence?', 'options': ['The middle-root design wins under the current line model, but the ranking could shift if the error profile changes materially', 'There are no remaining risks because one candidate won', 'Risk does not belong in a design recommendation'], 'correct_index': 0, 'explanation': 'Capstone recommendations should acknowledge scope and uncertainty.'}], heading='Lab Checkpoint B')\n"
|
||||
|
|
@ -504,7 +553,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short recommendation sentence that names both a winner and one residual risk.')\n"
|
||||
|
|
@ -529,7 +585,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write one prediction habit from this lab that you want to preserve in later professional work.')\n"
|
||||
|
|
@ -554,7 +617,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Capstone Circuit Design Review Lab Feedback Loop', prompt='Turn the lab into a review note: state the current claim, cite the strongest evidence, name the main remaining risk, and write the next comparison you would run.')\n"
|
||||
|
|
@ -579,7 +649,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -674,7 +751,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -705,7 +788,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -257,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'State the design brief and the constraints before generating any candidate.', 'diagram_effect': 'Every candidate diagram is read as an answer to a shared constrained question.', 'why_it_matters': 'Capstone work starts from explicit objective, not from attachment to a favorite circuit shape.'}, {'marker': '[2]', 'code_focus': 'Generate more than one plausible candidate family.', 'diagram_effect': 'The notebook contains alternatives instead of a single self-congratulatory path.', 'why_it_matters': 'Professional design requires comparison, not only construction.'}, {'marker': '[3]', 'code_focus': 'Benchmark ideal, compiled, and noisy behavior with the same reporting contract.', 'diagram_effect': 'Each candidate can be judged across several evidence layers.', 'why_it_matters': 'Recommendations are credible only when they survive more than one lens.'}, {'marker': '[4]', 'code_focus': 'Write a recommendation that names tradeoffs, risks, and why one candidate wins.', 'diagram_effect': 'The notebook ends as a design review, not a gallery.', 'why_it_matters': 'The capstone is about defended judgment under constraints.'}])\n"
|
||||
|
|
@ -282,7 +289,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -411,7 +425,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What distinguishes a capstone design notebook from an ordinary lab?', 'options': ['It must compare multiple plausible candidates under explicit constraints and end with a recommendation', 'It must avoid all metrics', 'It must use the largest circuit in the repo'], 'correct_index': 0, 'explanation': 'Capstone work is defined by comparative judgement and defended choice.'}, {'prompt': 'Why is a design brief necessary before candidate generation?', 'options': ['Because the winner depends on the stated objective and constraints, not on taste alone', 'Because it guarantees the first candidate is best', 'Because Qiskit requires one'], 'correct_index': 0, 'explanation': 'Without a brief, comparison becomes arbitrary.'}], heading='Lecture Checkpoint A')\n"
|
||||
|
|
@ -509,7 +530,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should a final recommendation include?', 'options': ['The winning candidate, the metrics and observations that favored it, and the risks that remain', 'Only the prettiest circuit diagram', 'Only the lowest ideal depth regardless of constraints'], 'correct_index': 0, 'explanation': 'Professional recommendations name both evidence and residual uncertainty.'}, {'prompt': 'Why benchmark ideal, compiled, and noisy behavior together?', 'options': ['Because a candidate can look good in one lens and weak in another', 'Because one lens always tells the whole story', 'Because the extra layers remove the need for prose'], 'correct_index': 0, 'explanation': 'Capstone judgement is multi-criteria, not single-metric worship.'}], heading='Lecture Checkpoint B')\n"
|
||||
|
|
@ -534,7 +562,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a capstone recommendation must come after candidate comparison rather than before it.')\n"
|
||||
|
|
@ -559,7 +594,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one way a local comparison can still be professionally useful without claiming universal truth.')\n"
|
||||
|
|
@ -584,7 +626,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Capstone Circuit Design Review Lecture Revision Loop', prompt='State the judgement this lecture is training, the strongest evidence that would justify it, the current weakness in your own explanation, and the next revision you should make.')\n"
|
||||
|
|
@ -609,7 +658,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -719,7 +775,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -750,7 +812,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -178,7 +178,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which statement best starts a capstone review?', 'options': ['The objective is to prepare a GHZ-style resource on a line topology with strong noisy support and reasonable compile cost', 'I like this circuit shape more than the others', 'Any entangled state will do'], 'correct_index': 0, 'explanation': 'The brief defines what the later comparison actually means.'}, {'prompt': 'Why must constraints be stated rather than implied?', 'options': ['Because they decide which tradeoffs are acceptable', 'Because constraints never affect rankings', 'Because metrics replace constraints'], 'correct_index': 0, 'explanation': 'A good recommendation is always recommendation-under-constraints.'}], heading='Design Brief')\n"
|
||||
|
|
@ -218,7 +225,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a strong reason to keep multiple candidates alive for a while?', 'options': ['Different candidates may dominate under different evidence layers', 'Because picking one early is more professional', 'Because capstones should avoid decisions'], 'correct_index': 0, 'explanation': 'Benchmarking exists because early intuition is often incomplete.'}, {'prompt': 'What does compiled depth tell you in this module?', 'options': ['Part of the implementation burden under the declared topology and basis set', 'The exact final fidelity', 'Whether the candidate is mathematically valid'], 'correct_index': 0, 'explanation': 'Compiled depth is one lens on cost, not the entire verdict.'}], heading='Candidate Benchmarks')\n"
|
||||
|
|
@ -258,7 +272,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which recommendation sentence is strongest?', 'options': ['I recommend the middle-root candidate because it preserves the target behavior while reducing compile burden and maintaining the best noisy support under the current model', 'I recommend the middle-root candidate because it feels elegant', 'I recommend the first candidate because it appeared first in the notebook'], 'correct_index': 0, 'explanation': 'The strongest sentence links candidate choice to explicit evidence and scope.'}, {'prompt': 'Why mention residual risk after naming a winner?', 'options': ['Because a professional review distinguishes current evidence from universal truth', 'Because it weakens the recommendation', 'Because risks only matter in cloud execution'], 'correct_index': 0, 'explanation': 'Honest recommendations are conditional on model and evidence.'}], heading='Recommendation Writing')\n"
|
||||
|
|
@ -298,7 +319,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Which review note is strongest?', 'options': ['The notebook names a winner but never explains the objective function used to rank the candidates', 'The notebook should have more animation', 'The notebook uses too many metrics by definition'], 'correct_index': 0, 'explanation': 'A ranking without a criterion is not yet a serious review.'}, {'prompt': 'What should a capstone notebook leave behind for another engineer?', 'options': ['A clear brief, comparable evidence, and a defensible recommendation', 'Only the final circuit', 'Only a celebratory conclusion'], 'correct_index': 0, 'explanation': 'The deliverable is a reviewable decision artifact, not just a result.'}], heading='Review Judgement')\n"
|
||||
|
|
@ -399,7 +427,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why a candidate ranking with no explicit criterion is not yet a professional review.')\n"
|
||||
|
|
@ -424,7 +459,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe the minimum evidence you would want before accepting a capstone recommendation written by someone else.')\n"
|
||||
|
|
@ -449,7 +491,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Capstone Circuit Design Review Problem-Set Review Loop', prompt='After the quizzes, write the claim you now trust most, the evidence pattern behind it, the phrasing that still feels weak, and the next rewrite you owe yourself.')\n"
|
||||
|
|
@ -474,7 +523,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -585,7 +641,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -616,7 +678,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -179,7 +179,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -244,7 +251,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -309,7 +323,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"LOCAL_BASIS = [\"rz\", \"sx\", \"x\", \"cx\"]\n",
|
||||
|
|
@ -358,7 +379,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the right studio goal for the capstone module?', 'options': ['Produce a compact design review that compares candidates and defends one under explicit constraints', 'Produce the largest notebook in the repository', 'Avoid final judgement to stay neutral'], 'correct_index': 0, 'explanation': 'The capstone should culminate in argued choice, not indefinite comparison.'}, {'prompt': 'Why is the capstone still local-first here?', 'options': ['Because the aim is to train judgement and workflow discipline without outsourcing the reasoning loop', 'Because hardware-aware thinking is unnecessary', 'Because local simulation gives exact hardware truth'], 'correct_index': 0, 'explanation': 'Local-first keeps the course controllable while still training real design habits.'}], heading='Studio Design Check')\n"
|
||||
|
|
@ -383,7 +411,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"evidence_checklist(['The design brief states both objective and local constraints.', 'At least two plausible candidate circuits are compared.', 'Ideal evidence is shown before constrained claims are made.', 'Compiled burden is compared under a fixed local constraint model.', 'Noise-aware evidence is compared under a declared local model.', 'The notebook ends with an explicit recommendation.', 'Residual risk or limits are named honestly.', 'Another engineer could reproduce the comparison from the notebook.'], title='Capstone Circuit Design Review Evidence Checklist')\n"
|
||||
|
|
@ -469,7 +504,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What brief did you ultimately freeze for the final review, and why was it appropriate?')\n"
|
||||
|
|
@ -494,7 +536,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which evidence layer most influenced the final ranking of your candidates?')\n"
|
||||
|
|
@ -519,7 +568,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What residual risk did you include in the recommendation, and why did it matter?')\n"
|
||||
|
|
@ -544,7 +600,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name the single most important course habit that now feels non-negotiable in professional circuit design.')\n"
|
||||
|
|
@ -569,7 +632,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"feedback_iteration_panel(title='Capstone Circuit Design Review Studio Revision Loop', prompt='Write the decision or diagnosis the studio currently supports, the evidence carrying that weight, the main remaining uncertainty, and the next revision that would sharpen the notebook.')\n"
|
||||
|
|
@ -594,7 +664,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"assessment_blueprint = load_assessment_blueprint()\n",
|
||||
|
|
@ -689,7 +766,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -720,7 +803,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Declare named quantum and classical registers that express circuit roles instead of anonymous wire positions.', 'diagram_effect': 'The rendered circuit now carries semantic names such as data, syndrome, and readout.', 'why_it_matters': 'Named registers turn diagrams into interfaces and make later review far less error prone.'}, {'marker': '[2]', 'code_focus': 'Build a preparation layer that creates the main data-state relationship.', 'diagram_effect': 'The first part of the diagram clearly separates state preparation from later bookkeeping.', 'why_it_matters': 'Good engineering keeps the causal burden of each region readable.'}, {'marker': '[3]', 'code_focus': 'Use a dedicated wire for a parity-style check rather than mixing all roles onto one register.', 'diagram_effect': 'The circuit exposes intent: data wires store the payload, the extra wire stores a check.', 'why_it_matters': 'Role separation is the start of reusable circuit architecture.'}, {'marker': '[4]', 'code_focus': 'Measure into an explicitly ordered classical register.', 'diagram_effect': 'The reporting layer is visible and auditable rather than implicit.', 'why_it_matters': 'Engineering quality includes the evidence path, not only the quantum body of the circuit.'}])\n"
|
||||
|
|
@ -188,7 +195,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister\\n\\ndata = QuantumRegister(2, \"data\")\\nsyndrome = QuantumRegister(1, \"syndrome\")\\nreadout = ClassicalRegister(3, \"readout\")\\ncircuit = QuantumCircuit(data, syndrome, readout)\\n\\n# [1] Prepare a named two-qubit data block.\\ncircuit.h(data[0])\\ncircuit.cx(data[0], data[1])\\n\\n# [2] Route a parity-style question into the syndrome wire.\\ncircuit.cx(data[0], syndrome[0])\\ncircuit.cx(data[1], syndrome[0])\\n\\n# [3] Keep the reporting layer explicit.\\ncircuit.measure(data[0], readout[0])\\ncircuit.measure(data[1], readout[1])\\ncircuit.measure(syndrome[0], readout[2])\\n'\n",
|
||||
|
|
@ -220,7 +234,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the best use of a first editable construction lab?', 'options': ['Change one role-bearing design decision and inspect how the structure and evidence respond', 'Randomly add gates until the diagram looks complicated', 'Avoid metrics until the capstone'], 'correct_index': 0, 'explanation': 'Engineering grows through controlled edits, not decorative complexity.'}, {'prompt': 'Why compare a flat circuit and a block-based circuit for the same behavior?', 'options': ['To judge whether the abstraction actually earned its existence', 'Because one of them must be numerically wrong', 'Because Qiskit disallows reuse otherwise'], 'correct_index': 0, 'explanation': 'Abstractions should be reviewed, not assumed good by default.'}], heading='Construction Lab Checkpoint A')\n"
|
||||
|
|
@ -245,7 +266,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which register-level edit most changed how readable the circuit felt, and why?')\n"
|
||||
|
|
@ -285,7 +313,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bell_block() -> QuantumCircuit:\\n block = QuantumCircuit(2, name=\"bell_prep\")\\n # [1] Encapsulate the preparation story.\\n block.h(0)\\n block.cx(0, 1)\\n return block\\n\\ndef readout_block() -> QuantumCircuit:\\n block = QuantumCircuit(2, 2, name=\"readout\")\\n # [2] Keep the question and the reporting layer reusable too.\\n block.measure([0, 1], [0, 1])\\n return block\\n\\ncircuit = QuantumCircuit(2, 2)\\n# [3] Compose blocks instead of retyping the same logic inline.\\ncircuit.compose(bell_block(), inplace=True)\\ncircuit.compose(readout_block(), inplace=True)\\n'\n",
|
||||
|
|
@ -388,7 +423,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef candidate(extra_layer: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(3, 3)\\n # [1] Create a clean backbone.\\n circuit.h(0)\\n circuit.cx(0, 1)\\n circuit.cx(1, 2)\\n # [2] Toggle the extra layer to inspect the cost of a design choice.\\n if extra_layer:\\n circuit.cx(0, 2)\\n # [3] Keep the reporting layer stable while you compare.\\n circuit.measure([0, 1, 2], [0, 1, 2])\\n return circuit\\n\\ncircuit = candidate(extra_layer=True)\\n'\n",
|
||||
|
|
@ -461,7 +503,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should stay fixed while you compare candidate constructions?', 'options': ['The intended behavior and reporting layer', 'The exact number of comments', 'The notebook theme'], 'correct_index': 0, 'explanation': 'Comparison only works when the engineering objective stays stable.'}, {'prompt': 'What is a useful first explanation after circuit metrics worsen?', 'options': ['Name the structural choice that caused the cost increase', 'Assume Qiskit made a mistake', 'Ignore the metrics if the counts still look plausible'], 'correct_index': 0, 'explanation': 'Metrics should be tied back to concrete design moves.'}], heading='Construction Lab Checkpoint B')\n"
|
||||
|
|
@ -503,7 +552,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short note explaining which candidate you would keep and what evidence actually supports that choice.')\n"
|
||||
|
|
@ -528,7 +584,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one case where a helper function could make a circuit harder, not easier, to review.')\n"
|
||||
|
|
@ -619,7 +682,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -650,7 +719,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -231,7 +231,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Declare named quantum and classical registers that express circuit roles instead of anonymous wire positions.', 'diagram_effect': 'The rendered circuit now carries semantic names such as data, syndrome, and readout.', 'why_it_matters': 'Named registers turn diagrams into interfaces and make later review far less error prone.'}, {'marker': '[2]', 'code_focus': 'Build a preparation layer that creates the main data-state relationship.', 'diagram_effect': 'The first part of the diagram clearly separates state preparation from later bookkeeping.', 'why_it_matters': 'Good engineering keeps the causal burden of each region readable.'}, {'marker': '[3]', 'code_focus': 'Use a dedicated wire for a parity-style check rather than mixing all roles onto one register.', 'diagram_effect': 'The circuit exposes intent: data wires store the payload, the extra wire stores a check.', 'why_it_matters': 'Role separation is the start of reusable circuit architecture.'}, {'marker': '[4]', 'code_focus': 'Measure into an explicitly ordered classical register.', 'diagram_effect': 'The reporting layer is visible and auditable rather than implicit.', 'why_it_matters': 'Engineering quality includes the evidence path, not only the quantum body of the circuit.'}])\n"
|
||||
|
|
@ -256,7 +263,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister\\n\\ndata = QuantumRegister(2, \"data\")\\nsyndrome = QuantumRegister(1, \"syndrome\")\\nreadout = ClassicalRegister(3, \"readout\")\\ncircuit = QuantumCircuit(data, syndrome, readout)\\n\\n# [1] Prepare a named two-qubit data block.\\ncircuit.h(data[0])\\ncircuit.cx(data[0], data[1])\\n\\n# [2] Route a parity-style question into the syndrome wire.\\ncircuit.cx(data[0], syndrome[0])\\ncircuit.cx(data[1], syndrome[0])\\n\\n# [3] Keep the reporting layer explicit.\\ncircuit.measure(data[0], readout[0])\\ncircuit.measure(data[1], readout[1])\\ncircuit.measure(syndrome[0], readout[2])\\n'\n",
|
||||
|
|
@ -330,7 +344,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the main engineering value of named registers?', 'options': ['They turn wires into role-bearing interfaces instead of anonymous positions', 'They always reduce depth', 'They remove the need for measurements'], 'correct_index': 0, 'explanation': 'Named registers improve legibility and make later review far cleaner.'}, {'prompt': 'Why separate a syndrome-style wire from the data wires in an introductory engineering example?', 'options': ['To make the role structure visible early', 'Because Qiskit requires one extra qubit in every circuit', 'Only to make the diagram longer'], 'correct_index': 0, 'explanation': 'Role separation is the foundation of reusable circuit architecture.'}, {'prompt': 'What does a circuit metric such as depth help you talk about?', 'options': ['The implementation cost of a design choice', 'The color of the plotted bars', 'Whether the statevector exists'], 'correct_index': 0, 'explanation': 'Metrics are evidence for engineering tradeoffs, not decoration.'}], heading='Construction Checkpoint A')\n"
|
||||
|
|
@ -417,7 +438,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the strongest reason to refactor repeated gate sequences into builder functions or blocks?', 'options': ['To make intent, reuse, and comparison explicit', 'To avoid ever reading the circuit diagram again', 'To bypass measurement wiring'], 'correct_index': 0, 'explanation': 'Abstraction should clarify the design and reduce fragile duplication.'}, {'prompt': 'When is abstraction boundary design going wrong?', 'options': ['When the helper hides the causal burden so thoroughly that the circuit story becomes harder to review', 'When the circuit becomes shorter', 'When a block has a name'], 'correct_index': 0, 'explanation': 'Good abstractions compress repetition without erasing meaning.'}, {'prompt': 'Why keep the classical register explicit in a construction module?', 'options': ['Because engineering includes how evidence is reported, not only how states are prepared', 'Because classical bits change the quantum state directly', 'Because count previews need more memory'], 'correct_index': 0, 'explanation': 'The evidence path is part of circuit design quality.'}], heading='Construction Checkpoint B')\n"
|
||||
|
|
@ -442,7 +470,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short paragraph defending one abstraction boundary in the anchor circuit and one region you would deliberately keep inline.')\n"
|
||||
|
|
@ -467,7 +502,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one metric you would track while refactoring a circuit builder and explain what design move you think that metric is proxying for.')\n"
|
||||
|
|
@ -573,7 +615,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -604,7 +652,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why does this course treat registers as more than container objects?', 'options': ['They help express circuit roles and interfaces clearly', 'They force circuits to be noisy', 'They replace the need for helper functions'], 'correct_index': 0, 'explanation': 'Register naming is part of diagram legibility and review quality.'}, {'prompt': 'What does circuit size count in a rough engineering sense?', 'options': ['The number of operations in the circuit', 'The number of markdown cells in the notebook', 'Only the number of qubits'], 'correct_index': 0, 'explanation': 'Size is one lens on cost and implementation complexity.'}, {'prompt': 'What is the risk of copy-paste circuit construction?', 'options': ['Intent drifts silently across duplicated fragments', 'The simulator stops working', 'All diagrams become identical'], 'correct_index': 0, 'explanation': 'Duplication is fragile precisely because review becomes harder.'}], heading='Construction Problem Set A')\n"
|
||||
|
|
@ -203,7 +210,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should a helper block preserve?', 'options': ['A clear local purpose that can still be explained in the larger circuit story', 'Only a short line count', 'A guarantee of minimal depth'], 'correct_index': 0, 'explanation': 'Abstractions should compress without becoming opaque.'}, {'prompt': 'Why compare count previews after refactoring?', 'options': ['To check that the cleaner structure preserved the intended behavior', 'Because refactoring should always change the output', 'Because counts replace code review'], 'correct_index': 0, 'explanation': 'Refactoring is only good if intent and behavior survive together.'}, {'prompt': 'What is an honest use of circuit metrics?', 'options': ['As evidence in a tradeoff discussion', 'As a replacement for explanation', 'As proof that one circuit is always superior'], 'correct_index': 0, 'explanation': 'Metrics inform judgment; they do not end it automatically.'}], heading='Construction Problem Set B')\n"
|
||||
|
|
@ -243,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the best sign that a design is still too flat?', 'options': ['You cannot name any stable substructure worth reusing or reviewing separately', 'The circuit fits on one screen', 'It contains only two qubits'], 'correct_index': 0, 'explanation': 'Engineering maturity includes seeing stable blocks inside a larger circuit.'}, {'prompt': 'Why keep measurement wiring explicit in a builder?', 'options': ['Because the reporting layer is part of the design contract', 'Because measurements have no relation to evidence', 'Because builders only exist for classical bits'], 'correct_index': 0, 'explanation': 'Good builders preserve the evidence path, not just the quantum gates.'}, {'prompt': 'What should happen if an abstraction hides a key design burden?', 'options': ['Refine or split the abstraction so the burden becomes reviewable again', 'Keep it because shorter code is always better', 'Remove all helper functions forever'], 'correct_index': 0, 'explanation': 'The point is clarity, not abstraction for its own sake.'}], heading='Construction Problem Set C')\n"
|
||||
|
|
@ -283,7 +304,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the strongest beginner-to-engineer transition in this module?', 'options': ['Moving from line-by-line execution toward deliberate block design and metric-aware comparison', 'Using more qubits', 'Avoiding diagrams'], 'correct_index': 0, 'explanation': 'This module is about workflow quality and design control.'}, {'prompt': 'How should you compare two circuit builders?', 'options': ['Against the same objective, with the same reporting layer, and with explicit cost evidence', 'Only by code length', 'Only by how familiar the gate names look'], 'correct_index': 0, 'explanation': 'Fair comparison requires stable objectives and explicit evidence.'}, {'prompt': 'What belongs in a short design memo for a reusable circuit block?', 'options': ['Intent, interface, cost, and the main tradeoff', 'Only the final counts', 'Only the block name'], 'correct_index': 0, 'explanation': 'A reusable block needs an auditable engineering story.'}], heading='Construction Problem Set D')\n"
|
||||
|
|
@ -340,7 +368,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why explicit register roles and explicit reporting layers belong in the same engineering conversation.')\n"
|
||||
|
|
@ -365,7 +400,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short design-review note critiquing a circuit builder that is shorter but less narratable than the inline version.')\n"
|
||||
|
|
@ -471,7 +513,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -502,7 +550,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef bell_block() -> QuantumCircuit:\\n block = QuantumCircuit(2, name=\"bell_prep\")\\n # [1] Encapsulate the preparation story.\\n block.h(0)\\n block.cx(0, 1)\\n return block\\n\\ndef readout_block() -> QuantumCircuit:\\n block = QuantumCircuit(2, 2, name=\"readout\")\\n # [2] Keep the question and the reporting layer reusable too.\\n block.measure([0, 1], [0, 1])\\n return block\\n\\ncircuit = QuantumCircuit(2, 2)\\n# [3] Compose blocks instead of retyping the same logic inline.\\ncircuit.compose(bell_block(), inplace=True)\\ncircuit.compose(readout_block(), inplace=True)\\n'\n",
|
||||
|
|
@ -195,7 +202,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What is the contract of your block, and what design burden did you intentionally leave outside the helper?')\n"
|
||||
|
|
@ -235,7 +249,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister\\n\\ndata = QuantumRegister(2, \"data\")\\nsyndrome = QuantumRegister(1, \"syndrome\")\\nreadout = ClassicalRegister(3, \"readout\")\\ncircuit = QuantumCircuit(data, syndrome, readout)\\n\\n# [1] Prepare a named two-qubit data block.\\ncircuit.h(data[0])\\ncircuit.cx(data[0], data[1])\\n\\n# [2] Route a parity-style question into the syndrome wire.\\ncircuit.cx(data[0], syndrome[0])\\ncircuit.cx(data[1], syndrome[0])\\n\\n# [3] Keep the reporting layer explicit.\\ncircuit.measure(data[0], readout[0])\\ncircuit.measure(data[1], readout[1])\\ncircuit.measure(syndrome[0], readout[2])\\n'\n",
|
||||
|
|
@ -267,7 +288,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which register name or split carries the most explanatory value in your design?')\n"
|
||||
|
|
@ -307,7 +335,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ndef candidate(extra_layer: bool = False) -> QuantumCircuit:\\n circuit = QuantumCircuit(3, 3)\\n # [1] Create a clean backbone.\\n circuit.h(0)\\n circuit.cx(0, 1)\\n circuit.cx(1, 2)\\n # [2] Toggle the extra layer to inspect the cost of a design choice.\\n if extra_layer:\\n circuit.cx(0, 2)\\n # [3] Keep the reporting layer stable while you compare.\\n circuit.measure([0, 1, 2], [0, 1, 2])\\n return circuit\\n\\ncircuit = candidate(extra_layer=True)\\n'\n",
|
||||
|
|
@ -339,7 +374,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What distinguishes a studio construction task from a lecture example?', 'options': ['You must choose and defend an abstraction boundary instead of merely reading one', 'It uses more markdown', 'It avoids circuit metrics'], 'correct_index': 0, 'explanation': 'The studio asks for design responsibility, not passive recognition.'}, {'prompt': 'What is the strongest sign that a block earned its place?', 'options': ['Its interface and role stay clear when another engineer reviews it in a larger circuit', 'It has the shortest possible name', 'It uses the most gates'], 'correct_index': 0, 'explanation': 'A good block remains understandable and reusable under review.'}], heading='Construction Studio Check')\n"
|
||||
|
|
@ -364,7 +406,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What is the biggest construction smell you can now recognize in your own notebook code?')\n"
|
||||
|
|
@ -389,7 +438,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which abstraction decision in this studio still feels uncertain, and what extra evidence would settle it?')\n"
|
||||
|
|
@ -512,7 +568,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -543,7 +605,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Write the abstract circuit in the cleanest form for the algorithmic intention.', 'diagram_effect': 'The first diagram expresses what you want, not yet what a constrained backend can host.', 'why_it_matters': 'Design begins with intent, but intent is not the end of the story.'}, {'marker': '[2]', 'code_focus': 'Declare a basis-gate set and a line coupling map that mimic local hardware pressure.', 'diagram_effect': 'The implicit device assumptions become explicit engineering constraints.', 'why_it_matters': 'Transpilation only becomes intelligible when the constraints are visible.'}, {'marker': '[3]', 'code_focus': 'Compile the circuit and inspect how the depth, size, and gate counts changed.', 'diagram_effect': 'The compiled diagram usually has more structure than the abstract one.', 'why_it_matters': 'Routing and basis conversion create real implementation cost.'}, {'marker': '[4]', 'code_focus': 'Compare the compiled rewrite to a topology-aware redesign.', 'diagram_effect': 'You can see whether the compiler had to rescue a poor abstract layout.', 'why_it_matters': 'Professional design does not stop at letting the compiler suffer in silence.'}])\n"
|
||||
|
|
@ -188,7 +195,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"defaults = load_experiment_defaults()\n",
|
||||
|
|
@ -228,7 +242,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the key question after a non-local circuit compiles poorly on a line?', 'options': ['Which abstract design choice created avoidable routing pressure', 'Whether Jupyter plotted it correctly', 'Whether the Bell state stopped existing'], 'correct_index': 0, 'explanation': 'The first move is to identify the topology-hostile part of the design.'}, {'prompt': 'Why keep the measurement layer simple in early transpilation exercises?', 'options': ['So the compile-time consequences stay easy to attribute', 'Because measurements block transpilation', 'Because counts do not matter'], 'correct_index': 0, 'explanation': 'Clean experiments make routing cost easier to read.'}], heading='Transpilation Lab Checkpoint A')\n"
|
||||
|
|
@ -253,7 +274,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which abstract line in the circuit is carrying the main routing burden, and how do you know?')\n"
|
||||
|
|
@ -293,7 +321,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"defaults = load_experiment_defaults()\n",
|
||||
|
|
@ -400,7 +435,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"defaults = load_experiment_defaults()\n",
|
||||
|
|
@ -440,7 +482,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is a topology-aware rewrite trying to do?', 'options': [\"Move some of the compiler's rescue work back into the original design\", 'Eliminate all two-qubit gates', 'Make every circuit look like a line'], 'correct_index': 0, 'explanation': 'A good rewrite cooperates with the topology instead of fighting it.'}, {'prompt': 'What should remain stable when you compare two compiled candidates?', 'options': ['The intended behavior and measurement protocol', 'The exact gate names in the abstract source', 'The order of markdown headings'], 'correct_index': 0, 'explanation': 'Fair comparison requires stable objectives.'}], heading='Transpilation Lab Checkpoint B')\n"
|
||||
|
|
@ -482,7 +531,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short memo explaining when the topology-aware rewrite is genuinely better and when it might overfit to one target.')\n"
|
||||
|
|
@ -507,7 +563,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Describe one compiled-circuit feature that you can now interpret causally instead of treating as arbitrary clutter.')\n"
|
||||
|
|
@ -598,7 +661,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -629,7 +698,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -212,7 +212,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Write the abstract circuit in the cleanest form for the algorithmic intention.', 'diagram_effect': 'The first diagram expresses what you want, not yet what a constrained backend can host.', 'why_it_matters': 'Design begins with intent, but intent is not the end of the story.'}, {'marker': '[2]', 'code_focus': 'Declare a basis-gate set and a line coupling map that mimic local hardware pressure.', 'diagram_effect': 'The implicit device assumptions become explicit engineering constraints.', 'why_it_matters': 'Transpilation only becomes intelligible when the constraints are visible.'}, {'marker': '[3]', 'code_focus': 'Compile the circuit and inspect how the depth, size, and gate counts changed.', 'diagram_effect': 'The compiled diagram usually has more structure than the abstract one.', 'why_it_matters': 'Routing and basis conversion create real implementation cost.'}, {'marker': '[4]', 'code_focus': 'Compare the compiled rewrite to a topology-aware redesign.', 'diagram_effect': 'You can see whether the compiler had to rescue a poor abstract layout.', 'why_it_matters': 'Professional design does not stop at letting the compiler suffer in silence.'}])\n"
|
||||
|
|
@ -237,7 +244,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"defaults = load_experiment_defaults()\n",
|
||||
|
|
@ -350,7 +364,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why is a clean abstract circuit still worth writing before compilation?', 'options': ['Because intent should be explicit before constraint-handling enters', 'Because transpilation always improves the algorithm', 'Because basis gates do not matter'], 'correct_index': 0, 'explanation': 'The abstract circuit states the target behavior in the clearest form.'}, {'prompt': 'What does a coupling map tell you?', 'options': ['Which two-qubit interactions are directly allowed by the local topology', 'How many markdown cells the notebook should contain', 'The final shot count'], 'correct_index': 0, 'explanation': 'Topology pressure is one of the main reasons compilation rewrites circuits.'}, {'prompt': 'Why do compiled circuits often get deeper?', 'options': ['Routing and basis conversion add implementation work', 'The statevector got larger', 'Measurements duplicate gates automatically'], 'correct_index': 0, 'explanation': 'Compilation cost is usually structural, not mysterious.'}], heading='Transpilation Checkpoint A')\n"
|
||||
|
|
@ -505,7 +526,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the main reason to inspect the compiled circuit directly?', 'options': ['To see what tradeoffs the transpiler actually paid on your behalf', 'To replace all analysis with pictures', 'To avoid basis gates altogether'], 'correct_index': 0, 'explanation': 'The compiled diagram is engineering evidence, not decoration.'}, {'prompt': 'When should you redesign a circuit instead of only accepting the compiler output?', 'options': ['When the compiled rewrite reveals avoidable topology hostility in the abstract design', 'Never, because the transpiler is always optimal', 'Only after hardware access'], 'correct_index': 0, 'explanation': 'Topology-aware redesign is part of professional circuit work.'}, {'prompt': 'Why compare optimization levels in a teaching notebook?', 'options': ['To learn that compilation is a design space with tradeoffs, not a single magic button', 'Because optimization level changes the number of qubits', 'Because lower levels disable measurement'], 'correct_index': 0, 'explanation': 'Compilation choices are part of the engineering story.'}], heading='Transpilation Checkpoint B')\n"
|
||||
|
|
@ -530,7 +558,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short paragraph explaining the difference between an abstract circuit being logically clear and the same circuit being implementation-friendly.')\n"
|
||||
|
|
@ -555,7 +590,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one sign in a compiled circuit that would make you consider an upstream redesign instead of only accepting the transpiler output.')\n"
|
||||
|
|
@ -661,7 +703,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -692,7 +740,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does basis-gate restriction usually force?', 'options': ['Decomposition of higher-level operations into the target gate vocabulary', 'Automatic noise mitigation', 'Fewer measurements'], 'correct_index': 0, 'explanation': 'Basis-gate sets are part of the implementation contract.'}, {'prompt': 'What is the main beginner danger in transpilation work?', 'options': ['Treating the compiled circuit as arbitrary instead of as a response to explicit constraints', 'Using a coupling map at all', 'Plotting the compiled diagram'], 'correct_index': 0, 'explanation': 'The compiled rewrite should always be read as a constrained response.'}, {'prompt': 'Why compare depth before and after compilation?', 'options': ['To quantify part of the cost of fitting the circuit to the target constraints', 'Because depth determines the statevector size directly', 'Because depth replaces code review'], 'correct_index': 0, 'explanation': 'Depth is one concrete lens on compile-time inflation.'}], heading='Transpilation Problem Set A')\n"
|
||||
|
|
@ -203,7 +210,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does a line coupling map make expensive?', 'options': ['Long-range interactions that skip intermediate qubits', 'Single-qubit gates', 'Classical registers'], 'correct_index': 0, 'explanation': 'Non-local interactions create routing pressure on a line.'}, {'prompt': 'Why is a compiled diagram worth discussing with prose?', 'options': ['Because the picture alone does not tell you which cost came from basis conversion and which came from routing', 'Because prose replaces the diagram', 'Because the compiled circuit never changes the metrics'], 'correct_index': 0, 'explanation': 'The review story should tie visible changes back to their causes.'}, {'prompt': 'What is the point of a topology-aware redesign exercise?', 'options': ['To compare compiler rescue with human foresight', 'To avoid compilation entirely', 'To force all circuits into identical shapes'], 'correct_index': 0, 'explanation': 'This is exactly where design judgment starts to matter.'}], heading='Transpilation Problem Set B')\n"
|
||||
|
|
@ -243,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should a good transpilation memo include?', 'options': ['Constraint set, pre/post metrics, and the main structural reason for the rewrite', 'Only the final counts', 'Only the number of qubits'], 'correct_index': 0, 'explanation': 'The memo should make the compile-time story auditable.'}, {'prompt': 'Why is optimization level a teaching lever here?', 'options': ['Because it shows that compilation choices affect the final structure and cost', 'Because it changes the algorithmic goal itself', 'Because it disables two-qubit gates'], 'correct_index': 0, 'explanation': 'Optimization level is part of the engineering design space.'}, {'prompt': 'What is the danger of ignoring the compiled circuit and looking only at counts?', 'options': ['You may miss severe structural inflation that matters for any realistic implementation', 'Counts already encode the full coupling map', 'There is no danger if the output looks correct'], 'correct_index': 0, 'explanation': 'Functional correctness is not the whole implementation story.'}], heading='Transpilation Problem Set C')\n"
|
||||
|
|
@ -283,7 +304,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the strongest sentence about transpilation maturity?', 'options': ['I can explain what the compiler changed, why it changed it, and what I would redesign upstream', 'I can run transpile without errors', 'I can recognize a SWAP symbol'], 'correct_index': 0, 'explanation': 'Maturity means explanatory control and redesign judgment.'}, {'prompt': 'Which comparison is most useful after compilation?', 'options': ['Abstract intent versus compiled form under stated constraints', 'Markdown versus code cell counts', 'Notebook title versus file path'], 'correct_index': 0, 'explanation': 'The entire point is to compare intent with constrained realization.'}, {'prompt': 'What should happen after you identify avoidable routing pressure?', 'options': ['Propose a topology-aware alternative and compare the metrics honestly', 'Ignore it because the transpiler handled it', 'Delete the coupling map'], 'correct_index': 0, 'explanation': 'The engineering response is redesign, not resignation.'}], heading='Transpilation Problem Set D')\n"
|
||||
|
|
@ -357,7 +385,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why the same logical circuit can have very different compiled forms under different topologies or optimization levels.')\n"
|
||||
|
|
@ -382,7 +417,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short review note on when accepting the transpiler output is good enough and when upstream redesign is the stronger choice.')\n"
|
||||
|
|
@ -488,7 +530,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -519,7 +567,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"defaults = load_experiment_defaults()\n",
|
||||
|
|
@ -203,7 +210,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What exactly did the compiler have to rescue, and what upstream change would reduce that burden?')\n"
|
||||
|
|
@ -243,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"defaults = load_experiment_defaults()\n",
|
||||
|
|
@ -283,7 +304,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What did your redesign gain, and what did it potentially give up?')\n"
|
||||
|
|
@ -323,7 +351,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"defaults = load_experiment_defaults()\n",
|
||||
|
|
@ -363,7 +398,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the core job of the transpilation studio?', 'options': ['Compare compiler rescue with human redesign under explicit constraints', 'Avoid compiled diagrams', 'Reduce everything to one metric'], 'correct_index': 0, 'explanation': 'The studio asks for engineering judgment, not only observation.'}, {'prompt': 'When is a redesign claim convincing?', 'options': ['When it states the objective, the constraints, and the evidence for why the new structure is better', 'When the circuit looks simpler at first glance', 'When it uses fewer comments'], 'correct_index': 0, 'explanation': 'Convincing redesign requires a reviewable argument.'}], heading='Transpilation Studio Check')\n"
|
||||
|
|
@ -388,7 +430,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What is the main transpilation smell you can now recognize in an abstract circuit before compiling it?')\n"
|
||||
|
|
@ -413,7 +462,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which redesign judgment in this module still feels tentative, and what extra comparison would strengthen it?')\n"
|
||||
|
|
@ -553,7 +609,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -584,7 +646,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare a small circuit with a clean ideal story that can be simulated exactly.', 'diagram_effect': 'The circuit is shallow enough that the intended behavior is easy to articulate.', 'why_it_matters': 'Noise reasoning is impossible if the ideal reference story is already blurry.'}, {'marker': '[2]', 'code_focus': 'Choose the right view: statevector, shot counts, or a noisy local model.', 'diagram_effect': 'The diagram may stay the same while the lens on it changes.', 'why_it_matters': 'Different questions require different simulators and evidence forms.'}, {'marker': '[3]', 'code_focus': 'Inject a local noise profile and compare the distribution to the ideal result.', 'diagram_effect': 'The circuit picture is unchanged, but the evidence becomes visibly distorted.', 'why_it_matters': 'Noise belongs in the interpretation layer even when the diagram looks familiar.'}, {'marker': '[4]', 'code_focus': 'Stress the design with extra two-qubit structure and see how robustness changes.', 'diagram_effect': 'A slightly deeper circuit may look only a little larger but degrade much more under noise.', 'why_it_matters': 'Structure and robustness are coupled design questions.'}])\n"
|
||||
|
|
@ -188,7 +195,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare the clean Bell-style reference.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Keep the reporting layer fixed.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -220,7 +234,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What should you compare first in a noise lab?', 'options': ['The ideal story and the empirical story under the same measurement protocol', 'Only the noisy plot', 'Only the circuit title'], 'correct_index': 0, 'explanation': 'Noise reasoning starts from a stable protocol comparison.'}, {'prompt': 'Why use a wrapper preview with a noise profile in an editable lab?', 'options': ['So the same circuit edits can be inspected under a consistent distortion model', 'Because noise removes the need for explanation', 'Because widgets cannot show ideal counts'], 'correct_index': 0, 'explanation': 'The wrapper keeps the experiment local and comparable.'}], heading='Noise Lab Checkpoint A')\n"
|
||||
|
|
@ -245,7 +266,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What does the ideal reference tell you that a single finite-shot histogram cannot?')\n"
|
||||
|
|
@ -285,7 +313,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"noisy_preview = lambda circuit, shots=256: simulate_counts(\n",
|
||||
|
|
@ -380,7 +415,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"noisy_preview = lambda circuit, shots=256: simulate_counts(\n",
|
||||
|
|
@ -418,7 +460,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"noisy_preview = lambda circuit, shots=256: simulate_counts(\n",
|
||||
|
|
@ -456,7 +505,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What does the stressed-circuit comparison teach first?', 'options': ['That small structural changes can create large robustness differences', 'That noisy simulation is random and therefore useless', 'That extra entanglers are always good'], 'correct_index': 0, 'explanation': 'Robustness is a design consequence, not merely a hardware complaint.'}, {'prompt': 'Why keep the measurement protocol fixed when comparing a shallow and a stressed circuit?', 'options': ['So the robustness difference can be attributed to structure rather than to a changed question', 'Because measurement gates cannot be edited', 'Because counts always stay identical'], 'correct_index': 0, 'explanation': 'Stable protocol is essential for fair comparison.'}], heading='Noise Lab Checkpoint B')\n"
|
||||
|
|
@ -498,7 +554,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short note explaining which difference in the stressed-circuit result you think is structural rather than mere sampling.')\n"
|
||||
|
|
@ -523,7 +586,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What would you check next if you were not yet sure whether the observed drift came from noise or from a protocol mistake?')\n"
|
||||
|
|
@ -614,7 +684,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -645,7 +721,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -208,7 +208,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"step_reference_table([{'marker': '[1]', 'code_focus': 'Prepare a small circuit with a clean ideal story that can be simulated exactly.', 'diagram_effect': 'The circuit is shallow enough that the intended behavior is easy to articulate.', 'why_it_matters': 'Noise reasoning is impossible if the ideal reference story is already blurry.'}, {'marker': '[2]', 'code_focus': 'Choose the right view: statevector, shot counts, or a noisy local model.', 'diagram_effect': 'The diagram may stay the same while the lens on it changes.', 'why_it_matters': 'Different questions require different simulators and evidence forms.'}, {'marker': '[3]', 'code_focus': 'Inject a local noise profile and compare the distribution to the ideal result.', 'diagram_effect': 'The circuit picture is unchanged, but the evidence becomes visibly distorted.', 'why_it_matters': 'Noise belongs in the interpretation layer even when the diagram looks familiar.'}, {'marker': '[4]', 'code_focus': 'Stress the design with extra two-qubit structure and see how robustness changes.', 'diagram_effect': 'A slightly deeper circuit may look only a little larger but degrade much more under noise.', 'why_it_matters': 'Structure and robustness are coupled design questions.'}])\n"
|
||||
|
|
@ -233,7 +240,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"editable_code = '\\nfrom qiskit import QuantumCircuit\\n\\ncircuit = QuantumCircuit(2, 2)\\n# [1] Prepare the clean Bell-style reference.\\ncircuit.h(0)\\ncircuit.cx(0, 1)\\n# [2] Keep the reporting layer fixed.\\ncircuit.measure([0, 1], [0, 1])\\n'\n",
|
||||
|
|
@ -307,7 +321,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the main difference between a statevector view and a shot-count view?', 'options': ['One describes the ideal pre-measurement object, the other gives sampled evidence from a chosen question', 'One uses qubits and the other uses classical bits only', 'They are interchangeable in all contexts'], 'correct_index': 0, 'explanation': 'The right simulator depends on what question you are asking.'}, {'prompt': 'Why keep an ideal reference before discussing noise?', 'options': ['Because you need a clean story to compare the distortion against', 'Because noise models cannot be local', 'Because counts are not allowed without it'], 'correct_index': 0, 'explanation': 'Noise interpretation collapses if the ideal target is already vague.'}, {'prompt': 'What kind of structural choice often hurts robustness first?', 'options': ['Extra two-qubit depth', 'Using markdown reflections', 'Naming registers'], 'correct_index': 0, 'explanation': 'Two-qubit structure is usually the first place local noise hurts visibly.'}], heading='Noise Checkpoint A')\n"
|
||||
|
|
@ -462,7 +483,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why compare ideal counts, sampled counts, and noisy counts in one module?', 'options': ['To separate model, sampling variation, and distortion caused by the noise profile', 'Because one view is never enough to be valid', 'Because the noisy view replaces the ideal one'], 'correct_index': 0, 'explanation': 'The three-way comparison clarifies what kind of deviation you are seeing.'}, {'prompt': 'What is the point of a local demo noise model in this course?', 'options': ['To teach disciplined comparison without requiring cloud access', 'To imitate every hardware detail exactly', 'To avoid discussing readout error'], 'correct_index': 0, 'explanation': 'The model is pedagogical and local-first, not a claim of perfect realism.'}, {'prompt': 'When is a deviation likely structural rather than mere sampling noise?', 'options': ['When it persists at high shot count and lines up with the noise-sensitive parts of the circuit', 'When a single 64-shot run looks strange', 'Whenever a histogram is not perfectly balanced'], 'correct_index': 0, 'explanation': 'Persistent, structure-aligned deviations deserve deeper explanation.'}], heading='Noise Checkpoint B')\n"
|
||||
|
|
@ -487,7 +515,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain why the same circuit should usually be inspected through all three lenses: ideal model, sampled evidence, and noisy evidence.')\n"
|
||||
|
|
@ -512,7 +547,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Name one structural reason a circuit might drift more under noise even when the logical objective stayed the same.')\n"
|
||||
|
|
@ -618,7 +660,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -649,7 +697,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the cleanest role of a statevector in a noise module?', 'options': ['It supplies the ideal reference description before noisy evidence is considered', 'It models readout error directly', 'It replaces the need for shots'], 'correct_index': 0, 'explanation': 'Ideal reference and noisy evidence serve different explanatory roles.'}, {'prompt': 'Why can a histogram drift even when the circuit did not change?', 'options': ['Finite-shot sampling introduces ordinary variation', 'The measurement basis changes on its own', 'The qubit count increases during execution'], 'correct_index': 0, 'explanation': 'Sampling noise should be named before deeper causes are assumed.'}, {'prompt': 'What does a local noise model help you ask?', 'options': [\"How a circuit's structure reacts to a controlled distortion pattern\", 'Which cloud token to request', 'How to avoid statevectors forever'], 'correct_index': 0, 'explanation': 'The model is for comparison and interpretation, not remote access.'}], heading='Noise Problem Set A')\n"
|
||||
|
|
@ -203,7 +210,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'Why are extra two-qubit layers worth stress-testing?', 'options': ['They often increase sensitivity to local noise substantially', 'They always reduce depth', 'They remove readout error'], 'correct_index': 0, 'explanation': 'Extra entangling structure is a natural robustness risk.'}, {'prompt': 'What is a useful three-way comparison in this module?', 'options': ['Ideal probabilities, sampled counts, and noisy counts', 'Notebook title, file path, and font size', 'Only low-shot and high-shot counts'], 'correct_index': 0, 'explanation': 'The three-way comparison separates different kinds of deviation.'}, {'prompt': \"What is the danger of calling every mismatch 'noise' immediately?\", 'options': ['You may ignore protocol mistakes or structural design choices that also explain the deviation', 'There is no danger if the circuit is small', 'Noise is always the deepest explanation'], 'correct_index': 0, 'explanation': 'Good debugging names ordinary causes before romantic ones.'}], heading='Noise Problem Set B')\n"
|
||||
|
|
@ -243,7 +257,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'When does a deviation become more credible as a structural noise effect?', 'options': ['When it tracks the parts of the circuit most exposed to the chosen error model and persists under repeated runs', 'When it appears once at low shot count', 'When the compiled circuit looks longer'], 'correct_index': 0, 'explanation': 'Persistent structure-aligned drift deserves a stronger claim.'}, {'prompt': 'Why compare a lean candidate and a stressed candidate under the same noise profile?', 'options': ['To isolate the effect of structural cost on robustness', 'Because two candidates are required in every notebook', 'Because the lean circuit has no statevector'], 'correct_index': 0, 'explanation': 'The comparison is about design consequences, not variety for its own sake.'}, {'prompt': 'What belongs in a short noise memo?', 'options': ['The ideal target, the observed distortion, and the structural reason you think the gap appeared', 'Only the backend name', 'Only the highest bar in the histogram'], 'correct_index': 0, 'explanation': 'A useful memo ties evidence back to a causal story.'}], heading='Noise Problem Set C')\n"
|
||||
|
|
@ -283,7 +304,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the strongest sentence about noise maturity?', 'options': ['I can say which mismatch is probably sampling, which is probably protocol, and which is plausibly structural noise', 'I can plot a histogram', 'I know that all real hardware is noisy'], 'correct_index': 0, 'explanation': 'Maturity means discriminating between kinds of failure.'}, {'prompt': 'Why does this course keep the main noise path local?', 'options': ['Because disciplined interpretation can be trained without cloud dependence', 'Because local models are always perfectly realistic', 'Because noise only exists in notebooks'], 'correct_index': 0, 'explanation': 'The goal is clean pedagogy and reproducibility, not false realism claims.'}, {'prompt': 'What should happen after you identify a noise-sensitive circuit region?', 'options': ['Propose a leaner or better-structured alternative and compare it honestly', 'Stop using the circuit entirely', 'Increase the markdown count'], 'correct_index': 0, 'explanation': 'The engineering response is redesign, not resignation.'}], heading='Noise Problem Set D')\n"
|
||||
|
|
@ -357,7 +385,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Explain the difference between a circuit that is sampling-noisy and a circuit that is structurally vulnerable to the chosen local error model.')\n"
|
||||
|
|
@ -382,7 +417,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Write a short memo on how you would compare two candidate circuits under the same noise model without overclaiming from the results.')\n"
|
||||
|
|
@ -488,7 +530,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 5,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -519,7 +567,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"noisy_preview = lambda circuit, shots=256: simulate_counts(\n",
|
||||
|
|
@ -201,7 +208,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What part of the observed drift do you think comes from the chosen noise model rather than from a changed question?')\n"
|
||||
|
|
@ -241,7 +255,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"noisy_preview = lambda circuit, shots=256: simulate_counts(\n",
|
||||
|
|
@ -279,7 +300,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"noisy_preview = lambda circuit, shots=256: simulate_counts(\n",
|
||||
|
|
@ -317,7 +345,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which candidate would you ship as the local teaching example, and what evidence actually supports that choice?')\n"
|
||||
|
|
@ -357,7 +392,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"custom_profile = build_demo_noise_model(single_qubit_error=0.002, two_qubit_error=0.12, readout_error=0.06)\n",
|
||||
|
|
@ -396,7 +438,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"quiz_block([{'prompt': 'What is the core job of the noise studio?', 'options': ['Compare candidate circuits under the same distortion model and defend a robustness judgment', 'Avoid ideal references', 'Treat every histogram difference as proof of hardware failure'], 'correct_index': 0, 'explanation': 'The studio is about disciplined robustness comparison.'}, {'prompt': 'What makes a noise design memo convincing?', 'options': ['A stable protocol, explicit evidence, and a structural explanation for the observed gap', 'Only a large number of shots', 'Only the prettiest plot'], 'correct_index': 0, 'explanation': 'Good memos tie distortion back to design structure and evidence.'}], heading='Noise Studio Check')\n"
|
||||
|
|
@ -421,7 +470,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('What is the main robustness smell you can now recognize in a circuit before simulating it under noise?')\n"
|
||||
|
|
@ -446,7 +502,14 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"reflection_box('Which part of your noise reasoning still feels too dependent on one chosen local model, and how would you test that weakness?')\n"
|
||||
|
|
@ -584,7 +647,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "test",
|
||||
"ql_difficulty": 6,
|
||||
"ql_note": "Optional multiple-choice extension."
|
||||
"ql_note": "Optional multiple-choice extension.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -615,7 +684,13 @@
|
|||
"ql_track": "facultative",
|
||||
"ql_role": "exercise",
|
||||
"ql_difficulty": 7,
|
||||
"ql_note": "Optional written exercise."
|
||||
"ql_note": "Optional written exercise.",
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
},
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
|
|||
|
|
@ -55,6 +55,16 @@ PALETTES = {
|
|||
},
|
||||
}
|
||||
|
||||
WRAPPER_SYMBOLS = (
|
||||
"quiz_block(",
|
||||
"reflection_box(",
|
||||
"editable_circuit_lab(",
|
||||
"step_reference_table(",
|
||||
"rubric_scorecard(",
|
||||
"feedback_iteration_panel(",
|
||||
"evidence_checklist(",
|
||||
)
|
||||
|
||||
|
||||
def cell_id(index: int, cell: dict) -> str:
|
||||
source = "".join(cell.get("source", []))
|
||||
|
|
@ -140,6 +150,19 @@ def replace_text(path: Path, replacements: list[tuple[str, str]]) -> None:
|
|||
save_notebook(path, notebook)
|
||||
|
||||
|
||||
def should_hide_code_input(text: str) -> bool:
|
||||
return any(symbol in text for symbol in WRAPPER_SYMBOLS)
|
||||
|
||||
|
||||
def hide_code_input(cell: dict) -> None:
|
||||
metadata = cell.setdefault("metadata", {})
|
||||
metadata.setdefault("jupyter", {})
|
||||
metadata["jupyter"]["source_hidden"] = True
|
||||
tags = metadata.setdefault("tags", [])
|
||||
if "hide-input" not in tags:
|
||||
tags.append("hide-input")
|
||||
|
||||
|
||||
def build_course_complete() -> None:
|
||||
path = completion_notebook_path()
|
||||
cells = [
|
||||
|
|
@ -209,6 +232,7 @@ def ensure_navigation() -> None:
|
|||
notebook = load_notebook(path)
|
||||
previous_step = steps[index - 1] if index > 0 else None
|
||||
next_step = steps[index + 1] if index + 1 < total_steps else None
|
||||
kind = notebook_kind(path)
|
||||
|
||||
prev_line = (
|
||||
f"Previous notebook: [{previous_step.title}]({relative_link(path, previous_step.absolute_path)})"
|
||||
|
|
@ -233,7 +257,15 @@ def ensure_navigation() -> None:
|
|||
f"{NAV_BOTTOM_MARKER}\n"
|
||||
"## What To Open Next\n\n"
|
||||
f"{next_line}\n\n"
|
||||
"This is the end of the mandatory walkthrough. Anything below this cell is facultative."
|
||||
"This is the end of the mandatory walkthrough."
|
||||
)
|
||||
elif kind == "meta":
|
||||
bottom_text = (
|
||||
f"{NAV_BOTTOM_MARKER}\n"
|
||||
"## What To Open Next\n\n"
|
||||
f"{next_line}\n\n"
|
||||
"Official walkthrough rule: after you finish the cells above, open the next notebook. "
|
||||
"There is no facultative material in this notebook."
|
||||
)
|
||||
else:
|
||||
bottom_text = (
|
||||
|
|
@ -538,11 +570,11 @@ def facultative_reflection_source(kind: str, title: str) -> str:
|
|||
|
||||
|
||||
def build_facultative_extension_cells(path: Path, notebook: dict) -> list[dict]:
|
||||
if path.name == "COURSE_COMPLETE.ipynb":
|
||||
kind = notebook_kind(path)
|
||||
if kind == "meta" or path.name == "COURSE_COMPLETE.ipynb":
|
||||
return []
|
||||
|
||||
title = extract_title(notebook, path.stem.replace("_", " ").title())
|
||||
kind = notebook_kind(path)
|
||||
zone_cells = [
|
||||
markdown_cell(
|
||||
f"{OPTIONAL_ZONE_MARKER}\n"
|
||||
|
|
@ -661,6 +693,8 @@ def annotate_notebook(path: Path) -> None:
|
|||
annotated_cells.append(badge_markdown_content(cell, track, role, difficulty, note))
|
||||
markdown_index += 1
|
||||
else:
|
||||
if should_hide_code_input(cell_text(cell)):
|
||||
hide_code_input(cell)
|
||||
annotated_cells.append(badge_markdown_cell(track, role, difficulty, note))
|
||||
annotated_cells.append(cell)
|
||||
|
||||
|
|
|
|||
|
|
@ -116,3 +116,26 @@ def test_notebooks_use_explicit_cell_labels_and_difficulty_scheme():
|
|||
assert "FACULTATIVE READING" in lecture_text
|
||||
assert "FACULTATIVE TEST" in lecture_text
|
||||
assert "FACULTATIVE EXERCISE" in lecture_text
|
||||
|
||||
|
||||
def test_meta_route_notebooks_do_not_offer_facultative_extensions():
|
||||
for rel in ["notebooks/START_HERE.ipynb", "notebooks/COURSE_BLUEPRINT.ipynb", "notebooks/COURSE_COMPLETE.ipynb"]:
|
||||
text = _notebook_text(project_root() / rel)
|
||||
assert "FACULTATIVE READING" not in text
|
||||
assert "FACULTATIVE TEST" not in text
|
||||
assert "FACULTATIVE EXERCISE" not in text
|
||||
assert "Difficulty 4/10" not in text
|
||||
|
||||
|
||||
def test_widget_wrapper_code_cells_are_hidden_from_learners():
|
||||
path = project_root() / "notebooks" / "START_HERE.ipynb"
|
||||
data = json.loads(path.read_text())
|
||||
hidden_wrapper_found = False
|
||||
for cell in data["cells"]:
|
||||
if cell["cell_type"] != "code":
|
||||
continue
|
||||
source = "".join(cell.get("source", []))
|
||||
if "quiz_block(" in source or "reflection_box(" in source:
|
||||
hidden_wrapper_found = True
|
||||
assert cell.get("metadata", {}).get("jupyter", {}).get("source_hidden") is True
|
||||
assert hidden_wrapper_found
|
||||
|
|
|
|||
Loading…
Reference in a new issue