NVIDIA CUDA-Q
0.10.0

Contents

  • Quick Start
    • Install CUDA-Q
    • Validate your Installation
  • Basics
    • What is a CUDA-Q Kernel?
    • Building your first CUDA-Q Program
    • Running your first CUDA-Q Program
      • Sample
      • Observe
      • Running on a GPU
    • Troubleshooting
      • Debugging and Verbose Simulation Output
  • Examples
    • Introduction
    • Building Kernels
    • Quantum Operations
      • Quantum States
      • Quantum Gates
      • Measurements
    • Measuring Kernels
      • Mid-circuit Measurement and Conditional Logic
    • Visualizing Kernels
      • Qubit Visualization
      • Kernel Visualization
    • Executing Kernels
      • Sample
      • Observe
      • Get state
      • Parallelization Techniques
        • Observe Async
        • Sample Async
        • Get State Async
    • Computing Expectation Values
      • Parallelizing across Multiple Processors
    • Multi-Control Synthesis
    • Multi-GPU Workflows
      • From CPU to GPU
      • Pooling the memory of multiple GPUs (mgpu)
      • Parallel execution over multiple QPUs (mqpu)
        • Batching Hamiltonian Terms
        • Circuit Batching
      • Multi-QPU + Other Backends (remote-mqpu)
    • Optimizers & Gradients
      • Built in CUDA-Q Optimizers and Gradients
      • Third-Party Optimizers
      • Parallel Parameter Shift Gradients
    • Noisy Simulations
    • Constructing Operators
      • Constructing Spin Operators
      • Pauli Words and Exponentiating Pauli Words
    • Performance Optimizations
      • Gate Fusion
    • Using Quantum Hardware Providers
      • Amazon Braket
      • Infleqtion
      • IonQ
      • IQM
      • OQC
      • ORCA Computing
      • Pasqal
      • Quantinuum
      • QuEra Computing
  • Applications
    • Bernstein-Vazirani Algorithm
      • Classical case
      • Quantum case
      • Implementing in CUDA-Q
    • Compiling Unitaries Using Diffusion Models
      • Diffusion model pipeline
      • Setup and compilation
      • Load model
      • Unitary compilation
      • Convert tensors to CUDA-Q
      • Evaluate generated circuits
      • Simulate kernels
      • Compare unitaries
      • Choosing the circuit you need
    • Computing Magnetization With The Suzuki-Trotter Approximation
      • Problem Setup
      • Running the Simulation
    • Cost Minimization
    • Deutsch’s Algorithm
      • XOR \(\oplus\)
      • Quantum oracles
      • Phase oracle
      • Quantum parallelism
      • Deutsch’s Algorithm:
    • The Deutsch-Jozsa Algorithm
      • The Theory
      • The Algorithm Implementation
    • Spin-Hamiltonian Simulation Using CUDA-Q
      • Introduction
        • Heisenberg Hamiltonian
        • Transverse Field Ising Model (TFIM)
        • Time Evolution and Trotter Decomposition
      • Key steps
        • 1. Prepare initial state
        • 2. Hamiltonian Trotterization
        • 3. Compute overlap
        • 4. Construct Heisenberg Hamiltonian
        • 5. Construct TFIM Hamiltonian
        • 6. Extract coefficients and Pauli words
      • Main code
      • Visualization of probablity over time
      • Expectation value over time:
      • Visualization of expectation over time
      • Additional information
      • Relevant references
    • Divisive Clustering With Coresets Using CUDA-Q
      • Data preprocessing
      • Quantum functions
      • Divisive Clustering Function
      • QAOA Implementation
      • Scaling simulations with CUDA-Q
    • Factoring Integers With Shor’s Algorithm
      • Shor’s algorithm
        • Solving the order-finding problem classically
        • Solving the order-finding problem with a quantum algorithm
        • Determining the order from the measurement results of the phase kernel
        • Postscript
    • Hybrid Quantum Neural Networks
    • Max-Cut with QAOA
    • Molecular docking via DC-QAOA
      • Setting up the Molecular Docking Problem
      • CUDA-Q Implementation
    • Multi-reference Quantum Krylov Algorithm - \(H_2\) Molecule
      • Setup
      • Computing the matrix elements
      • Determining the ground state energy of the subspace
    • Quantum Fourier Transform
      • Quantum Fourier Transform revisited
    • Quantum Teleporation
      • Teleportation explained
    • Quantum Transformer
      • Installation
      • Algorithm and Example
        • Creating the self-attention circuits
      • Usage
        • Model Training
        • Generating Molecules
        • Attention Maps
    • Quantum Volume
    • Readout Error Mitigation
      • Inverse confusion matrix from single-qubit noise model
      • Inverse confusion matrix from k local confusion matrices
      • Inverse of full confusion matrix
    • Variational Quantum Eigensolver
      • Using CUDA-Q Optimizers
      • Integration with Third-Party Optimizers
    • VQE with gradients, active spaces, and gate fusion
      • The Basics of VQE
      • Installing/Loading Relevant Packages
      • Implementing VQE in CUDA-Q
      • Parallel Parameter Shift Gradients
      • Using an Active Space
      • Gate Fusion for Larger Circuits
    • Using the Hadamard Test to Determine Quantum Krylov Subspace Decomposition Matrix Elements
      • Numerical result as a reference:
      • Using Sample to perform the Hadamard test
      • Multi-GPU evaluation of QKSD matrix elements using the Hadamard Test
        • Classically Diagonalize the Subspace Matrix
    • Anderson Impurity Model ground state solver on Infleqtion’s Sqale
      • Performing logical Variational Quantum Eigensolver (VQE) with CUDA-QX
      • Constructing circuits in the [[4,2,2]] encoding
      • Setting up submission and decoding workflow
      • Running a CUDA-Q noisy simulation
      • Running logical AIM on Infleqtion’s hardware
    • ADAPT-QAOA algorithm
      • Simulation input:
      • The problem Hamiltonian \(H_C\) of the max-cut graph:
      • Th operator pool \(A_j\):
      • The commutator \([H_C,A_j]\):
      • Beginning of ADAPT-QAOA iteration:
  • Backends
    • Circuit Simulation
      • State Vector Simulators
        • CPU
        • Single-GPU
        • Multi-node multi-GPU
      • Tensor Network Simulators
        • Multi-node multi-GPU
        • Matrix product state
        • Fermioniq
      • Multi-QPU Simulators
        • Simulate Multiple QPUs in Parallel
        • Multi-QPU + Other Backends
      • Noisy Simulators
        • Trajectory Noisy Simulation
        • Density Matrix
        • Stim
      • Photonics Simulators
        • orca-photonics
    • Quantum Hardware (QPUs)
      • Ion Trap QPUs
        • IonQ
        • Quantinuum
      • Superconducting QPUs
        • Anyon Technologies/Anyon Computing
        • IQM
        • OQC
      • Neutral Atom QPUs
        • Infleqtion
        • Pasqal
        • QuEra Computing
      • Photonic QPUs
        • ORCA Computing
    • Dynamics Simulation
      • Quick Start
      • Operator
      • Time-Dependent Dynamics
      • Numerical Integrators
      • Multi-GPU Multi-Node Execution
    • Cloud
      • Amazon Braket (braket)
        • Setting Credentials
        • Submission from C++
        • Submission from Python
      • NVIDIA Quantum Cloud (nvqc)
        • Quick Start
        • Simulator Backend Selection
        • Multiple GPUs
        • Multiple QPUs Asynchronous Execution
        • FAQ
  • Dynamics
    • Quick Start
    • Operator
    • Time-Dependent Dynamics
    • Numerical Integrators
    • Multi-GPU Multi-Node Execution
  • Installation
    • Local Installation
      • Introduction
        • Docker
        • Singularity
        • Python wheels
        • Pre-built binaries
      • Development with VS Code
        • Using a Docker container
        • Using a Singularity container
      • Connecting to a Remote Host
        • Developing with Remote Tunnels
        • Remote Access via SSH
      • DGX Cloud
        • Get Started
        • Use JupyterLab
        • Use VS Code
      • Additional CUDA Tools
        • Installation via PyPI
        • Installation In Container Images
        • Installing Pre-built Binaries
      • Distributed Computing with MPI
      • Updating CUDA-Q
      • Dependencies and Compatibility
      • Next Steps
    • Data Center Installation
      • Prerequisites
      • Build Dependencies
        • CUDA
        • Toolchain
      • Building CUDA-Q
      • Python Support
      • C++ Support
      • Installation on the Host
        • CUDA Runtime Libraries
        • MPI
  • Integration
    • Downstream CMake Integration
    • Combining CUDA with CUDA-Q
    • Integrating with Third-Party Libraries
      • Calling a CUDA-Q library from C++
      • Calling an C++ library from CUDA-Q
      • Interfacing between binaries compiled with a different toolchains
  • Extending
    • Create a new NVQIR Simulator
      • CircuitSimulator
      • Let’s see this in action
    • Working with CUDA-Q IR
    • Create an MLIR Pass for CUDA-Q
  • Specifications
    • Language Specification
      • 1. Machine Model
      • 2. Namespace and Standard
      • 3. Quantum Types
        • 3.1. cudaq::qudit<Levels>
        • 3.2. cudaq::qubit
        • 3.3. Quantum Containers
      • 4. Quantum Operators
        • 4.1. cudaq::spin_op
      • 5. Quantum Operations
        • 5.1. Operations on cudaq::qubit
      • 6. Quantum Kernels
      • 7. Sub-circuit Synthesis
      • 8. Control Flow
      • 9. Just-in-Time Kernel Creation
      • 10. Quantum Patterns
        • 10.1. Compute-Action-Uncompute
      • 11. Platform
      • 12. Algorithmic Primitives
        • 12.1. cudaq::sample
        • 12.2. cudaq::observe
        • 12.3. cudaq::optimizer (deprecated, functionality moved to CUDA-Q libraries)
        • 12.4. cudaq::gradient (deprecated, functionality moved to CUDA-Q libraries)
      • 13. Example Programs
        • 13.1. Hello World - Simple Bell State
        • 13.2. GHZ State Preparation and Sampling
        • 13.3. Quantum Phase Estimation
        • 13.4. Deuteron Binding Energy Parameter Sweep
        • 13.5. Grover’s Algorithm
        • 13.6. Iterative Phase Estimation
    • Quake Specification
      • General Introduction
      • Motivation
  • API Reference
    • C++ API
      • Operators
      • Quantum
      • Common
      • Noise Modeling
      • Kernel Builder
      • Algorithms
      • Platform
      • Utilities
      • Namespaces
    • Python API
      • Program Construction
        • make_kernel()
        • PyKernel
        • Kernel
        • PyKernelDecorator
        • kernel()
      • Kernel Execution
        • sample()
        • sample_async()
        • observe()
        • observe_async()
        • get_state()
        • get_state_async()
        • vqe()
        • draw()
        • translate()
      • Dynamics
        • evolve()
        • evolve_async()
      • Backend Configuration
        • has_target()
        • get_target()
        • get_targets()
        • set_target()
        • reset_target()
        • set_noise()
        • unset_noise()
        • initialize_cudaq()
        • num_available_gpus()
        • set_random_seed()
      • Data Types
        • SimulationPrecision
        • Target
        • State
        • Tensor
        • QuakeValue
        • qubit
        • qreg
        • qvector
        • ComplexMatrix
        • Schedule
        • BaseIntegrator
        • EvolveResult
        • AsyncEvolveResult
        • SpinOperator
        • OperatorSum
        • ElementaryOperator
        • ProductOperator
        • RydbergHamiltonian
        • ScalarOperator
        • SpinOperator
        • spin.i()
        • spin.x()
        • spin.y()
        • spin.z()
        • CuDensityMatState
        • InitialState
        • to_cupy_array()
        • SampleResult
        • AsyncSampleResult
        • ObserveResult
        • AsyncObserveResult
        • AsyncStateResult
        • OptimizationResult
        • Optimizers
        • Gradients
        • Noisy Simulation
      • MPI Submodule
        • initialize()
        • rank()
        • num_ranks()
        • all_gather()
        • broadcast()
        • is_initialized()
        • finalize()
      • ORCA Submodule
        • sample()
    • Quantum Operations
      • Unitary Operations on Qubits
        • x
        • y
        • z
        • h
        • r1
        • rx
        • ry
        • rz
        • s
        • t
        • swap
        • u3
      • Adjoint and Controlled Operations
      • Measurements on Qubits
        • mz
        • mx
        • my
      • User-Defined Custom Operations
      • Photonic Operations on Qudits
        • create
        • annihilate
        • phase_shift
        • beam_splitter
        • mz
  • Other Versions
