nvidia/qiskit-to-cudaq
Use when porting Qiskit Python circuits to CUDA-Q kernels while preserving algorithms and validation fidelity.
npx skills add https://github.com/NVIDIA/cuda-quantum --skill qiskit-to-cudaq
Use this skill to port Qiskit Python code, or code with Qiskit-style circuit
construction, to CUDA-Q Python kernels. The goal is a framework-free CUDA-Q port
that preserves the source quantum algorithm, matches source behavior at small
test sizes, and documents any unavoidable CUDA-Q limitations.
python -c "import cudaq; print(getattr(cudaq, '__version__', 'unknown'))".
behavior.
environment. The final CUDA-Q port itself must not require Qiskit.
connector is available before relying on it; otherwise use local docs or the
source tree.
documentation, review relevant documentation or source changes before
treating a behavior difference as a porting bug.
qubit/register layout, measurement behavior, and any framework helpers.
measurement, QPE structure, oracle definitions, or decomposition strategy
without explicit user permission.
cudaq.sample for final-measurement sampling.cudaq.run when mid-circuit measurement values must be returned orused per shot.
CUDA-Q requires a fixed-length return shape.
precision guidance, and helper-extraction patterns, read
references/porting-reference.md.
pure helpers into framework-free modules.
keys and distributions, not just aggregate fidelity.
imports unless they are genuinely unavoidable and documented.
r1.ctrl, x.ctrl, swap.ctrl, etc.) overtranspiling through Qiskit.
measurement return list, or final count-key formatting.
fidelity differences matter.
source-compatible behavior.
Read references/porting-reference.md when
you need any of the following:
behavior against the installed CUDA-Q version for version-sensitive features.
Python; use the companion cudaq-guide skill for core CUDA-Q authoring
constraints and shared kernel patterns.
Apparent fidelity or bitstring mismatches may be convention differences.
the local CUDA-Q installation.
correctness-preserving ports.
Use this format when diagnosing failures:
ModuleNotFoundError: qiskit from a CUDA-Q path.Cause: The port still imports the source framework.
Solution: Move pure helpers into a framework-free module and verify with
the import-blocker pattern in the reference.
Cause: Qiskit and CUDA-Q count-key ordering differ.
Solution: Fix allocation, return-list order, or formatting at the port
boundary. Do not alter the algorithm.
Cause: CUDA-Q and Qiskit may be using different floating-point precision.
Solution: Match precision before comparing, then rerun the smallest
failing deterministic case.
silently changes behavior at higher arity.
Cause: The port used a fixed-arity dispatcher.
Solution: Use CUDA-Q control-list patterns for arbitrary arity.
Cause: Connector unavailable, stale, or transiently failing.
Solution: Verify the connector/resource list, retry transient failures
once, then fall back to local docs/source or official CUDA-Q docs. Do not
change the port based on unverified MCP results.
Cause: The installed CUDA-Q version may differ from the latest
documentation.
Solution: Check cudaq.__version__, then review relevant documentation or
source changes between the installed version and latest before changing the
port.
cudaq-guide (/cudaq-guide author) for CUDA-Q authoringpatterns, kernel-language constraints, execution APIs, and debugging workflow.
Take nvidia/qiskit-to-cudaq from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.