Repository navigation
Mark QAOA demos as non-executable - #1870
Open
JerryChen97 wants to merge 2 commits into
Open
JerryChen97 wants to merge 2 commits into
JerryChen97 wants to merge 2 commits into
Conversation
`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>
|
👋 Hey, looks like you've updated some demos! 🐘 Don't forget to update the Please hide this comment once the field(s) are updated. Thanks! |
Your preview is ready 🎉!You can view your changes here
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
qp.qaoawas removed from PennyLane in PennyLaneAI/pennylane#10249 in anticipation of PL2. This PR marks the demos that useqp.qaoaas non-executable.Two demos are affected:
tutorial_qaoa_intro— usesedge_driver,min_vertex_cover,cost_layer,mixer_layertutorial_falqon— usesmax_clique,cost_layer,mixer_layerThree further demos import
qp.qaoa(braket-parallel-gradients,learning2learn,qnspsa) but are already marked non-executable ondev, 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:
.. warning::noting the demo is only compatible with PennyLane v0.45 or belowsphx-glr-script-outblocks (7 fortutorial_qaoa_intro, 3 fortutorial_falqon)_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(matchingdependencies/constraints-stable.txt, withmatplotlib==3.10.0andpennylane-qulacs==0.44.*), and the captured stdout and figures were inserted verbatim. Both demos are deterministic — the graph layouts useseed=1and 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\rangleand :math:|10\rangledominate, and after adding the constraint :math:|10\rangleovertakes :math:|6\rangletutorial_falqon: the cost function decreases monotonically, bit string 28 =11100wins on the 5-vertex graph, and 112 =1110000wins on the 7-vertex graphChecks run locally: metadata validates against
demo.metadata.schema.0.1.10.jsonusing the pinnedcheck-jsonschema0.23.3, and every text block parses throughsphinx_gallery.py_source_parserand renders via docutils with no errors. All 22 figure references resolve to files in the repo.dateOfLastModificationhas been bumped for both demos.[sc-132794]