Add PNA tutorial#5209
Open
henryzou50 wants to merge 2 commits into
Open
Conversation
Adapt the PNA tutorial from the QDC Challenges 2025 repo [1] into a documentation tutorial, updated for the stable Qiskit Runtime release and restructured to follow the standard tutorial template. New files: - docs/tutorials/propagated-noise-absorption.ipynb - public/docs/images/tutorials/propagated-noise-absorption/ (3 schematics + extracted cell outputs) Registered in docs/tutorials/_toc.json and docs/tutorials/index.mdx under "Error mitigation", excluded from notebook CI in scripts/config/notebook-testing.toml (consistent with other tutorials), and given an owner in qiskit_bot.yaml. Major changes from the original [1]: - API: migrated off the `executor_preview` branch to the released qiskit-ibm-runtime 0.47.0. `Executor`, `QuantumProgram`, and `NoiseLearnerV3` are now imported from the top-level package; noise-learner options are passed as a plain dict instead of importing `NoiseLearnerV3Options`. - Credentials: replaced the hardcoded `shared_service` (token + `instance` CRN) and the named `QiskitRuntimeService(name="qdc-2025")` with a plain `service = QiskitRuntimeService()` that reads saved credentials. - Live execution: removed all saved-job loading (the `shared_service.job(...)` IDs and the `load_saved_nl_result` / `load_exec_results_from_disk` branches). The noise learner and Executor now run live, and the job is tagged `TUT_PNA`. - Bug fix: the measurement basis-change input was hardcoded as `basis2`, which no longer matches the samplex interface (it expects `basis0` here). Replaced with a lookup over `samplex.inputs().get_specs(...)` so the name is discovered from the circuit's box structure rather than hardcoded. Also fixed the execution `shape` to be a real 1-tuple. - Structure: reformatted to the tutorial template (title/description frontmatter, learning outcomes, prerequisites, background, requirements, setup, next steps). The small-scale simulator section is kept but explains why simulation is skipped (PNA mitigates learned hardware noise), and the workflow is presented as the four-step large-scale hardware example. - Content: corrected the learned-noise-rates discussion, which had claimed two-qubit rates exceed one-qubit rates (the opposite of what the plot shows); rewrote it to be device-dependent.
Make the tutorial runnable on any backend instead of being tied to a hardcoded ibm_kingston chain. - Add a `find_qubit_chain` helper (defined in the Setup section) that walks the backend's coupling map and greedily builds a connected, low-error line of `num_qubits`. This replaces the hardcoded 30-qubit layout. Transpilation stays at optimization_level=0 with the chain pinned as `initial_layout`, so the mirrored two-qubit-gate layer structure that the boxing and noise-learning steps depend on is preserved exactly. - Select the backend dynamically with `service.least_busy(...)` rather than pinning ibm_kingston. - Make the learned-noise-rates commentary backend-agnostic; it no longer names a specific device. - Regenerate the extracted output figures from a fresh hardware run.
Contributor
|
One or more of the following people are relevant to this code:
|
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new tutorial, "Improving expectation values with propagated noise absorption (PNA)." It is an updated, documentation-ready version of the PNA tutorial from the QDC Challenges 2025 repo: https://github.com/qiskit-community/qdc-challenges-2025/blob/main/day3_tutorials/Track_A/pna/propagated_noise_absorption.ipynb
PNA mitigates two-qubit gate noise by propagating the inverse of learned noise channels into the measured observable (using
samplomatic,NoiseLearnerV3, andqiskit-addon-pna), then sampling the randomized circuits with the newQuantumProgram/Executorclasses in Qiskit Runtime. The tutorial walks through the full four-step Qiskit pattern on a 30-site mirrored kicked-Ising circuit and compares PNA against PNA+TREX, PNA+PS, and PNA+PS+TREX.Major changes from the original
executor_previewbranch.Executor,QuantumProgram, andNoiseLearnerV3are now imported from the top-levelqiskit_ibm_runtime; noise-learner options are passed as a plain dict (noNoiseLearnerV3Optionsimport).shared_service(token +instanceCRN) and the namedQiskitRuntimeService(name="qdc-2025")with a plainQiskitRuntimeService()that reads saved credentials.shared_service.job(...)IDs andload_saved_*branches); the noise learner andExecutornow execute live, with the job taggedTUT_PNA.ibm_kingstonchain with afind_qubit_chainhelper that builds a connected, low-error line from the backend's coupling map, and selects the backend withleast_busy. Transpilation stays atoptimization_level=0with the chain pinned asinitial_layout, preserving the mirrored two-qubit-gate layer structure that boxing and noise learning rely on.basis2, which no longer matches the samplex interface; it now looks up the name fromsamplex.inputs().get_specs(...).Files
docs/tutorials/propagated-noise-absorption.ipynb+ images underpublic/docs/images/tutorials/propagated-noise-absorption/(3 schematics and the extracted cell outputs).docs/tutorials/_toc.jsonanddocs/tutorials/index.mdx(Error mitigation section), added to the notebook-CI exclude list inscripts/config/notebook-testing.toml, and given an owner inqiskit_bot.yaml.Testing
Ran on IBM Quantum hardware,
tox -e lint, the notebook normalizer, spelling, and internal-link checks all pass.