[Python] Add native OpenQASM 2.0/3.0 parser and expand Qiskit interoperability#4357
Open
QuantumRaul wants to merge 6 commits intoNVIDIA:mainfrom
Open
[Python] Add native OpenQASM 2.0/3.0 parser and expand Qiskit interoperability#4357QuantumRaul wants to merge 6 commits intoNVIDIA:mainfrom
QuantumRaul wants to merge 6 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Raul Martinez <raul.marpa01@gmail.com>
…perability in cudaq.contrib Signed-off-by: Raul Martinez <raul.marpa01@gmail.com>
1 task
CI Summary (
|
| Job | Result | Link |
|---|---|---|
python_wheels |
❌ failure | view |
Top-level jobs (13)
| Job | Result |
|---|---|
binaries |
✅ success |
build_and_test |
✅ success |
config_devdeps |
✅ success |
config_source_build |
✅ success |
config_wheeldeps |
✅ success |
devdeps |
✅ success |
docker_image |
✅ success |
gen_code_coverage |
✅ success |
metadata |
✅ success |
python_metapackages |
⏩ skipped |
python_wheels |
❌ failure |
source_build |
✅ success |
wheeldeps |
✅ success |
⏩ Skipped jobs (1) — intentionally skipped on PR builds; run on merge_group / workflow_dispatch
| Job |
|---|
python_metapackages |
All sub-jobs (172) — every matrix leg, with links
| Job | Status | Link |
|---|---|---|
| Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| CI Summary | ❔ in_progress | view |
| Configure build (devdeps) | ✅ success | view |
| Configure build (source_build) | ✅ success | view |
| Configure build (wheeldeps) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Build CUDA Quantum assets | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Minimal OpenMPI installation | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Prepare cache clean-up | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Prepare validation | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Staging | ⏩ skipped | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (debian:12) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (fedora:42) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (opensuse/leap:15.5) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (redhat/ubi9:9.6) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (ubuntu:22.04) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Build CUDA Quantum assets | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Minimal OpenMPI installation | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Prepare cache clean-up | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Prepare validation | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Staging | ⏩ skipped | view |
| Create CUDA Quantum installer (amd64, 13.0) / Validate installer (debian:12) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Validate installer (fedora:42) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Validate installer (opensuse/leap:15.5) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 13.0) / Validate installer (ubuntu:22.04) | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Build CUDA Quantum assets | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Minimal OpenMPI installation | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Prepare cache clean-up | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Prepare validation | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Staging | ⏩ skipped | view |
| Create CUDA Quantum installer (arm64, 12.6) / Validate installer (redhat/ubi9:9.6) | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Validate installer (ubuntu:22.04) | ✅ success | view |
| Create CUDA Quantum installer (arm64, 13.0) / Build CUDA Quantum assets | ✅ success | view |
| Create CUDA Quantum installer (arm64, 13.0) / Minimal OpenMPI installation | ✅ success | view |
| Create CUDA Quantum installer (arm64, 13.0) / Prepare cache clean-up | ✅ success | view |
| Create CUDA Quantum installer (arm64, 13.0) / Prepare validation | ✅ success | view |
| Create CUDA Quantum installer (arm64, 13.0) / Staging | ⏩ skipped | view |
| Create CUDA Quantum installer (arm64, 13.0) / Validate installer (ubuntu:22.04) | ✅ success | view |
| Create Docker images (amd64) / Documentation | ✅ success | view |
| Create Docker images (amd64) / Metadata | ✅ success | view |
| Create Docker images (amd64) / Prepare cache clean-up | ✅ success | view |
| Create Docker images (amd64) / Staging | ⏩ skipped | view |
| Create Docker images (amd64) / Validation | ✅ success | view |
| Create Docker images (amd64) / cuda-quantum (release) | ✅ success | view |
| Create Docker images (amd64) / cuda-quantum-dev (debug) | ✅ success | view |
| Create Docker images (amd64) / open-mpi | ⏩ skipped | view |
| Create Docker images (arm64) / Documentation | ⏩ skipped | view |
| Create Docker images (arm64) / Metadata | ✅ success | view |
| Create Docker images (arm64) / Prepare cache clean-up | ✅ success | view |
| Create Docker images (arm64) / Staging | ⏩ skipped | view |
| Create Docker images (arm64) / Validation | ✅ success | view |
| Create Docker images (arm64) / cuda-quantum (release) | ✅ success | view |
| Create Docker images (arm64) / cuda-quantum-dev (debug) | ✅ success | view |
| Create Docker images (arm64) / open-mpi | ⏩ skipped | view |
| Create Python metapackages | ⏩ skipped | view |
| Create Python wheels (amd64, 3.11, 12.6) / Build Python 3.11 wheel | ✅ success | view |
| Create Python wheels (amd64, 3.11, 12.6) / Prepare validation | ✅ success | view |
| Create Python wheels (amd64, 3.11, 12.6) / Staging | ⏩ skipped | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (debian:12) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (debian:12, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (fedora:42) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (fedora:42, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (redhat/ubi9:9.6) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (redhat/ubi9:9.6, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (ubuntu:22.04) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (ubuntu:22.04, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Build Python 3.11 wheel | ✅ success | view |
| Create Python wheels (amd64, 3.11, 13.0) / Prepare validation | ✅ success | view |
| Create Python wheels (amd64, 3.11, 13.0) / Staging | ⏩ skipped | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (debian:12) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (debian:12, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (fedora:42) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (fedora:42, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (redhat/ubi8:8.10) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (redhat/ubi8:8.10, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (redhat/ubi9:9.6) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (redhat/ubi9:9.6, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (ubuntu:22.04) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 13.0) / Validate wheel (ubuntu:22.04, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.13, 12.6) / Build Python 3.13 wheel | ✅ success | view |
| Create Python wheels (amd64, 3.13, 12.6) / Prepare validation | ✅ success | view |
| Create Python wheels (amd64, 3.13, 12.6) / Staging | ⏩ skipped | view |
| Create Python wheels (amd64, 3.13, 12.6) / Validate wheel (fedora:42) | ❌ failure | view |
| Create Python wheels (amd64, 3.13, 12.6) / Validate wheel (fedora:42, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.13, 13.0) / Build Python 3.13 wheel | ✅ success | view |
| Create Python wheels (amd64, 3.13, 13.0) / Prepare validation | ✅ success | view |
| Create Python wheels (amd64, 3.13, 13.0) / Staging | ⏩ skipped | view |
| Create Python wheels (amd64, 3.13, 13.0) / Validate wheel (fedora:42) | ❌ failure | view |
| Create Python wheels (amd64, 3.13, 13.0) / Validate wheel (fedora:42, --user) | ❌ failure | view |
| Create Python wheels (arm64, 3.11, 12.6) / Build Python 3.11 wheel | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Prepare validation | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Staging | ⏩ skipped | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (debian:12) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (debian:12, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (fedora:42) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (fedora:42, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (redhat/ubi9:9.6) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (redhat/ubi9:9.6, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (ubuntu:22.04) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (ubuntu:22.04, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Build Python 3.11 wheel | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Prepare validation | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Staging | ⏩ skipped | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (debian:12) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (debian:12, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (fedora:42) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (fedora:42, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (redhat/ubi8:8.10) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (redhat/ubi8:8.10, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (redhat/ubi9:9.6) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (redhat/ubi9:9.6, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (ubuntu:22.04) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 13.0) / Validate wheel (ubuntu:22.04, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.13, 12.6) / Build Python 3.13 wheel | ✅ success | view |
| Create Python wheels (arm64, 3.13, 12.6) / Prepare validation | ✅ success | view |
| Create Python wheels (arm64, 3.13, 12.6) / Staging | ⏩ skipped | view |
| Create Python wheels (arm64, 3.13, 12.6) / Validate wheel (fedora:42) | ✅ success | view |
| Create Python wheels (arm64, 3.13, 12.6) / Validate wheel (fedora:42, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.13, 13.0) / Build Python 3.13 wheel | ✅ success | view |
| Create Python wheels (arm64, 3.13, 13.0) / Prepare validation | ✅ success | view |
| Create Python wheels (arm64, 3.13, 13.0) / Staging | ⏩ skipped | view |
| Create Python wheels (arm64, 3.13, 13.0) / Validate wheel (fedora:42) | ✅ success | view |
| Create Python wheels (arm64, 3.13, 13.0) / Validate wheel (fedora:42, --user) | ✅ success | view |
| Gen code coverage (amd64) / gen_code_coverage | ✅ success | view |
| Load dependencies (amd64, gcc12) / Caching | ✅ success | view |
| Load dependencies (amd64, gcc12) / Finalize | ✅ success | view |
| Load dependencies (amd64, gcc12) / Metadata | ✅ success | view |
| Load dependencies (amd64, llvm) / Caching | ✅ success | view |
| Load dependencies (amd64, llvm) / Finalize | ✅ success | view |
| Load dependencies (amd64, llvm) / Metadata | ✅ success | view |
| Load dependencies (arm64, gcc12) / Caching | ✅ success | view |
| Load dependencies (arm64, gcc12) / Finalize | ✅ success | view |
| Load dependencies (arm64, gcc12) / Metadata | ✅ success | view |
| Load dependencies (arm64, llvm) / Caching | ✅ success | view |
| Load dependencies (arm64, llvm) / Finalize | ✅ success | view |
| Load dependencies (arm64, llvm) / Metadata | ✅ success | view |
| Load source build cache (amd64, 12.6) / Caching | ✅ success | view |
| Load source build cache (amd64, 12.6) / Finalize | ✅ success | view |
| Load source build cache (amd64, 12.6) / Metadata | ✅ success | view |
| Load source build cache (amd64, 13.0) / Caching | ✅ success | view |
| Load source build cache (amd64, 13.0) / Finalize | ✅ success | view |
| Load source build cache (amd64, 13.0) / Metadata | ✅ success | view |
| Load source build cache (arm64, 12.6) / Caching | ✅ success | view |
| Load source build cache (arm64, 12.6) / Finalize | ✅ success | view |
| Load source build cache (arm64, 12.6) / Metadata | ✅ success | view |
| Load source build cache (arm64, 13.0) / Caching | ✅ success | view |
| Load source build cache (arm64, 13.0) / Finalize | ✅ success | view |
| Load source build cache (arm64, 13.0) / Metadata | ✅ success | view |
| Load wheel dependencies (amd64, 12.6) / Caching | ✅ success | view |
| Load wheel dependencies (amd64, 12.6) / Finalize | ✅ success | view |
| Load wheel dependencies (amd64, 12.6) / Metadata | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Caching | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Finalize | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Metadata | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Caching | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Finalize | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Metadata | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Caching | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Finalize | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Metadata | ✅ success | view |
| Prepare cache clean-up | ❔ in_progress | view |
| Retrieve PR info | ✅ success | view |
⚠️ Required checks (28/39) — 11 missing — declared in .github/required-checks.yml for workflow_dispatch
| Required check | Status | Link |
|---|---|---|
| Build and test (amd64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Build CUDA Quantum assets | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Minimal OpenMPI installation | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (debian:12) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (fedora:42) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (opensuse/leap:15.5) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (redhat/ubi9:9.6) | ✅ success | view |
| Create CUDA Quantum installer (amd64, 12.6) / Validate installer (ubuntu:22.04) | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Build CUDA Quantum assets | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Minimal OpenMPI installation | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Validate installer (redhat/ubi9:9.6) | ✅ success | view |
| Create CUDA Quantum installer (arm64, 12.6) / Validate installer (ubuntu:22.04) | ✅ success | view |
| Create Docker images (amd64) / Documentation | ✅ success | view |
| Create Docker images (amd64) / Validation | ✅ success | view |
| Create Docker images (arm64) / Validation | ✅ success | view |
| Create Python metapackages / Build Python metapackages | ❔ missing | |
| Create Python metapackages / Test Python metapackages (3.11) | ❔ missing | |
| Create Python metapackages / Test Python metapackages (3.13) | ❔ missing | |
| Create Python metapackages / Test Python metapackages (12.6, 3.11) | ❔ missing | |
| Create Python metapackages / Test Python metapackages (12.6, 3.13) | ❔ missing | |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (debian:12, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (debian:12) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (fedora:42, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (fedora:42) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10, --user) | ❌ failure | view |
| Create Python wheels (amd64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10) | ❌ failure | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (debian:12, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (debian:12) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (fedora:42, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (fedora:42) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10, --user) | ✅ success | view |
| Create Python wheels (arm64, 3.11, 12.6) / Validate wheel (redhat/ubi8:8.10) | ✅ success | view |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
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.
Summary
Expands
cudaq.contribinteroperability with two related improvements:from_qasm_str,from_qasm) — pure-Python parser that converts OpenQASM source directly into a CUDA-Q kernel, no Qiskit dependency. Dispatches on theOPENQASM <version>;header; 2.x is handled by_QASM2Translator, 3.x by the_QASM3Translatorsubclass.from_qiskit— a complete dispatch table for theqelib1.inc/stdgates.incgate sets, with a recursive fallback throughInstruction.definitionfor custom and composite gates.Both helpers share a common gate handler table (
_GATE_HANDLERSinqiskit_convert.py) so the two translators stay in lockstep on gate semantics.Motivation
The new native translator removes the dependency for qiskit over OpenQASM translation needs, adds first-class 3.0 support, and keeps
from_qiskitrobust enough to round-trip circuits built with the full Qiskit standard library.Changes
python/cudaq/contrib/qasm_convert.py_QASM2Translatorcovering the fullqelib1.incgate set (Paulis, 1-qubit Clifford, universalu1/u2/u3/u/p/u0, rotations, extended single-qubitsx/sxdg/r, controlled one- and two-qubit gates, swap family, two-qubit parametricsrxx/ryy/rzz/rzx, and multi-qubitccx/ccz/rccx/c3x/c4x/mcx/mcp), plusmeasure,reset,barrier,opaque, and user-definedgateblocks with recursive expansion._QASM3Translator(subclass) adds the 3.0 surface:qubit[N]/bit[N]declarations,c = measure q;assignment, built-inU(θ,φ,λ)and 4-parameterU(θ,φ,λ,γ),gphase(γ), legacy uppercaseCXandI, andinclude "stdgates.inc";. Gate modifiers (ctrl @,negctrl @,inv @,pow(n) @) and classical control / typed-variable declarations will be lately implemented, at the moment raiseNotImplementedErrorwith a clear message_eval_exprbuilt onast.parsewith an allowlist (constantspi/e/tau; standard math functions;+ - * / ** ^and unary+ -), used for gate-parameter expressions and nested custom-gate environments.h q;applies element-wise, mismatched sizes rejected).python/cudaq/contrib/qiskit_convert.pyif/elifdispatch with a single_GATE_HANDLERSdict keyed byoperation.name, covering the full Qiskit standard library.RXX,RYY,RZZ,RZX,ECR,iSWAP,XXPlusYY,XXMinusYY) and multi-qubit gates (CCZ,RCCX/Margolus,MCXvariants,MCP/MCPhase,CSX,CU)._apply_instructiongracefully handles unboundParameterExpressions (returns False so the caller raises a clearValueError) and recursively expands any gate not in the dispatch table throughInstruction.definition.python/cudaq/contrib/__init__.pyfrom_qasm/from_qasm_strentry points alongsidefrom_qiskit.Tests
python/tests/contrib/test_from_qasm.py— unit coverage for the expression evaluator, both QASM 2.0 and 3.0 gate surfaces, register broadcasting, and user-defined gates.python/tests/contrib/test_from_qiskit.py— per-gate tests for the expanded dispatch table.python/tests/contrib/test_roundtrip.py(new) — end-to-end round-trip tests across the three conversion paths (direct QASM, QASM→Qiskit→CUDA-Q, Qiskit→QASM→CUDA-Q), including a consistency cross-check that direct and indirect paths produce the same measurement distributions.