Quantum Algorithms Database
Quantum Random Access Memory (QRAM)
A proposed architecture for accessing classical data in superposition, theoretically required to realize many quantum machine learning speedups in practice.
Last reviewed September 30, 2026. Check the linked sources for anything that may have changed since.
Year
2008
Inventor(s)
Vittorio Giovannetti, Seth Lloyd, and Lorenzo Maccone
Speedup Type
Exponential Speedup
Difficulty
★★★★★
Overview
Quantum random access memory, or QRAM, is a proposed device that lets a quantum computer look up classical data in superposition. Given an address register in a superposition of many addresses, a QRAM returns the corresponding memory contents entangled with each address, so that a single query touches all N entries at once. This is the quantum counterpart of the RAM in a classical computer.
QRAM matters because many of the best-known exponential quantum speedups in machine learning and linear algebra, including HHL, quantum principal component analysis, and quantum support vector machines, assume that data can be loaded into a quantum state quickly. If it cannot, those speedups disappear. QRAM is therefore one of the most important open questions about the practical value of quantum algorithms.
The problem
Efficiently loading classical data into a quantum computer so multiple data points can be queried simultaneously in superposition.
History
Giovannetti, Lloyd, and Maccone introduced QRAM in 2008 in two papers, one in Physical Review Letters and one in Physical Review A. They proposed a bucket-brigade architecture in which a memory of N cells is arranged as a binary tree, and a query activates only about log N routers on the path to the addressed cell, rather than all N. That design was meant to keep the error and energy cost low.
Over the next decade the debate shifted to feasibility. Arunachalam, Gheorghiu, Jochym-O'Connor, Mosca, and Srinivasan analyzed the noise robustness of bucket-brigade QRAM in 2015, and Hann, Lee, Girvin, and Jiang showed in 2021 that bucket-brigade QRAM has a favorable polylogarithmic error scaling for generic noise models, which was encouraging. Others, including Di Matteo, Gheorghiu, and Mosca in 2020 and Jaques and Rattew in a 2023 survey, estimated that fault-tolerant implementations require a number of gates proportional to N, with serious consequences for algorithms that need a very large table. Read-only variants called QROM, developed by Babbush and colleagues in 2018, are used inside chemistry algorithms today.
Intuition
A classical RAM takes an address and returns the data stored there. A quantum RAM must do this coherently: if the address register is in the state that is a superposition of address i with amplitude a sub i, then the result is a superposition of address i together with the data x sub i, with the same amplitudes. Formally it maps the sum of a sub i times the state i and 0 to the sum of a sub i times the state i and x sub i.
The bucket-brigade design routes a signal down a binary tree. At each node, a small quantum router qubit, initially in a waiting state, is set by the address bit to direct the signal left or right. Only the routers along the chosen path are activated, so the number of active elements per query is logarithmic, even though the total memory has N cells. The data bit is picked up at the leaf and sent back up the same path.
A key point is that the memory itself is still N physical elements. QRAM does not compress data. What it offers is fast access, with a query depth proportional to log N, to a table that required N units of hardware to build in the first place.
How it works
Proposes a tree-like addressing structure for retrieving memory cells in superposition, requiring specialized quantum hardware distinct from a standard quantum processor's qubits.
- Store the classical data as N memory cells, arranged at the leaves of a binary tree of routers.
- Prepare the address register in a superposition of the addresses to be queried, one qubit per address bit.
- Send a bus qubit into the tree. At each level, the next address bit sets the local router, directing the bus toward the selected cell.
- At the leaf, copy the stored data bit onto the bus conditioned on the cell value, and send the bus back up, resetting the routers along the way.
- Read the bus into the output register, which now holds the data entangled with the address.
- Use the output in the rest of the algorithm, for example to construct a state whose amplitudes are the data values.
Worked example
Take N = 8 memory cells holding the bits 1, 0, 1, 1, 0, 0, 1, 0, and an address register of three qubits in the equal superposition of all eight addresses. A QRAM call produces a state in which each address is paired with its bit: address 000 with 1, address 001 with 0, and so on, all with amplitude one over the square root of 8.
A classical computer would read the cells one at a time, taking eight steps. The QRAM call uses a circuit of depth about three, the logarithm of eight. The catch is that the memory still needs eight cells, and for a data set of a billion entries, it needs a billion cells, which is comparable to the classical memory itself.
Complexity and resources
| Query depth | O(log N) for N memory cells |
|---|---|
| Active components per query | O(log N) in bucket-brigade designs |
| Total hardware | O(N) memory cells and routers |
| Fault-tolerant gate cost | Roughly proportional to N Toffoli or T gates for lookups, with smaller overheads using clever constructions |
| Noise | Bucket-brigade has polylogarithmic infidelity for generic noise in some analyses; error correction may still be needed |
Hardware needs
A large array of memory cells and quantum routers with long coherence times.
Error rates low enough that thousands of router operations per query do not destroy the superposition.
Proposed platforms include photonic circuits, circuit QED, and spin-photon systems, but no large-scale QRAM has been built.
Real-world impact
Widely discussed as the 'input problem' bottleneck — many proposed quantum ML and linear algebra speedups assume QRAM exists, but building an efficient, large-scale QRAM remains a major open hardware challenge.
Applications
Loading data for HHL, quantum principal component analysis, quantum support vector machines, and quantum recommendation systems.
Table lookups in quantum chemistry algorithms, where QROM supplies Hamiltonian coefficients.
Quantum algorithms for database search, collision finding, and element distinctness that need random access to a classical table.
Preparing amplitude-encoded states from classical data.
Limitations
- The hardware scales with N, so loading a huge data set requires a huge memory.
- Fault-tolerant implementations have costs proportional to N, which can cancel exponential speedups.
- Correct operation in the presence of noise depends on details of the architecture and error model.
- It is unclear if a practical, large QRAM can be built at all.
Common misconceptions
- QRAM does not store data in fewer qubits. It stores N cells and provides fast coherent access.
- It does not let you read all data at once. Measurement gives only one outcome.
- Having a QRAM does not by itself give an exponential speedup. The algorithm using it must also be efficient.
How it compares
QROM is the read-only version used in chemistry circuits with a smaller footprint.
Classical RAM supports random access in constant time but not in superposition.
Quantum-inspired classical algorithms assume a classical data structure that supports sampling, which has the same preprocessing cost as QRAM without the quantum hardware.
Why it matters
QRAM sits at the center of the debate over whether quantum machine learning can deliver large speedups. If an efficient QRAM exists, many proposed algorithms become more plausible. If not, their advantage shrinks to what is left after paying for data loading.
It is also a useful concept for evaluating claims: whenever an algorithm says that its runtime is logarithmic in the data size, ask whether it assumes a QRAM, and what that would cost.
What qRAM is for
Many quantum algorithms for machine learning and linear algebra assume you can load data into a quantum state quickly. Quantum random access memory (qRAM) is the proposed hardware that would let a computer look up memory cells in superposition. Giovannetti, Lloyd and Maccone's 'Quantum random access memory' (arXiv 0708.1879) proposes a 'bucket-brigade' architecture for accessing quantum or classical memory cells.
According to the paper, the bucket-brigade design reduces the cost of a memory call compared with conventional designs and makes qRAM algorithms more robust, since fewer gates must be entangled. It also substantially lowers the power needed for addressing. For N memory cells, the abstract cites O(N) switches for conventional designs, while the body gives O(N^(1/d)) for a d-dimensional array and O(log N) switches per call for the bucket-brigade.
The caveats the authors themselves state
On errors, the paper says that if a fraction epsilon of gates decoheres, fidelity falls roughly as 1 - epsilon x log N, much more resilient than conventional qRAM, with the benefit largest when few memory cells are accessed in superposition. The authors warn that the many idle 'wait' elements could still cause significant overall error even if their individual error rates are much lower.
On energy, they note that current RAMs spend most of their power on leakage and refreshing, not decoding, so savings matter mainly for future non-CMOS memories. The design also adds delay and extra memory elements, and the optical implementation is described as an illustrative proof of principle, not an experimental proposal.
- Cost per call: O(log N) switches thrown (bucket-brigade) versus O(N^(1/d)) for a d-dimensional conventional array.
- Error: fidelity falls about as 1 - epsilon x log N.
- Status: proposal; the optical version is an illustration, not an experiment.
Why it matters for speedup claims
Algorithms such as HHL and quantum recommendation systems quote speed in terms of log N, which assumes fast qRAM. If the memory has N physical cells, building it takes at least N hardware elements, and the dequantization work by Ewin Tang shows that comparable classical sampling access can erase some of the advantage. So whether qRAM can be built at scale, and at what error rate, is a central open question behind many quantum machine-learning claims. This page makes no claim that large qRAM exists today.
Frequently asked questions
What is QRAM?
A memory that a quantum computer can query with a superposition of addresses, returning the data associated with each address in superposition.
Does QRAM exist?
Small-scale proposals and experiments exist, but a large, fault-tolerant QRAM has not been built.
What is the bucket-brigade architecture?
A QRAM design that arranges memory in a binary tree of routers and activates only the routers on the path to the queried cell, limiting errors.
Why is QRAM important for machine learning?
Many quantum machine learning speedups assume that classical data can be loaded into a quantum state quickly, which is what QRAM would provide.
What is QROM?
A read-only quantum memory used for lookup tables, for example in chemistry algorithms, with specialized low-cost circuits.
Related algorithms
References and further reading
Sources opened and checked on December 1, 2026. Resource estimates and claims change, so check the originals.
- Quantum random access memory (arXiv (Giovannetti, Lloyd, Maccone)) Opened. Source for the bucket-brigade costs, the error scaling and the stated caveats.
- A quantum-inspired classical algorithm for recommendation systems (arXiv (E. Tang)) Opened. Context on data-access assumptions.
- Quantum algorithm for solving linear systems of equations (arXiv (Harrow, Hassidim, Lloyd)) Opened. An algorithm whose speed assumes fast data loading.