fix(docs): 🐛 make the README quick-start examples runnable - #222
Open
nelyasi wants to merge 1 commit into
Open
Conversation
Updated the README to correct mathematical notation and improve clarity in examples. Signed-off-by: Seyed Navid Elyasi <navid.elyasi97@gmail.com>
nelyasi
requested review from
diagonal-hamiltonian,
fpietra,
ludmilaasb and
robertodr
as code owners
August 11, 2026 16:24
Collaborator
|
Thank you for the PR, I will look at it tomorrow 🙂 |
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.
Both snippets under “Quick example” currently fail with a TypeError.
Circuit.init has the signature
(gates, system_size, parameters=(), initial_state=None)
so system_size is required, but neither example passes it. The equivalent examples under docs/content/docs/ already include it correctly; the README appears to be the only one that drifted, likely because it is not covered by just doctest-docs.
The comments also describe the gates as exp(-i θ/2 · H), but ExpGate applies exp(+i θ · H). The engine rotates by 2 · gen_coeff · param (LayerAngle in Evolution.h, and cos(2 * param) in Evolution.cpp:476), so both the sign and the factor in the comments were incorrect. I fixed the comments only; no code changes were needed.
I also fixed an unterminated </p tag left over from the benchmark images.