← Back to section · Software & Developer Tools

The State-Vector Memory Budget: Every Extra Qubit Doubles the Bill

State-vector simulation is one of the few workloads whose cost can be computed exactly in advance: a bill set by precision, qubit count, and memory bandwidth. This article opens the ledger — bytes per amplitude, the qubit ceiling for common memory sizes, how bandwidth prices every gate, and how distribution and GPUs buy a few more qubits.

Published 22 November 2026 · 5 min read · PQ Frontier

The State-Vector Memory Budget: Every Extra Qubit Doubles the Bill
AI-generated site artwork
Video explainer · Quantum simulators: computing quantum states classically

State-vector simulation is one of the rare computational tasks whose cost can be settled in advance: given the qubit count and numerical precision, the memory footprint is exact and the runtime is roughly estimable. This article skips the debate between simulation routes and does the arithmetic — how much memory one qubit actually costs, how far a given machine can go, and how many qubits each engineering trick for 「scaling up」 really buys.

The ledger: 16 bytes times 2 to the n

A state vector is an array of 2^n complex numbers. A double-precision complex value (complex128) consists of two 64-bit floats, 16 bytes in total, so the memory footprint is exactly 16×2^n bytes — a tidy table: 20 qubits take 16 MiB, 25 qubits 512 MiB, 30 qubits 16 GiB, 32 qubits 64 GiB, 36 qubits 1 TiB, and 40 qubits 16 TiB. Single precision (complex64) costs 8 bytes per amplitude and shifts the whole table by one: the same memory holds one more qubit.

Note that this is a lower bound for the vector itself. A real process also houses the runtime, circuit data, and temporary buffers, and the operating system takes its share; in practice a laptop with 16 GiB of RAM tops out around 29 qubits in double precision, while 30 qubits usually means leaning on swap and slowing to the point of uselessness. Conversely, whenever you see a scale claim for state-vector simulation, checking it against this table immediately reveals what class of memory resources were involved. The density-matrix bill can be read off the same table by squaring: it amounts to looking up the state-vector bill at twice the qubit count, which is why noisy simulation always reaches a smaller scale than noiseless simulation — change the representation and the shape of the ledger changes with it.

The time bill: bandwidth, not arithmetic

Every gate in a state-vector simulation sweeps the entire array: a single-qubit gate pairs up the 2^n amplitudes and applies a 2×2 matrix to each pair, and a two-qubit gate does the same with a different pairing pattern. The floating-point work per gate is therefore of the same order as the data movement, and since modern processors offer far more arithmetic throughput than memory bandwidth, simulation speed is in practice set by how many times per second the vector can be streamed through memory.

That gives a simple runtime estimate: a workstation with roughly 100 GB/s of memory bandwidth running a 30-qubit circuit must stream a 16 GiB vector, about 0.16 seconds per pass; a circuit of a few hundred gates lands in the tens of seconds, and a few thousand gates in minutes to hours. Optimizations revolve around this ledger: gate fusion merges adjacent gates into one larger matrix before sweeping, cutting the number of passes; cache blocking keeps paired accesses in fast cache; index reordering turns strided two-qubit access patterns into sequential ones. These can yield several-fold speedups, but none removes the floor that every gate must touch the whole vector at least once.

One detail is often overlooked: not all sweeps are equal, because different gates have different memory-access patterns. A gate acting on a low-order qubit pairs amplitudes that are adjacent in memory, with high cache hit rates; a gate acting on a high-order qubit pairs elements half an array apart, so nearly every access goes straight to main memory and real speed drops noticeably. This is why per-gate times on the same machine can differ severalfold between circuits, and why reordering optimizations exist at all — moving frequently gated qubits to low positions is equivalent to relocating hot data into cache-friendly territory. Performance figures that quote only an average per-gate time without the circuit structure deserve the same discount.

Raising the ceiling: distribution, GPUs, and the precision trade

Three routes push the qubit ceiling higher. Distributed state vectors split the array across machines: local gates finish within a node, while gates involving cross-node qubits require communication to exchange data; total memory grows linearly with node count at the cost of communication overhead and scheduling complexity, and full-amplitude simulations beyond 45 qubits on supercomputers all take this route. GPUs offer memory bandwidth an order of magnitude above main memory, but a single card’s tens of GiB correspond to 31 to 33 qubits in double precision and fill up fast — the bottleneck shifts from 「slow」 to 「does not fit」. Dropping precision is the cheapest: single precision halves the footprint outright, but amplitude errors accumulate with circuit depth; acceptable for shallow circuits whose final product is a probability distribution, risky for algorithms that need high-precision amplitudes, such as some phase-estimation settings.

The three routes can be combined, but the shape of the ledger never changes: each additional qubit doubles the total memory. Engineering buys single-digit extra qubits, never an order-of-magnitude leap in scale. One more aggressive supercomputing practice deserves mention: storing the amplitudes in lossily compressed form and decompressing on read, trading computation for memory. Some large-scale simulations used exactly this to fit full amplitudes at around fifty qubits into the aggregate memory of existing machines, but the compression ratio depends on the amplitude distribution itself and error is introduced along the way — this is numerical engineering tailored to a specific task, not a standard configuration of general-purpose simulators, and scale numbers of this kind should be read together with their precision conventions.

Conclusion: do the arithmetic before choosing a route

Whether state-vector simulation fits a problem is, at bottom, an arithmetic question: qubit count fixes memory, memory fixes the machine, and circuit depth times sweep time fixes the schedule. Spending a minute on this bill before starting avoids waiting all night for a 34-qubit circuit on a laptop; if the answer is 「does not fit」, tensor networks, stabilizer methods, and other routes are still there. Writing this bill into the experiment record is also good practice: when results are reproduced or tools compared later, complete memory and bandwidth conventions are what make the numbers comparable. The exponential wall does not move for wishing — but it is at least a wall you can measure in advance.

Tags: state vectormemorysimulation scale