Generated banner for Cudaq Guide
Generated logo for Cudaq Guide

Cudaq Guide

NVIDIAOfficialCreated by CUDA-Q TeamDistributed by NVIDIA

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Use for CUDA-Q setup, simulation targets, QPU access, and @cudaq.kernel authoring guidance.
— the description by CUDA-Q Team

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The CUDA-Q Guide provides comprehensive support for developers working with NVIDIA's CUDA-Q programming model. It covers the full lifecycle of quantum development, including environment setup for Python and C++, selection of simulation targets (GPU-accelerated or CPU-only), and integration with real QPU hardware. The skill also offers deep-dive assistance for authoring @cudaq.kernel code, including execution API selection, kernel-language constraints, and debugging common compilation or runtime issues.

What it does

  • Walks users through CUDA-Q installation and validation on various platforms.
  • Assists in selecting appropriate simulation backends, including multi-GPU and tensor-network targets.
  • Provides best practices for authoring and debugging Python @cudaq.kernel code.
  • Guides users through connecting to and executing jobs on real QPU hardware providers.
  • Explains how to parallelize quantum workloads across GPUs or QPUs.
  • Offers troubleshooting steps for common import, compilation, and execution errors.

When to use it

  • When setting up a new CUDA-Q development environment on Linux, macOS, or WSL.
  • When you need to write or debug a quantum kernel using the @cudaq.kernel decorator.
  • When choosing between simulation backends like qpp-cpu or NVIDIA GPU-accelerated targets.
  • When preparing to submit quantum circuits to external QPU hardware providers.
  • When optimizing quantum workloads for multi-GPU or distributed execution.

Advantages

  • Provides version-aware guidance for CUDA-Q 0.14 and 0.15 APIs.
  • Centralizes documentation for both onboarding and advanced kernel authoring.
  • Helps avoid common pitfalls like incorrect execution API selection or kernel-language violations.
  • Streamlines the process of configuring provider-specific QPU access.

Usage examples

“/cudaq-guide install”
The agent provides step-by-step installation instructions for Python or C++, followed by a validation test using a Bell-state kernel.
“/cudaq-guide author”
The agent explains how to structure a kernel, select the correct execution API (e.g., sample vs. observe), and debug common compiler issues.
“/cudaq-guide qpu”
The agent initiates a dialogue to identify the target QPU technology and guides the user through secure credential configuration.
“/cudaq-guide gpu-sim”
The agent helps the user select the optimal simulation backend based on their hardware availability and performance requirements.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/cudaq-guide/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip cudaq-guide.zip -d .agents/skills

Documentation by CUDA-Q Team

CUDA-Q Guide

Purpose

Guide users through CUDA-Q installation, basic kernels, GPU simulation targets, QPU access, built-in applications, multi-GPU execution, and Python @cudaq.kernel authoring. For Qiskit-to-CUDA-Q ports, route to the cudaq-importing skill instead.

Prerequisites

  • Python 3.10+ for Python CUDA-Q workflows.

  • CUDA Toolkit and an NVIDIA GPU for GPU-accelerated targets on Linux.

  • CPU-only simulation is available through qpp-cpu; macOS is CPU-only.

  • C++ workflows require Linux or WSL and C++20.

  • QPU workflows require provider-specific credentials and accounts.

Instructions

  • Invoke with /cudaq-guide [argument].

  • If no argument is given, display the onboarding menu and ask which topic the user wants.

  • Use the routing table below to choose the relevant reference file.

  • Read local CUDA-Q documentation files when the answer depends on a specific CUDA-Q version or backend behavior.

  • Do not answer Qiskit porting questions from this skill; use cudaq-importing.

Routing by Argument

ArgumentActionReference
installWalk through Python or C++ installation and validation.references/onboarding.md
test-programBuild and run a Bell-state kernel.references/onboarding.md
gpu-simSelect GPU, multi-GPU, tensor-network, or CPU targets.references/onboarding.md
qpuGuide provider selection and credential-safe QPU setup.references/onboarding.md
applicationsSummarize CUDA-Q application areas and notebooks.references/onboarding.md
parallelizeChoose mgpu, mqpu, async dispatch, or distributed observe.references/onboarding.md
authorAuthor CUDA-Q Python kernels, select execution APIs, and debug compiler issues.references/authoring.md
(none)Print the menu below and ask which topic to explore.This file

Menu

CUDA-Q Getting Started

CUDA-Q is NVIDIA's unified quantum-classical programming model for CPUs, GPUs, and QPUs.
Supports Python and C++. Docs: https://nvidia.github.io/cuda-quantum/latest/

Choose a topic:
  /cudaq-guide install         Install CUDA-Q
  /cudaq-guide test-program    Write and run a Bell-state kernel
  /cudaq-guide gpu-sim         Accelerate simulation on NVIDIA GPUs
  /cudaq-guide qpu             Connect to real QPU hardware
  /cudaq-guide applications    Explore what you can build
  /cudaq-guide parallelize     Run across GPUs or QPUs
  /cudaq-guide author          Author @cudaq.kernel Python code

Reference Files

  • references/onboarding.md: installation, test program, GPU targets, QPU providers, application areas, parallelization modes, examples, and platform troubleshooting.

  • references/authoring.md: execution APIs, kernel-language constraints, silent-failure pitfalls, recurring coding patterns, resource metrics, debugging, and validation.

Limitations

  • Guidance targets CUDA-Q Python/C++ workflows, with authoring details focused on decorator-mode Python APIs used in CUDA-Q 0.14 and 0.15.

  • GPU and multi-GPU support depends on local CUDA-Q, CUDA Toolkit, driver, MPI, and hardware availability.

  • QPU access and target options are provider-specific and may change; verify against local docs before giving operational steps.

Troubleshooting

  • Import error after pip install cudaq: check Python 3.10+ and supported OS.

  • No GPU detected: verify CUDA Toolkit and nvidia-smi; fall back to qpp-cpu.

  • Kernel compile error: read references/authoring.md and check the restricted kernel-language subset.

  • Version-specific behavior differs: compare cudaq.__version__ with the latest documentation, then review relevant documentation or source changes when debugging an installed version that is not the latest release.

  • QPU submission fails: verify provider credentials are set as environment variables or through a secrets manager, never hardcoded.

  • Documentation lookup fails: retry transient MCP or repository lookup once, then fall back to local docs or official CUDA-Q documentation.

Files

evals/evals.json

[
  {
    "id": "cudaq-guide-install-001",
    "question": "I just got access to a Linux box with an NVIDIA GPU. How do I install CUDA-Q and confirm it works?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent recommends the Python `pip install cudaq` path (with the CUDA Toolkit for GPU targets) and defaults to the `nvidia` target, then validates the install by running the Bell state example and confirming the output is roughly `{ 00:~500 11:~500 }`.",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent recommended installing CUDA-Q via `pip install cudaq`",
      "The agent included a validation step that runs the Bell state example and expects roughly { 00:~500 11:~500 }"
    ]
  },
  {
    "id": "cudaq-guide-test-program-001",
    "question": "Help me write and run a minimal CUDA-Q program to check my setup is working.",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent guides the user to write a Bell state kernel using `@cudaq.kernel`, `cudaq.qvector`, and a Hadamard + CX, then run it with `cudaq.sample` and read the resulting roughly balanced { 00 11 } measurement histogram.",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent explained that `@cudaq.kernel` marks a quantum kernel and `cudaq.qvector(N)` allocates qubits",
      "The agent used `cudaq.sample` to obtain a measurement histogram"
    ]
  },
  {
    "id": "cudaq-guide-gpu-sim-001",
    "question": "My CUDA-Q state vector circuit is 34 qubits and won't fit on one GPU. Which simulation target should I use?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent recommends the `nvidia --target-option mgpu` target, which pools memory across multiple GPUs for circuits that exceed single-GPU memory, and notes that it requires MPI.",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent recommended the `nvidia --target-option mgpu` target",
      "The agent noted that the mgpu target requires MPI"
    ]
  },
  {
    "id": "cudaq-guide-qpu-001",
    "question": "How do I run my CUDA-Q kernel on real Quantinuum hardware?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent identifies Quantinuum as an ion-trap provider, points to the ion-trap hardware documentation, and advises testing locally with `emulate=True` before submitting to real hardware.",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent identified Quantinuum as an ion-trap QPU provider",
      "The agent advised testing locally with `emulate=True` before submitting to real hardware"
    ]
  },
  {
    "id": "cudaq-guide-parallelize-001",
    "question": "I need to run hundreds of independent CUDA-Q circuits as fast as possible across my 8 GPUs. How should I do that?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent recommends the `nvidia --target-option mqpu` target and asynchronous dispatch with `cudaq.sample_async` / `cudaq.observe_async`, spreading circuits across GPUs via `qpu_id`.",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent recommended the `nvidia --target-option mqpu` target",
      "The agent described asynchronous dispatch with `sample_async`/`observe_async` across GPUs"
    ]
  },
  {
    "id": "cudaq-guide-applications-001",
    "question": "What kinds of quantum applications can I build with CUDA-Q?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent surveys CUDA-Q's built-in application areas such as optimization (QAOA), chemistry (VQE), error correction, and standard algorithms (Grover, Shor, QFT).",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent listed multiple CUDA-Q application domains, such as optimization/QAOA, chemistry/VQE, and error correction"
    ]
  },
  {
    "id": "cudaq-guide-author-api-001",
    "question": "I'm writing a @cudaq.kernel and just need aggregate measurement counts, not per-shot data. Which execution API should I use and how should the kernel end?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent recommends `cudaq.sample`, ends the kernel with `mz(qubits)` and no return type, and notes that `cudaq.run` (which requires a return type) is orders of magnitude (~1000x) slower and should only be used when per-shot data must be captured into Python.",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent recommended `cudaq.sample` and ending the kernel with `mz(qubits)` with no return type",
      "The agent noted that `cudaq.run` is much slower and only needed when per-shot data is required"
    ]
  },
  {
    "id": "cudaq-guide-author-adjoint-001",
    "question": "My QPE kernel fails at sample time with 'RuntimeError: Could not successfully apply argument synth'. I'm wrapping a kernel in cudaq.control and that kernel calls cudaq.adjoint internally. How do I fix it?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent identifies that `cudaq.control(K, ...)` does not compose with `cudaq.adjoint(...)` inside K, and advises hand-rolling the inverse: write a separate inverse kernel that walks the gates in reverse (self-inverse gates unchanged, parameterized rotations negate their angle) and call it directly instead of using `cudaq.adjoint`.",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent identified that cudaq.control does not compose with cudaq.adjoint inside the controlled kernel",
      "The agent recommended hand-rolling an explicit inverse kernel (reverse gate order, negate rotation angles) instead of cudaq.adjoint"
    ]
  },
  {
    "id": "cudaq-guide-author-constraint-001",
    "question": "Inside my @cudaq.kernel I get a CompilerError when I call int(x) to cast a value. Why, and what should I do instead?",
    "expected_skill": "cudaq-guide",
    "expected_script": null,
    "ground_truth": "The agent explains that explicit casts like `int(x)`/`float(x)`/`bool(x)` are not supported inside a kernel because it compiles to Quake MLIR rather than regular Python, and advises using implicit int/float promotion instead (e.g. multiplying by a float literal like `1.0 * x`).",
    "expected_behavior": [
      "The agent read skills/cudaq-guide/SKILL.md before answering",
      "The agent explained that explicit casts are unsupported inside a @cudaq.kernel (restricted Python subset compiled to Quake MLIR)",
      "The agent suggested implicit promotion instead of an explicit cast"
    ]
  },
  {
    "id": "cudaq-guide-route-qiskit-001",
    "question": "I have an existing Qiskit circuit and I want to port it to CUDA-Q. Can you help me translate the gates and handle the bit-ordering differences?",
    "expected_skill": "cudaq-importing",
    "expected_script": null,
    "ground_truth": "The agent recognizes this as a Qiskit-to-CUDA-Q porting task and routes to the cudaq-importing skill (gate-translation table, bit-ordering vs Qiskit, framework-decoupling patterns) rather than answering solely from the cudaq-guide skill.",
    "expected_behavior": [
      "The agent routed the request to the cudaq-importing skill rather than handling it only via cudaq-guide",
      "The agent addressed gate translation and bit-ordering differences between Qiskit and CUDA-Q"
    ]
  },
  {
    "id": "cudaq-guide-neg-001",
    "question": "Write a short poem about the changing seasons.",
    "expected_skill": null,
    "expected_script": null,
    "should_trigger": false,
    "ground_truth": "The agent writes the poem directly and does not consult the CUDA-Q guide skill.",
    "expected_behavior": [
      "The agent did not read skills/cudaq-guide/SKILL.md",
      "The agent answered the request directly with a poem"
    ]
  },
  {
    "id": "cudaq-guide-neg-002",
    "question": "Write a JavaScript function that debounces another function.",
    "expected_skill": null,
    "expected_script": null,
    "should_trigger": false,
    "ground_truth": "The agent provides a JavaScript debounce implementation without invoking the CUDA-Q guide skill.",
    "expected_behavior": [
      "The agent did not read skills/cudaq-guide/SKILL.md",
      "The agent provided a JavaScript debounce function directly"
    ]
  },
  {
    "id": "cudaq-guide-neg-003",
    "question": "Install PyTorch with CUDA support on my Ubuntu machine.",
    "expected_skill": null,
    "expected_script": null,
    "should_trigger": false,
    "ground_truth": "The agent gives PyTorch + CUDA installation guidance (e.g. the appropriate pip/conda command for the CUDA version) without invoking the CUDA-Q guide skill, since the request is about PyTorch rather than CUDA-Q.",
    "expected_behavior": [
      "The agent did not read skills/cudaq-guide/SKILL.md",
      "The agent provided PyTorch installation steps for the requested CUDA setup"
    ]
  }
]

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Python

The author says: Python 3.10+, C++ 20

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs
  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
CUDA-Q Team
Publisher
NVIDIA (Official)
Distributed by
NVIDIA
Source
NVIDIA/skills · skills/cudaq-guide · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by CUDA-Q Team or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cudaq-guide.zip