Skip to content

Conversation

DRovara
Copy link
Collaborator

@DRovara DRovara commented Aug 12, 2025

Description

This PR provides two main functionalities, each accessible through its own transformation pass:

  • lift-measurements: Attempts to move measurements over other gates, if that is possible (e.g. over controls or phase gates).
  • qubit-reuse: Attempts to reduce the number of required qubits by reusing existing qubits that are no longer necessary, when possible.

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.
  • 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.

@DRovara DRovara added this to the MLIR Support milestone Aug 12, 2025
@DRovara DRovara added enhancement New feature or request c++ Anything related to C++ code MLIR Anything related to MLIR labels Aug 12, 2025
@DRovara DRovara changed the title Mlir - Hybrid Circuit Optimization with Qubit Reuse ✨ Mlir - Hybrid Circuit Optimization with Qubit Reuse Aug 12, 2025
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 98.85496% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...Dialect/MQTOpt/Transforms/LiftMeasurementsPass.cpp 91.6% 1 Missing ⚠️
...nsforms/ReplaceBasisStateControlsWithIfPattern.cpp 99.1% 1 Missing ⚠️
.../lib/Dialect/MQTOpt/Transforms/ReuseQubitsPass.cpp 85.7% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@denialhaag denialhaag changed the title ✨ Mlir - Hybrid Circuit Optimization with Qubit Reuse ✨ MLIR - Hybrid Circuit Optimization with Qubit Reuse Aug 12, 2025
@DRovara DRovara marked this pull request as draft August 13, 2025 13:20
@DRovara DRovara self-assigned this Aug 13, 2025
DRovara added 21 commits August 18, 2025 14:02
two test cases have the same name and should be renamed
…gate no longer removes the gate, as this is not equivalent and it also is handled by dead gate elimination now
…lassicalControlsWithIf" also works for targets of controlled gates where targets and controls are interchangeable
…errors when considered gate also has dynamic parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code enhancement New feature or request MLIR Anything related to MLIR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant