Opens in a new tab
Back to all

Toward Accelerated AI-Guided Quantum Error Correction with NVIDIA CUDA-Q

October 21, 2026

Quantum X Labs is demonstrating how learned guidance can improve matching-based quantum error correction, using NVIDIA CUDA-Q QEC for consistent evaluation and to build a path from decoder research toward accelerated deployment.

The decoding challenge

Fault-tolerant quantum computing depends on quantum error correction, but detecting errors is only part of the problem. A decoder must interpret streams of syndrome measurements and determine which recovery operation is most likely to preserve the encoded quantum information.

As quantum processors scale, decoding must satisfy two increasingly demanding requirements: it must make accurate recovery decisions, and it must eventually do so within the timing constraints of the underlying processor. At Quantum X Labs, we are investigating how machine learning can improve established algorithmic decoding approaches while maintaining a practical path toward accelerated implementation.

Adding learned guidance to matching based decoding

Minimum-weight perfect matching, or MWPM, is a widely used decoding approach for surface codes. It converts detected error events into a graph and identifies a minimum-cost matching that represents a likely explanation for the observed syndrome. Its effectiveness depends on the weights assigned to possible error connections.

Our work builds on the published Neural Minimum Weight Perfect Matching (NMWPM) approach and investigates whether learned information can help matching respond more effectively to the structure of an observed error pattern. Rather than replacing matching entirely with a neural network, the approach uses machine learning to guide the matching process, combining learned adaptation with the practical structure of an established algorithmic decoder.

The main path predicts syndrome-conditioned edge weights and then uses MWPM to produce a syndrome-consistent recovery. A two-pass configuration feeds the first matching result into a second learned update. We have also implemented a logical-class head that independently estimates the logical outcome and can be used to review the matching decision.

Diagram of the NMWPM decoder architecture
Figure 1 NMWPM architecture. The class head has been implemented and evaluated, and remains an optional path for further optimization.

Evidence from simulation

We first evaluated learned matching across toric and rotated surface-code simulations under depolarizing noise. The evaluation covered six code sizes, with 18 physical-noise settings per code size and 20,000 shots for each decoder and noise level.

Across the 108 evaluated size-and-noise combinations, the learned-weight NMWPM configuration recorded a lower observed failure rate than uniform-weight MWPM. In one representative toric-code configuration at physical error probability 0.05, the observed failure rate decreased from 0.01770 to 0.00420. These finite-size results do not establish an asymptotic threshold, but they support continued investigation of learned weighting.

Chart comparing observed failure rates for learned-weight NMWPM and uniform-weight MWPM on a toric code
Figure 2 Representative simulation result for one toric-code configuration. Lower observed failure rate is better.

Evaluation on experimental hardware data

We next evaluated NMWPM using the public experimental dataset associated with Google’s surface-code work, Suppressing quantum errors by scaling a surface code logical qubit. NMWPM and the NVIDIA CUDA-Q QEC library implementations use the even/odd detector-error-model protocol and were run on one NVIDIA L4; the Google rows use published predictions for the same shot ranges. The reported values below use the first 10,000 shots for each experiment, except for the CUDA-Q tensor-network run at d=3, which uses a 2,000-shot subset.

Decoderd=3, five roundsd=5, five rounds
NMWPM two-pass0.1366 ± 0.00340.1283 ± 0.0033
NVIDIA CUDA-Q QEC PyMatching0.1565 ± 0.00360.1460 ± 0.0035
NVIDIA CUDA-Q QEC BP+OSD0.1394 ± 0.00350.1302 ± 0.0034
NVIDIA CUDA-Q QEC tensor network0.1315 ± 0.0076 (2,000 shots)Not run
Google PyMatching0.1613 ± 0.00370.1499 ± 0.0036
Google correlated matching0.1528 ± 0.00360.1300 ± 0.0034
Google belief matching0.1366 ± 0.00340.1149 ± 0.0032
Google tensor network0.1315 ± 0.00340.1082 ± 0.0031
Table 2 Logical error rate on the current hardware-data benchmark. Lower is better; ± is one binomial standard error.
Bar chart comparing logical error rates of NMWPM and other decoders at distance 3 and distance 5
Figure 3 Canonical hardware-data comparison for d=3 and d=5 at five rounds. The NVIDIA CUDA-Q tensor-network subset is excluded from this paired chart because it uses fewer shots.

At d=3, NMWPM two-pass and Google belief matching both record 0.1366 on the evaluated shots, while CUDA-Q QEC BP+OSD records 0.1394. The difference between NMWPM and BP+OSD is smaller than the current uncertainty scale, so we describe the observed accuracy as comparable rather than claiming a statistically resolved winner.

At d=5, NMWPM records 0.1283, CUDA-Q QEC BP+OSD records 0.1302, and Google correlated matching records 0.1300. Belief matching and tensor-network decoding reach lower logical error rates in this configuration, highlighting the additional information available to hypergraph-aware and maximum-likelihood methods. The CUDA-Q tensor-network decoder could not run at d=5 on the available 24 GB GPU because of the required workspace.

Record fieldCurrent protocol
DatasetGoogle public surface-code data associated with arXiv:2207.06431; X-basis memory
Experimentssurface_code_bX_d3_r05_center_3_5 and surface_code_bX_d5_r05_center_5_5
ShotsFirst 10,000 shots; NVIDIA CUDA-Q tensor network at d=3 uses the first 2,000
DEM protocolEven-shot DEM decodes odd shots; odd-shot DEM decodes even shots
GPU and precisionOne NVIDIA L4; NMWPM inference uses BF16 autocast
NVIDIA CUDA-Q QECVersion 0.8; BP+OSD uses 100 BP iterations and OSD order 0
Table 3 Protocol record for Table 2 and Figure 3.

