Repository navigation
fix: correct circuit state handling, QASM serialization, and gate semantics - #72
Merged
Merged
Conversation
Align the signed tableau updates with Ry(+pi/2) and Ry(-pi/2), and clarify conjugation and global-phase comments. Add regressions for complete Pauli product eigenstates, packed-word boundaries, interference and Bell circuits, sampling and execution, and seeded random Clifford circuits. All five new tests fail before the fix and pass afterward. Validation: core library tests (3423 passed, 2 ignored), core all-targets Clippy with warnings denied, cargo fmt, and git diff --check.
Reject program termination before lowering can discard unreachable branches or expand loops, preserving UnsupportedFeature errors for nested scopes and included files. Add regressions for top-level and nested end statements, unreachable code, file-loading aliases, includes, and non-statement uses of end. Document the restriction in Chinese and English APIs and guides. Ignore the valid Unicode Nd regex category in typos to prevent the commit hook from rewriting it as And. Validation: core library tests (3428 passed, 2 ignored), original audit regression, core all-targets Clippy with warnings denied, cargo fmt, and git diff --check.
Terminate every expanded X2P/X2M/Y2P/Y2M/XY2P/XY2M instruction and share QASM parameter formatting so decompositions emit ASCII pi. Add regressions for individual gates, numeric and symbolic axes, entangled circuits, custom and unitary gate definitions, file aliases, parameter errors, conditional rejection, and all standard gates with an explicit phase policy. Validation: QASM2 tests (121 passed), core library tests (3435 passed, 2 ignored), core all-targets Clippy with warnings denied, cargo fmt, and git diff --check.
Reject duplicate explicit qubit targets before mutation. Prepare remapped operations, parameter tables, and global phase before committing, preserving circuit identity, classical handles, and active control scopes. Add core and binding regressions for duplicate mappings, failure atomicity, sparse permutations, phase semantics, and classical handle preservation. Document the composition contract. Validation: core library tests (3439 passed, 2 ignored), Python circuit tests (263 passed), C circuit tests (15 passed), original audit reproduction, core and C all-targets Clippy, Rust formatting, Ruff, and git diff --check.
Add exact decomposition paths into U and RXY, bridge XY half-rotation polarities, and lower U into RZ plus same-polarity X/Y half rotations. Preserve symbolic parameters and global phase throughout lowering. Cover registered rule equivalence, device capability overrides, bounded planning under heterogeneous calibrations, and directed routing with initial/final layout isometry. Correct the incomplete-basis negative test to use the diagonal-only RZ/Z basis. Validation: core library tests (3446 passed, 2 ignored), core all-targets Clippy with warnings denied, cargo fmt, and git diff --check. Confirmed the added native-basis and compact-decomposition regressions fail with the original rules.
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.
Fix circuit state corruption during composition, parameter binding, and failed control-flow construction. Correct stabilizer half-rotation signs, QASM handling, and missing native gate lowering paths.
Changes
piformatting.endstatements before lowering discards unreachable branches or expands loops.composereject duplicate target qubits and preserve destination identity, existing classical handles, and state on failure.