In this study, we introduce a novel implementation of Shor’s algorithm specifically designed for the Graphics Processing Unit (GPU) acceleration framework. Our focus lies on achieving efficient execution of the modular multiplication circuit through GPU simulation. To seamlessly integrate our design into the PyQPanda library framework, we made necessary modifications, making a deliberate trade-off by sacrificing a small number of quantum resources to leverage the advantages of GPU acceleration. Subsequently, we conducted simulations and rigorously validated the functionality of our circuit using the PyQPanda library, resulting in a significant speedup compared to a central processing unit-only mode.
In this study, we introduce a novel implementation of Shor’s algorithm specifically designed for the Graphics Processing Unit (GPU) acceleration framework. Our focus lies on achieving efficient execution of the modular multiplication circuit through GPU simulation. To seamlessly integrate our design into the PyQPanda library framework, we made necessary modifications, making a deliberate trade-off by sacrificing a small number of quantum resources to leverage the advantages of GPU acceleration. Subsequently, we conducted simulations and rigorously validated the functionality of our circuit using the PyQPanda library, resulting in a significant speedup compared to a central processing unit-only mode.
Shor’s quantum algorithm is very important for cryptography, because it can factor large numbers much faster than classical algorithms. In this study, we implement a simulator for Shor’s quantum algorithm on graphic processor units (GPU) and compare our results with Liquid, which is a Microsoft quantum simulation platform, and two classical CPU implementations. We evaluate 10 benchmarks for comparing our GPU implementation with Liquid and single-core implementation. The analysis shows that GPU vector operations are more suitable for Shor’s quantum algorithm. Our GPU kernel function is compute-bound, due to all threads in a block reaching the same element of the state vector. Our implementation has 52.5× speedup over single-core algorithm and 20.5× speedup over Liquid.
We present the NVIDIA cuQuantum SDK [1], a state-of-the-art library of composable primitives for GPU-accelerated quantum circuit simulations. As the size of quantum devices continues to increase, making their classical simulation progressively more difficult, the availability of fast and scalable quantum circuit simulators becomes vital for quantum algorithm developers, as well as quantum hardware engineers focused on the validation and optimization of quantum devices. The cuQuantum SDK was created to accelerate and scale up quantum circuit simulators developed by the quantum information science community by enabling them to utilize efficient scalable software building blocks optimized for NVIDIA GPU-based platforms. The functional building blocks provided cover the needs of both state vector- and tensor network- based simulators, including approximate tensor network simulation methods based on matrix product state, projected entangled pair state, and other factorized tensor representations. By leveraging the enormous computing power of the latest NVIDIA GPU architectures, quantum circuit simulators that have adopted the cuQuantum SDK demonstrate significant acceleration, compared to CPU-only execution, for both the state vector and tensor network simulation methods. Furthermore, by utilizing the parallel primitives available in the cuQuantum SDK, one can easily transition to distributed GPU-accelerated platforms, including those furnished by cloud service providers and high-performance computing systems deployed by supercomputing centers, extending the scale of possible quantum circuit simulations. The rich capabilities provided by the cuQuantum SDK are conveniently made available via both Python and C application programming interfaces, where the former is directly targeting a broad Python quantum community and the latter allows tight integration with simulators written in any programming language.
Quantum circuit simulation is crucial for algorithm development and cryptanalysis given the limited qubit counts and high noise in today’s quantum hardware. We present a Qiskit MPI framework that accelerates classical simulation of quantum circuits focusing on Shor’s integer factoring algorithm by distributing workloads across high performance computing (HPC) resources. A novel dynamic shot allocation strategy balances simulation tasks across MPI processes, preventing idle CPUs even when the total number of circuit "shots" (independent runs) is not evenly divisible. This load balancing approach, combined with support for hybrid CPU/GPU execution on each node, achieves near linear speedups (e.g. 7.5× on 8 processes and 14× on 16 processes) in simulating Shor’s algorithm circuits. We validate the correctness of our parallel simulator by showing that distributed execution produces identical quantum output distributions as a serial run, thus maintaining fidelity. All experiments are performed with fixed random seeds and provided in open source form for reproducibility. We also discuss compatibility with the emerging Quantum Message Passing Interface (QMPI), which extends MPI to quantum computing contexts. By enabling fast, scalable simulation of cryptographically relevant algorithms like Shor’s on classical clusters, our framework allows researchers to prototype quantum attacks and assess quantum algorithm performance ahead of large scale quantum hardware. We report extensive experiments, including factoring small composite numbers, that demonstrate significant wall clock speedups without loss of accuracy. These results position our approach as a practical tool for scalable quantum algorithm prototyping and cryptanalysis research in the pre-quantum era.
In recent years, quantum computing has undergone significant developments and has established its supremacy in many application domains. While quantum hardware is accessible to the public through the cloud environment, a robust and efficient quantum circuit simulator is necessary to investigate the constraints and foster quantum computing development, such as quantum algorithm development and quantum device architecture exploration. In this paper, we observe that most of the publicly available quantum circuit simulators (e.g., QISKit from IBM, QDK from Microsoft, and Qsim-Cirq from Google) suffer from slow simulation and poor scalability when the number of qubits increases. To this end, we systematically investigate the deficiencies in quantum circuit simulation (QCS) and propose Q-GPU, a framework that leverages GPUs with comprehensive optimizations to allow efficient and scalable QCS. Specifically, Q-GPU features i) proactive state amplitude transfer, ii) zero state amplitude pruning, iii) delayed qubit involvement, and iv) lossless nonzero state amplitude compression. Experimental results across nine representative quantum circuits indicate that Q-GPU significantly reduces the execution time of the state-of-the-art GPU-based QCS by 71.89% (3.55× speedup). Q-GPU also outperforms the state-of-the-art OpenMP CPU implementation, the Google Qsim-Cirq simulator, and the Microsoft QDK simulator by 1.49×, 2.02×, and 10.82×, respectively.
Classical simulation of quantum circuits remains indispensable for algorithm development, hardware validation, and error analysis in the noisy intermediate-scale quantum (NISQ) era. However, state-vector simulation faces exponential memory scaling, with an n-qubit system requiring O(2^n) complex amplitudes, and existing simulators often lack the flexibility to exploit heterogeneous computing resources at runtime. This paper presents a GPU-accelerated quantum circuit simulation framework that introduces three contributions: (1) an empirical backend selection algorithm that benchmarks CuPy, PyTorch-CUDA, and NumPy-CPU backends at runtime and selects the optimal execution path based on measured throughput; (2) a directed acyclic graph (DAG) based gate fusion engine that reduces circuit depth through automated identification of fusible gate sequences, coupled with adaptive precision switching between complex64 and complex128 representations; and (3) a memory-aware fallback mechanism that monitors GPU memory consumption and gracefully degrades to CPU execution when resources are exhausted. The framework integrates with Qiskit, Cirq, PennyLane, and Amazon Braket through a unified adapter layer. Benchmarks on an NVIDIA A100-SXM4 (40 GiB) GPU demonstrate speedups of 64x to 146x over NumPy CPU execution for state-vector simulation of circuits with 20 to 28 qubits, with speedups exceeding 5x from 16 qubits onward. Hardware validation on an IBM quantum processing unit (QPU) confirms Bell state fidelity of 0.939, a five-qubit Greenberger-Horne-Zeilinger (GHZ) state fidelity of 0.853, and circuit depth reduction from 42 to 14 gates through the fusion pipeline. The system is designed for portability across NVIDIA consumer and data-center GPUs, requiring no vendor-specific compilation steps.
This work presents a portable, modular quantumcircuit emulator designed to accelerate algorithm prototyping by leveraging Central Processing Unit (CPU) and Compute Unified Device Architecture (CUDA)-enabled Graphic Processing Unit (GPU) backends for dense linearalgebra workloads.The emulator provides a lightweight backend abstraction that unifies NumPy and CuPy, supports both statevector and density-matrix representations, and implements efficient multi-target unitary embedding and Kraus-map noise channels.These capabilities enable rapid exploration of quantum algorithms that require full 2 n × 2 n operators, such as quantum phase estimation, full Quantum Fourier Transform (QFT), and noise-aware variational circuits, while minimizing host/device transfer and preserving numerical parity between backends.Implementation strategies are described for embedding single-and multi-qubit gates, parameterized rotations, and controlled unitaries, along with an "apply_unitary_on_targets" routine that employs reshape/matrix-multiply/reshape patterns to map arbitrary target sets to dense GPU kernels for high throughput.Using a curated benchmark suite of dense quantum workloads and microbenchmarks, including large matrix multiplies and Fast Fourier Transforms (FFT), performance is quantified across a range of qubit counts and precisions.The results demonstrate substantial speedups on modern NVIDIA GPUs for workloads dominated by dense linear algebra, identify cross-over points where GPU acceleration becomes beneficial, and analyse memory/precision trade-offs for complex64 versus complex128.The presented emulator lowers the barrier for noise-aware algorithm prototyping by combining practical software ergonomics with GPU performance, enabling faster iteration on algorithm design and noise-mitigation strategies on commodity single-node hardware.While the abstraction layer ensures portability, achieving peak performance currently requires hardwarespecific tuning-a limitation we address through future automation strategies.