munich-quantum-toolkit / munich-quantum-toolkit/core

✨ Add rotation-through-CX optimization pass

Open
#2,274 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

c++ feature MLIR
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.