npx skills add ...
npx skills add nvidia/skills --skill cudaq-importing
Use when porting circuits from another framework (e.g. Qiskit) into CUDA-Q kernels while preserving the source algorithm and validation fidelity.
npx skills add nvidia/skills --skill cudaq-importing
Use this skill to port quantum circuits from another framework into CUDA-Q Python kernels. This includes Qiskit code and Qiskit-style circuit construction, as well as other framework-driven circuit builders. 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.
For authoring new CUDA-Q kernels from scratch, and for CUDA-Q installation,
simulation targets, QPU access, and parallelization, use the cudaq-guide
skill (/cudaq-guide author for kernel authoring).
python -c "import cudaq; print(getattr(cudaq, '__version__', 'unknown'))".cudaq.sample for final-measurement sampling.cudaq.run when mid-circuit measurement values must be returned or
used per shot.r1.ctrl, x.ctrl, swap.ctrl, etc.) over
transpiling through the source framework.Read references/porting-reference.md when you need any of the following:
cudaq-guide skill (/cudaq-guide author) for core
CUDA-Q authoring constraints and shared kernel patterns.Use this format when diagnosing failures:
Error: ModuleNotFoundError: qiskit (or another source framework) 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.
Error: Fidelity looks plausible but raw keys are reversed. Cause: The source framework and CUDA-Q count-key ordering differ. Solution: Fix allocation, return-list order, or formatting at the port boundary. Do not alter the algorithm.
Error: Deep-circuit fidelity differs between frameworks. Cause: CUDA-Q and the source framework may be using different floating-point precision. Solution: Match precision before comparing, then rerun the smallest failing deterministic case.
Error: A multi-controlled operation works for small controls but fails or silently changes behavior at higher arity. Cause: The port used a fixed-arity dispatcher. Solution: Use CUDA-Q control-list patterns for arbitrary arity.
Error: MCP documentation or repository lookup fails. 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.
Error: CUDA-Q behavior conflicts with documentation while debugging.
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 authoring
patterns, kernel-language constraints, execution APIs, and debugging workflow.