Table of Contents
Fetching ...

Extending the OmpSs-2 Programming Model for Hybrid Quantum-Classical Programming

Philip Döbler, David Álvarez, Lucas J. Menger, Thomas Lippert, Vicenç Beltran, Manpreet Singh Jattana

TL;DR

This work addresses the integration of quantum accelerators into HPC by extending the OmpSs-2 programming model to offload computation to quantum processors using OpenQASM kernels. It introduces a compiler/runtime stack and a networked quantum backend simulator, enabling asynchronous, data-dependency-driven execution alongside existing accelerators. Four application examples—random-number generation, energy landscape plotting, a variational algorithm, and a quantum convolutional network—demonstrate practical hybrid quantum-classical workflows and the ease of integrating with third-party libraries. The approach provides a modular path toward scalable hybrid HPC, with future work targeting backend abstraction, performance optimizations, error mitigation, and multi-hardware experimentation.

Abstract

The OmpSs-2 programming model is used in HPC programs to parallelize code and offload code to accelerators. In this work, we extend the offloading capability to quantum computers. We explain the necessary changes to the Clang compiler and the Nanos6 runtime, which are both part of OmpSs-2. In addition, we develop a simulator that simulates a quantum computer in the network and receives the jobs offloaded by the runtime. Four detailed examples show how our programming model can be used to write hybrid quantum-classical software. The examples are random number generation, a parameter scan using the mean-field ansatz, a variational algorithm using this ansatz, and handwritten digit recognition using a hybrid convolutional neural network.

Extending the OmpSs-2 Programming Model for Hybrid Quantum-Classical Programming

TL;DR

This work addresses the integration of quantum accelerators into HPC by extending the OmpSs-2 programming model to offload computation to quantum processors using OpenQASM kernels. It introduces a compiler/runtime stack and a networked quantum backend simulator, enabling asynchronous, data-dependency-driven execution alongside existing accelerators. Four application examples—random-number generation, energy landscape plotting, a variational algorithm, and a quantum convolutional network—demonstrate practical hybrid quantum-classical workflows and the ease of integrating with third-party libraries. The approach provides a modular path toward scalable hybrid HPC, with future work targeting backend abstraction, performance optimizations, error mitigation, and multi-hardware experimentation.

Abstract

The OmpSs-2 programming model is used in HPC programs to parallelize code and offload code to accelerators. In this work, we extend the offloading capability to quantum computers. We explain the necessary changes to the Clang compiler and the Nanos6 runtime, which are both part of OmpSs-2. In addition, we develop a simulator that simulates a quantum computer in the network and receives the jobs offloaded by the runtime. Four detailed examples show how our programming model can be used to write hybrid quantum-classical software. The examples are random number generation, a parameter scan using the mean-field ansatz, a variational algorithm using this ansatz, and handwritten digit recognition using a hybrid convolutional neural network.

Paper Structure

This paper contains 22 sections, 7 figures, 1 table.

Figures (7)

  • Figure 1: An example of the OmpSs-2 task graph executed on a heterogeneous platform. Tasks executing on devices (in this example, task 3) can stablish fine-grained data dependencies with host tasks. At runtime, their offloading is overlapped with host execution, and dependencies cause asynchronous release of dependant tasks, as depicted by the dashed lines in the execution trace.
  • Figure 2: (Top) Compilation toolchains that process classical and quantum resources separately. The link is created by the fact that the function name in the classic code must be identical to the filename of the OpenQASM file. (Bottom) The Nanos6 runtime runs classical tasks on the HPC cluster, if their dependencies are satisfied. Quantum tasks are offloaded to the backend, which is in our case a simulator.
  • Figure 3: Circuit diagram of the mean-field ansatz for four qubits. The two parameters $\theta_0$ and $\theta_1$ can be freely selected.
  • Figure 4: Expectation value $E$ for different angles $\theta_0$ and $\theta_1$.
  • Figure 5: Schematic representation of the execution of variational algorithms. The CPU optimizes the parameters of the quantum circuit, the QPU returns the bit strings of the current measurements.
  • ...and 2 more figures