Commit 3942c9c
Support commutation check between Pauli-based gates and standard gates (Qiskit#15488)
* Transpiler: implement exact Pauli generators for LightCone in Rust
This PR adds exact Pauli generator expansions for the following gates:
- single-qubit: H (X+Z)
- 2-qubit: CX, CY, CZ, ECR, Swap, iSwap, CSX, CS, CSdg
- parametric: CRX, CRY, CRZ, CPhase, RXX, RYY, RZZ, RZX, XXPlusYY, XXMinusYY
- 3-qubit: CCX, CSwap
This enables high-performance bitwise commutation checks in the LightCone
pass, avoiding slow matrix-multiplication fallbacks. Parametric gates are
scaled dynamically in Rust using the input parameters.
Co-authored-by: Shelly Garion <shelly.garion@ibm.com>
Co-authored-by: Alexander Ivrii <alexander.ivrii@ibm.com>
* Lint: apply cargo fmt and fix clippy::map_clone in split_2q_unitaries.rs
* Expose generator_observable to Python
Following feedback from Alexander Ivrii, this commit exposes the Rust
generator_observable function and the StandardGate enum to Python under
the qiskit._accelerate.standard_generators submodule.
This allows developers to verify the mathematical generators directly from
Python and reuse the logic for other purposes like PauliEvolutionGate
verification. The Rust-internal API is maintained via a dedicated
generator_observable function that accepts slices.
* Refactor generator logic to use qiskit_circuit::StandardGate
* Update generator_observable with expansions for CCX/CCZ/CSwap
* Fix generator fallback for unsupported gates and update docs
* Narrow PR scope: remove split_2q_unitaries and pyext python wrapper
* Add generator support for CS, CSdg, CSX, CCX, CCZ; add commutation tests
* style: run black on test_commutation_checker.py
* style: run rustfmt on standard_generators.rs
* lint: fix license headers and pylint warnings
* style: remove decorative unicode lines and add operator equivalence tests
* fix: ensure strict Operator equivalence for all supported generators
* style: fix pylint reimport and missing variables in test_commutation_checker.py
* Add generic generator equivalence test, fix matrix conversion, and optimize gate generators
* Format python tests
* Update copyright year in standard_generators.rs
* Clarify docstring for multi-qubit generators context
* Fix XXPlusYY and XXMinusYY generator validation and test cases
* Move test imports to top of file
* Use ddt data parameterization for gate generator testing tests
* Refactor test_clifford_gates_have_generators to use ddt
* Add CPhase, CRX, CRY, CRZ to generator tests
* Update test_all_gates_operator_equivalence_ddt docstring to be more accurate
* Move all inline imports to the top of the file
* Reorganize test data to group related gates logically
* Add tests for unsupported gates and parameters in generator logic
* Rename test helper to _commute to reflect that it uses either generator or matrix paths
* Clarify parameter handling in generator_observable docstring
* Comprehensive audit: Add Identity support and register all missing gates in SUPPORTED_OP
* Fix: Correct gate generator expansions and resolve UnsortedIndices layout panic
* pose generator engine, restore overflow logic, expand tests, and centralize constants
* Update crates/circuit/src/util.rs
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
* Update releasenotes/notes/pauli-evolution-commutation-8f7caab8.yaml
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
* Update releasenotes/notes/pauli-evolution-commutation-8f7caab8.yaml
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
* added missing gate, added test, copyright year, doc explaining
* restore negative constants to util.rs for generator expansions
* fix lint errors in regression test and move imports to top
* Final PR fixes: address remaining lint issues and update copyright headers
* Remove accidental temporary files from PR
* Restore original copyright years for existing files (only PR-created files keep 2026)
* Permanently delete bicycle-architecture-compiler from branch
---------
Co-authored-by: Shelly Garion <shelly.garion@ibm.com>
Co-authored-by: Alexander Ivrii <alexander.ivrii@ibm.com>
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>1 parent b2d4c87 commit 3942c9c
9 files changed
Lines changed: 900 additions & 13 deletions
File tree
- crates
- circuit/src
- pyext/src
- quantum_info/src
- sparse_observable
- transpiler/src
- releasenotes/notes
- test/python
- circuit
- transpiler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
4484 | 4486 | | |
4485 | 4487 | | |
4486 | 4488 | | |
| 4489 | + | |
| 4490 | + | |
| 4491 | + | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
| 4496 | + | |
| 4497 | + | |
| 4498 | + | |
4487 | 4499 | | |
4488 | 4500 | | |
| 4501 | + | |
4489 | 4502 | | |
4490 | 4503 | | |
4491 | 4504 | | |
| |||
0 commit comments