Skip to content

✨ Add optional MQT Core compilation - #1027

Open
simon1hofmann wants to merge 47 commits into
mainfrom
feat/mqt-core-compiler
Open

simon1hofmann wants to merge 47 commits into
mainfrom
feat/mqt-core-compiler

Conversation

@simon1hofmann

@simon1hofmann simon1hofmann commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Description

Add optional MQT Core compilation through compiler="mqt" or --compiler mqt. Qiskit remains the default, and both compilers return QuantumCircuit.

The mqt extra pins Core 4.1.1 and Qiskit 2.5.x. The base package retains Qiskit 2.2.3 support. Native compilation keeps the input width and ignores device placement; mapped compilation enforces device width and connectivity. Both preserve measurement destinations. QASM/QPY output records compiler provenance alongside benchmark options and seeds.

Core uses a fixed pipeline (opt_level=2), seed 10, and four mapping trials. Pass CompilationOptions in Python or use --compiler-seed and --mapping-trials in the CLI. Setting one CLI control retains the other default. Invalid CLI combinations produce usage errors.

QIR export is stacked separately in #1094.

Validation

  • Full suite with Core 4.1.1 / Qiskit 2.5.2 on Python 3.13: 874 passed.
  • Full suite without Core / Qiskit 2.6.0 on Python 3.13: 707 passed.
  • Full suite at the Qiskit 2.2.3 floor on Python 3.11: 707 passed.
  • Each suite reports four expected failures for the known Qiskit fixed-width carry bug. Installations without Core skip its test module.
  • All lint hooks passed, including type checking with the optional extra.
  • Earlier documentation validation rendered the docs with notebook execution disabled; its 29 warnings also occurred on the preceding PR head.

Updated against current main. Fresh CI is pending.

Codex assisted with implementation, updates, and checks.

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:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@codecov

codecov Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@simon1hofmann simon1hofmann changed the title ✨ Add MQT Core as an optional compiler ✨ Add MQT Core compilation and QIR export Sep 12, 2026
@simon1hofmann simon1hofmann added feature New feature or request python Pull requests that update Python code mqt.bench Issues that affect mqt.bench labels Sep 17, 2026
@simon1hofmann simon1hofmann self-assigned this Sep 24, 2026
@simon1hofmann
simon1hofmann force-pushed the feat/mqt-core-compiler branch from a51d1ac to 91949dd Compare October 2, 2026 11:21
@burgholzer
burgholzer force-pushed the feat/mqt-core-compiler branch from 91949dd to 68d4f2a Compare October 2, 2026 14:06
@burgholzer burgholzer self-assigned this Oct 2, 2026
@burgholzer
burgholzer force-pushed the feat/mqt-core-compiler branch 3 times, most recently from 93867e1 to 3c3ab51 Compare October 4, 2026 15:09
@simon1hofmann

This comment has been minimized.

Assisted-by: GPT-6 via Codex
Assisted-by: GPT-6 via Codex
Assisted-by: GPT-6 via Codex
Include the MQT Core coverage report in the combined CI upload.

Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖

Pin Core main plus the controlled-composite fix and expose CompilationOptions
with a fixed seed and mapping trial count, including mirror recompilation.
Remove circuit preprocessing and parameter remapping now handled by Core.

Configure MLIR for CI source builds and cover option forwarding,
reproducibility, and parameter-vector identity.

Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖

Use the Core fix that handles composite controls within the existing
decomposition pass and avoids extra single-qubit merging.

Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖

The reusable lint job configures sccache without installing it when stub
checks are disabled, so building Core for ty fails. Run the existing ty hook
in the Core job, which already provides MLIR and builds the dependency.
Require that job whenever either tests or lint are requested.

Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖

Pin the integrated Core changes for native trapped-ion gates and generic
fixed RX/RY/RZ capabilities while preserving controlled-composite support.
Restore Rigetti pulse names during target validation and cover symbolic
parameters, native semantics, and rejected target definitions.

Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖

Use canonical native definitions so Core preserves numeric and symbolic
pulses through repeated compilation. Omit capabilities wider than the
input circuit at the native-gate level. Pin Core with the matching import
and fixed-parameter compatibility fixes.

Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖

Pin the rebased integration branch with the fixed-parameter and native-gate CI tests. Keep the dependency lockfile and documented revision aligned.

Assisted-by: GPT-6 via Codex
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
Extract the target-test isolation and device capability checks from #1027.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
Cover bounded target aliases and legacy Qiskit serialization. Extract registry isolation from #1027. Remove the extra test file.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
Extracted from #1027; retain original authorship.


Assisted-by: GPT-6 via Codex

Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
* ✨ Add AQT IBEX device and native gate set

Extracted from #1027; retain original authorship.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* 📝 Reference #1084 in changelog

* ✅ Isolate target registries and check device control-flow limits

Extract the target-test isolation and device capability checks from #1027.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* ✅ Keep AQT tests in the existing target test module

* 📝 Keep migration guidance and changelog links in their sections

---------

Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
* 🔥 Remove retired IBM device models

Extracted from #1027; retain original authorship.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* 📝 Reference #1089 in changelog

* 📝 Keep migration guidance and changelog links in their sections

* 📝 Distinguish gate-set and device names in CLI help

* 🔥 Remove tests for retired IBM catalogue names

---------

Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
* 📝 Fix API documentation markup and notebook builds

