case studies

Choosing an Error Target for a 2048-Qubit OQFT, Each Tenfold Tightening Costs 24 to 32 Layers

OQFT asks for one number besides the register size: the error target, --eps. It’s the average squared error you’re willing to accept over all inputs. Pick it too loose and Shor’s algorithm misses more often. Pick it too tight and you pay in depth. This case study puts numbers on that trade for a 2,048-qubit register, the size a 2048-bit RSA key calls for.

We ran oqft stats -n 2048 at four targets, from 0.1 down to 0.0001, and recorded the block width OQFT chose for each.

Depth of a 2,048-qubit OQFT at four error targets: 174 at 0.1 with 22-qubit blocks, 198 at 0.01 with 25, 230 at 0.001 with 29, 254 at 0.0001 with 32. The textbook circuit needs 4,096.

The Numbers

Error target Block width Depth Total gates Two-qubit gates
0.1 22 174 92,404 88,332
0.01 25 198 104,200 100,152
0.001 29 230 120,646 116,568
0.0001 32 254 132,064 128,032

The textbook QFT on 2,048 qubits: depth 4,096, 2,099,200 gates.

Each tenfold tightening adds three or four qubits to the block width, 24 to 32 layers of depth, and 11,000 to 17,000 gates. Going from 0.1 all the way to 0.0001, a thousand times tighter, costs 80 extra layers. The circuit is still 16 times shallower than the textbook one.

Which One to Pick

The error target bounds how far the QFT’s output can drift from the exact one, averaged over all inputs, and that drift is what can turn a good run into a miss. At 0.01 it’s a small addition to whatever else the algorithm and the hardware get wrong. For most planning, 0.01 is a sensible default, and it’s the one OQFT uses when you don’t say.

Go tighter when the QFT sits inside something that can’t simply be rerun, or when you’re comparing against published estimates that assume a stricter target. The 2026 study on deploying optimistic QFTs used 32-qubit blocks for registers of this size, which is what OQFT picks at 0.0001.

Go looser only if you’ve checked that the rest of your algorithm tolerates it. At 0.1 you save 24 layers over 0.01 and accept ten times the error budget for the QFT.

How the Width Is Chosen

OQFT picks the smallest block width whose error bound fits the target. The bound is deliberately cautious, so the real error is usually lower than the target. How block width sets the error shows the measured side on a register small enough to simulate. The runs behind this table are in the recorded results.