Repository navigation
[Feature] Add S gate to QuMat - #1540
Open
tingyu-patrick wants to merge 2 commits into
Open
tingyu-patrick wants to merge 2 commits into
tingyu-patrick wants to merge 2 commits into
Conversation
Author
|
Hi @400Ping , sorry to bother you. When you have some free time, could you please take a look at this PR? Any feedback would be greatly appreciated! |
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.
Related Issues
Part of #1511
Changes
Why
QuMatcurrently has no S gate (phase of π/2), which is common in textbook circuits and standard transpilation targets. Users have to drop down to the underlying SDK to use it. This PR adds the S gate as one of the gates tracked in #1511 (one gate per PR, as requested there).How
QuMat.apply_s_gateinqumat/qumat.py, following the pattern ofapply_t_gate.testing/qumat/test_single_qubit_gates.pythat run on all backends: basis-state preservation, S² = Z, S⁴ = I (each H-sandwiched so the phase becomes measurable), and a sign check (H-S-T-T-H ends in |1⟩, which would fail if the gate were S† instead of S).docs/qumat/basic-gates.md.All tests in
testing/qumat/pass locally on all backends, and ruff passes. The ty and Rust pre-commit hooks could not run in my Windows environment (uvandcargowere not found by the hooks), so I am relying on CI for those.AI assistance: I used Claude to help draft the tests and docs. I reviewed and ran all of it and can explain every change.
Checklist