Extracted from #1027; retain original authorship.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* 📝 Reference #1088 in changelog

* 📝 Keep migration guidance and changelog links in their sections

* Preserve citations and signatures in Markdown documentation

* Remove ineffective sphinx-llm version cap

sphinx-llm 1.0 and 1.1 produce identical per-page Markdown. Version 1.1
exposes existing unsupported-node warnings; the cap does not restore
missing content.

Refs: NVIDIA/sphinx-llm#153

---------

Signed-off-by: simon1hofmann <119581649+simon1hofmann@users.noreply.github.com>
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
* ✨ Add IBM Nighthawk device model

Extracted from #1027; retain original authorship.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* 📝 Reference #1085 in changelog

* ✅ Keep Nighthawk tests in the existing target test module

* 📝 Keep migration guidance and changelog links in their sections

---------

Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
* 🐛 Preserve IonQ and Rigetti native gate semantics

Extracted from #1027; retain original authorship.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* 📝 Reference #1086 in changelog

* ✅ Keep native regression tests in the target test module

Cover bounded target aliases and legacy Qiskit serialization. Extract registry isolation from #1027. Remove the extra test file.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>

* 🐛 Preserve physical placements shared by native aliases

Keep equivalent RX aliases on every supported physical site, including targets that also expose a standard X gate. Retain phase-correct local lowering and add mapped regressions.


Assisted-by: GPT-6 via Codex

* ✅ Check mixed aliases at native and mapped levels

* Test minimum Qiskit support and complete mirror layouts

* ✅ Verify native gate constraints and restore minimums session

Cover arbitrary U/RX compilation at all optimization levels for native and mapped targets, and check session equivalences remain unchanged. Keep local lowering because preset passes do not consistently enforce fixed R/RX angles. Restore noxfile.py to main.

Assisted-by: GPT-6 via Codex

---------

Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
🤖 *AI text below* 🤖

Keep the merged device and native-alias changes from main while preserving Core/QIR and fractional-Heron support. Reconcile the changelog and retain the upstream placement and bounds regressions.

Assisted-by: GPT-5 via Codex
simon1hofmann added a commit that referenced this pull request Oct 21, 2026
* 🐛 Preserve IonQ and Rigetti native gate semantics

Extracted from #1027; retain original authorship.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* 📝 Reference #1086 in changelog

* ✨ Add fractional Heron compilation targets

Extracted from #1027; retain original authorship.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-6 via Codex

* 📝 Reference #1087 in changelog

* ✅ Keep native regression tests in the target test module

Cover bounded target aliases and legacy Qiskit serialization. Extract registry isolation from #1027. Remove the extra test file.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>

* ✅ Keep fractional target tests in the existing test module

Cover old Qiskit rejection and narrower caller-defined RZZ bounds.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>

* 🐛 Preserve physical placements shared by native aliases

Keep equivalent RX aliases on every supported physical site, including targets that also expose a standard X gate. Retain phase-correct local lowering and add mapped regressions.


Assisted-by: GPT-6 via Codex

* ✅ Check mixed aliases at native and mapped levels

* 🐛 Serialize documentation builds that share notebook output

Use the same notebook build ordering as #1088 to prevent concurrent HTML and Markdown builds from deleting each other’s example output.

* Test minimum Qiskit support and complete mirror layouts

* Test the fractional target compatibility error on current Qiskit

* ♻️ Simplify fractional Heron registration and angle wrapping

Use a shared packaging.version check while keeping Qiskit 2.1.2 support. Use theta parameters, simplify the local wrapping traversal and phase correction, and cover all optimization levels and large angles.

Assisted-by: GPT-6 via Codex

* ✅ Verify native gate constraints and restore minimums session

Cover arbitrary U/RX compilation at all optimization levels for native and mapped targets, and check session equivalences remain unchanged. Keep local lowering because preset passes do not consistently enforce fixed R/RX angles. Restore noxfile.py to main.

Assisted-by: GPT-6 via Codex

* ⬆️ Require Qiskit 2.2.3 and simplify fractional targets

Register fractional Heron targets unconditionally, remove obsolete compatibility guards and tests, and document the new Qiskit minimum and upgrade command.

Assisted-by: GPT-6 via Codex

---------

Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
@simon1hofmann simon1hofmann changed the title ✨ Add MQT Core compilation and QIR export ✨ Add optional MQT Core compilation Oct 21, 2026
Extract target documentation, remove redundant target tests and dead packaging metadata, and restore main’s documentation dependency.

Assisted-by: GPT-5 via Codex
Include the complete Cepheus architecture and consolidated parameter guide. Preserve the optional compiler dependency pins and minimum-version base support.

Assisted-by: GPT-6 via Codex
@simon1hofmann
simon1hofmann added this pull request to stack #1097 October 22, 2026 11:21
@simon1hofmann
simon1hofmann marked this pull request as ready for review October 22, 2026 13:39
@burgholzer

Copy link
Copy Markdown
Member

I haven't looked at this in detail yet, but one thing that has become clear to me:
Let's move to Qiskit 2.5+ for this change. Already from quickly glancing over the changes, maintaining compatibility with anything less will become painful.

I also stumbled over this separately in munich-quantum-toolkit/core#2850 where I now experimented with raising the lower bound as well. This would fit well with the PR here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request mqt.bench Issues that affect mqt.bench python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants