Skip to content

The quantum Fourier transform on an nn-qubit register is the unitary discrete Fourier transform of the register’s amplitudes over the cyclic group Z2n\mathbb Z_{2^n}. Its short circuit is useful because it turns carefully encoded phase structure into interference, not because it prints a classical table of Fourier coefficients. We will derive its Hadamard–controlled-phase circuit, explain the final bit-reversal swaps, and estimate the error from omitting small rotations.

Here QFT means quantum Fourier transform. The full circuit derivation concerns N=2nN=2^n and the cyclic group Z2n\mathbb Z_{2^n}; other finite groups require different encodings and constructions.

Helpful background. Controlled operations explains coherent branch phases; single-qubit gates gives the Hadamard and phase matrices.

Fourier transformation of quantum amplitudes

Section titled “Fourier transformation of quantum amplitudes”

Fix an input Hilbert space with computational basis

{∣x⟩:x=0,…,N−1},N=2n.\{ \lvert x\rangle : x=0,\ldots,N-1 \}, \qquad N=2^n.

Using the positive exponential convention, the transform acts on

∣ψ⟩=∑x=0N−1ax∣x⟩.|\psi\rangle=\sum_{x=0}^{N-1}a_x|x\rangle.

By linearity,

FN∣ψ⟩=∑y=0N−1(1N∑x=0N−1axe2πixy/N)∣y⟩.F_N\lvert\psi\rangle = \sum_{y=0}^{N-1} \left( \frac{1}{\sqrt N} \sum_{x=0}^{N-1} a_x e^{2\pi ixy/N} \right) \lvert y\rangle.

Those transformed amplitudes are not a freely readable array. One measurement returns one outcome sampled from their squared magnitudes. Recovering phase information or many coefficients requires a separate interference, estimation, or tomography protocol with its own access and repetition costs.

Use tensor order

Q=qn−1⊗⋯⊗q0Q = q_{n-1}\otimes\cdots\otimes q_0

with qn−1q_{n-1} displayed on the left and q0q_0 on the right. The same convention fixes the integer map:

x=∑j=0n−12jxj,∣x⟩=∣xn−1⋯x0⟩.x = \sum_{j=0}^{n-1} 2^j x_j, \qquad \lvert x\rangle = \lvert x_{n-1}\cdots x_0\rangle.

Thus qn−1q_{n-1} is the most-significant wire and q0q_0 the least-significant wire. This convention is not “big-endian” or “little-endian” in isolation: the ket order, wire order, memory order, and integer interpretation must be stated together.

Define

ωN=e2πi/N.\omega_N = e^{2\pi i/N}.

This page uses the positive-sign forward transform

⟨y∣FN∣x⟩=1NωNxy,\langle y\rvert F_N\lvert x\rangle = \frac{1}{\sqrt N} \omega_N^{xy},

so rows are indexed by output yy and columns by input xx:

FN∣x⟩=1N∑y=0N−1ωNxy∣y⟩.F_N\lvert x\rangle = \frac{1}{\sqrt N} \sum_{y=0}^{N-1} \omega_N^{xy}\lvert y\rangle.

The inverse has the negative exponent,

FN†∣y⟩=1N∑x=0N−1ωN−xy∣x⟩.F_N^\dagger\lvert y\rangle = \frac{1}{\sqrt N} \sum_{x=0}^{N-1} \omega_N^{-xy}\lvert x\rangle.

Some mathematics and software references assign the negative sign to the forward transform. Neither choice changes the content, but silently mixing them turns an intended inverse into a modular-negation operation. Fourier Transform Conventions compares the sign and normalization choices used in other settings.

For two computational-basis columns,

⟨x′∣FN†FN∣x⟩=1N∑y=0N−1ωN(x−x′)y.\begin{aligned} \langle x'\rvert F_N^\dagger F_N\lvert x\rangle &= \frac{1}{N} \sum_{y=0}^{N-1} \omega_N^{(x-x')y}. \end{aligned}

If x=x′x=x', every summand is one. Otherwise the ratio r=ωNx−x′r=\omega_N^{x-x'} obeys rN=1r^N=1 but r≠1r\neq1, so the finite geometric sum is

