High-performance techniques to simulate quantum programs on classical hardware rely on exponentially large vectors to represent quantum states. When simulating quantum algorithms, the quantum states that occur are often sparse due to special structure in the algorithm or even in the underlying problem. We thus introduce a new simulation method that exploits this sparsity to reduce memory usage and simulation runtime. Moreover, our prototype implementation includes optimizations such as gate (re)scheduling, which amortizes data structure accesses and reduces memory usage. To benchmark our implementation, we run quantum algorithms for factoring, for computing integer and elliptic curve discrete logarithms, and for chemistry. Our simulator successfully runs a factoring instance of a 20-bit number using 102 qubits, and elliptic curve discrete logarithm over a 10-bit curve with 110 qubits. While previous work needed a supercomputer to simulate such instances of factoring, our approach succeeds in less than four minutes using a single core and less than 100 MB of memory. To the best of our knowledge, we are the first to fully simulate a quantum algorithm to compute elliptic curve discrete logarithms.
High-performance techniques to simulate quantum programs on classical hardware rely on exponentially large vectors to represent quantum states. When simulating quantum algorithms, the quantum states that occur are often sparse due to special structure in the algorithm or even in the underlying problem. We thus introduce a new simulation method that exploits this sparsity to reduce memory usage and simulation runtime. Moreover, our prototype implementation includes optimizations such as gate (re)scheduling, which amortizes data structure accesses and reduces memory usage. To benchmark our implementation, we run quantum algorithms for factoring, for computing integer and elliptic curve discrete logarithms, and for chemistry. Our simulator successfully runs a factoring instance of a 20-bit number using 102 qubits, and elliptic curve discrete logarithm over a 10-bit curve with 110 qubits. While previous work needed a supercomputer to simulate such instances of factoring, our approach succeeds in less than four minutes using a single core and less than 100 MB of memory. To the best of our knowledge, we are the first to fully simulate a quantum algorithm to compute elliptic curve discrete logarithms.
Abstract Quantum computing promises advantages for problems in physics, chemistry, and optimization, yet current noisy and small-scale devices limit the implementation of large quantum algorithms. Classical simulation therefore remains essential for algorithm design, verification, and performance benchmarking. However, existing Schrödinger- and Feynman-based simulators suffer from exponential scaling or limited oracle integration. Here we present SparQSim, a C++-based, Feynmaninspired simulator that exploits state sparsity to reduce memory consumption and supports registerlevel operations with integrated quantum random access memory (QRAM). Benchmarks from QASMBench and MQTBench show that for circuits with substantial state space sparsity, which represent the core application scenario of SparQSim, the method surpasses Schrödinger style simulators in both runtime and memory efficiency. Moreover, full-process simulations of quantum linear-system solvers yield results consistent with theoretical predictions. SparQSim provides a flexible and scalable platform for efficient simulation and optimization of quantum algorithms.
Classical simulation of quantum circuits is critical for the development of implementations of quantum algorithms: it does not require access to specialized hardware, facilitates debugging by allowing direct access to the quantum state, and is the only way to test on inputs that are too big for current NISQ computers. Many quantum algorithms rely on invariants that result in sparsity in the state vector. A sparse state vector simulator only computes with non-zero amplitudes. For important classes of algorithms, this results in an asymptotic improvement in simulation time. While promising prior work has investigated ways to exploit sparsity, it is still unclear what is the best way to scale sparse simulation to modern multi-core architectures. In this work, we address this challenge and present qblaze , a highly optimized sparse state vector simulator based on (i) a compact sorted array representation, and (ii) new, easily parallelizable and highly-scalable algorithms for all quantum operations. Our extensive experimental evaluation shows that qblaze is often orders-of-magnitude more efficient than prior sparse state vector simulators even on a single thread, and also that qblaze scales well to a large number of CPU cores. Overall, our work enables testing quantum algorithms on input sizes that were previously out of reach.
Simulating quantum circuits on classical hardware remains essential for developing and validating quantum algorithms, particularly in this era of noisy and limited quantum devices. Classical simulation is computationally demanding, due to the exponential growth of the Hilbert space with the number of qubits, because of quantum entanglement. Tensor networks offer a versatile tool for quantum circuit simulation, helping to reduce the associated computational cost. While tensor networks leverage entanglement to represent quantum states in compressed form, many quantum systems also exhibit additional symmetries, such as conserved particle number, that induce block sparsity in quantum states and quantum operators. We demonstrate through numerical experiments how block sparsity can be exploited to enhance the performance of the simulation of quantum circuits, in terms of execution time and memory usage.
Quantum computer simulations are essential for validating quantum algorithms but face significant computational and memory challenges due to massive floating-point arithmetic with complex numbers. In this paper, we propose a Quantization for Quantum computer simulation (QQ), an integer-based quantization scheme that considerably reduces these overheads while maintaining simulation accuracy. By exploiting the structure of quantum gate matrices, the proposed method separates real and imaginary components, eliminating zero-value operations. Across 25 quantum benchmark circuits, our quantization scheme reduces matrix-vector multiplications and additions by up to 50% and 66.7%, respectively, leading to energy savings of up to 400,834× compared to conventional quantum simulations. It also maintains simulation fidelity above 0.99 for most benchmark circuits, with over half preserving accuracy even at 2-bit precision. Additionally, it reduces memory usage by up to 93.75%, enabling scalable and efficient quantum computer simulations.
One of the strengths of our recently proposed Walking Cat Architecture for a trapped-ion quantum computer is that it is straightforward to extend and optimize for a specific application. As a proof-of-concept, here we present such optimizations for solving the 256-bit elliptic curve discrete logarithm problem (ECDLP) on secp256k1, which is the elliptic curve used by blockchain technologies such as Bitcoin, using Shor's algorithm. We optimize the circuits from Schrottenloher's recent work and arrive at a logical quantum circuit for solving the ECDLP using about 1450 qubits and 40⋅106 Toffoli gates, with a rigorous lower bound on the logical-level success probability that holds with confidence at least 1−2−128. Using our compilation toolchain with manual optimization of the logical layout and integrated routing, we produce estimates for the logical measurement depth and the required number of physical qubits by compiling all components to measurement schedules that obey the architectural constraints. A key ingredient is a fast CCZ magic-state factory and a depth-one CCZ state injection, reducing the execution time of CCZ gates by a factor of 31. We increase the logical-measurement parallelism using non-overlapping cat-based measurements in parallel, and we leverage the recently proposed logical CliNR protocol to speed up Clifford operations. To reduce the qubit overhead, we introduce a more efficient loss correction protocol, design a layout that allows us to recycle the CliNR ancilla qubits, and provision reusable cat-state resources according to the circuit's peak measurement parallelism. All results and optimizations combined, we conclude that a trapped-ion quantum computer based on our architecture can solve the ECDLP on secp256k1 in approximately 25.7 days using 19,397 physical qubits with an estimated success probability of 63%.
Scalable Program Implementation and Simulation of the Large-Scale Quantum Algorithm: 1024×1024 Quantum Linear Solver and Beyond
Program implementation and simulation are essential for research in the field of quantum algorithms. However, complex and large-scale quantum algorithms can pose challenges for existing quantum programming languages and simulators. Here, we present a scalable program implementation of the quantum walk on a sparse matrix and the quantum linear solver based on the quantum walk. Our implementation is based on a practical scenario in which the sparse matrix is stored in the compressed-sparse-column format in quantum random access memory. All necessary modules are implemented unitarily and are ensured to be decomposed at the quantum gate level, including implementing a quantum binary search and a modification of the original algorithm. The program is validated using a highly efficient quantum circuit simulator which is based on the register level and sparse state representation. With only a single core, we simulate the quantum walk on a 16384-dimensional matrix with 582 qubits in 1.1 minutes per step, as well as a quantum linear solver up to 1024 dimensions and 212245 steps in 70 hours. Our work narrows the gap between the simulation of a quantum algorithm and its classical counterparts, where the asymptotic complexity of our quantum linear solver simulation approximates a classical linear solver. These program implementation and simulation techniques have the potential to expand the boundary of numerical research for large-scale quantum algorithms, with implications for the development of error-correction-era quantum computing solutions.