Mera: Memory Reduction and Acceleration for Quantum Circuit Simulation via Redundancy Exploration

Yuhong Song,Edwin Hsing-Mean Sha,Longshan Xu,Qingfeng Zhuge,Zili Shao
2024-11-23
Abstract:With the development of quantum computing, quantum processor demonstrates the potential supremacy in specific applications, such as Grovers database search and popular quantum neural networks (QNNs). For better calibrating the quantum algorithms and machines, quantum circuit simulation on classical computers becomes crucial. However, as the number of quantum bits (qubits) increases, the memory requirement grows exponentially. In order to reduce memory usage and accelerate simulation, we propose a multi-level optimization, namely Mera, by exploring memory and computation redundancy. First, for a large number of sparse quantum gates, we propose two compressed structures for low-level full-state simulation. The corresponding gate operations are designed for practical implementations, which are relieved from the longtime compression and decompression. Second, for the dense Hadamard gate, which is definitely used to construct the superposition, we design a customized structure for significant memory saving as a regularity-oriented simulation. Meanwhile, an ondemand amplitude updating process is optimized for execution acceleration. Experiments show that our compressed structures increase the number of qubits from 17 to 35, and achieve up to 6.9 times acceleration for QNN.
Quantum Physics,Emerging Technologies
What problem does this paper attempt to address?
This paper attempts to solve the problems of memory consumption and computational efficiency in quantum circuit simulation. As the number of qubits increases, classical computers face exponentially growing memory requirements when performing full - state quantum circuit simulations. This not only limits the number of qubits that can be simulated but also significantly increases the computation time. To solve these problems, the author proposes a multi - level optimization method, namely Mera, which reduces memory usage and accelerates simulation by exploring redundancy. ### Main problems 1. **Memory consumption problem**: - As the number of qubits increases, the memory requirement grows exponentially. For example, an n - qubit quantum circuit needs to store an operation matrix of size \(2^n\times2^n\) and a state vector of size \(2^n\). - This makes it difficult for classical computers to handle large - scale quantum circuit simulations. 2. **Computational efficiency problem**: - Due to the memory bottleneck, existing supercomputers cannot fully meet the requirements of large - scale quantum circuit simulations either. - Although compilation - level optimization and parallel computing are helpful, there is still a large amount of memory and computational redundancy. ### Solutions To address the above problems, the paper proposes the following solutions: 1. **Compression structures for sparse quantum gates**: - For a large number of sparse quantum gates (such as Pauli - X, Pauli - Y, etc.), two new compression structures, DAX and DAS, are designed. - These structures reduce memory usage by removing duplicate zero elements and do not require a long - term compression and decompression process. - The DAX and DAS structures can achieve efficient matrix - tensor - product (MTP) and matrix - vector - multiplication (MVM) operations. 2. **Custom - made structure for dense Hadamard gates**: - The Hadamard gate is used to construct quantum superposition states and is a dense matrix, and its memory cannot be reduced by simple compression methods. - For this reason, the author proposes a custom - made structure RH based on regularity, specifically for the Hadamard gate. - The RH structure utilizes the regularity of the signs of matrix elements to achieve efficient state - vector updates and significantly reduces memory occupation. 3. **Experimental results**: - Experiments show that these compression structures can increase the number of simulatable qubits from 17 to 35. - For quantum neural networks (QNN), a maximum acceleration effect of 6.9 times is achieved. ### Formula summary - **Sizes of operation matrix and state vector**: \[ \text{Operation matrix size}=2^{2n}+ 4\text{ bytes} \] \[ \text{State vector size}=2^{n + 4}\text{ bytes} \] - **Redundancy exploration of sparse matrix - tensor product**: \[ R(A\otimes B)=R(A)+(1 - R(A))\cdot R(B) \] where \(R(A)\) and \(R(B)\) are the proportions of zero elements in matrices A and B respectively. - **Symbol - calculation complexity of Hadamard gate**: \[ O(\log_2 N)=O(n) \] Through these methods, the paper successfully reduces the memory consumption in quantum circuit simulation and significantly improves the computational efficiency.