Skip to content

✨ Add Constant Propagation#1845

Draft
LiRem101 wants to merge 149 commits into
munich-quantum-toolkit:mainfrom
LiRem101:mlir/constant-propagation
Draft

✨ Add Constant Propagation#1845
LiRem101 wants to merge 149 commits into
munich-quantum-toolkit:mainfrom
LiRem101:mlir/constant-propagation

Conversation

@LiRem101

@LiRem101 LiRem101 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR introduces the optimization pass constant propagation. It propagates the state of a quantum machine through a circuit and optimizes the applied gates with respect to the current state. Namely, it removes controlling qubits, exchanges controlling qubits with controlling classical values and removes phase gates which only introduce a global phase. The optimization routine is based on this paper, accepted at QSW 2026.

I suggest having constant propagation switched to off on default, because it assumes that all states are initial zero, can take quite a while and can create dynamic circuits, which might not be everyone's goal.

GPT-4 and GPT-5 have been used for refactoring and for first drafts of code. No Gen AI was integrated in the used IDE.

Fixes #(1387)

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • I have disclosed the use of AI tools in the PR description as per our AI Usage Guidelines.
  • AI-assisted commits include an Assisted-by: [Model Name] via [Tool Name] footer.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

LiRem101 and others added 30 commits March 26, 2026 16:52
LiRem101 and others added 29 commits June 30, 2026 13:32
@mergify mergify Bot added the conflict label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants