Repository navigation
✨ Improve Qiskit QDMI compiler integration - #2850
Open
burgholzer wants to merge 3 commits into
Open
burgholzer wants to merge 3 commits into
burgholzer wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Represent the standard Qiskit control-flow and loop-jump classes only when the device advertises them. Assisted-by: Codex
Advertise variadic loop controls already executed by the DD engine. Cover nested jump scope, native operand validation, bound loop parameters, and register-separated results. Assisted-by: Codex
burgholzer
force-pushed
the
codex/qdmi-qiskit-control-flow
branch
from
October 25, 2026 21:28
7b844a0 to
9358a06
Compare
burgholzer
force-pushed
the
codex/qdmi-qiskit-control-flow
branch
from
October 25, 2026 22:28
9358a06 to
ee8e98f
Compare
11 of 12 tasks
burgholzer
force-pushed
the
codex/qdmi-qiskit-control-flow
branch
from
October 25, 2026 23:15
ee8e98f to
cee0955
Compare
Serialize QASM3 through Core's Qiskit importer and OpenQASM exporter. Native import preserves physical sites and opaque gate calls. Validate captured blocks through operand maps and reject unlowered annotations. Use LLVM lookup containers with deterministic SSA slot ordering, share symbol naming, and reject conflicting opaque signatures. Import OpenQASM 2 opaque declarations as external functions without invented gate bodies. OpenQASM 3 output retains calls supplied by the receiving device. Require Qiskit >=2.5,<2.7 without the QASM extra; retain OpenQASM 2 and QPY 17. Use uv overlays for supported-minor tests and locked environments for Git Qiskit builds with matching C headers. Consolidate serializer tests and document the current compiler and backend contracts. Advertise existing Store execution through DDSIM and Qiskit. Use owned LLVM permutation keys with borrowed lookup and return opaque-gate errors as Expected for translation at the Python binding boundary. Emit OPENQASM 3 unless emitted switch syntax requires 3.1. Add compiler-backed IQM JSON and Base/Adaptive QIR text/bitcode serializers behind provider registrations. Separate physical allocation from opaque import so QIR preserves site indices and lowers gate definitions. Share consuming QIR-to-IQM export with the compiler pipeline, and omit finite unconditional global phase only from IQM sampling payloads. Preserve explicit readout and native-operation validation limits. Prefer QPY and OpenQASM 3 before QIR to retain opaque native-gate support and avoid unnecessary lowering for existing backend submissions. Assisted-by: Codex
burgholzer
force-pushed
the
codex/qdmi-qiskit-control-flow
branch
from
October 26, 2026 01:46
cee0955 to
532330d
Compare
This branch has not been deployed
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.
🤖 AI text below 🤖
Description
Route Qiskit-to-OpenQASM 3 QDMI submissions through Core's Qiskit importer and OpenQASM exporter. Native import preserves physical sites, gate names, scalar parameters, operand order, and classical outputs. The backend validates device support before conversion. Advertised if/for/while/switch/break/continue operations and Store assignments map to Qiskit instructions; captured blocks use operand maps rather than top-level register-layout restrictions.
Opaque gates use private external functions without invented definitions. OpenQASM 2 input accepts
opaquedeclarations; OpenQASM 3 output emits receiver-supplied calls, since that language has noopaquedeclaration. Unresolved execution, conflicting opaque signatures, and unlowered annotated operations reject explicitly. The Qiskit backend requires registers to partition the circuit bits in register order. DDSIM advertises Store support, using the compiler's existing assignment and local-variable lowering.Use LLVM lookup containers in the importer, sorting variable identities only when constructing SSA tuples. Permutation-cache keys use owned SmallVectors with borrowed lookup; and opaque-cache hits compare argument types without rebuilding function types. Opaque-gate creation returns Expected errors, translated to Python exceptions by the binding-side caller. Share symbol naming, consolidate serializer tests, and integrate the contracts into existing documentation.
Emit
OPENQASM 3;unless emitted syntax requires a newer minor version. Both native switches and switches generated for indexed tables require3.1; the exporter tracks this while emitting, without a second traversal.Provide compiler-backed IQM JSON and Base/Adaptive QIR serializers in text and bitcode. Physical import preserves qubit indices while lowering gate definitions. The consuming
QIRProgram.to_iqm_json(target, copy=False)exposes the existing exporter and is shared with the compiler pipeline. IQM accepts placed PRX/CZ and complete, unique terminal readout; finite unconditional global phase is omitted from sampling payloads. Native placements remain validated.Provider registrations override the new fallbacks. Prefer device-native/custom formats, then QPY, OpenQASM 3, Adaptive QIR, Base QIR, and OpenQASM 2. This retains opaque-gate submission and the effective previous DDSIM default. Devices with external QIR serializers that also advertise QPY/OpenQASM now follow this documented order. Conversion failure does not trigger a format retry.
Require
qiskit>=2.5,<2.7without the optional QASM importer. OpenQASM 2 submission and QPY 17 remain supported. Supported-minor nox tests use uv overlays. Git-Qiskit tests retain the exact-header build and use locked environments without backing up or replacing the lockfile. Users independently calling Qiskit's optional OpenQASM importer must install its extra themselves or use Core's converters.Validation
Signed head: 532330d.
06ff24ed8c396525111159df88d77a430093e78bfor radians, site names, readout ordering and serializer precedence; no external provider job was submitted.Hosted CI is pending/unobserved. Other platforms and external hardware were not evaluated on this head.
AI assistance: Codex implemented and reviewed these changes under explicit user authorization.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).