Skip to content

fix(docs): 🐛 make the README quick-start examples runnable - #222

Open
nelyasi wants to merge 1 commit into
Algorithmiq:mainfrom
nelyasi:main
Open

fix(docs): 🐛 make the README quick-start examples runnable#222
nelyasi wants to merge 1 commit into
Algorithmiq:mainfrom
nelyasi:main

Conversation

@nelyasi

@nelyasi nelyasi commented Aug 11, 2026

Copy link
Copy Markdown

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.

Updated the README to correct mathematical notation and improve clarity in examples.

Signed-off-by: Seyed Navid Elyasi <navid.elyasi97@gmail.com>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 11, 2026
@diagonal-hamiltonian

Copy link
Copy Markdown
Collaborator

Thank you for the PR, I will look at it tomorrow 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants