releases

OQFT 0.3 Cuts QFT Depth From 4096 to 198 on a 2048-Qubit Register

The quantum Fourier transform sits in the middle of Shor’s algorithm. Build it the textbook way on 2,048 qubits, the size you’d need for a 2048-bit RSA key, and you get about 2.1 million gates stacked 4,096 layers deep. Most of those gates are tiny rotations that barely change anything. The rest still have to wait their turn.

OQFT 0.3 builds the other version. The optimistic QFT on the same 2,048 qubits takes 198 layers and about 104,000 gates, and it needs no qubits beyond the register itself. It’s right on almost every input. On a small, known slice of inputs it’s badly wrong, and that’s the deal.

A terminal running oqft stats for 2,048 qubits: the textbook QFT needs depth 4,096 and 2.1 million gates, the optimistic QFT depth 198 and about 104,000 gates.

Three Commands

  • oqft gen writes a circuit as OpenQASM 3: the textbook QFT, the approximate QFT that drops small rotations, or the optimistic QFT for an error target you choose.
  • oqft stats counts gates and depth for all three side by side.
  • oqft check runs inputs through a simulator, up to 20 qubits, and measures how far each output lands from the exact transform.

The circuits use only h, cp and swap from the standard gate library, so Qiskit, Cirq and most other toolchains can load them as they are.

Where It Pays Off

Not on small registers. At 32 qubits the textbook circuit is shallower, 64 layers against 103. The two meet around 64 qubits. After that the textbook depth doubles every time the register doubles, while the optimistic one adds 16 layers or fewer.

Circuit depth of the textbook QFT and OQFT from 32 to 2,048 qubits on a log scale: the textbook line doubles at each step, the OQFT line rises slowly from 103 to 198.

That slow growth is the point. Depth is time on a quantum computer, and time is where errors pile up.

What’s Missing

There’s no resource estimator yet. The next release adds one: pick an RSA key size and see what the optimistic QFT does to the qubit and depth estimates for factoring it. A browser calculator built on the same code comes after that.

Grab a binary from the download page, or start with the quick start. The code is on GitHub under the Apache License 2.0.