Skip to content

Snap theta before the RXYXY2Q zero check and document the gate - #811

Open
ciaranra wants to merge 1 commit into
devfrom
rxyxy2q-docs-and-zero-snap
Open

ciaranra wants to merge 1 commit into
devfrom
rxyxy2q-docs-and-zero-snap

Conversation

@ciaranra

Copy link
Copy Markdown
Member

Closes #805. Addresses the zero-check half of #804.

Change

  • try_rxyxy2q compared theta to exact Angle64::ZERO before its Clifford check, whereas try_rxx snaps within the Clifford tolerance, so a theta within tolerance of zero combined with a non-Clifford phi was rejected although the gate is the identity. It now snaps first, as try_simplify_rxy1q does. The existing zero-theta test covers a near-zero theta too; restoring the exact comparison makes it fail.
  • docs/user-guide/gates.md gains an RXYXY2Q section (definition, matrix, relation to RXX/RYY, Selene RPP correspondence, stabilizer angle grid) and a Quick Reference row; gate-naming-conventions.md and gate-angle-types.md list the gate alongside RXY1Q.

Not in this PR

Accepting theta = pi with phi an odd multiple of pi/4 (a Clifford that Selene's Stim simulator accepts) stays open in #804: try_simplify_rxy1q returns a single named GateType, so that case needs a decomposition return type and an eighth-turn snap grid, which is a design change.

Verification

cargo test -p pecos-simulators --lib clifford_rotation (35 passed), cargo clippy --locked -p pecos-simulators --all-targets -- -D warnings, cargo fmt --check, and pre-commit on the changed files, all clean.

Written directly by Claude Fable 5.1 in Claude Code at the maintainer's request; no Codex arm was used for this one.

@ciaranra
ciaranra force-pushed the rxyxy2q-docs-and-zero-snap branch from 2db549d to 1330bde Compare September 21, 2026 03:57
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.

Document RXYXY2Q in the gates user guide

1 participant