Contribution to import QuantumCircuits from Qiskit/OpenQASM#3847
Merged
bettinaheim merged 12 commits intoNVIDIA:mainfrom Mar 12, 2026
Merged
Contribution to import QuantumCircuits from Qiskit/OpenQASM#3847bettinaheim merged 12 commits intoNVIDIA:mainfrom
QuantumCircuits from Qiskit/OpenQASM#3847bettinaheim merged 12 commits intoNVIDIA:mainfrom
Conversation
1 task
7545485 to
b756339
Compare
Collaborator
|
@QuantumRaul Thank you for this contribution! |
Contributor
Author
|
@bettinaheim Sure, I will start working on building the contrib module. I'll give it a try and I will reach you with any news. |
…ions Signed-off-by: Raul Martinez <raul.marpa01@gmail.com>
fe72364 to
2f703b3
Compare
Contributor
Author
|
@bettinaheim Just finished creating the contrib module, and added to it the functions I builded before. Also reviewed the imports at init.py |
Signed-off-by: Raul Martinez <raul.marpa01@gmail.com>
Signed-off-by: Bettina Heim <heimb@outlook.com>
…cuda-quantum into qiskit_qasm_support
Collaborator
Command Bot: Processing... |
Signed-off-by: Bettina Heim <heimb@outlook.com>
Signed-off-by: Bettina Heim <heimb@outlook.com>
QuantumCircuits from Qiskit/OpenQASM
bettinaheim
approved these changes
Mar 12, 2026
bettinaheim
added a commit
that referenced
this pull request
Mar 12, 2026
<!-- Thanks for helping us improve CUDA-Q!⚠️ The pull request title should be concise and understandable for all.⚠️ If your pull request fixes an open issue, please link to the issue. Checklist: - [ x] I have added tests to cover my changes. - [ x] I have updated the documentation accordingly. - [ x] I have read the CONTRIBUTING document. --> ## Summary This PR adds two new functions to enable interoperability between Qiskit and CUDA-Q: - **`cudaq.from_qiskit(qiskit_circuit)`**: Converts a Qiskit `QuantumCircuit` to a CUDA-Q kernel - **`cudaq.from_qasm(file_path)`**: Loads an OpenQASM file and converts it to a CUDA-Q kernel ### Supported Gates | Category | Gates | |----------|-------| | Single qubit | h, x, y, z, s, t, sdg, tdg, id | | Two qubit | cx, cy, cz, ch, swap, rxx, rzz | | Three qubit | ccx (Toffoli) | | Parametric | rx, ry, rz, r1, p, u3, u | | Controlled parametric | crx, cry, crz | | Special | sx, sxdg, barrier, measure | ### Example Usage ```python from qiskit import QuantumCircuit import cudaq # Create a Bell state in Qiskit qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1) # Convert to CUDA-Q and run on GPU kernel = cudaq.from_qiskit(qc) result = cudaq.sample(kernel) print(result) # {'00': 500, '11': 500} ``` ## Documentation Documentation is provided via comprehensive docstrings in the source code. Additional user guide documentation can be added in a follow-up PR if desired. --------- Signed-off-by: Raul Martinez <raul.marpa01@gmail.com> Signed-off-by: Bettina Heim <heimb@outlook.com> Co-authored-by: Bettina Heim <heimb@outlook.com>
schweitzpgi
reviewed
Mar 12, 2026
| @@ -0,0 +1,9 @@ | |||
| # ============================================================================ # | |||
| # Copyright (c) 2022 - 2026 NVIDIA Corporation & Affiliates. # | |||
Collaborator
There was a problem hiding this comment.
nit: Copyright for new files ought to be simply 2026, I believe.
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
This PR adds two new functions to enable interoperability between Qiskit and CUDA-Q:
cudaq.from_qiskit(qiskit_circuit): Converts a QiskitQuantumCircuitto a CUDA-Q kernelcudaq.from_qasm(file_path): Loads an OpenQASM file and converts it to a CUDA-Q kernelSupported Gates
Example Usage
Documentation
Documentation is provided via comprehensive docstrings in the source code.
Additional user guide documentation can be added in a follow-up PR if desired.