Bringing NMWPM into NVIDIA CUDA-Q

A major focus of the recent work has been moving decoder development out of isolated research scripts and into a common QEC framework. NMWPM is now registered as a decoder in CUDA-Q QEC, with single-pass and two-pass configurations inferred from the checkpoint. The implementation returns mechanism flips that satisfy the observed syndrome and includes helpers for both hyperedge and decomposed matching-graph conventions.

A shared benchmark command can run NMWPM, CUDA-Q QEC PyMatching, BP+OSD and the tensor-network decoder on the same input set and record failures without aborting the full comparison. This makes protocol differences visible and gives us a more reliable basis for discussing accuracy and latency tradeoffs.

Diagram of the NVIDIA CUDA-Q QEC integration model
Figure 4 CUDA-Q QEC integration model. Multiple decoder technologies are evaluated through common inputs, conventions and output metrics.

Accelerating the decoder on NVIDIA accelerated computing

The integration work also clarified where time is spent. We introduced BF16 autocast for inference, fused scaled-dot-product attention, vectorized graph construction and per-shot matching, sparse check-matrix construction for larger defect sets, and optional compiled execution with shape bucketing.

BF16 was accuracy-neutral at the current statistical resolution across 50,000 real shots: d=3, r=5 single-pass changed from 0.14714 to 0.14708, while d=5, r=5 two-pass changed from 0.12554 to 0.12572. As shown in the figure 5, the runtime optimizations reduced complete-decoder time by approximately 15 percent at d=3 single-pass, from 0.45 to 0.38 ms per shot, and by approximately 29 percent at d=5 two-pass, from 3.86 to 2.74 ms per shot. At d=5, the largest proportional improvement came from graph construction, while matching also improved materially. Neural inference changed more modestly and remains the largest component of the optimized d=5 execution path.

Chart of end-to-end decoder time by processing stage, before and after runtime optimization
Figure 5 End-to-end decoder time by processing stage before and after the latest runtime work. Results use BF16 inference on one NVIDIA L4 and include neural inference, graph construction and matching.

Validating an ONNX and NVIDIA TensorRT path

The learned component now exports to ONNX with dynamic batch and edge dimensions, and TensorRT 11 strongly typed engines have been built and compared with PyTorch on real batches. This closes the earlier export placeholder and establishes a working accelerated-inference path.

For a d=3 batch of 32 shots, measured batch latency decreased from 4.70 ms with PyTorch BF16 to 2.07 ms with TensorRT FP32 and 1.08 ms with TensorRT FP16. The maximum probability deviation from the PyTorch reference was 0.001 for the FP32 engine and 0.004 for the FP16 engine. These are neural-inference measurements.

Chart comparing TensorRT FP32 and FP16 inference latency against PyTorch BF16
Figure 6 TensorRT neural-inference benchmark on real d=3 batches. Values are forward time per batch of 32 shots; graph construction and matching are excluded.

From offline evaluation toward streaming decoding

A real-time decoder must process syndrome information continuously rather than rebuild and decode an entire experiment at once. We have implemented a forward sliding-window prototype with an open future edge, commit-by-earliest-detector logic and residual-syndrome updates. A single trained model can serve the first, interior and last windows.

On held-out d=3, r=25 shots 10,000–20,000, the current operating point is two-pass NMWPM with a six-round window and a three-round commit interval, written W=6 and C=3. It records a logical error rate of 0.4108 compared with 0.4399 for windowed PyMatching. A wider W=10, C=5 window does not improve the two-pass result, so the shorter commit delay is the more practical current choice.

Chart of streaming decoder prototype results for a distance-3, 25-round experiment
Figure 7 Streaming prototype results for one d=3, r=25 experiment

Engineering path toward deployment

Diagram of the engineering progression from Python integration to production deployment
Figure 8 Engineering progression. Python integration, TensorRT validation and streaming prototypes are complete; broad validation and production integration are in progress.

The product-facing step is a C++ plugin for NVIDIA CUDA-Q QEC that reproduces the sliding-window contract already defined in Python, builds the appropriate TensorRT engine for the target GPU, and includes conformance tests and deployment packaging. NVIDIA NVQLink and NVIDIA CUDA-Q QEC online-decoding infrastructure provide a relevant environment for exploring the longer-term quantum-classical interface.

Building toward a broader decoder platform

There may not be a single decoder that is optimal for every QPU, QEC code, error model and latency constraint. Surface codes, color codes and qLDPC families have different structures and may favor different decoding strategies. Quantum X Labs is therefore developing toward a broader QEC software platform in which multiple decoder technologies can be evaluated, adapted and ultimately deployed according to the characteristics of the hardware and code.

NVIDIA CUDA-Q is important to this direction because it allows algorithmic and AI-based decoders to coexist behind common interfaces while exposing NVIDIA’s accelerated-computing stack and an emerging route toward online quantum-classical integration. Learned matching is one part of that broader strategy.

Technical sources

  1. Neural Minimum Weight Perfect Matching: https://arxiv.org/abs/2601.00242v2
  2. Google surface-code experiment paper: https://arxiv.org/abs/2207.06431
  3. NVIDIA CUDA-Q QEC real-time decoders and AI inference update: https://developer.nvidia.com/blog/real-time-decoding-algorithmic-gpu-decoders-and-ai-inference-enhancements-in-nvidia-cuda-q-qec/
  4. NVIDIA CUDA-Q QEC decoder documentation: https://nvidia.github.io/cudaq-qec/components/qec/decoders.html
  5. NVIDIA CUDA-Q QEC real-time decoding documentation: https://nvidia.github.io/cudaq-qec/components/qec/realtime_decoding.html
Table of Contents
Share