Let be classical data with entries encoded as -bit strings. A quantum random access memory for is a unitary on an address register of qubits and a -qubit data register with
so that a superposition of addresses is mapped to in one call. For with , amplitude encoding is the preparation of
on qubits. The QRAM input model assumes that , and hence (with suitable precomputed partial norms) the preparation of , cost time polylogarithmic in after a one-time loading of the data.
The physical cost is a separate question. In the bucket-brigade architecture of Giovannetti, Lloyd and Maccone a memory call throws only switches instead of the of conventional designs, which reduces the number of components that must be entangled during a query. Whether such devices can be built with the required error rates is open, and Aaronson lists data loading among the caveats that decide whether a claimed speed-up survives. The classical analogue of this input model, sample-and-query access, is the one under which Tang and later work dequantize several algorithms.