Repository navigation
fix: correct circuit and simulation semantics for beta6 - #68
Merged
Merged
Conversation
jianjian01
commented
Oct 18, 2026
Collaborator
- Fix composite-gate parameter binding, qubit ordering, and global phase preservation.
- Correct symbolic substitution, NumPy complex coefficients, density-matrix validation, readout noise, and Pauli-vector labels.
- Bump versions to beta6 and document compatibility changes.
Return scalar numeric and symbolic matrices for zero-qubit GPhase gates so controlled matrices match their declared qubit counts. Dispatch controlled gates only after recognizing supported specializations, and route zero-control GPhase through the ordinary phase execution path in the three numerical simulators. Return an unsupported-operation error for controlled GPhase in StabilizerState without indexing a nonexistent target. Add Rust and Python regressions for matrix metadata, symbolic parameters, controlled evolution, noise behavior, zero controls, and stabilizer errors.
Emit each defining circuit's global phase inside CircuitGate and circuit-backed UnitaryGate definitions so round trips preserve the full unitary, including phase. Add Rust and Python regressions for fixed and symbolic phases, nested and repeated calls, local parameters, and explicit GPhase operations alongside phase metadata.
Validate distinct targets in the shared two-qubit and multi-qubit checks before running gate kernels, clearing Kraus output, or applying noise. Reuse the existing invalid-parameter error and include the duplicate index in the diagnostic. Add Rust regressions for gate, custom-matrix, Kraus, and noisy paths that verify rejection leaves the full density matrix unchanged, including middle-qubit targets. Validation: 134 density-matrix-related Rust tests passed. The preceding full workspace run passed 4080 tests; the production fix is unchanged since that run.
Verify Python raises ValueError and the C ABI returns -8 for duplicate targets, with the complete density matrix unchanged. Compare valid ordered-target results against independently constructed full-matrix expectations. Include the standalone C host test in staged SDKs and register static and shared CTest suites. Update the SDK documentation to describe the additional coverage. Validation: 103 Python regressions passed; development and release SDK workflows each passed all 6 CTests. Workspace Clippy and formatting checks passed.
…order Share matrix evaluation between instruction and full-circuit paths, preserving global phase and gate-local argument ordering. Validate parameter arity and finite values without mutating frozen definitions. Add Rust, Python, and C regression coverage for parameter binding, sparse and permuted qubits, nested and inverse gates, and commutation classification.
Generate MSB-first matrices at the instruction boundary while preserving the public definition matrix convention. Cover commutation, positional qubit order, parameter binding, global phase, and explicit matrix precedence.
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.