CUDA-Q Logical

Getting started

  • Quick start
    • Use a CUDA-Q kernel
    • Write a standalone logical program
    • Build from source
    • Where to go next
  • The logical programming stack
    • 1. Compile and estimate the logical program
    • 2. Choose the code and its implementations
    • 3. Describe the device
    • 4. Place and realize the program
    • 5. Schedule and estimate the physical resources
    • 6. Expose the device as a CUDA-Q target
    • Where to go next
  • Core concepts
    • Logical programs and quantum values
    • Definitions, builds, and compilation
    • Clifford+T decomposition
    • Codes and operation implementations
    • Devices and placement
    • Schedules and resource estimates
    • CUDA-Q integration
  • CUDA-Q Logical by Example
    • CUDA-Q kernel examples
      • Logical Resource Estimate
      • Clifford+T Synthesis
      • CUDA-Q Logical Resource Estimate
      • Fermi–Hubbard Estimation
      • Carbon Code Target
      • Gidney–Ekerå RSA
    • Standalone compiler examples
      • Portable P0 Bell Program
      • P1 Placement
      • Code and Gadget
      • Standalone Physical Schedule
      • Steane-Encoded Bernstein–Vazirani on Stim
      • T-State Distillation
      • T-State Distillation with cudaq.run
      • Gidney–Ekerå Lookup Addition
    • Gadget verification and error models
      • Verify an Authored Gadget
        • Author the realization and its claim
        • Declare the detector contract
        • Inspect a successful receipt
        • Inspect an incorrect logical claim
      • Physical Surface-Code Memory
        • Select preparation, extraction, and readout
        • Verify the ideal behavior
        • Emit a circuit and derive its model
        • Save and optionally sample
      • Surface-Memory Stim Export
      • Surface-Memory Error Model
      • Surface-Memory Reference Comparison
        • Run the example
        • Select the concrete gadgets
        • Verify the ideal behavior
        • Project the realization and choose physical noise
        • Emit the circuit and reuse gadget models
        • Export the original models
        • Compare with Stim and choose a sampler
        • Physical schedule and reference equivalence

Use cases

  • Defining codes
    • CSS codes: state the checks once
    • Distance is evidence, not an integer
    • The catalog and parameterized families
    • What you get for free
    • Where to go next
  • Gadgets and verification
    • What implements= takes
      • Author the action in CUDA-Q Logical
      • Reuse a CUDA-Q kernel as the claim
      • What the signature and body add
    • Typed records at the boundary
    • Preparation and destructive measurement
    • Selection: retry and postselection belong to the protocol
    • Verification: claims are checked, not trusted
    • Design rules that keep the model crisp
    • Where to go next
  • Devices and placement
    • Machines, devices, architectures
      • Stop at the layer your study needs
    • Automatic placement: constraints, preferences, witnesses
    • Code-agnostic P1
    • Where the firewall pays off
    • Continue from here
  • Magic states and protocols
    • Phase convention
      • Authoring exact angles with cudaq.logical.algebra.pi
    • Typed resource kinds
    • 15-to-1: a concrete factory
    • Compact factory models at P3
    • Continue from here
  • Logical Clifford+T synthesis
    • Synthesize a program
    • Precision
    • Inspect and replay the result
    • Use the pipeline form
    • Pauli-based computation, still at P0
    • When not to synthesize
    • Continue from here
  • Resource estimation
    • Tier.LOGICAL — cost the algorithm before any QEC choice
    • Tier.STATIC — count one selected P2 realization
    • Tier.ANALYTICAL — apply an explicit physical model
    • Tier.SCHEDULE — cost the physical event graph
    • The rules that keep estimates honest
    • Direct spellings
    • Sweeps and reproducibility
    • Paper-specific projections live in the open
    • Estimating ordinary CUDA-Q kernels
  • Stim emission
    • Export a surface-code memory with detector contracts
      • Read the exported circuit
      • Choose the experiment size and noise
      • Build preparation, storage, and readout
      • Describe which results signal errors
      • Assemble the experiment and add data errors
      • Save the Stim circuit
      • Sample and interpret the results
      • Customize the experiment
    • Native MLIR emission
      • Emit from the command line
      • Fail-closed boundaries
    • Where to go next
  • Derive an error model from gadgets
    • What an EDEM records
    • Derive a surface-memory model
      • Import the libraries
      • Configure the experiment
      • Select the gadget contracts
      • Choose where faults occur
      • Derive and compose the model
      • Inspect the model
      • Save and reload the model
      • Sample the model
    • Going further
      • Specify faults
      • Derive models stage by stage
      • Contract checks during derivation

Reference

  • Detector contracts and Clifford projection
    • Gadget terminology
      • Compatibility spellings
    • Virtual syndromes and boundary errors
    • Detector map and outcome map
    • Recipe-provided contracts
    • Declare a contract
      • Declare a default contract
    • Verify a contract and the logical action
    • Project the realization
    • Boundary for EDEM producers
  • CUDA-Q Logical for Stim users
    • The translation table
    • Execute a physical build
    • Worked emission
    • What has no Stim equivalent
    • When to just use Stim
  • Capabilities and status
    • What the product is
    • Subsystem status
    • Present but not yet exercised
    • Execution and documented boundaries
  • Architecture
    • The dialect stack
    • The semantic spine and its facets
    • Definitions versus builds
    • The artifact model
    • Data ownership
    • The compile pipeline
    • The P2 patch graph
    • Verification layers
    • Typed inspection
    • Package map
    • Extensibility
    • Where to go next
  • Building against CUDA-Q
    • Build EDEM and Logical separately

CUDA-Q

  • Main CUDA-Q documentation
CUDA-Q Logical
  • Search


© Copyright Copyright © 2026, NVIDIA Corporation & affiliates. All rights reserved..

Built with Sphinx using a theme provided by Read the Docs.