Skip to content

Overhaul Qmod Tutorial (Part I & II) - #1714

Open
matanvax2 wants to merge 1 commit into
mainfrom
Product/matanvax2/basic-qmod-tutorial
Open

Overhaul Qmod Tutorial (Part I & II)#1714
matanvax2 wants to merge 1 commit into
mainfrom
Product/matanvax2/basic-qmod-tutorial

Conversation

@matanvax2

@matanvax2 matanvax2 commented Aug 15, 2026

Copy link
Copy Markdown
Member

Summary

Rewrites the two Classiq Tutorial notebooks (Qmod_tutorial_part1.ipynb, Qmod_tutorial_part2.ipynb) into a cohesive two-part Qmod Tutorial:

  • A run-and-see Warmup (Bell state) showing the synthesize → show → sample flow.
  • Part I — language foundations (6 sections): quantum variables & types, output parameters & state-prep, classical parameters, classical control flow, quantum assignment & arithmetic, control statements.
  • Part II — statements & operators for real algorithms (6 sections): phase statements, local variables & auto-uncomputation, within-apply, Hamiltonians/Pauli/suzuki_trotter/observe, higher-order functions (incl. built-in qpe), execution parameters & hybrid execution.
  • Each section is a concept + a runnable # TODO exercise skeleton, with a collected Solutions section per notebook (every solution is a complete, executable cell, so CI actually runs it).

🤖 Generated with Claude Code

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Rewrite Qmod_tutorial_part1 and Qmod_tutorial_part2 into a cohesive
two-part Qmod tutorial: a run-and-see warmup, numbered concept/exercise
sections, and a collected Solutions section per part.

Both notebooks execute end-to-end and pass the testbook harness under the
CI config (filterwarnings=error). Fixes in Part II: removed a stray %%sql
cell and renamed a Hamiltonian variable that had shadowed the built-in
Hadamard gate H.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@matanvax2
matanvax2 force-pushed the Product/matanvax2/basic-qmod-tutorial branch from 7a6ddaa to e5f570c Compare August 16, 2026 09:23
@@ -5,518 +5,376 @@
"id": "0",

@Alexandre-Classiq Alexandre-Classiq Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They generate a flat unrolled description, which can impact compilation performance.

I don't think that this statement is useful here. This is a beginner tutorial, and this information isn't beginner-friendly. I would introduce it later, perhaps in the advanced tutorial or the user guide itself.


Reply via ReviewNB

@matanvax2 matanvax2 Aug 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you talking about the note as a whole, or just the second sentence? I need the note as a whole because QAEs are teaching people, in a first Qmod training, to use Python control flow by default, and I need to mention this as a possibility, but advise against it for the reasons I mention. Indeed this should be covered in more depth in an advanced tutorial.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm talking about specifically "They generate a flat unrolled description" - if the targeted reader doesn't yet know the terminology this will sound like a lot of words that they can't comprehend

@@ -4,366 +4,320 @@
"cell_type": "markdown",

@Alexandre-Classiq Alexandre-Classiq Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cell is not looking well, but might be just a rendering problem from reviewNB


Reply via ReviewNB

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you seeing? What specifically is messed up?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Font is bigger and bold. + the paragraph starts with a >

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it renders fine, but it was looking like a header. It was probably some reviewNB bug

@@ -4,366 +4,320 @@
"cell_type": "markdown",

@Alexandre-Classiq Alexandre-Classiq Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Exercise C: Measure <Z_i> for a system with N>i+1 qubits. This is important because Z_i is a Pauli operator acting over i+1 qubits, while you need to measure an N-qubit system.


Reply via ReviewNB

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually consider this a bug. I filed a ticket and synced Dror.

https://classiq.atlassian.net/browse/CLS-10035

@@ -4,366 +4,320 @@
"cell_type": "markdown",

@Alexandre-Classiq Alexandre-Classiq Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same rendering problem as above


Reply via ReviewNB

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same..

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It renders fine. I think it was reviewNB.

@Alexandre-Classiq Alexandre-Classiq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments, overall looking great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants