✨ Add native gate synthesis MLIR pass and decomposition stack#1665
Draft
simon1hofmann wants to merge 60 commits into
Draft
✨ Add native gate synthesis MLIR pass and decomposition stack#1665simon1hofmann wants to merge 60 commits into
simon1hofmann wants to merge 60 commits into
Conversation
…use `std::exp` for complex exponentiation instead of `std::polar`.
… basis decomposer, Euler decomposition, and associated helper functions. This update introduces new headers and source files for managing gate sequences, unitary matrices, and decomposition strategies, enhancing the framework's capabilities for quantum circuit transformations. Co-authored-by: Tamino Bauknecht <dev@tb6.eu>
… and additional test cases for Euler and Weyl decompositions.
…, including new utility functions and validation for gate sequences.
…xamples and execution details.
…dual global phases.
… synthesis utilities
… clarifying examples and improving readability.
…d results in native synthesis tests.
…re both output and input qubits match correctly.
…pointers and ensure operand count validation for RZ, RX, RY, U, P, and R operations in native synthesis tests.
…ubit outputs and inputs, ensuring correct operation merging in XXMinusYY and XXPlusYY patterns.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: simon1hofmann <119581649+simon1hofmann@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@mlir/include/mlir/Dialect/QCO/Transforms/Passes.h`:
- Around line 42-43: Add a Doxygen comment above the public factory declaration
createNativeGateSynthesisPass describing its purpose (what the pass does),
documenting the parameter `@param` options (type NativeGateSynthesisOptions) and
any important semantics of those options, and the return value via `@return` (a
std::unique_ptr<Pass> owning the created pass). Keep wording consistent with
surrounding pass factory comments (brief one-line summary plus `@param/`@return
tags) and place it immediately above the declaration for
createNativeGateSynthesisPass.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 468c7c0e-7e17-4ed8-8a53-dd3ca91801ad
📒 Files selected for processing (4)
mlir/include/mlir/Dialect/QCO/Transforms/Passes.hmlir/lib/Compiler/CompilerPipeline.cppmlir/lib/Dialect/QCO/IR/Operations/StandardGates/XXMinusYYOp.cppmlir/lib/Dialect/QCO/IR/Operations/StandardGates/XXPlusYYOp.cpp
8 tasks
burgholzer
added a commit
that referenced
this pull request
Jun 17, 2026
…1672) ## Description - Consolidate Euler decomposition into `Euler.h` / `Euler.cpp` (angle extraction + `synthesizeUnitary1QEuler` IR emission), replacing the previous `EulerDecomposition` / `GateSequence` / `Helpers` / `UnitaryMatrices` split. - Add the `fuse-single-qubit-unitary-runs` MLIR pass: fuse maximal runs of constant single-qubit unitaries on a wire by composing 2×2 matrices and resynthesizing in a configurable Euler basis (`zyz`, `zxz`, `xzx`, `xyx`, `u`, `zsxx`), with `gphase` for exact global phase. Split up and refactored from #1665. ## AI Assistance Used Composer via Cursor for parts of this change. I reviewed the full diff and take responsibility for everything in this PR. ## Checklist <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are focused and relevant to this change. - [x] I have added appropriate tests that cover the new/changed functionality. - [x] I have updated the documentation to reflect these changes. - [x] 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). - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. **If PR contains AI-assisted content:** - [x] I have disclosed the use of AI tools in the PR description as per our [AI Usage Guidelines](https://github.com/munich-quantum-toolkit/core/blob/main/docs/ai_usage.md). - [ ] AI-assisted commits include an `Assisted-by: [Model Name] via [Tool Name]` footer. - [x] I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it. --------- Signed-off-by: simon1hofmann <119581649+simon1hofmann@users.noreply.github.com> Signed-off-by: burgholzer <burgholzer@me.com> Signed-off-by: Lukas Burgholzer <burgholzer@me.com> Co-authored-by: Tamino Bauknecht <dev@tb6.eu> Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Co-authored-by: Copilot <copilot@github.com> Co-authored-by: burgholzer <burgholzer@me.com>
…qubit unitary windows via Weyl/KAK resynthesis. Update changelog and remove obsolete files related to two-qubit window consolidation.
…ubit unitary operations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduces a
native-gate-synthesistransform on QCO modules that lowers arbitrary supported unitaries to a comma-separated native gate menu, with scoring over two-qubit count, single-qubit count, and local depth.User-visible behavior
--native-gates=<menu>onmqt-cc(empty menu = no-op), aligned with pass options documented inPasses.td(native-gates,score-weight-twoq,score-weight-oneq,score-weight-depth).Fixes #(issue)
Checklist
If PR contains AI-assisted content:
Assisted-by: [Model Name] via [Tool Name]footer.