Q-GEAR: Improving quantum simulation framework

Ziqing Guo, Jan Balewski, Ziwen Pan · 2025

Read Q-GEAR: Improving quantum simulation framework by Ziqing Guo, Jan Balewski, Ziwen Pan (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-03967.txt.

Introduction

Ziqing Guo, Jan Balewski, and Ziwen Pan built a translator between quantum software frameworks in a 2025 paper. Simulating quantum circuits on classical machines verifies algorithms before hardware runs them, but mainstream tools run on CPUs and crawl, while graphics processors need code written for entirely different frameworks. Their Q-GEAR system converts circuits written in the popular Qiskit toolkit into kernels for NVIDIA's CUDA-Q platform automatically.

Converted circuits then run far faster: about two orders of magnitude on CPUs and tenfold on GPUs, with little coding effort, per their benchmarks. Linking memory across several GPUs lets oversized circuits fit. Container images tuned for a national supercomputer's scheduler reached near-full GPU use, easing adoption for large simulation campaigns.

Catalog record

CREATORZiqing Guo, Jan Balewski, Ziwen Pan
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE40 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2504-03967

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Q-GEAR: Improving quantum simulation framework Ziqing Guo, Jan Balewski, Ziwen Pan Abstract . Fast execution of complex quantum circuit simulations is crucial for the verification of theoretical algorithms, paving the way for their successful execution on quantum hardware. However, mainstream CPU-based platforms for circuit simulation are well established, but slower. However, the adoption of GPU platforms remains limited because different hardware architectures require specialized quantum simulation frameworks, each with distinct implementations and optimization strategies. Therefore, we introduced Q-Gear , a software framework that transforms Qiskit quantum circuits into Cuda-Q kernels. By leveraging Cuda-Q seamless execution on GPUs, Q-Gear accelerates both CPU- and GPU-based simulations by two orders of magnitude and ten times with minimal coding effort. Furthermore, Q-Gear leverages the Cuda-Q configuration to interconnect the memory of GPUs, allowing the execution of much larger circuits beyond the memory limit set by a single GPU or CPU node. Additionally, we created and deployed a Podman container and a Shifter image at Perlmutter (NERSC/LBNL), both derived from an NVIDIA public image. These public NERSC containers were optimized for the Slurm job scheduler, allowing approximately 100% utilization of up to 1,024 GPUs. We present various benchmarks for Q-Gear to demonstrate the efficiency of our computational paradigm. \acmCodeLink https://github.com/gzquse/Q-Gear ISBN: 978-1-4503-XXXX-X/18/06 1. Introduction Figure 1 . The current quantum computing challenges and the general analysis of quantum simulation are introduced in ( 1 , 2 , 3 ) . GPU-based quantum simulation outperforms CPU simulations by overcoming performance ceilings associated with increasing qubit counts ( 4 , 5 ) ; the parallelized GPU architecture enables superior scalability and faster computation for large-scale matrix operations. Cuda-Q enables a platform-agnostic quantum circuit simulation by encapsulating essential simulation variables, ensuring compatibility across diverse hardware architectures. Detailed gates and state vector simulator functions are provided in Appendix A . A diagram illustrating the challenges in quantum computing and the advantages of GPU-based quantum simulation. It highlights the scalability and performance benefits of GPU parallelization for large-scale matrix operations and the platform-agnostic capabilities of \cq\ for quantum circuit simulation. Quantum circuit simulation (QCS) directly models the mathematical formalism of complex quantum states. Quantum methods are expected to outperform classical methods in sampling and factoring problems because they bypass the need to explicitly represent and manipulate exponentially large state vectors, which is a limitation of classical algorithms. These advantages have led to the growing prominence of quantum methods in both fundamental research and widespread applications in various domains, including cryptography ( 6 ) , materials science ( 7 ) , and quantum machine learning ( 8 ) . The most well-known approach to quantum computing systems involves designing a sequence of basic unitary operations, known as quantum gates, to transform a standard initial state into a specific target quantum state ( 9 ) . Modern QCS tackles a diverse range of tasks, including variational quantum algorithms ( 10 , 11 , 12 ) and hybrid quantum-classical frameworks ( 13 , 14 , 15 ) . These frameworks are supported by techniques such as unitary compilation ( 16 ) , ansatz initialization ( 17 ) , and circuit optimization ( 18 ) . The implementation of these tasks relies on tools such as Qiskit ( 19 ) , Pennylane ( 20 ) , Cuda-Q ( 5 ) , MPICH ( 21 ) , and Podman ( 22 ) containers. The key focus of these techniques is to improve the measurement fidelity using millions of shots and to improve the scalability of quantum computations. Figure 2 . Summary of Q-Gear methods and workflows. (a) Three quantum circuits—Quantum Fourier Transform (QFT), Random CX Block, and QCrank—are encoded as three-dimensional tensors, with gate types represented as parameterized tensor blocks. Each block includes A_{m,1} matrices and continuous vector-encoded gate parameters, mapping gates, control qubits, and target qubits. (b) Source circuits are transformed into kernel circuits, optimized for CUDA execution within thread warps, eliminating transformation overhead and ensuring an efficient hardware layout. (c) Workflow includes two modes designed for large circuits and accelerated simulation. A summary diagram of Q-Gear methods and workflows. It illustrates three quantum circuits—Quantum Fourier Transform (QFT), Random CX Block, and QCrank—encoded as three-dimensional tensors with parameterized tensor blocks. The diagram also shows the transformation of source circuits into kernel circuits optimized for CUDA execution and highlights the workflow modes designed for large circuits and accelerated simulation. However, QCS efficiency remains highly sensitive to circuit layouts, with scaling challenges becoming more pronounced as circuit complexity increases. Specifically, as the number of qubits, the depth of the circuit, and the complexity of the entanglement of the circuit grow, the simulation overhead increases significantly. Furthermore, IBM experts have demonstrated a possible integration of Qiskit with a V100 GPU ( 23 ) . However, this process required installation of Qiskit from the source, a complex and non-trivial task. Their performance benchmarks on QFT circuits (up to 22 qubits) reported speedups of less than 10x utilizing single-float accuracy. To address these QCS challenges, we introduce Q-Gear that provides a platform-agnostic containerized running mode that fully utilizes the state-of-the-art GPU to accelerate the entire program, and therefore with minimal coding effort, Q-Gear allows QCS of circuits that are significantly larger and faster than what is feasible on typical CPUs as shown in Fig. 1 . Specifically, Q-Gear optimizes performance by distributing workloads from native objects to CUDA kernels using the MPI framework. This enables scalability to higher qubit counts, reduces simulation runtime, and enhances efficiency while maintaining flexibility for user adaptability. 2. Methods In this section, we present the comprehensive methods of Q-Gear to encode circuit sequences into Cuda-Q kernels, and the architecture of the containerized workflow that fully utilizes GPU power using Podman ( 22 ) and Slurm jobs ( 24 ) . Detailed instructions for reproducing the pipeline are provided in Section E.3 , including methods for single GPU transformations, adjoint GPU modes, and cross-node configurations. 2.1. Circuit encoding To accurately map quantum circuits, we converted the saved gate list into a three-dimensional tensor comprising matrices and tensors. As shown in (a) of Fig. 2 , the first dimension encodes the type of circuit, indices of the qubits, and gate count. The second dimension stores gate categories, control qubit indices, and target qubit indices. The third dimension captures unified gate parameters extracted from the QPY file ( 25 ) , transpiled from native gate sets, and maps the variables into predefined tensors that remain fixed but are dynamically updated based on the input quantum circuits during encoding. The lengths of the tensors correspond to the number of circuits encoded. Although the illustrated graph demonstrates a CX block, more complex block encoding and highly entangled scenarios ( 26 , 27 , 16 ) require larger data storage for transformation encoding. To address this, we used the HDF5 ( 28 ) file format, which efficiently encodes and manages high-dimensional datasets, supports various data types (including metadata integration), and provides scalable storage for complex scientific and computational workflows. This approach ensures a constant circuit conversion time. Details and proof of the encoding process are provided in Appendix B . 2.2. Kernel transformation To transform circuits into CUDA kernels efficiently, Q-Gear directly converts Qiskit quantum circuits into GPU executable kernels.

Read the complete text