Skip to content

Added from_qiskit() and from_qasm() for Qiskit/OpenQASM interoperability#3847

Open
QuantumRaul wants to merge 1 commit intoNVIDIA:mainfrom
QuantumRaul:qiskit_qasm_support
Open

Added from_qiskit() and from_qasm() for Qiskit/OpenQASM interoperability#3847
QuantumRaul wants to merge 1 commit intoNVIDIA:mainfrom
QuantumRaul:qiskit_qasm_support

Conversation

@QuantumRaul
Copy link

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

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.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 3, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Raul Martinez <raul.marpa01@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant