Repository navigation
✨ Add MQT Core compilation and QIR export - #1027
simon1hofmann wants to merge 35 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
509d184 to
df2aeca
Compare
a51d1ac to
91949dd
Compare
91949dd to
68d4f2a
Compare
93867e1 to
3c3ab51
Compare
|
🤖 AI text below 🤖 [P2] Preserve angle bounds when translating native aliases In Reproduced on from math import pi
from qiskit import QuantumCircuit
from qiskit.circuit import Parameter
from qiskit.circuit.library import RZGate, RZZGate
from qiskit.transpiler import Target
from mqt.bench import get_benchmark_native_gates, get_benchmark_mapped
from mqt.bench.targets.gatesets.ionq import GPIGate, GPI2Gate
target = Target(num_qubits=2)
target.add_instruction(GPIGate(Parameter("gpi")))
target.add_instruction(GPI2Gate(Parameter("gpi2")))
target.add_instruction(RZGate(Parameter("rz")))
target.add_instruction(RZZGate(Parameter("zz")), angle_bounds=[(0, pi / 2)])
source = QuantumCircuit(2)
source.rzz(-0.37, 0, 1)
for compile_circuit in (get_benchmark_native_gates, get_benchmark_mapped):
result = compile_circuit(source, None, target, compiler="qiskit")
invalid = [
item.operation.params
for item in result.data
if item.operation.name == "rzz"
and not target.supported_angle_bound("rzz", item.operation.params)
]
print(invalid) # [[-0.37]] for both compilation levelsBoth outputs preserve the unitary but violate the requested target. Core compilation handles the same input correctly. Please preserve angle bounds when constructing the temporary target and add a regression test combining native aliases with a bounded entangler, covering both native and mapped compilation. |
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
Convert provider turns and ZZ names at the Core boundary, preserve physical-wire recompilation, and align fixed-target tests with supported synthesis bases. Assisted-by: GPT-6 via Codex
Assisted-by: GPT-6 via Codex
Delegate target semantics to Core, preserve virtual RZ, and use standard fixed RX aliases shared with Qiskit. Replace retired device models with current Cepheus and AQT snapshots and repair exact native equivalences. Cover strict constraints, native placement policy, phase, aliases, and both compiler paths. Resolve documentation warnings. Assisted-by: GPT-6 via Codex
Use Core 0ceb14003 with canonical ion gates, aliases, and jeff support. Require an entangling capability for multi-qubit targets, removing the single-qubit-only device workaround while retaining narrow benchmarks. Require Qiskit 2.5 to avoid the obsolete post-layout pass path. Document hardware feedback limits and refresh the dependency lockfile. Assisted-by: GPT-6 via Codex
Use a conflicting uv minimums group so CI tests Qiskit 2.1.2 while the optional Core extra retains its 2.5.x native bridge requirement. Make IonQ and Rigetti equivalence registration idempotent with stable parameters and copied recipe comparisons. Preserve global phase and parameter binding across repeated compilation. Update the Core pin and compatibility documentation. Assisted-by: GPT-6 via Codex
Use Qiskit's single-qubit circuit constructor for GPI/GPI2 definitions. Pin Core's matching explicit pulse export signatures. Assisted-by: GPT-6 via Codex
Compile through a private standard-gate target and a local equivalence library. Preserve native RX aliases and full phase without changing the session library, so results remain reusable under control and recompilation. Reuse the pipeline for mirrors, preserve their complete layout metadata, and retain logical layout in Core's native compilation results. Pin the matching Core synthesis update. Assisted-by: GPT-6 via Codex
Use gate terminology for fixed-angle RX and IonQ operations in source, tests, and documentation. Describe virtual Z using native gate phases and reserve pulse terminology for physical control and Qiskit timing. Update the Core pin to its matching terminology cleanup. Assisted-by: GPT-6 via Codex
Compile IonQ and Rigetti aliases through standard Qiskit gates and local phase-correct equivalences. Select supported native capabilities instead of provider descriptions and leave the session equivalence library alone. Pin the simplified Core synthesis implementation and retain independent uv selections for minimum Qiskit and the optional Core integration. Assisted-by: GPT-6 via Codex
Pin Core's integrated parametric synthesis and check runtime Pauli and controlled rotations against IonQ, AQT, and Rigetti native targets. Verify parameter identity, global phase, and native entangler counts. Assisted-by: GPT-6 via Codex
Use the simplified synthesis capabilities and cost analysis from Core PR #2578. Validate the optional integration against the exact revision. Assisted-by: GPT-6 via Codex
Use Core's native Clifford conjugation and shared numerical Euler synthesis. Keep the optional dependency and uv lockfile on the exact validated revision. Assisted-by: GPT-6 via Codex
Pin the optional MQT compiler to the integrated one-qubit fusion work and the large symbolic-expression import/export fixes from Core #2578. Refresh the uv lockfile without changing the base Qiskit requirement. Assisted-by: GPT-6 via Codex
Pin the optional compiler to the audited symbolic synthesis fixes in Core #2578, including balanced RZ runs, unchanged runtime Euler angles, and collective input metadata validation. Refresh the uv lockfile. Assisted-by: GPT-6 via Codex
Expose arbitrary RX and bounded RZZ on the existing Heron models. Use Qiskit's angle wrapping with local registry copies and retain phase when folding negative or large angles. Keep these models conditional on Qiskit 2.2 support without raising the base dependency minimum. Pin Core's equatorial and fractional synthesis update. Import native gate sets directly through Core while preserving parameter bounds. Cover both compilers, mapped and native compilation, and safe runtime fallback. Assisted-by: GPT-6 via Codex
Model the 120-qubit Nighthawk grid from IBM Runtime's device snapshot. Share Heron's conventional CZ basis and validate mapped compilation for Nighthawk, Heron, and fractional Heron. Document the model's provenance. Pin the optional compiler to Core's synthesis CI and IBM mock fixes. Assisted-by: GPT-6 via Codex
Use the final IBM mock catalogue and QDMI discovery fixes from Core #2578. Assisted-by: GPT-6 via Codex
Build native compilation targets from NativeOperations and the circuit width. Keep physical import for mapped compilation. Update fractional-gate tests and documentation for the supported RZZ(pi/2) endpoint decomposition. Pin the matching Core revision and refresh uv's lockfile. All 553 tests and 180 optional compiler checks pass against this pin, along with lint and docs. Assisted-by: GPT-6 via Codex
Use the rebased native-synthesis branch with direct equatorial frame absorption, commuting RZ cancellation, and shared Qiskit expressions. Refresh uv's optional-dependency resolution for the exact compiler commit. Assisted-by: GPT-6 via Codex
Use the native rotation composition and synthesis cleanup from Core #2578. Retain the separate Qiskit dependency selections in the uv lockfile. Assisted-by: GPT-6 via Codex
Refresh the optional compiler dependency and uv lockfile to include inverse-trigonometric evaluation in DDSIM. Assisted-by: GPT-6 via Codex
Pin the compiler extra to the shared approximation and Z-frame update. Retain the separate minimum-Qiskit dependency selection in uv.lock. Preserve the ML-QAE test helpers when rebasing onto upstream main. Assisted-by: GPT-6 via Codex
Pin the native compiler to its validated tensor-chain cleanup and numerically stable Euler emission. Refresh the optional dependency lock. Assisted-by: GPT-6 via Codex
Pin the optional compiler dependency and lock file to the final Core revision. The exact revision passes all 180 MQT integration tests. Assisted-by: GPT-6 via Codex
Use the released PyPI wheel and its builtin QDMI driver API. Preserve bounded gates when translating native aliases, retain main’s mirror fixes, and serialize documentation builds that share generated files. Assisted-by: GPT-6 via Codex
2972a1e to
1e1eba6
Compare
🤖 AI text below 🤖
Description
Add optional MQT Core compilation with
compiler="mqt"or--compiler mqt, plus QIR export as LLVM text or bitcode. Qiskit remains the default compiler; both paths returnQuantumCircuit. Native compilation ignores placement and uses the input circuit width. Mapped compilation enforces connectivity, ordered gate placements, and device width.The
mqtextra installs MQT Core 4.1.1 from PyPI and requires Qiskit 2.5.x. Core wheels include the compiler runtime, so wheel installations and the integration CI no longer need a separate LLVM/MLIR setup. Base Bench retains Qiskit 2.1.2 support. uv keeps both dependency selections in one lockfile; theminimumsgroup conflicts with themqtextra so minimum-version CI cannot silently upgrade to 2.5.python -m pip install -e ".[mqt]" mqt-bench --compiler mqt --algorithm ghz --num-qubits 3 \ --level mapped --target iqm_crystal_5 --saveCore owns gate identity, native aliases, parameter constraints, and synthesis. Native compilation imports
CompilerTarget.NativeOperations, retaining bounds independently of hardware placement, then uses the ordinary Core target constructor. Runtime Pauli rotations, single-controlled Pauli rotations, and controlled phase use Core's shared synthesis. IQM compilation benefits from direct two-R synthesis and Z-frame propagation through CZ, with compact symbolic angles and shared Qiskit expression conversion. Native RZ targets also merge Z frames through diagonal entanglers. Constant resynthesis shares Core's local average-fidelity floor of1 - 1e-12; unbound angles remain exact. Unsupported constraints fail explicitly; there is no fallback transpiler or approximate Clifford+T synthesis. Multi-qubit devices require an entangling capability; one-qubit benchmarks remain supported.Native targets
ibm_nighthawk_120and the shared CZ-basedibm_nighthawkgate set. Its 12-by-10 grid matches all 436 directed edges in IBM Runtime's FakeNighthawk snapshot. IBM's current Nighthawk has 120 programmable qubits; Heron has 156. Nighthawk fractional gates are not advertised. Test mapped compilation for Nighthawk, Heron, and fractional Heron.ibm_heron_fractionalandibm_heron_156_fractional, with arbitrary RX and bounded RZZ. Both compilers fold numeric RZZ angles into[0, pi/2]with exact local and phase corrections. Core uses two RZZ(pi/2) gates for unknown runtime angles; bind parameters before Qiskit compilation to enforce the interval. Qiskit uses its existing wrapping pass with local registry copies, preserving the global registry. Fractional models are available with Qiskit 2.2 or newer. Calibration is synthetic.rxpi,rxpidg,rxpi2, andrxpi2dg, plus RZ/CZ. IonQ and Rigetti optimize through standard Qiskit gates and lower native names with a local equivalence library. Global phase is preserved, including when results are controlled and recompiled. Alias translation preserves angle bounds on other gates; native and mapped regression tests cover bounded RZZ combined with both IonQ and Rigetti aliases.rigetti_cepheus_107with explicit physical labels andaqt_ibex_12using R/RZ/RXX. Keep Forte, Heron-156, IQM architecture models, and Quantinuum H2. Models have documented provenance and calibration limitations; benchmark generation makes no cloud queries.Compilation and output
Core uses its fixed optimization pipeline; leave
opt_level=2. Seed10and four mapping trials are the defaults;compiler_options=CompilationOptions(...)overrides them, including for mirror recompilation. Native results retain logical layout metadata; useOperator.from_circuitto interpret them. Mapped results use physical wires and preserve measurement destinations. Qiskit mirror recompilation preserves the original layout. Exports record compiler provenance.The extra enables
qir/llvmtext andqir-bitcodeoutput for either compiler, with Base or Adaptive profiles. Parameters must be bound. Export lowers the supplied circuit without another compilation pipeline; execution requires a compatible QIR runtime. The parameter guide, upgrade guide, and target catalogue describe options, migrations, and device evidence. Broader compiler pipeline changes remain deferred.Validation
fcc5b3cb, preserving Python 3.15 support and the mirror fixes.open_devicefrommqt.core.qdmi.builtin_driver.Assisted by GPT-6 via Codex.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).