Skip to content

Mark QAOA demos as non-executable - #1870

Open
JerryChen97 wants to merge 2 commits into
devfrom
rm-qaoa
Open

JerryChen97 wants to merge 2 commits into
devfrom
rm-qaoa

Conversation

@JerryChen97

@JerryChen97 JerryChen97 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

qp.qaoa was removed from PennyLane in PennyLaneAI/pennylane#10249 in anticipation of PL2. This PR marks the demos that use qp.qaoa as non-executable.

Two demos are affected:

  • tutorial_qaoa_intro — uses edge_driver, min_vertex_cover, cost_layer, mixer_layer
  • tutorial_falqon — uses max_clique, cost_layer, mixer_layer

Three further demos import qp.qaoa (braket-parallel-gradients, learning2learn, qnspsa) but are already marked non-executable on dev, so they need no change here.

Following the approach in #1869 and #1865, the previously generated output has been inlined into the demo bodies so the rendered pages still show results:

  • a .. warning:: noting the demo is only compatible with PennyLane v0.45 or below
  • printed output moved into sphx-glr-script-out blocks (7 for tutorial_qaoa_intro, 3 for tutorial_falqon)
  • 9 new figures added under _static/demonstration_assets/{qaoa_module,falqon}/

Rather than transcribing the output by hand, both demos were executed end to end against pennylane==0.45.1 (matching dependencies/constraints-stable.txt, with matplotlib==3.10.0 and pennylane-qulacs==0.44.*), and the captured stdout and figures were inserted verbatim. Both demos are deterministic — the graph layouts use seed=1 and the optimizations start from fixed parameters on analytic devices — so the inlined results are reproducible.

The captured results agree with what the demo text already claims:

  • tutorial_qaoa_intro: states :math:|6\rangle and :math:|10\rangle dominate, and after adding the constraint :math:|10\rangle overtakes :math:|6\rangle
  • tutorial_falqon: the cost function decreases monotonically, bit string 28 = 11100 wins on the 5-vertex graph, and 112 = 1110000 wins on the 7-vertex graph

Checks run locally: metadata validates against demo.metadata.schema.0.1.10.json using the pinned check-jsonschema 0.23.3, and every text block parses through sphinx_gallery.py_source_parser and renders via docutils with no errors. All 22 figure references resolve to files in the repo.

dateOfLastModification has been bumped for both demos.

[sc-132794]


Prepared with the assistance of an AI coding assistant; the demo output was generated by actually running the demos, and all changes were reviewed by a human.

`qp.qaoa` was removed from PennyLane in PennyLaneAI/pennylane#10249 in
anticipation of PL2. This marks the demos that use it as non-executable
and inlines their previously generated output.

The printed output and figures were captured by running both demos against
pennylane==0.45.1, matching dependencies/constraints-stable.txt.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

👋 Hey, looks like you've updated some demos!

🐘 Don't forget to update the dateOfLastModification in the associated metadata files so your changes are reflected in Glass Onion (search and recommendations).

Please hide this comment once the field(s) are updated. Thanks!

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Your preview is ready 🎉!

You can view your changes here

Deployed at: 2026-10-08 15:06:10 UTC

@JerryChen97
JerryChen97 marked this pull request as ready for review October 6, 2026 21:12
@JerryChen97
JerryChen97 requested review from a team as code owners October 6, 2026 21:12
@JerryChen97 JerryChen97 self-assigned this Oct 6, 2026

This branch has not been deployed

No deployments
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