QuantumLearning/notebooks/qiskit_engineering/module_02_transpilation_and_visualization/problems.ipynb

544 lines
27 KiB
Text

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"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 · Notebook-level rule, objective, or usage guidance.\n",
"</div>\n",
"\n",
"# Transpilation and Visualization Problems\n",
"\n",
"This notebook checks whether compile-time thinking is becoming explicit. The questions focus on constraints, routing pressure, metric interpretation, and redesign judgment.\n"
],
"id": "004bcb69"
},
{
"cell_type": "markdown",
"metadata": {},
"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 · Official walkthrough guardrail.\n",
"</div>\n",
"\n",
"<!-- COURSE_NAV_TOP -->\n",
"## Mainline Navigation\n",
"\n",
"Step 21 of 59. Follow the official walkthrough in order.\n",
"\n",
"Previous notebook: [Transpilation and Visualization Lab](lab.ipynb)\n",
"\n",
"Next notebook: [Transpilation and Visualization Studio](studio.ipynb)\n",
"\n",
"Rule: complete the mandatory cells in this notebook before you open the next one.\n"
],
"id": "770cc7bd"
},
{
"cell_type": "markdown",
"metadata": {},
"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 · Notebook-level rule, objective, or usage guidance.\n",
"</div>\n",
"\n",
"## How To Use This Notebook\n",
"\n",
"Answer as if you were preparing short review comments for another engineer. The goal is not only to know facts about transpilation but to speak about compile-time consequences precisely.\n"
],
"id": "bcb253e3"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "setup"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #6b7280; background:#e5e7eb; color:#111827; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY SETUP</strong> · Difficulty 1/10 · Environment, import, or helper cell required by the notebook.\n",
"</div>\n"
],
"id": "36a43fbf"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from pathlib import Path\n",
"import sys\n",
"\n",
"project_root = Path.cwd().resolve()\n",
"while not (project_root / \"pyproject.toml\").exists():\n",
" if project_root.parent == project_root:\n",
" raise RuntimeError(\"Could not locate the project root from this notebook.\")\n",
" project_root = project_root.parent\n",
"\n",
"src_path = project_root / \"src\"\n",
"if str(src_path) not in sys.path:\n",
" sys.path.insert(0, str(src_path))\n"
],
"id": "50c7b992"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "exercise"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY EXERCISE</strong> · Difficulty 3/10 · Official walkthrough runnable or written exercise.\n",
"</div>\n"
],
"id": "6ce28ece"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from quantum_learning import (\n",
" build_demo_noise_model,\n",
" counts_to_probabilities,\n",
" draw_circuit,\n",
" editable_circuit_lab,\n",
" line_coupling_map,\n",
" load_experiment_defaults,\n",
" plot_counts,\n",
" plot_probabilities,\n",
" quiz_block,\n",
" reflection_box,\n",
" simulate_counts,\n",
" statevector_probabilities,\n",
" step_reference_table,\n",
" transpile_summary,\n",
")\n",
"from qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister\n",
"from qiskit.providers.basic_provider import BasicSimulator\n"
],
"id": "499342c3"
},
{
"cell_type": "markdown",
"metadata": {},
"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 · Notebook-level rule, objective, or usage guidance.\n",
"</div>\n",
"\n",
"## Transpilation Problem Set A\n",
"\n",
"Treat these quizzes as compact design-review drills. You are practicing the sentences that make compiled circuits intelligible.\n"
],
"id": "c3d234be"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "test"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY TEST</strong> · Difficulty 3/10 · Official walkthrough multiple-choice test.\n",
"</div>\n"
],
"id": "4d2d170d"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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"
],
"id": "fa6ddc3f"
},
{
"cell_type": "markdown",
"metadata": {},
"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 · Notebook-level rule, objective, or usage guidance.\n",
"</div>\n",
"\n",
"## Transpilation Problem Set B\n",
"\n",
"Treat these quizzes as compact design-review drills. You are practicing the sentences that make compiled circuits intelligible.\n"
],
"id": "fb739875"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "test"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY TEST</strong> · Difficulty 3/10 · Official walkthrough multiple-choice test.\n",
"</div>\n"
],
"id": "a72df115"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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"
],
"id": "170f53c4"
},
{
"cell_type": "markdown",
"metadata": {},
"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 · Notebook-level rule, objective, or usage guidance.\n",
"</div>\n",
"\n",
"## Transpilation Problem Set C\n",
"\n",
"Treat these quizzes as compact design-review drills. You are practicing the sentences that make compiled circuits intelligible.\n"
],
"id": "9833afde"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "test"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY TEST</strong> · Difficulty 3/10 · Official walkthrough multiple-choice test.\n",
"</div>\n"
],
"id": "2d739bba"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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"
],
"id": "0e3be81f"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY READING</strong> · Difficulty 2/10 · Official walkthrough reading cell.\n",
"</div>\n",
"\n",
"## Transpilation Problem Set D\n",
"\n",
"Treat these quizzes as compact design-review drills. You are practicing the sentences that make compiled circuits intelligible.\n"
],
"id": "7aa70b86"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "test"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY TEST</strong> · Difficulty 3/10 · Official walkthrough multiple-choice test.\n",
"</div>\n"
],
"id": "81b9a6e6"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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"
],
"id": "317836d1"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY READING</strong> · Difficulty 2/10 · Official walkthrough reading cell.\n",
"</div>\n",
"\n",
"## Mini Case: Correct Output, Expensive Realization\n",
"\n",
"One of the central lessons of this module is that functional correctness does not end the engineering discussion. Two circuits can implement the same logical objective and even produce the same sampled evidence while having very different compile-time cost. If you ignore that, you will think the transpiler is only a performance detail. It is not. It is part of the design story.\n",
"\n",
"The quizzes above are therefore not only about definitions. They are practice in keeping implementation cost visible even when the logical story stayed stable. That distinction is one of the main differences between being able to run circuits and being able to engineer them.\n"
],
"id": "c02dc14b"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY READING</strong> · Difficulty 2/10 · Official walkthrough reading cell.\n",
"</div>\n",
"\n",
"## Mini Case: Same Intent, Better Topology Cooperation\n",
"\n",
"A useful transpilation exercise is to imagine two teammates proposing circuits for the same local objective. One writes the conceptually shortest abstract circuit and leaves the routing burden to the compiler. The other writes a slightly more topology-aware version that is less elegant at first glance but compiles more gently. Which one is better? The only serious answer is: compare them under the same constraints and state the tradeoff honestly.\n",
"\n",
"This mini case is here to reinforce that transpilation reasoning is not about punishing abstraction. It is about deciding when abstract elegance and physical cooperation pull in different directions and writing down that tension clearly.\n"
],
"id": "c3cc65ef"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY READING</strong> · Difficulty 2/10 · Official walkthrough reading cell.\n",
"</div>\n",
"\n",
"## Written Checks\n",
"\n",
"Use the prompts below to rehearse the core explanatory loop of this module: state the constraints, describe the rewrite, and justify the redesign recommendation.\n"
],
"id": "0e06767b"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "exercise"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY EXERCISE</strong> · Difficulty 3/10 · Official walkthrough runnable or written exercise.\n",
"</div>\n"
],
"id": "c5a957cd"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"reflection_box('Explain why the same logical circuit can have very different compiled forms under different topologies or optimization levels.')\n"
],
"id": "5d1e0c9e"
},
{
"cell_type": "markdown",
"metadata": {
"ql_injected": "badge",
"ql_track": "mandatory",
"ql_role": "exercise"
},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY EXERCISE</strong> · Difficulty 3/10 · Official walkthrough runnable or written exercise.\n",
"</div>\n"
],
"id": "16f3fa60"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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"
],
"id": "ae7348c7"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!-- QL_BADGE -->\n",
"<div style=\"padding:0.55rem 0.8rem; border-left:6px solid #15803d; background:#dcfce7; color:#14532d; border-radius:0.35rem; font-family:Helvetica, Arial, sans-serif; margin:0.15rem 0 0.85rem 0;\">\n",
"<strong>MANDATORY READING</strong> · Difficulty 2/10 · Official walkthrough reading cell.\n",
"</div>\n",
"\n",
"## Exit Condition\n",
"\n",
"Move on only when you can read a compiled circuit as a constrained implementation, not as unexplained visual clutter.\n"
],
"id": "bd2151e6"
},
{
"cell_type": "markdown",
"metadata": {},
"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 · Official walkthrough guardrail.\n",
"</div>\n",
"\n",
"<!-- COURSE_NAV_BOTTOM -->\n",
"## What To Open Next\n",
"\n",
"Next notebook: [Transpilation and Visualization Studio](studio.ipynb)\n",
"\n",
"Official walkthrough rule: once every mandatory cell above is complete, open the next notebook. Anything below this cell is facultative.\n"
],
"id": "45070437"
},
{
"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 **Transpilation and Visualization Problems**. Everything below is optional. Use it only if you want deeper consolidation or extra transfer work.\n"
],
"id": "85a10d75"
},
{
"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",
"Use this optional problems extension only if you want stronger diagnostic habits. In **Transpilation and Visualization Problems**, the useful move is not just to know the right answer; it is to record which wrong answer tempted you and what that says about your current mental model.\n"
],
"id": "498a5103"
},
{
"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 5/10 · Optional multiple-choice extension.\n",
"</div>\n"
],
"id": "c16da1b4"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ql_injected": "facultative",
"ql_track": "facultative",
"ql_role": "test",
"ql_difficulty": 5,
"ql_note": "Optional multiple-choice extension."
},
"outputs": [],
"source": [
"quiz_block([{'prompt': 'Why revisit a missed question in a facultative problems block?', 'options': ['To name the specific misconception that produced the miss', 'To memorize the right option letter only', 'To skip written explanation entirely'], 'correct_index': 0, 'explanation': 'The value is diagnostic precision, not rote recovery.'}, {'prompt': 'What should an optional error log contain?', 'options': ['The tempting wrong model and the corrected model', 'Only the final score', 'Only the notebook path'], 'correct_index': 0, 'explanation': 'The error log is useful when it captures the broken idea, not just the result.'}], heading='Facultative Extension Test')\n"
],
"id": "0b720bc5"
},
{
"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 6/10 · Optional written exercise.\n",
"</div>\n"
],
"id": "2f86dd13"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ql_injected": "facultative",
"ql_track": "facultative",
"ql_role": "exercise",
"ql_difficulty": 6,
"ql_note": "Optional written exercise."
},
"outputs": [],
"source": [
"reflection_box('Name one tempting wrong answer pattern from Transpilation and Visualization Problems and write the shortest correction that would stop you from repeating it.')\n"
],
"id": "eada569d"
}
],
"metadata": {
"kernelspec": {
"display_name": "QuantumLearning (.venv)",
"language": "python",
"name": "quantum-learning"
},
"language_info": {
"name": "python",
"version": "3.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}