Skip to content

Integrate REST API docs to CI#4629

Open
kaelynj wants to merge 4 commits intomainfrom
kjf/docs-rest-blocks
Open

Integrate REST API docs to CI#4629
kaelynj wants to merge 4 commits intomainfrom
kjf/docs-rest-blocks

Conversation

@kaelynj
Copy link
Collaborator

@kaelynj kaelynj commented Feb 3, 2026

Closes #4381

This replaces the markdown code examples to testable ones. I also had to include a few hidden cells to support testing (mostly to generate Bearer tokens and wait for job results to come back before continuing to execute other cells). The content itself hasn't really changed, but I would especially appreciate a review on the hidden cells since they're somewhat involved.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@qiskit-bot
Copy link
Contributor

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

abbycross
abbycross previously approved these changes Feb 3, 2026
Copy link
Collaborator

@abbycross abbycross left a comment

Choose a reason for hiding this comment

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

All good from copyediting! (I didn't look at the hidden cells other than to check for copyedit-relevant stuff.)

Copy link
Member

@frankharkins frankharkins left a comment

Choose a reason for hiding this comment

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

Awesome work, thank you!

To pass CI, you'll need to add this to the test-eagle or the cron-job-only group:

# Only run the following notebooks in our fortnightly cron job on real hardware.
[groups.cron-job-only]
test-strategies.hardware = { patch="qiskit-ibm-runtime-open" }
notebooks = [

Because this notebook submits jobs and we don't want to submit jobs in CI (it uses a lot of device time and can cause CI to flake).

I have some suggestions, but they're not blocking.

"token = os.getenv(\"IBM_CLOUD_TEST_TOKEN\")\n",
"crn = os.getenv(\"IBM_CLOUD_TEST_CRN\")\n",
"url = \"https://quantum.cloud.ibm.com/api/v1/jobs\"\n",
"service = QiskitRuntimeService()\n",
Copy link
Member

Choose a reason for hiding this comment

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

Sorry I didn't think of this earlier, but you could do this instead and remove the env vars from the github action step:

crn = service.active_account()['instance']
token = service.active_account()['token']

We use this approach in qunova-chemistry.ipynb and functions.ipynb

"The following examples demonstrate the default options for dynamical decoupling, twirling, and TREX + ZNE. Find more options and further details in the [Error mitigation and suppression techniques](./error-mitigation-and-suppression-techniques) topic.\n",
"\n",
"\n",
"<Tabs>\n",
Copy link
Member

Choose a reason for hiding this comment

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

If you wanted to keep the tabs, you could use the CodeCellPlaceholder component. You'd basically just split the cell into three, give each an id- tag, and put the <CodeCellPlaceholder tag="id-..." /> component inside the tab components in the markdown.

"id": "3814b809-3012-4498-adc8-efa1f1f5c959",
"metadata": {},
"source": [
"Get job results:"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Get job results:"
"Once the job has completed, get job results:"

"name": "stdout",
"output_type": "stream",
"text": [
"Job created: {\"id\":\"d6147vao8gvs73f0h12g\",\"backend\":\"ibm_pittsburgh\"}\n"
Copy link
Member

Choose a reason for hiding this comment

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

I think we create this job but never use it, maybe we should cancel it immediately afterwards in a hidden cell?

Same for the other "Work with Runtime options" job.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Switch to notebook code blocks in REST API page

4 participants