Quantum Fourier Transform #
The quantum Fourier transform (QFT) on n qubits is the 2^n × 2^n unitary
matrix mapping computational basis states to Fourier basis states
[dW19, qcnotes.tex:1692; Lin22, phaseestimation.tex:351]:
QFT |x⟩ = (1/√N) Σ_{y=0}^{N-1} ω^{xy} |y⟩
where N = 2^n and ω = e^{2πi/N} is the primitive N-th root of unity.
Conventions #
- Sign: forward transform uses
ω = e^{+2πi/N}(standard physics sign convention, matching [dW19, qcnotes.tex:1690] and [Lin22, phaseestimation.tex:349]). - Normalization:
1/√Nprefactor makes the transform unitary. - Endianness: big-endian, matching
LeanPool.LeanQuantumAlg.PureState.
Main definitions #
LeanPool.LeanQuantumAlg.omega n— primitive2^n-th root of unitye^{2πi/2^n}.LeanPool.LeanQuantumAlg.invSqrtN n— normalization factor1/√(2^n).LeanPool.LeanQuantumAlg.QFT n— the QFT gate onnqubits.
Main results #
LeanPool.LeanQuantumAlg.omega_pow_eq_one—ω^(2^n) = 1.LeanPool.LeanQuantumAlg.norm_omega—‖ω‖ = 1.LeanPool.LeanQuantumAlg.QFT_apply_ket— component formula forQFT |x⟩.LeanPool.LeanQuantumAlg.sum_omega_zpow_eq_zero— full-period geometric sums of nontrivial powers ofωvanish (column orthogonality).LeanPool.LeanQuantumAlg.QuantumFourierTransform.main— the QFT is unitary.
Pinned Mathlib API: Complex.exp, Complex.exp_nat_mul, Complex.exp_eq_one_iff,
Complex.norm_exp_ofReal_mul_I, Complex.isPrimitiveRoot_exp,
Matrix.of_apply, Real.mul_self_sqrt, RCLike.inv_eq_conj,
IsPrimitiveRoot.zpow_eq_one_iff_dvd, geom_sum_eq,
Fin.sum_univ_eq_sum_range, Int.eq_zero_of_abs_lt_dvd,
Int.abs_sub_lt_of_lt_lt, Matrix.mem_unitaryGroup_iff'.
Root of unity #
Primitive 2^n-th root of unity: ω_n = e^{2πi/2^n}
[dW19, qcnotes.tex:1690].
Forward-transform sign convention (+2πi, not −2πi).
Equations
- QuantumAlg.omega n = Complex.exp (↑(2 * Real.pi / 2 ^ n) * Complex.I)
Instances For
omega n is a primitive 2^n-th root of unity.
Normalization #
QFT normalization factor: 1/√(2^n), generalizing PureState.invSqrt2.
Equations
- QuantumAlg.invSqrtN n = (↑√(2 ^ n))⁻¹
Instances For
QFT gate #
The quantum Fourier transform on n qubits
[dW19, qcnotes.tex:1692].
Entry (j, k) = invSqrtN n * ω_n^{j·k}.
Equations
- QuantumAlg.QFTMatrix n = Matrix.of fun (j k : Fin (2 ^ n)) => QuantumAlg.invSqrtN n * QuantumAlg.omega n ^ (↑j * ↑k)
Instances For
Action on basis kets #
Unitarity #
The QFT is unitary [dW19, qcnotes.tex:1696]: columns are normalized and
pairwise orthogonal. Entry-by-entry, star (QFT n) * QFT n at (j, k) is
invSqrtN² · ∑_l ω^{l·(k−j)}, which sum_omega_zpow_eq_zero collapses to
if j = k then 1 else 0.
The quantum Fourier transform on n qubits as a unitary gate.
Equations
Instances For
Action on basis kets #
Fixed-circuit gate profile for the standard QFT decomposition: n
Hadamard gates, n(n-1)/2 controlled-phase gates, and n/2 final register
swaps in this natural-number convention.
Equations
Instances For
QFT basis action paired with the fixed-circuit gate counts used by the standard decomposition.