Skip to content

Composable Building Blocks for Fault-Tolerant Quantum Programs with CUDA-Q Algorithms

As quantum computing enters the era of logical qubits, discovering, designing, and optimizing fault-tolerant algorithms that can deliver quantum advantage is becoming increasingly important. These algorithms will be a critical lever for translating quantum computing into meaningful scientific and societal impact.

Fault-tolerant quantum algorithms are assembled from recurring components, including state preparation, Hamiltonian encoding, qubitization, polynomial transformations, and time evolution. CUDA-Q provides the programming model, logical architecture, and decoding layers needed for leveraging these components in fault-tolerant quantum-GPU supercomputing. Until now, however, research teams have often had to develop their own circuit-construction, integration, and validation code to turn components into working programs.

CUDA-Q Algorithms is a modular Python library that makes these components available as reusable CUDA-Q primitives. The 0.1 release includes Pauli LCU block encodings, qubitization, quantum singular value transformation, Trotterization, state-preparation utilities, fermion-to-qubit transformations, and quantum chemistry utilities. The library is designed to support the flexible composition of fault-tolerant algorithms from modular primitives without prescribing a monolithic application or end-to-end solver workflow.

CUDA-Q Algorithms is the successor to CUDA-Q Solvers, reflecting the industry's shift from proof-of-concept experiments on small, noisy QPUs toward early fault-tolerant algorithms running on error-corrected QPUs integrated into quantum-GPU supercomputers.

Composable by design

CUDA-Q Algorithms separates classical problem data from executable quantum operations. Python objects store inputs such as Pauli coefficients, molecular integrals, and polynomial phases, then generate CUDA-Q kernels with that data captured.

Developers can compose these kernels inside their own @cudaq.kernel, execute them on any supported CUDA-Q target, or use convenience workflows such as Walk.moments(). A common BlockEncoding interface also allows built-in and custom encodings to work with the same Walk and QSVT implementations. This makes it possible to explore new algorithm components without rebuilding the surrounding workflow.

This approach is useful for a number of different use cases:

  • Quantum algorithm researchers can prototype encodings, QSVT constructions, and simulation methods as executable programs.
  • Chemistry and materials researchers can start from molecular integrals or qubit Hamiltonians and assemble simulation and phase estimation workflows.
  • Framework, QPU, and logical-stack software builders can use the library as a CUDA-Q implementation layer while keeping their existing problem representations and research tools.

The common goal is to move from an algorithm idea or scientific input to a runnable, testable CUDA-Q program with less project-specific code.

A first program

The core workflow takes only a few lines:

import cudaq
import numpy as np

from cudaq_algorithms import PauliLCU, Walk

cudaq.set_target("qpp-cpu")

# Block-encode H / alpha.
hamiltonian = {
    "ZZ": 0.5,
    "XI": 0.3,
    "IX": 0.3,
}
encoding = PauliLCU(hamiltonian)

# Construct the qubitization walk.
walk = Walk(encoding)

# Measure Chebyshev moments of H / alpha.
state = np.array([1, 0, 0, 0], dtype=complex)
moments = walk.moments(state, 4)

print(moments)

PauliLCU converts the Hamiltonian into a block encoding, and Walk constructs its qubitization operator. The measured Chebyshev moments, \(\langle T_k(H/\alpha)\rangle\), can then be used by spectral methods such as Krylov eigensolvers. The quickstart verifies the results against dense linear algebra.

State preparation can also be supplied as a CUDA-Q kernel. This allows Walk, QSVT, and Trotter to generate a single kernel that prepares the state and applies the algorithm. The included example demonstrates this workflow with both a Hartree–Fock state and a Givens-rotation-generated Slater determinant.

From molecular data to a ground-state calculation

An included quantum chemistry example demonstrates how to use CUDA-Q Algorithms to connect PySCF and CUDA-Q in an end-to-end workflow:

PySCF mean field → molecular integrals → Jordan–Wigner Hamiltonian → Pauli LCU block encoding → qubitization moments → classical Krylov solve → ground-state energy

The result can be verified against a full configuration interaction calculation. A second example replaces the Pauli LCU encoding with a double-factorized encoding while leaving the downstream Walk and QSVT code unchanged, making it easier to compare Hamiltonian representations within the same workflow.

The release includes six runnable examples covering block encoding, QSVT, Trotter simulation, quantum chemistry, double factorization, state preparation, and custom encodings. Each checks its output against an independent reference, such as dense matrix calculations or full configuration interaction.

Quantum computing is entering the era of fault tolerance. Discovering and testing fault-tolerant applications requires an ability to rapidly test and optimize candidate algorithms. CUDA-Q Algorithms provides researchers with the open-source tools they need to do so.

Get started

Install CUDA-Q Algorithms with:

pip install cudaq-algorithms

Download the source from GitHub and explore the documentation.

Share on Share on Share on LinkedIn