case studies

OQFT Depth Crossover, the Optimistic QFT Beats the Textbook Circuit From 68 Qubits On

The optimistic QFT is built for big registers. Everyone working with it knows that. The less obvious question is where “big” starts, because below some size the textbook circuit is simply shallower, and a compiler that swaps in OQFT everywhere would make small circuits worse.

So we ran oqft stats at an error target of 0.01 for every register size from 32 to 80 qubits, plus a few larger ones, and wrote down depth and gate count for both circuits. Depth counts every gate as one layer, with gates on separate qubits sharing a layer.

Depth of the textbook QFT and OQFT from 32 to 96 qubits at epsilon 0.01. The textbook line rises steadily. The OQFT line steps up from 103 to 134 and crosses it between 63 and 67 qubits.

Depth Doesn’t Cross Once

The textbook depth is a straight line, two layers per qubit: 64 at 32 qubits, 128 at 64. The optimistic depth moves in steps. It sits at 103 from 32 to 45 qubits, 110 from 46 to 48, 126 from 49 to 64, then 133 or 134 up to 100 qubits.

That staircase makes the crossover messy. At 63 qubits the two tie at 126. At 64 OQFT wins, 126 against 128. At 65 and 66 it loses again, 134 against 130 and 132, because one more qubit pushed it onto the next step. They tie at 67. From 68 qubits on, OQFT stays shallower in every size we measured, and the gap only grows: 134 against 160 at 80 qubits, 142 against 256 at 128.

The steps come from the block width. As the register grows, the error target calls for wider blocks, and each widening adds a few layers at once.

Gates Cross Earlier

Gate count crosses sooner and cleanly. The textbook circuit has fewer gates up to 48 qubits, 1,200 against 1,216. From 49 qubits on OQFT has fewer, 1,233 against 1,249, and by 80 qubits it’s 2,413 against 3,280.

What to Do With It

For a register under about 68 qubits, use the textbook circuit if depth is what you’re paying for. Between 49 and 67 the choice depends on whether gate count or depth matters more on your hardware. Above that, the optimistic circuit wins on both, and the lead widens with every qubit.

These are counts at one error target. A looser target shifts the steps down and the crossover earlier. Run oqft stats -n N --eps E for the size and target you care about; it takes well under a second. The full sweep is in the recorded results.