Native OpenQASM 2.0/3.0 Translation and Expanded Qiskit Support in contrib
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Domain
- quantum-computing
Research direction
Start by reviewing PR #4613 and the cudaq.contrib entry points named in the proposal: from_qasm_str, from_qasm, and from_qiskit. The issue is ready when maintainers clarify whether native OpenQASM support, expanded Qiskit coverage, or neither fits the project's roadmap and contribution scope.
Written by the indexing model from the issue text.
Description
Background & Context
I recently submitted PR #4613 which expanded the interoperability features within the cudaq.contrib module. The PR was labeled with a wontfix without additional feedback.
Since the PR was an iteration over my previously merged work in the same module, I am opening this issue to shift the conversation from a code review to a high-level architectural discussion. I would love to understand the core team's roadmap regarding OpenQASM parsing and framework interoperability, and see if the concepts proposed hold value for the project's future.
Motivation & The Gap
Currently, translating OpenQASM into CUDA-Q relies heavily on external dependencies. The proposal aims to solve two main pain points for users:
- Dependency Overhead: Relying on Qiskit just to parse OpenQASM introduces unnecessary overhead. A native, zero-dependency translator simplifies the pipeline.
- OpenQASM 3.0 Support: As the ecosystem moves towards OpenQASM 3.0, having first-class support (declarations, built-in gates, assignments) is becoming critical.
- Qiskit Round-tripping: The existing
from_qiskitcoverage is somewhat limited. Expanding the dispatch table ensures users can round-trip circuits built with the full Qiskit standard library (qelib1.inc/stdgates.inc) without silent failures.
Proposed Solution (Proof of Concept)
The closed PR serves as a fully tested Proof of Concept for this architecture. The key features implemented were:
- Native OpenQASM Translator (
from_qasm_str,from_qasm): A pure-Python parser dispatching on theOPENQASM <version>;header._QASM2Translator: Covers the fullqelib1.incgate set, user-defined gates with recursive expansion, and register broadcasting._QASM3Translator: Adds the 3.0 surface (qubit[N],c = measure q;, etc.).- Includes a safe expression evaluator built on
ast.parsefor parameter expressions.
- Expanded
from_qiskit: Replaced ad-hocif/elifwith a comprehensive_GATE_HANDLERSdictionary covering parametric families and multi-qubit gates, staying in lockstep with the QASM semantics.
Discussion Questions for Maintainers
I understand that a wontfix usually means the approach conflicts with internal plans. To help align community contributions with the CUDA-Q vision:
- Is the translation of OpenQASM 2.0/3.0 currently being developed at the C++ compiler/core level, making a Python
contribapproach redundant? - If a native Python parser is not desired, would the team be open to merging only the expanded Qiskit gate coverage (
from_qiskitimprovements) in a separate PR? - What is the current policy/roadmap for the
cudaq.contribmodule moving forward?
Thanks for your time and for maintaining this great framework!
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 508
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 100
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-quantum
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NVIDIA/cuda-quantum#6035 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 77/100
NVIDIA/cuda-quantum#6034 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-quantum#6033 ·
Maintainers usually reply within 1 day
-
Point the CUDA-Q Pulse research preview docs to the released cudaq-pulse packagePossibly taken @fedonman claimed this 2 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
NVIDIA/cuda-quantum#6031 ·
Maintainers usually reply within 1 day
-
Realtime fnv1a_hash sign-extends char, so a non-ASCII handler name gets a platform-dependent function idPossibly taken @fedonman claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
NVIDIA/cuda-quantum#6029 ·
Maintainers usually reply within 1 day
All issues in NVIDIA/cuda-quantum
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug compatibility difficulty:easy prio:normal
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NatronGitHub/openfx-misc#524 ·
Maintainers usually reply within 1 day
-
documentation enhancement help wanted P0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openscad/openscad#7360 · 2 comments ·
Maintainers usually reply within 1 day