Qiskit / Qiskit/documentation

[Content Request] Add practical steps for local setup and real hardware execution to QML tutorial

Open
#4,907 0 comments 0 reactions 2 assignees View on GitHub

@kcmccormibm is already working on this.

Since Mar 31, 2026.

content 📄 course 🎓
Dominant language
Jupyter Notebook
Stars
106
Forks
223
Avg merge
1d 8h
Merged PRs (30d)
72

Description

URL to the relevant tutorial

https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning/introduction

Select all that apply
  • new content request
  • typo
  • code bug
  • out-of-date content
  • broken link
  • other
Describe the fix or the content request.

The current introductory tutorial for Quantum Machine Learning provides a great conceptual framework, but it presents significant roadblocks for users trying to run the code on their local machines and execute it on actual IBM quantum hardware. The current code defaults to local simulation and uses OS-dependent commands that fail in local environments.

What value does the new content bring?

By adding these practical steps, readers will truly understand how to transition code from a theoretical simulation to a real QPU. It removes friction for learners building on their own machines rather than relying solely on cloud notebooks.

Specific Content Requests / Fixes:

1. Local Dataset Handling (!wget issue):

The code currently uses !wget to download dataset_graph7.csv. This system command fails on Windows machines or local environments without wget installed.

Proposed Fix: Replace the system command with a robust Python-native solution using pandas to read directly from the URL.

# Replace !wget command with:
url = "https://raw.githubusercontent.com/qiskit-community/prototype-quantum-kernel-training/main/data/dataset_graph7.csv"
df = pd.read_csv(url, sep=",", header=None)

2. Real Hardware Execution Gaps (Step 2 & 3):

The tutorial states it introduces Qiskit patterns for utility-scale execution, but the hardware execution code is commented out and outdated. If a user uncomments Step 2, the job will fail to run on a QPU for the following reasons:

  • Authentication: There is no mention of needing an active IBM Quantum API token (QiskitRuntimeService.save_account()).
  • Transpilation / ISA: The tutorial does not emphasize that overlap_circ must be transpiled to match the hardware topology before sending it to a real backend.
  • V2 Primitives: Step 3 uses StatevectorSampler (local simulation). To run on real hardware, the tutorial should explain how to import and use the hardware-ready SamplerV2 from qiskit_ibm_runtime.
  • Job Queues: Adding a brief note or code snippet for job monitoring (e.g., job.status()) would prepare learners for real-world queue wait times, preventing them from thinking their local notebook has frozen.

Suggested Action: Please consider updating the commented-out code in Step 2 to reflect the modern V2 primitives workflow (Authentication -> Transpile -> SamplerV2), or adding an expandable "Real Hardware Execution Note" that outlines these necessary real-world steps.

For new content requests - if the request is accepted, do you want to write the content?

I will write (or already have written) a draft of the proposed content

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.