Skip to content

Update tutorial template and details, remove serverless#5033

Open
vrpascuzzi wants to merge 3 commits intoQiskit:mainfrom
vrpascuzzi:tutorial-template-update-qkt
Open

Update tutorial template and details, remove serverless#5033
vrpascuzzi wants to merge 3 commits intoQiskit:mainfrom
vrpascuzzi:tutorial-template-update-qkt

Conversation

@vrpascuzzi
Copy link
Copy Markdown
Collaborator

This commit update the tutorial to use the latest template.

Additionally, we add details about the training dataset and reference to further background for the inquisitive reader so as to not overwhelm the text with group theory. This addition is to address #4929.

Finally, we remove the bit on serverless for two primary reasons:

  1. the workload is small and can be easily performed on a laptop,
  2. serverless nodes appear to not have the necessary modules installed (e.g., pandas)

It is suggested to include serverless in an SQD-type tutorial or standalone.

Closes #4929.

This commit update the tutorial to use the latest template.

Additionally, we add details about the training dataset and
reference to further background for the inquisitive reader so as to
not overwhelm the text with group theory. This addition is to
address Qiskit#4929.

Finally, we remove the bit on serverless for two primary reasons:

1. the workload is  small and can be easily performed on a laptop,
2. serverless nodes appear to not have the necessary modules
   installed (e.g., pandas)

It is suggested to include serverless in an SQD-type tutorial or
standalone.

Closes Qiskit#4929.
@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

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 24, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ henryzou50
❌ vrpascuzzi
You have signed the CLA already but the status is still pending? Let us recheck it.

@qiskit-bot
Copy link
Copy Markdown
Contributor

One or more of the following people are relevant to this code:

  • @nathanearnestnoble
  • @vrpascuzzi

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@arnaucasau arnaucasau removed their request for review April 24, 2026 21:06
Copy link
Copy Markdown
Collaborator

@henryzou50 henryzou50 left a comment

Choose a reason for hiding this comment

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

@vrpascuzzi Thanks for porting this to the new tutorial template and great work so far! A few things to address before merging.

Structural

1. Restructure to match the tutorial template's small/large-scale layout

The template organizes tutorials around two top-level sections — ## Small-scale example and ## Large-scale example — with the four pattern steps nested under each as ### headings (e.g., ### Step 1: Map classical inputs to a quantum problem). This PR currently uses ## for the steps and has a single hardware example without that framing.

Could you restructure it to:

  • Wrap the existing hardware example under ## Small-scale example (it's fine for the small-scale section to run on hardware rather than a simulator if that's the natural fit here), and demote the four steps from ## to ###.
  • Add a ## Large-scale example section for the large-scale hardware example or explain why a larger hardware run isn't included or is tricky to demonstrate here (e.g., kernel matrix construction scales as O(N²) circuits, hardware time/cost, fidelity at depth, etc.), so readers understand the scope is intentional and know what would change at scale.

This keeps the tutorial aligned with the template structure even though we're only shipping the small-scale run.

Code

2. Remove the named service credential

In Step 2:

service = QiskitRuntimeService(name="solutions_demo_premium")

3. Fix job_tags format

In Step 3:

sampler.options.environment.job_tags = ["quantum-kernel-training-demo"]

This doesn't match the convention used across the other tutorials. It should be the short TUT_* tag:

sampler.options.environment.job_tags = ["TUT_QKT"]

4. !wget is not portable

In the Setup cell:

!wget https://raw.githubusercontent.com/qiskit-community/prototype-quantum-kernel-training/main/data/dataset_graph7.csv

wget is not installed by default on macOS (only curl is), so this cell will fail for any reader on Mac with zsh:1: command not found: wget. Consider either:

  • Switching to !curl -O <url> (works on macOS and Linux out of the box), or
  • Using Python's urllib.request.urlretrieve(...) for full portability.

If we keep wget, we should at least add a note telling macOS readers to install it (brew install wget) or use curl instead.

5. qiskit-ibm-catalog is listed but never used

The Requirements section lists Qiskit IBM Catalog v0.14.0 or later, but I don't see qiskit_ibm_catalog imported or used anywhere in the notebook. Either remove it from Requirements, or add the missing usage.

Content / consistency issues

6. Stray paragraph in the Background that the tutorial doesn't actually deliver on

The Background ends with:

In this lesson we will examine the depths of pre-coded encoding circuits that use substantial entanglement and compare those to depths of circuits we code by hand. This is not to advocate for one method over another. You may find that pre-coded circuits are too deep, and that the entanglement in the custom-built circuit is insufficient to be useful. Again, these are shown only to enable your exploration.

The notebook never actually compares pre-coded vs. hand-coded encoding circuit depths. This paragraph appears to be left over from a different version and should be removed (or the comparison should be added).

7. Step 2 description references an "observable" that isn't produced

Step 2 says:

Output: Target circuit and observable, optimized for the selected QPU

But the step only produces a transpiled circuit; there's no "observable". Drop "and observable" so the I/O matches the code.

8. Step 3 references a commented-out alternative block that doesn't exist

Step 3 markdown says:

To run on qiskit statevector-based primitives, replace the block of code using Qiskit IBM® Runtime primitives with the commented block.

…but there is no commented block in the following code cell. Either add the statevector alternative as commented code, or remove this sentence.

@github-project-automation github-project-automation Bot moved this to In Review in Docs Planning Apr 30, 2026
@henryzou50
Copy link
Copy Markdown
Collaborator

@vrpascuzzi Also when you get the chance, can you sign the CLA?

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

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Quantum kernel training: Additional explanations of context and data content & usage could enhance user experience

4 participants