Introduction
Quantum circuit simulation on classical hardware is a cornerstone of quantum algorithm development, providing the necessary environment for debugging and hardware calibration. However, full-state simulation is fundamentally constrained by the "memory wall." Because the state vector of an $n$-qubit system grows exponentially ($2^n$), and the corresponding operation matrices grow even faster ($2^{2n}$), classical resources are quickly exhausted. Even the world's most powerful supercomputers, such as Fugaku, are limited to approximately 24 qubits when using standard simulation techniques.
To address this bottleneck, we introduce Mera, a multi-level optimization framework designed to reduce both the memory footprint and the execution time of quantum simulations. By exploiting the inherent mathematical redundancies in quantum gates—specifically sparsity and structural regularity—Mera enables the simulation of up to 35 qubits on a single workstation, nearly doubling the capacity of traditional methods.
The Mera Framework
Mera shifts the paradigm of quantum simulation from high-bandwidth memory reliance to efficient computational logic. The framework targets two primary categories of quantum operations: sparse gates and dense but regular gates.
Exploiting Sparsity: DAX and DAS
Analysis of common quantum circuits reveals that approximately 80% of standard gates (e.g., Pauli-X, Toffoli, CSwap) are sparse. Mera introduces two compressed storage formats to capitalize on this:
- Decimal Index (DAX): Stores only non-zero elements along with their decimal indices.
- Distance (DAS): Stores non-zero elements and the relative distance (number of zeros) between them.
A key innovation of Mera is the development of Matrix Tensor Product (MTP) and Matrix-Vector Multiplication (MVM) algorithms that operate directly on these compressed formats. This "zero-decompression" workflow avoids the performance penalties typically associated with lossless compression, as data never needs to be expanded into a dense format during calculation. Furthermore, the framework relies on the principle of Sparsity Persistence, which ensures that the sparsity of an operation matrix is maintained throughout the MTP process.
Optimizing Dense Regularity: The RH Structure
While Hadamard gates are dense and cannot be compressed via sparsity-based methods, they exhibit high mathematical regularity. Traditional simulation stores the entire $2^{2n}$ matrix for an $n$-qubit Hadamard operation. Mera’s Regularity-oriented Hadamard (RH) structure reduces this to a single stored value: the absolute magnitude $1/\sqrt{N}$.
The signs (positive or negative) of the matrix elements are computed on-the-fly using a novel logarithm-based method. By shifting the burden from memory storage to $O(n)$ computational logic, Mera achieves significant speedups, as modern CPUs are better equipped to handle logic operations than the massive data transfers required by dense matrices.
Experimental Results
Mera was evaluated on a workstation equipped with an Intel Xeon Silver 4114 CPU and 0.7 TB of RAM. The framework was tested against standard quantum gates, Grover’s algorithm, and Quantum Neural Network (QNN) components.
Capacity and Efficiency
Mera successfully extended the simulation limit from 17 qubits to 35 qubits on the test hardware. For sparse gates, the memory savings reached up to $1.1 \times 10^{10} \times$ compared to standard representations.
Speedup Metrics
The computational efficiency of the zero-decompression algorithms resulted in dramatic performance gains:
- MTP Operations: Up to 1800.3× speedup.
- MVM Operations: Up to 141.2× speedup.
- Hadamard Optimization: The log-based sign computation provided a 98.7× speedup over non-optimized RH methods for 17 qubits.
In end-to-end algorithmic tests, Mera achieved a 6.9× acceleration for QNNs and a 4.6× acceleration for Grover’s algorithm.
Limitations and Future Work
Despite its success with sparse and Hadamard gates, Mera encounters limitations with other dense operations. In QNN simulations, for instance, the data encoding stage utilizes RY (rotation-Y) gates. These gates are dense and lack the specific regularity of the Hadamard gate, making them resistant to current Mera optimizations. This "Stage 1" encoding remains a primary memory bottleneck that limits the overall qubit count for specific algorithms.
Future research will focus on identifying and exploiting regularity in a broader range of dense rotation gates to further extend the reach of classical quantum simulation.
Summary updated