We propose a programmable quantum read-only memory based on Gray code encoding, termed GQROM, designed to efficiently load classical data into quantum circuits. This architecture mitigates critical bottlenecks in near-term quantum computing by reducing initialization overhead and gate-induced errors. By utilizing Gray code, in which consecutive addresses differ by only a single bit, GQROM minimizes state transition complexity. We demonstrate the architecture's flexibility in accessing targeted data through initial-state modification. The entire design, including a systematic EDA flow, was implemented and validated on the Qiskit platform, confirming its practical feasibility. These results underscore GQROM's potential as a scalable and hardware-friendly solution for efficient state preparation in quantum circuits.
Quantum computing is a rapidly expanding field with applications ranging from optimization all the way to complex machine learning tasks. Quantum memories, while lacking in practical quantum computers, have the potential to bring quantum advantage. In quantum machine learning applications for example, a quantum memory can simplify the data loading process and potentially accelerate the learning task. Quantum memory can also store intermediate quantum state of qubits that can be reused for computation. However, the depth, gate count and compilation time of quantum memories such as, Quantum Read Only Memory (QROM) scale exponentially with the number of address lines making them impractical in state-of-the-art Noisy Intermediate-Scale Quantum (NISQ) computers beyond 4-bit addresses. In this paper, we propose techniques such as, pre-decoding logic and qubit reset to reduce the depth and gate count of QROM circuits to target wider address ranges such as, 8-bits. The proposed approach reduces the number of gates and depth count by at least 2X compared to the naive implementation at only 36% qubit overhead. A reduction in circuit depth and gate count as high as 75X and compilation time by 85X at the cost of a maximum of 2.28X qubit overhead is observed. Experimentally, the fidelity with the proposed pre-decoding circuit compared to existing optimization approach is also higher (as much as 73% compared to 40.8%) under reduced error rates.
Quantum read only memory (QROM) is a substantial source of non-Clifford cost in fault-tolerant quantum algorithms. Borrowing dirty qubits can reduce this cost, provided their unknown initial states are restored. We consider the practically relevant qubit-constrained regime, where limited workspace restricts the table-block size and table loading dominates the cost. For
N entries of
b bits and approximately
bλ dirty qubits, SelectSwap has leading Toffoli count
2N/λ. Recent work using sequential bit packets reduces this to
(1+1/b)N/λ. In this work we introduce a dense encoding construction of QROM, where two bits of classical information are stored in each dirty qubit instead of one by utilizing both the
Z and
X bases. On its own, dense encoding provides a
2× improvement over SelectSwap by reducing the leading Toffoli count to
N/λ. Combining it with sequential bit packets gives
21(1+1/b)N/λ, a further halving of the sequential construction's leading cost, and an approximately
4× improvement over SelectSwap in the large-
N limit for practical values of
b.
Emerging quantum algorithms that process data require that classical input data be represented as a quantum state. These data-processing algorithms often follow the gate model of quantum computing-which requires qubits to be initialized to a basis state, typically| 0 〉-and thus often employ state generation circuits to transform the initialized basis state to a data-representation state. There are many ways to encode classical data in a qubit, and the oft-applied approach of basis encoding does not allow optimization to the extent that other variants do. In this work, we thus consider automatic synthesis of addressable, quantum read-only memory (QROM) circuits, which act as data-encoding state-generation circuits. We investi-gate three data encoding approaches, one of which we introduce to provide improved dynamic range and precision. We present experimental results that compare these encoding methods for QROM synthesis to better understand the implications of and applications for each.
Quantum random access memory (QRAM) is an essential ingredient for many quantum algorithms, such as quantum machine learning models. The quantum resources (qubit counts and circuit depths) required to load classical data into a circuit severely prohibit many reasonably sophisticated demonstrations in the near term. To this end, we propose a method to construct a compact QRAM circuit, leveraging classical preprocessing to design as shallow a circuit with as few auxiliary qubits as possible. The underlying idea is to map data-encoded quantum states into an orthogonal set of quantum states (characterized by a family of parametrized circuits); then one can straightforwardly entangle the data qubits with the address qubits using cnot gates to realize a data-loading QRAM circuit. The nonunitary transformation to convert the orthogonalized quantum states back to the original data-encoded quantum states can be easily achieved with the help of a small set of auxiliary qubits and postselections. Numerical simulations on handwritten digits and Iris data sets are performed to assess the effectiveness of the proposed method, and we also highlight how noise influences quantum circuit performance across diverse configurations using random data sets. The proposed method for constructing a QRAM circuit can potentially facilitate the development and testing of many quantum machine learning methods in the near term.
Quantum circuit simulation (QCS) is essential in the noisy intermediate scale quantum (NISQ) era when real quantum computers are scarce. However, fully tracking the states of a quantum system in QCS is highly challenging due to the exponential memory growth that significantly limits the computational reach of classical systems for QCS. Though it is straightforward to leverage secondary storage to extend the scale of QCS, excessive data movement between memory and storage dominates the simulation time, making this solution unrealistic. To tackle this challenge, we identify an intrinsic property of QCS and implement an open-source framework to effectively reduce data movement by >116x. We evaluate the framework on various benchmarks and demonstrate 4x memory reduction with only <20% overhead. On a memory constrained system, we show that it extends the scale of QCS to 32 qubits (64 GB memory requirement) while existing simulators are bounded to 28 qubits (4 GB memory requirement). Our implementation can be accessed via https://github.com/Zhaoyilunnn/qdao.