Skip to content

✨ Add native gate synthesis MLIR pass and decomposition stack - #1665

Closed
simon1hofmann wants to merge 174 commits into
mainfrom
native_gate_synthesis
Closed

simon1hofmann wants to merge 174 commits into
mainfrom
native_gate_synthesis

Conversation

@simon1hofmann

Copy link
Copy Markdown
Contributor

Description

Introduces a native-gate-synthesis transform 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> on mqt-cc (empty menu = no-op), aligned with pass options documented in Passes.td (native-gates, score-weight-twoq, score-weight-oneq, score-weight-depth).

Fixes #(issue)

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.

simon1hofmann and others added 13 commits April 22, 2026 16:04
…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.
@simon1hofmann simon1hofmann self-assigned this Apr 24, 2026
@simon1hofmann simon1hofmann added enhancement Improvement of existing feature MLIR Anything related to MLIR labels Apr 24, 2026
@simon1hofmann simon1hofmann added this to the MLIR Support milestone Apr 24, 2026
@codecov

codecov Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.52846% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...sforms/NativeSynthesis/FuseTwoQubitUnitaryRuns.cpp 94.7% 10 Missing ⚠️
mlir/lib/Compiler/Programs.cpp 88.8% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

simon1hofmann and others added 22 commits July 21, 2026 14:49
Signed-off-by: simon1hofmann <119581649+simon1hofmann@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: Cursor Grok 4.5 via Cursor
Assisted-by: GPT-5 via Codex
Move QCO cleanup ahead of explicit native synthesis so no later QCO
transformation can reintroduce off-menu gates, and reject native-gate
menus for raw QCO output where they cannot be applied.

Add end-to-end driver regressions for both contracts.

Assisted-by: GPT-5 via Codex
Assisted-by: GPT-5 via Codex
Assisted-by: GPT-5 via Codex
Assisted-by: GPT-5 via Codex
Match the --pass-pipeline guard so the option is not silently ignored when
optimization is skipped.
Emit the off-gateset convergence error on the leftover operation and cover
runtime-parameterized residuals with a unit test.
Use h+swap input and assert synthesized ctrl output rather than only
single-qubit lowering.
@mergify mergify Bot added conflict and removed conflict labels Jul 29, 2026
Resolve fuse native-gates API conflicts in favor of main (required non-empty
menu). Keep QDMI child-device changelog and FoMaC updates from this branch.
Remove superseded fuse leftovers (mqt-cc native-gates tests, global-phase
helper, duplicate changelog entry) after merging #1865.
@mergify mergify Bot removed the conflict label Jul 29, 2026
@simon1hofmann

Copy link
Copy Markdown
Contributor Author

Closing this PR as superseded: its contents are already on main via focused follow-ups, and the branch tip now matches main (no remaining unique changes).

What this branch was

Long-lived integration for native-gate synthesis (matrix utils → Weyl/KAK → single- and two-qubit fuse → mqt-cc / compiler / Python wiring). Review and landing moved to smaller PRs instead of merging this umbrella.

Landed elsewhere

  • Unitary matrix / QCO utils — e.g. #1774 and related
  • Weyl (KAK) decomposition and native-gateset synthesis — #1803, #1832
  • fuse-single-qubit-unitary-runs — #1672
  • fuse-two-qubit-unitary-runs (menus, compiler/mqt-cc/Python exposure, required native-gates contract) — #1865

@simon1hofmann
simon1hofmann deleted the native_gate_synthesis branch July 29, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of existing feature MLIR Anything related to MLIR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants