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.
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 it solves
Efficiently loading classical data into a quantum computer so multiple data points can be queried simultaneously in superposition.
History and background
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.
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.
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.
Step by step
- 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.
A 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
| Item | Detail |
|---|---|
| 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 |
What hardware it 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.
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 and caveats
- 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.
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.
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.
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.
Keep learning
- Related algorithm: HHL Algorithm
- Related algorithm: Quantum Principal Component Analysis
- Related algorithm: Quantum Support Vector Machine
- Related algorithm: Quantum k-Means Clustering
This page is written for educational purposes. Complexity statements describe the best known results at the time of review (September 30, 2026), and research in this area moves quickly, so check recent papers before relying on a specific bound.