NEROX/CUDA-Q
Integration

CUDA-Q

Quantum-classical hybrid workflows combining NVIDIA CUDA-Q circuit simulation with NEROX classical optimization.

CUDA-Q and NEROX

NVIDIA CUDA-Q is an open-source platform for quantum-classical computing. NEROX integrates with CUDA-Q in two directions: NEROX can use CUDA-Q as a backend for QAOA and VQE circuit simulation, and CUDA-Q applications can call NEROX classical solvers for post-processing and hybrid optimization loops.

Using CUDA-Q as NEROX QAOA backend

python
import nerox

# Tell NEROX to use CUDA-Q for circuit simulation
# Requires cudaq installed in the same environment
job = nerox.optimize.maxcut(
    adjacency_matrix=A,
    solver="qaoa",
    backend="cudaq",          # use CUDA-Q instead of default custatevec
    depth=6,
    cudaq_target="nvidia",    # nvidia | nvidia-mqpu | nvidia-fp64
)

result = job.wait()
print(f"Cut: {result.objective}")

Calling NEROX from a CUDA-Q program

python
import cudaq
import nerox
import numpy as np

# Define a QAOA circuit in CUDA-Q
@cudaq.kernel
def qaoa(n_qubits: int, gammas: list[float], betas: list[float]):
    q = cudaq.qvector(n_qubits)
    # ... apply QAOA gates ...
    pass

# Run circuit on CUDA-Q backend
counts = cudaq.sample(qaoa, n_qubits, gammas, betas, shots_count=1000)
bitstring_energies = [(b, compute_energy(b, Q)) for b in counts]

# Pass best bitstrings to NEROX for classical local search refinement
seeds = [list(map(int, b)) for b, _ in sorted(bitstring_energies, key=lambda x: x[1])[:10]]

client = nerox.Client()
job = client.optimize.qubo(
    Q=Q,
    solver="gpu",
    warm_start_solutions=seeds,   # initialize chains from QAOA output
)
result = job.wait()
print(f"Refined objective: {result.objective}")

Warm-start hybrid optimization

The most effective quantum-classical hybrid pattern is to use QAOA to explore promising regions of the solution space, then warm-start GPU Annealing from those seed solutions. This outperforms either approach in isolation on graph problems in the 50–200 node range where QAOA runs in tractable time.

Requirements

CUDA-Q 0.7+ with custatevec backend
NEROX Business or Enterprise plan
NVIDIA GPU with CUDA 12.1+
Python 3.10+