Skip to content

docs: add runnable dicke and measure examples - #1906

Merged
vprusso merged 1 commit into
vprusso:masterfrom
happykawayigt:docs/dicke-measure-examples
Aug 1, 2026
Merged

docs: add runnable dicke and measure examples#1906
vprusso merged 1 commit into
vprusso:masterfrom
happykawayigt:docs/dicke-measure-examples

Conversation

@happykawayigt

@happykawayigt happykawayigt commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Adds proper runnable Examples sections to dicke and measure as part of #1886.

Changes

  • Promote the existing Dicke state snippets into a rendered Examples section.
  • Add a rendered Examples section to measure and correct the state/operator argument order in its projector example.

Validation

  • Ran every documented snippet directly against this branch and verified the printed results
  • Targeted tests (22 passed)
  • ruff check
  • ruff format --check
  • git diff --check
  • GitHub Actions test and style checks passed

A full local MkDocs build was not run because mkdocs is unavailable in the local environment. The repository's Docs Preview check was skipped by its workflow configuration.

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@happykawayigt
happykawayigt marked this pull request as ready for review July 30, 2026 19:28
@vprusso

vprusso commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Thanks @happykawayigt. Verified against the branch: the corrected measure(rho, proj_0) prints 1/3 and measure(rho, proj_1) prints 2/3, matching the documented probabilities. The argument-order swap is a real fix, the signature is measure(state, measurement), so state comes first (the value coincides here only because of the symmetry of this particular example). Moving the example-specific math into the Examples: block is the right structure. Merging.

@vprusso
vprusso merged commit bb72f82 into vprusso:master Aug 1, 2026
15 checks passed
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.

2 participants