munich-quantum-toolkit / munich-quantum-toolkit/core
✨ Add rotation-through-CX optimization pass
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 133
- Forks
- 73
- Avg merge
- 17h 34m
- Merged PRs (30d)
- 261
Description
Problem Statement
Following up on #1107 and inspired by the plenty of optimization passes Qiskit provides (many of which will soon be covered in the Predictor), I came across Optimize1qGatesSimpleCommutation, which (among other things) does:
RZ(a)──CX(control)──RZ(b) → CX(control)──RZ(a+b)
RX(a)──CX(target)──RX(b) → CX(target)──RX(a+b)
Current adjacent-rotation canonicalization and merge-single-qubit-rotation-gates cannot cross a CX. Target-level two-qubit fusion also does not cover dynamic angles or a lone CX.
Proposed Solution
I propose implementing this as a lightweight pass that runs before merge-single-qubit-rotation-gates.
A later iteration could move toward parity with Qiskit’s Optimize1qGatesSimpleCommutation by supporting P on the CX control, X/SX on the target, RZX blockers, broader one-qubit-run resynthesis, target-aware profitability, and fixed-point execution.
Wrong-wire rotations, RY, multi-controlled X, and movement across region or control-flow boundaries could be separate generalizations.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the existing adjacent-rotation canonicalization, merge-single-qubit-rotation-gates, and target-level two-qubit fusion passes, then inspect how passes are registered and ordered. Implement the lightweight pass before merge-single-qubit-rotation-gates and verify the stated RZ/control and RX/target transformations while preserving the listed blockers and region or control-flow boundaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100