∑y=0N−1ry=1−rN1−r=0.\sum_{y=0}^{N-1}r^y = \frac{1-r^N}{1-r} = 0.

Therefore

1N∑y=0N−1ωN(x′−x)y=δx,x′,FN†FN=I.\frac{1}{N} \sum_{y=0}^{N-1} \omega_N^{(x'-x)y} = \delta_{x,x'}, \qquad F_N^\dagger F_N = I.

Applying the transform twice gives another useful convention check:

FN2∣x⟩=1N∑z=0N−1∑y=0N−1ωNy(x+z)∣z⟩=∣−x mod N⟩.\begin{aligned} F_N^2\lvert x\rangle &= \frac{1}{N} \sum_{z=0}^{N-1} \sum_{y=0}^{N-1} \omega_N^{y(x+z)} \lvert z\rangle \\ &= \lvert -x\bmod N\rangle. \end{aligned}

Consequently,

FN4=I.F_N^4 = I.

These identities check normalization and the modular-negation action, but they do not distinguish the positive- and negative-exponent transforms: both obey them. To test the sign, compare a complex Fourier column or decode a known phase-gradient state, as in the exercises. Wire permutations require a separate check.

The cyclic transform is also a change between the group-element basis of ZN\mathbb Z_N and its character basis. Direct products of finite cyclic groups motivate finite Abelian extensions, but their register layouts and algorithms must be specified separately. General representation theory and non-Abelian Fourier transforms are not silently covered by the power-of-two circuit derived here.

Write the output integer as

y=∑k=0n−12kyk.y = \sum_{k=0}^{n-1} 2^k y_k.

Then the Fourier phase factorizes:

ω2nxy=∏k=0n−1exp⁡(2πixyk2n−k).\omega_{2^n}^{xy} = \prod_{k=0}^{n-1} \exp\left( \frac{2\pi i x y_k}{2^{n-k}} \right).

Only the fractional part of x/2n−kx/2^{n-k} matters. Define

0.xjxj−1⋯x0:=∑r=0jxr2j−r+1.0.x_jx_{j-1}\cdots x_0 := \sum_{r=0}^{j} \frac{x_r}{2^{j-r+1}}.

For example,

0.x2x1x0=x22+x14+x08.0.x_2x_1x_0 = \frac{x_2}{2} + \frac{x_1}{4} + \frac{x_0}{8}.

Substituting the binary expansion of yy into the Fourier sum and distributing the independent sums over yk∈{0,1}y_k\in\{0,1\} gives

F2n∣x⟩=⨂j=0n−1∣0⟩qn−1−j+e2πi 0.xjxj−1⋯x0∣1⟩qn−1−j2.F_{2^n}\lvert x\rangle = \bigotimes_{j=0}^{n-1} \frac{ \lvert0\rangle_{q_{n-1-j}} + e^{2\pi i\,0.x_jx_{j-1}\cdots x_0} \lvert1\rangle_{q_{n-1-j}} }{\sqrt2}.

The first written factor belongs to qn−1q_{n-1} and depends only on x0x_0; the last belongs to q0q_0 and depends on all input bits. This reversed dependency pattern is why the natural radix-two gate sequence produces a bit-reversed wire order before its final swaps.

For a general superposition the QFT need not be a product state. The factorization above is a column formula for a basis input, used to derive the circuit; linearity then determines the action on arbitrary inputs.

The phase gates used here are not the site’s Bloch-sphere rotations Rk(θ)R_k(\theta). Define instead

Pℓ:=diag⁡(1,e2πi/2ℓ),P_\ell := \operatorname{diag} \left( 1, e^{2\pi i/2^\ell} \right),

and

CPℓ:=diag⁡(1,1,1,e2πi/2ℓ).CP_\ell := \operatorname{diag} \left( 1, 1, 1, e^{2\pi i/2^\ell} \right).

The controlled-phase matrix is symmetric under exchanging its two wires. Naming a control and target is nevertheless useful when following how each input bit contributes to a binary fraction.

Use left-to-right time order in the following construction. For each target wire qrq_r, starting at r=n−1r=n-1 and descending to r=0r=0:

  1. apply HH to qrq_r;
  2. for k=r−1,r−2,…,0k=r-1,r-2,\ldots,0, apply CPr−k+1CP_{r-k+1} with control qkq_k and target qrq_r.

Three-qubit positive-sign Fourier circuit with Hadamards, controlled P2 and P3 phases, and a final swap of the outer wires

The three-qubit circuit reads left to right, with q2q_2 the most-significant wire. Here P2=diag⁡(1,i)P_2=\operatorname{diag}(1,i) and P3=diag⁡(1,eiπ/4)P_3=\operatorname{diag}(1,e^{i\pi/4}). The final SWAP restores the mathematical output order; omitting it gives B3F8B_3F_8.

Finally swap

qr⟷qn−1−r,0≤r<⌊n2⌋.q_r \longleftrightarrow q_{n-1-r}, \qquad 0\leq r<\left\lfloor\frac n2\right\rfloor.

For a basis input, HH supplies the leading half-turn and the controlled phases supply the remaining binary-fraction digits. Before the swaps, the phase 0.xrxr−1⋯x00.x_rx_{r-1}\cdots x_0 resides on qrq_r. After the swaps, it resides on the mathematical output wire required by the product formula.

Let UcoreU_{\mathrm{core}} denote the no-swap circuit and define bit reversal by

Bn∣yn−1⋯y0⟩=∣y0⋯yn−1⟩.B_n \lvert y_{n-1}\cdots y_0\rangle = \lvert y_0\cdots y_{n-1}\rangle.

Then

Ucore=BnFN,FN=BnUcore,U_{\mathrm{core}} = B_nF_N, \qquad F_N = B_nU_{\mathrm{core}},

because Bn−1=BnB_n^{-1}=B_n.

The exact logical counts in the alphabet {H,CPℓ,SWAP}\{H,CP_\ell,\mathrm{SWAP}\} are

NH=n,NCP=∑r=1n−1r=n(n−1)2,N_H = n, \qquad N_{CP} = \sum_{r=1}^{n-1}r = \frac{n(n-1)}{2},

and

NSWAP=⌊n2⌋.N_{\mathrm{SWAP}} = \left\lfloor\frac n2\right\rfloor.

These are counts, not a minimum depth or a native-hardware cost. Universal Gate Sets explains why an abstract continuous phase alphabet and a finite fault-tolerant alphabet are different resource models.

Omitting BnB_n changes the coherent unitary from FNF_N to BnFNB_nF_N. If the register is measured immediately in the computational basis, software may reverse the recorded bits. If a later coherent operation consumes the register, that consumer must be rewritten to absorb BnB_n or the swaps must be performed. Classical relabeling cannot act retroactively on a coherent state.

The inverse circuit follows from

FN†=Ucore†Bn.F_N^\dagger = U_{\mathrm{core}}^\dagger B_n.

Thus it reverses the exact forward gate order, conjugates every controlled phase, and retains the declared swap convention. A positive-phase CPℓCP_\ell becomes

CPℓ†=diag⁡(1,1,1,e−2πi/2ℓ).CP_\ell^\dagger = \operatorname{diag} \left( 1, 1, 1, e^{-2\pi i/2^\ell} \right).

For a basis input, both the exact circuit and its truncated versions below have uniform computational-basis probabilities. Those probabilities can agree even when the relative phases are wrong. A useful test compares complex amplitudes with the analytic matrix, checks the no-swap result against BnFNB_nF_N, and recombines the result with the intended inverse. Unitarity by itself checks only that a circuit is reversible, not that it is the desired Fourier transform.

A truncated or approximate quantum Fourier transform (AQFT) drops selected small-angle controlled phases under an explicit error budget. It is a different ideal unitary, not a noise model.

Choose an integer cutoff

1≤m≤n1 \leq m \leq n

and retain only CPℓCP_\ell with

2≤ℓ≤m.2 \leq \ell \leq m.

This rule keeps all Hadamards and the same declared swaps. It retains

NCP(m)=∑ℓ=2m(n−ℓ+1)=(m−1)(2n−m)2,\begin{aligned} N_{CP}^{(m)} &= \sum_{\ell=2}^{m} (n-\ell+1) \\ &= \frac{(m-1)(2n-m)}{2}, \end{aligned}

and omits

Nomit=∑ℓ=m+1n(n−ℓ+1)=(n−m)(n−m+1)2.\begin{aligned} N_{\mathrm{omit}} &= \sum_{\ell=m+1}^{n} (n-\ell+1) \\ &= \frac{(n-m)(n-m+1)}{2}. \end{aligned}

For an omitted controlled phase with angle

θℓ=2π2ℓ,\theta_\ell = \frac{2\pi}{2^\ell},

the unitary difference from the identity has operator norm

∥CPℓ−I∥op=∣eiθℓ−1∣=2sin⁡(π2ℓ).\left\| CP_\ell-I \right\|_{\mathrm{op}} = \left| e^{i\theta_\ell}-1 \right| = 2\sin\left( \frac{\pi}{2^\ell} \right).

Insert one omitted gate at a time between otherwise unitary prefixes and suffixes. Unitary invariance of the operator norm and the triangle inequality give the phase-sensitive telescoping bound

∥FN−F~n,m∥op≤∑ℓ=m+1n(n−ℓ+1)2sin⁡(π2ℓ),\left\| F_N-\widetilde F_{n,m} \right\|_{\mathrm{op}} \leq \sum_{\ell=m+1}^{n} (n-\ell+1) 2\sin\left( \frac{\pi}{2^\ell} \right),

provided exact and approximate circuits use identical swaps.

This is a worst-case operator-norm bound with the matrix phase fixed. It is not the fidelity of one selected input, a measured distribution distance, or an algorithm’s success probability. Physical noise and the approximation of retained rotations by a finite gate set are additional errors.

The simpler inequality sin⁡x≤x\sin x\leq x gives

∥FN−F~n,m∥op≤2πn∑ℓ=m+1∞2−ℓ=2πn2m.\|F_N-\widetilde F_{n,m}\|_{\rm op} \leq 2\pi n\sum_{\ell=m+1}^{\infty}2^{-\ell} =\frac{2\pi n}{2^m}.

For 0<ϵ<10<\epsilon<1, choosing m=min⁡{n,⌈log⁡2(2πn/ϵ)⌉}m=\min\{n,\lceil\log_2(2\pi n/\epsilon)\rceil\} therefore suffices: if the minimum selects nn, no phase is omitted. Otherwise the retained controlled-phase count is O(nlog⁡(n/ϵ))O(n\log(n/\epsilon)). This is a sufficient cutoff, not necessarily the best one for a particular input or algorithm.

What the short circuit does and does not provide

Section titled “What the short circuit does and does not provide”

The exact circuit uses O(n2)O(n^2) logical gates for n=log⁡2Nn=\log_2N qubits. Those counts assume exact controlled rotations and do not include preparing an arbitrary amplitude-encoded input, routing distant qubits, compiling rotations into Clifford+TT, or extracting many classical coefficients. Gate decomposition treats the synthesis cost. A classical FFT instead accepts a stored array and returns a readable array; these are different input/output tasks.

The coherent transform is used in phase estimation and Shor’s algorithm, whose advantages depend on the rest of the algorithm as well. For a terminal QFT measurement, the semiclassical construction of Griffiths and Niu replaces coherent controlled phases with ordered measurements and classical feedforward. It reproduces the relevant measured output, not a reusable coherent QFT state; mid-circuit measurement explains the distinction.

Use q2q1q0q_2q_1q_0 order and prepare x=5=1012x=5=101_2. The circuit applies, in time order,

Hq2,CP2(q1,q2),CP3(q0,q2),Hq1,CP2(q0,q1),Hq0,SWAP⁡(q2,q0).\begin{gathered} H_{q_2},\quad CP_2(q_1,q_2),\quad CP_3(q_0,q_2),\\ H_{q_1},\quad CP_2(q_0,q_1),\quad H_{q_0},\\ \operatorname{SWAP}(q_2,q_0). \end{gathered}

It uses three Hadamards, three controlled phases and one logical SWAP; the two initial XX gates used to prepare 101101 are separate preparation costs.

For x=5x=5, the analytic output in increasing yy order is

F8∣5⟩=18(1e5πi/4ie7πi/4−1eπi/4−ie3πi/4).F_8\lvert5\rangle = \frac{1}{\sqrt8} \begin{pmatrix} 1\\ e^{5\pi i/4}\\ i\\ e^{7\pi i/4}\\ -1\\ e^{\pi i/4}\\ -i\\ e^{3\pi i/4} \end{pmatrix}.

The binary-fraction form gives the same column as

∣0⟩−∣1⟩2⊗∣0⟩+i∣1⟩2⊗∣0⟩+e5πi/4∣1⟩2.\frac{ \lvert0\rangle-\lvert1\rangle }{\sqrt2} \otimes \frac{ \lvert0\rangle+i\lvert1\rangle }{\sqrt2} \otimes \frac{ \lvert0\rangle+e^{5\pi i/4}\lvert1\rangle }{\sqrt2}.

Every consecutive non-wrapping amplitude ratio is

⟨y+1∣F8∣5⟩⟨y∣F8∣5⟩=e5πi/4,y=0,…,6.\frac{ \langle y+1\rvert F_8\lvert5\rangle }{ \langle y\rvert F_8\lvert5\rangle } = e^{5\pi i/4}, \qquad y=0,\ldots,6.

That phase-sensitive check complements

Ucore=B3F8U_{\mathrm{core}} = B_3F_8

and

F8†F8∣5⟩=∣5⟩.F_8^\dagger F_8\lvert5\rangle = \lvert5\rangle.

Worked example: truncating a six-qubit transform

Section titled “Worked example: truncating a six-qubit transform”

Compare F64F_{64} with cutoff m=4m=4, keeping identical final swaps. Both circuits use six Hadamards and three SWAPs. The exact circuit has fifteen controlled phases; the truncated one retains twelve, omitting two CP5CP_5 gates and one CP6CP_6 gate. In this logical alphabet the total decreases from 2424 to 2121 gates.

The exact and retained controlled-phase counts are

NCP=6⋅52=15,NCP(4)=(4−1)(12−4)2=12.N_{CP} = \frac{6\cdot5}{2} = 15, \qquad N_{CP}^{(4)} = \frac{(4-1)(12-4)}{2} = 12.

The three omissions give

∥F64−F~6,4∥op≤4sin⁡(π32)+2sin⁡(π64)=0.49020390997.\begin{aligned} \left\| F_{64}-\widetilde F_{6,4} \right\|_{\mathrm{op}} &\leq 4\sin\left( \frac{\pi}{32} \right) + 2\sin\left( \frac{\pi}{64} \right) \\ &= 0.49020390997. \end{aligned}

A dense singular-value calculation gives

∥F64−F~6,4∥op=0.48596035981.\left\| F_{64}-\widetilde F_{6,4} \right\|_{\mathrm{op}} = 0.48596035981.

For x=45x=45, the two nonzero omitted binary-fraction tails are π/16\pi/16 and π/32\pi/32. The exact-to-truncated column overlap is

⟨F6445|F~6,445⟩=0.98322758570−0.14584803490i,\left\langle F_{64}45 \middle| \widetilde F_{6,4}45 \right\rangle = 0.98322758570 - 0.14584803490i,

and its squared magnitude is

∣⟨F6445|F~6,445⟩∣2=cos⁡2(π32)cos⁡2(π64)=0.98800813457.\begin{aligned} \left| \left\langle F_{64}45 \middle| \widetilde F_{6,4}45 \right\rangle \right|^2 &= \cos^2\left( \frac{\pi}{32} \right) \cos^2\left( \frac{\pi}{64} \right) \\ &= 0.98800813457. \end{aligned}

The fidelity is close to one for this column, but only the operator-norm bound establishes a worst-case budget such as 0.500.50. A different input superposition can be more sensitive to coherent phase errors.

The numerical values above follow from building the analytic Fourier matrix and the stated gate sequence, then taking the largest singular value of their difference. A Frobenius norm or largest matrix entry is a different quantity. The overlap can also be checked directly from the product of the two omitted phase factors.

Construct the positive-sign four-point transform. Verify unitarity and determine its second and fourth powers.

Solution

With ω4=i\omega_4=i and rows yy, columns xx,

F4=12(11111i−1−i1−11−11−i−1i).F_4 = \frac12 \begin{pmatrix} 1&1&1&1\\ 1&i&-1&-i\\ 1&-1&1&-1\\ 1&-i&-1&i \end{pmatrix}.

The inner product of columns xx and x′x' is

14∑y=03i(x−x′)y=δx,x′,\frac14 \sum_{y=0}^{3} i^{(x-x')y} = \delta_{x,x'},

so F4†F4=IF_4^\dagger F_4=I. The general power identity gives

F42∣x⟩=∣−x mod 4⟩.F_4^2\lvert x\rangle = \lvert-x\bmod4\rangle.

In particular,

F42∣1⟩=∣3⟩.F_4^2\lvert1\rangle = \lvert3\rangle.

Applying modular negation twice is the identity, hence F44=IF_4^4=I.

Factor F8∣3⟩F_8\lvert3\rangle in order q2⊗q1⊗q0q_2\otimes q_1\otimes q_0, then expand the product and match the analytic Fourier column.

Solution

The input bits are x2x1x0=011x_2x_1x_0=011. The three binary fractions are

0.x0=12,0.x1x0=34,0.x2x1x0=38.0.x_0 = \frac12, \qquad 0.x_1x_0 = \frac34, \qquad 0.x_2x_1x_0 = \frac38.

Therefore

F8∣3⟩=∣0⟩−∣1⟩2⊗∣0⟩−i∣1⟩2⊗∣0⟩+e3πi/4∣1⟩2.F_8\lvert3\rangle = \frac{\lvert0\rangle-\lvert1\rangle}{\sqrt2} \otimes \frac{\lvert0\rangle-i\lvert1\rangle}{\sqrt2} \otimes \frac{\lvert0\rangle+e^{3\pi i/4}\lvert1\rangle}{\sqrt2}.

For y=y2y1y0y=y_2y_1y_0, the product coefficient is

(−1)y2(−i)y1e3πiy0/4=e3πiy/4.(-1)^{y_2} (-i)^{y_1} e^{3\pi i y_0/4} = e^{3\pi i y/4}.

Thus the expanded vector is

18(1e3πi/4−ieπi/4−1e7πi/4ie5πi/4),\frac{1}{\sqrt8} \begin{pmatrix} 1\\ e^{3\pi i/4}\\ -i\\ e^{\pi i/4}\\ -1\\ e^{7\pi i/4}\\ i\\ e^{5\pi i/4} \end{pmatrix},

which is exactly the column with entries e2πi3y/8/8e^{2\pi i3y/8}/\sqrt8.

Count the exact logical QFT gates for n=7n=7. Then translate only the logical SWAP count into CNOTs.

Solution

The formulas give

NH=7,NCP=7⋅62=21,NSWAP=⌊72⌋=3.N_H = 7, \qquad N_{CP} = \frac{7\cdot6}{2} = 21, \qquad N_{\mathrm{SWAP}} = \left\lfloor\frac72\right\rfloor = 3.

In the declared abstract alphabet the total is

7+21+3=31.7+21+3 = 31.

If each logical SWAP is later decomposed as three CNOTs, report nine CNOTs in place of the three SWAPs. The resulting gate count is seven Hadamards, twenty-one controlled phases, and nine CNOTs. No depth follows without a schedule and connectivity model.

An intended terminal result is y=11=10112y=11=1011_2 on four qubits. Determine the raw no-swap label and state when classical repair is valid.

Solution

The no-swap core applies B4B_4 to the mathematical output:

B4∣1011⟩=∣1101⟩.B_4\lvert1011\rangle = \lvert1101\rangle.

Interpreted with the original significance convention, the raw label is

11012=13.1101_2 = 13.

Applying B4B_4 restores ∣1011⟩\lvert1011\rangle. If computational-basis measurement is immediate, software may instead reverse the recorded bits and report 1111. That relabeling is invalid before a coherent downstream consumer unless the consumer itself is rewritten to absorb B4B_4.

Let

∣ψ3⟩=18∑y=07e2πi3y/8∣y⟩.\lvert\psi_3\rangle = \frac{1}{\sqrt8} \sum_{y=0}^{7} e^{2\pi i3y/8} \lvert y\rangle.

Compare the correct inverse with a mistaken application of the forward transform.

Solution

By definition,

∣ψ3⟩=F8∣3⟩.\lvert\psi_3\rangle = F_8\lvert3\rangle.

The declared inverse therefore gives

F8†∣ψ3⟩=F8†F8∣3⟩=∣3⟩.F_8^\dagger \lvert\psi_3\rangle = F_8^\dagger F_8 \lvert3\rangle = \lvert3\rangle.

Using the positive-sign forward transform instead gives

F8∣ψ3⟩=F82∣3⟩=∣−3 mod 8⟩=∣5⟩.F_8 \lvert\psi_3\rangle = F_8^2 \lvert3\rangle = \lvert-3\bmod8\rangle = \lvert5\rangle.

The wrong sign does not merely add a global phase; it changes the decoded integer.

For n=12n=12 and cutoff m=5m=5, count exact, retained, and omitted controlled phases. Evaluate the telescoping bound and test a 0.50.5 operator-norm budget.

Solution

The exact count is

NCP=12⋅112=66.N_{CP} = \frac{12\cdot11}{2} = 66.

The retained and omitted counts are

NCP(5)=(5−1)(24−5)2=38,Nomit=(12−5)(12−5+1)2=28.\begin{aligned} N_{CP}^{(5)} &= \frac{(5-1)(24-5)}{2} = 38, \\ N_{\mathrm{omit}} &= \frac{(12-5)(12-5+1)}{2} = 28. \end{aligned}

The circuit also has twelve Hadamards and six logical SWAPs. Its phase-sensitive telescoping bound is

∑ℓ=612(13−ℓ)2sin⁡(π2ℓ)=1.17932228487.\begin{aligned} \sum_{\ell=6}^{12} (13-\ell) 2\sin\left( \frac{\pi}{2^\ell} \right) &= 1.17932228487. \end{aligned}

Because 1.17932228487>0.51.17932228487>0.5, this bound does not certify the proposed budget. The actual operator norm might be smaller, but that possibility is not a pass; a tighter proof or a direct worst-case calculation is required.

A report observes uniform computational-basis probabilities after transforming a basis state and quotes an O(n2)O(n^2) logical QFT count. It concludes that the phases and an exponential end-to-end speedup have both been verified. Explain why neither conclusion follows.

Solution

Neither conclusion follows from these observations.

Uniform probabilities establish only

∣⟨y∣ψout⟩∣2=1N.\left| \langle y\rvert\psi_{\mathrm{out}}\rangle \right|^2 = \frac1N.

They do not determine the relative phases. Verification needs an inverse-reconstruction test, amplitude-ratio comparison, or another interference-sensitive experiment with declared tolerances.

The O(n2)O(n^2) count applies only to the abstract transform on n=log⁡2Nn=\log_2N coherently encoded qubits. An end-to-end claim must also account for input preparation or oracle access, repetitions, output measurement, classical postprocessing, synthesis, routing, and the success criterion of the surrounding algorithm. No exponential speedup follows from the primitive count alone.

Take n=4n=4, cutoff m=3m=3 and input x=11=10112x=11=1011_2. Count the omitted gates, calculate the exact operator-norm error, and find the probability that applying the exact inverse to the approximate output returns 1111. Does the approximation meet worst-case budgets 0.400.40 and 0.100.10?

Solution

The exact circuit has four Hadamards, six controlled phases and two SWAPs. The truncated circuit omits only CP4CP_4 and retains the other eleven logical gates. Because a single gate differs between otherwise identical unitary prefixes and suffixes, norm invariance gives the exact error

∥F16−F~4,3∥op=∥CP4−I∥op=2sin⁡(π/16)≃0.39018064403.\|F_{16}-\widetilde F_{4,3}\|_{\rm op} =\|CP_4-I\|_{\rm op} =2\sin(\pi/16)\simeq0.39018064403.

It meets the 0.400.40 budget and fails the 0.100.10 budget. For input 10111011, the omitted conditional phase is active and changes one factor of the product output by π/8\pi/8. The squared overlap of exact and approximate outputs is

∣1+e−iπ/82∣2=cos⁡2(π/16)≃0.96193976626.\left|\frac{1+e^{-i\pi/8}}2\right|^2 =\cos^2(\pi/16)\simeq0.96193976626.

This is the probability of returning 1111 after the exact inverse. Both forward outputs alone still have uniform computational-basis probabilities. Thus a high selected-state fidelity and a visibly nonzero worst-case error are compatible.