NVIDIA CUDA-Q
  • CUDA-Q Applications
  • View page source
Previous Next

CUDA-Q Applications¶

Applications that give an in depth view of CUDA-Q and its applications in Python.

Bernstein-Vazirani Algorithm
Compiling Unitaries Using Diffusion Models
Computing Magnetization With The Suzuki-Trotter Approximation
Cost Minimization
Deutsch’s Algorithm
The Deutsch-Jozsa Algorithm
Spin-Hamiltonian Simulation Using CUDA-Q
Divisive Clustering With Coresets Using CUDA-Q
Factoring Integers With Shor’s Algorithm
Hybrid Quantum Neural Networks
Max-Cut with QAOA
Molecular docking via DC-QAOA
Multi-reference Quantum Krylov Algorithm - H_2 Molecule
Quantum Fourier Transform
Quantum Teleporation
Quantum Transformer
Quantum Volume
Readout Error Mitigation
Variational Quantum Eigensolver
VQE with gradients, active spaces, and gate fusion
Using the Hadamard Test to Determine Quantum Krylov Subspace Decomposition Matrix Elements
Anderson Impurity Model ground state solver on Infleqtion’s Sqale
ADAPT-QAOA algorithm
Previous Next

© Copyright 2025, NVIDIA Corporation & Affiliates.

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