Skip to content

Functions update - #5630

Merged
abbycross merged 23 commits into
ajc/aqarios-docsfrom
ajc/parityqc-function
Sep 10, 2026
Merged

Functions update#5630
abbycross merged 23 commits into
ajc/aqarios-docsfrom
ajc/parityqc-function

Conversation

@abbycross

Copy link
Copy Markdown
Collaborator

No description provided.

github-actions Bot and others added 22 commits September 9, 2026 15:29
This PR updates all dev APIs that changed since the last sync. If there
is a merge conflict, usually you can close the PR and use the next dev
docs PR.
> [!NOTE]
> This pull request was created by a GitHub action.

### What is this PR?

We host "dev" API docs (e.g.
https://quantum.cloud.ibm.com/docs/en/api/qiskit-ibm-runtime/dev), which
are generated from the branch of the project's repo. This helps us
preview upcoming changes and helps any users that are using the branch
rather than a specific release.
This PR updates the dev API docs 

### How to deal with this PR

1. Glance through the diff and check things look reasonable. Only the
dev docs and supporting images should be changed. It's common for there
to be new pages. While sometimes a page or API will be removed, we
should not be deleting a substantial portion of the docs.

2. If it looks good, approve the PR.

3. Close and re-open this PR to trigger CI; the action is not allowed to
trigger CI properly so we need a human with write access to trigger it.

4. Once CI has passed, you can merge this PR. If something goes wrong,
consider asking an engineer for help. With broken links, we sometimes
need to update the original API docs to fix the bad link, such as
updating the Qiskit SDK in Qiskit/qiskit.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
### Summary

Fixes the projected-quantum-kernels tutorial so it runs end to end. It
currently fails at the preprocessing step with `FileNotFoundError:
'./train_data.csv'`, and would fail again further down even if that were
fixed.

Three problems, all in the tutorial's own data handling:

1. **Wrong data directory.** The download cell writes the CSVs into
`data_tutorial/pqk/`, but `dir_root` was `"./"`, so `preprocess_data`
looked for the files in the working directory.
2. **Wrong projections file names.** With `run_experiment = False` (the
default), the notebook loaded `projections_train.txt` /
`projections_test.txt`, which are never downloaded. The downloaded files
are `projections_train.csv` / `projections_test.csv` in
`data_tutorial/pqk/`.
3. **Malformed dataset files.** The four CSVs under
`datasets/tutorials/pqk/` had a UTF-8 BOM, CRLF line endings, and every
line of `train_data.csv` / `test_data.csv` wrapped in double quotes.
pandas parsed each row as a single string column of NaNs, and
`np.loadtxt` rejected the BOM. The stored notebook output (`14:0:15`)
shows the author's original data parsed correctly, so the files were
mangled on export.

### Changes

- `dir_root` now points at `./data_tutorial/pqk/`, and the projections
are loaded from the downloaded `.csv` files.
- The `!mkdir` / `!wget` shell cells are replaced with
`urllib.request.urlretrieve`, matching the approach in
`quantum-kernel-training` and `simulate-kicked-ising-tem`. This works on
Windows and on runners without `wget`.
- The dataset CSVs are rewritten as plain UTF-8 with LF line endings and
no wrapping quotes. Values are unchanged.

### Testing

- Ran the notebook locally as a script with `run_experiment = False` (no
jobs submitted) against the fixed dataset files. Download,
preprocessing, backend selection, and transpilation all succeed. The
preprocessing output matches the notebook's stored output (`14:0:15`),
and the projections load with shapes (172, 180) and (74, 180). I stopped
the run during the tutorial's grid search, which is untouched by this
change.
- `ruff check`, `ruff format --check`, and `squeaky --check` pass on the
notebook with the repo's `docs/ruff.toml`.

Note: this notebook is in the `exclude` group of
`scripts/config/notebook-testing.toml`, so docs CI does not execute it.
The failure was observed in the internal tutorial-tests suite.
Standardizes prerequisite wording across 32 tutorials to match the SQD
tutorial:

> We recommend that users familiarize themselves with the following
topics before going through this tutorial:

Preserves singular wording where appropriate. No code, notebook outputs,
or metadata changes.

Validation: Markdown, spelling, and diff checks passed.

Fixes #5621.
Fixes #5626 .

- demonstrate usage of `max_dim`
- use square lattice connectivity and higher number of reps in
small-scale example, to improve energies
- in hardware example, determine connectivity from backend processor
family
- don't limit optimization iterations for compressed factorization for
LUCJ, since it's much faster in `ffsim >= 0.0.81`.
- put nitrogen atoms symmetrically around Z axis to eliminate warning in
newer PySCF versions
- set "chemical accuracy" to 1.6 mHa and simplify y axis plotting logic
## Summary

Adds a new tutorial, *Probabilistic error cancellation with logical
noise models*, ported from the internal ibm-quantum-learning-enablement
repo. The tutorial combines mediator-qubit error detection with PEC on a
49-qubit hexagonal Ising circuit, showing that QED+PEC converges with
far fewer shots than PEC alone.

## Changes

- Add
`docs/tutorials/probabilistic-error-cancellation-with-logical-noise-models.ipynb`
and its hero image under `public/docs/images/tutorials/`.
- Extract the 10 embedded plot outputs to `extracted-outputs/*.avif` via
`tox -e fix`.
- Add the tutorial to `_toc.json` and `index.mdx` under **Error
mitigation**.
- Add a `qiskit_bot.yaml` ownership entry.
- Exclude the notebook from notebook CI in `notebook-testing.toml`,
since it runs on hardware (`ibm_boston`, ~28 min).

## Notes for reviewers

- The notebook installs `qiskit-noise-learning` and `qiskit-mitigation`
from git, as neither is on PyPI yet. The `qiskit-mitigation` install
pins the `postselection-rename` branch until that module lands on
`main`. Both install lines should be updated once the packages are
released.

---------

Co-authored-by: abbycross <across@us.ibm.com>
@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

@qiskit-bot

Copy link
Copy Markdown
Contributor

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

@abbycross
abbycross merged commit 353dfbe into ajc/aqarios-docs Sep 10, 2026
4 of 6 checks passed
@abbycross
abbycross deleted the ajc/parityqc-function branch September 10, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants