Skip to content

Add the figures the example programs produce - #29

Merged
fedonman merged 4 commits into
mainfrom
docs/example-figures
Aug 27, 2026
Merged

Add the figures the example programs produce#29
fedonman merged 4 commits into
mainfrom
docs/example-figures

Conversation

@fedonman

@fedonman fedonman commented Aug 27, 2026

Copy link
Copy Markdown
Member

The example pages described their results in dims and shapes and left the reader to picture the curve. Nine of them now show it, and the tenth, checking-a-program.md, gets none because it runs nothing.

The figures are generated rather than drawn. .claude/skills/qprogram-docs/scripts/build_example_plots.py holds each page's program, runs it on the reference platform, and renders the result, so a plot cannot drift from the code printed above it; the docs change checklist now names it as a step. The CZ chevron runs at the size its page prints, a 101 by 101 grid at 1000 shots, which is 20 million model samples and around six minutes.

Each figure is written twice, once per site theme, onto surfaces matching Material's default and slate exactly, and the pages embed the pair with the #only-light / #only-dark fragments the stylesheet keys on data-md-color-scheme. The dark variant is its own render with its own colour steps rather than a light figure behind a filter, and the sequential ramp runs away from the surface in both themes so the marks carrying the data stand furthest off the page rather than the empty regions.

Running the programs turned up two things the pages had wrong, each fixed in its own commit ahead of the figures.

qubit-spectroscopy.md gave int(np.argmax(magnitude)) for recovering f01, which raises on an xarray.DataArray. The docs checker parses Python fences but never executes them, so it got through review and CI. It takes .values.

Four pages shaped their mock response as sin(pi * gain / 2) ** 2 and called the result a Rabi oscillation, but over a gain of 0 to 1 that is a quarter period: the curve rises and flattens exactly at the last sweep point, so the pi-pulse amplitude the pages say the sweep calibrates cannot be read off it. Dropping the halving gives a full period peaking at 0.5 V, which is the IQDrag(amplitude=0.5, ...) those same pages already resolve "pi_pulse" to.

`np.argmax` on an `xarray.DataArray` raises `ValueError: dimensions ('freq',)
must have the same length as the number of data dimensions, ndim=0`, so the
line the qubit spectroscopy page gives for recovering `f01` did not run. The
docs checker parses Python fences but never executes them, which is why it got
through. It takes `.values`.
Four pages shape their mock response as `sin(pi * gain / 2) ** 2` and describe
the result as a Rabi oscillation, but over a gain of 0 to 1 that is a quarter
period: the curve rises and flattens exactly at the last sweep point, never
turning over. The pi-pulse amplitude the pages say the sweep calibrates is not
readable off it, and `execution.md` labels the plot "a noisy Rabi oscillation"
in a comment.

Dropping the halving gives a full period with a maximum at 0.5 V, which is the
`IQDrag(amplitude=0.5, ...)` the same pages already resolve `"pi_pulse"` to, so
the curve peaks where the calibration data says it should.
The example pages described their results in dims and shapes and left the
reader to picture the curve. Nine of them now show it.

The figures are generated rather than drawn: `build_example_plots.py` holds
each page's program, runs it on the reference platform, and renders the result,
so the picture and the code above it cannot disagree. The CZ chevron runs at
the size the page prints, a 101 by 101 grid at 1000 shots, which is 20 million
model samples and around six minutes.

Each figure is written twice, once per site theme, onto surfaces that match
Material's `default` and `slate` exactly, and the pages embed the pair with the
`#only-light` / `#only-dark` fragments the stylesheet keys on
`data-md-color-scheme`. The sequential ramp runs away from the surface in both
themes, so the marks that carry the data are the ones standing furthest off the
page rather than the empty regions.

`checking-a-program.md` gets none, because it runs nothing.
@pullpo-for-slack

Copy link
Copy Markdown

🔗Pullpo.io Slack PR-Channel

@pullpo-for-slack

pullpo-for-slack Bot commented Aug 27, 2026

Copy link
Copy Markdown

AI Analysis

Oupsie! Looks like something went wrong on our end.
We'll investigate it and solve it for future pull requests!

@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@fedonman
fedonman merged commit 6e7366f into main Aug 27, 2026
9 checks passed
@fedonman
fedonman deleted the docs/example-figures branch August 27, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant