Abstract
Classical simulation of quantum circuits is a critical tool for the development and verification of quantum algorithms. However, as the number of qubits increases, the memory requirements for state vector simulation grow exponentially, leading to severe performance bottlenecks due to data movement across memory hierarchies and network interconnects. This paper introduces HiSVSIM, a hierarchical framework that optimizes state vector simulation by treating quantum circuits as Directed Acyclic Graphs (DAGs). By employing a novel acyclic partitioning strategy (dagP), HiSVSIM ensures that sub-circuits fit within faster memory layers (such as L3 cache) and minimizes redundant data transfers. Experimental results using the QASMBench suite demonstrate that HiSVSIM achieves up to a 3.9x speedup over industry-standard simulators like Intel IQS.
Introduction
The simulation of quantum circuits on classical hardware is a fundamental challenge in quantum information science. To track the state of an $n$-qubit system, a simulator must maintain a state vector of $2^n$ complex amplitudes. This exponential growth quickly exhausts the memory capacity of even the largest supercomputers; for instance, a 40-qubit simulation requires over a terabyte of RAM.
Beyond simple capacity, the primary performance bottleneck is the "memory wall." Because the computational intensity of quantum gate operations is relatively low compared to the volume of data being manipulated, simulators are typically memory-bound. The processor spends a disproportionate amount of time waiting for data to arrive from slow main memory (DRAM) or across a network in distributed environments. HiSVSIM addresses this by optimizing data locality through sophisticated graph-based partitioning.
Methodology
Hierarchical Acyclic Partitioning
HiSVSIM transforms the quantum circuit into a Directed Acyclic Graph (DAG), where nodes represent quantum gates and edges represent the qubits they act upon. The framework then applies a multi-level partitioning strategy:
- Acyclic Partitioning (
dagP): Unlike standard partitioning that may require multiple passes over the same data, HiSVSIM ensures that the dependencies between partitioned sub-circuits remain acyclic. This allows each part of the state vector to be loaded, processed, and stored back exactly once in a specific sequence, eliminating redundant communication and synchronization overhead. - Gather-Execute-Scatter Model: For each sub-circuit, the framework "gathers" the relevant segments of the global state vector into a localized "inner state vector" designed to fit within the CPU's L3 cache. After executing the gate operations locally, the results are "scattered" back to the main memory. This approach maximizes the use of high-bandwidth, low-latency cache layers.
- Multi-level Hierarchy: The system is designed to be nested. It can partition a circuit at the node level to minimize inter-node network traffic and then further partition it at the socket or core level to optimize DRAM-to-cache transfers.
Partitioning Heuristics
The researchers compared three distinct strategies for organizing gate execution:
- Natural Order: Following the original sequence of the circuit.
- Depth-First Search (DFS): Prioritizing the execution of gates along a single qubit path.
- dagP Heuristic: The proposed acyclic graph partitioning method designed to minimize the "cut size" (the number of qubits crossing partition boundaries).
Experimental Evaluation
Setup and Benchmarks
HiSVSIM was evaluated using QASMBench, a comprehensive benchmark suite. The tests included 13 circuit types, such as the Quantum Fourier Transform (QFT), Grover’s Search, and the Quantum Approximate Optimization Algorithm (QAOA). Simulations ranged from 30 qubits (16GB) to 37 qubits (2TB), executed across a high-performance computing cluster.
Performance Results
- Execution Speed: HiSVSIM outperformed Intel’s IQS (a state-of-the-art distributed simulator) by an average of 2.1x. On complex circuits like the Quantum Ripple-Carry Adder, the speedup reached 3.9x.
- Communication Efficiency: The
dagPstrategy significantly reduced communication overhead. In distributed settings, it achieved over a 50% reduction in time spent on network transfers compared to standard methods. - Cache Optimization: By forcing the working set into the L3 cache, HiSVSIM reduced "DRAM stall" time, where the CPU remains idle while waiting for data. The two-level partitioning scheme (Node + Cache) provided an additional 1.5x performance gain over single-level partitioning.
- Cross-Platform Portability: The partitioning logic was also integrated as a front-end for the GPU-based simulator HyQuas, where it reduced execution time from 1.47s to 0.83s, demonstrating the general utility of the acyclic partitioning approach.
Conclusion
HiSVSIM demonstrates that significant performance gains in quantum circuit simulation can be achieved by focusing on data movement and memory hierarchy rather than gate execution alone. By enforcing acyclic dependencies and optimizing for cache locality, the framework provides a more scalable path for simulating mid-scale quantum systems on classical hardware. Future work will explore the integration of these partitioning techniques into Tensor Network simulators and specialized AI hardware accelerators.
Summary updated