[cudaq-logical] IR Improvements

Open
#5,572 3 comments 0 reactions 3 assignees View on GitHub

Maintainers usually reply within 1 day

@boschmitt is already working on this.

Since Oct 8, 2026.

Assessment

This issue has not been assessed yet.

Description

cuda-q logical stale-notified

CUDA-Q Logical is compiler infrastructure for fault tolerant quantum computing. It gives a program a path from logical intent to an implementation: place logical qubits, choose error correction codes and protocols, map them to physical operations, then prepare the control needed to run them. Each step adds detail while preserving what the program means. That lets us study the same workload across different codes, devices, and targets.

The IR as-is grew with the internal early access implementation. It has repeated facts across operations, metadata, and artifacts. Some compiler paths lived in Python while others lived in native code, and some tools identified operations by name or by reading printed IR. These splits have made the system harder to verify and extend. They also made it harder to show that a physical result, resource estimate, or simulation still came from the intended logical program.

This tracker seeks to follow public work on improvements to the cudaq-logical IR. A major theme of this work will be focused on cudaq-logical as infrastructure for fault tolerant compilation. As such, we want to clean up redundancy, expose typed MLIR interfaces for common extensibility tasks, and move early Python IR analysis and passes completely to native C++.

Typed interfaces tell common compiler passes what an operation means. One native pipeline serves Python and command line users. Stable links connect the program, its selected QEC methods, physical events, schedules, detector models, estimates, and results. As the full plan is completed, researchers and providers will be able to add methods, compare architectures, and reproduce results on a shared compiler foundation.

Here we enumerate expected tasks.

IR contracts and stage boundaries
  • Define shared IR interfaces for stages, operation meaning, ownership, and extensions. (PR #5574)
  • Remove duplicate P0 and P1 facts while keeping placement code agnostic.
  • Resolve device and QEC definitions through typed interfaces that any provider can use.
  • Track exact value and resource ownership across calls and returns.
  • Define one verified contract for handing resources between QEC operations.
  • Support reusable QEC callables and lower their calls to selected implementations.
  • Define an extensible P2 to P3 boundary for physical events, resources, and records.
  • Set typed contracts for cost models, target lowering, and Quake import.
  • Reduce physical schedule memory use and share native ownership analysis.
  • Track distinct value lifetimes when P1 slots are reused through P2 and P3.
Move compiler work to native C++
  • Move authoring analysis, definition linking, and IR verification to C++.
  • Compute operation counts and analytical resource estimates in C++.
  • Derive component timing and resource use in C++.
  • Import CUDA-Q kernels through a native Quake to P0 path.
  • Select QEC implementations and lower P1 programs to P2 in C++.
  • Handle QEC block placement and resource flow in C++.
  • Lower P2 protocols to verified P3 physical events in C++.
  • Emit Stim circuits and measurement metadata in C++.
  • Remove facet tags and migrate Builds to typed stage and artifact schemas.
Dominant language
C++
Stars
1.2k
Forks
508
Avg merge
1d 19h
Merged PRs (30d)
100

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/cuda-quantum

All issues in NVIDIA/cuda-quantum

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.