The quantum Fourier transform is the classical discrete Fourier transform applied to the vector of amplitudes of a quantum state, which has length N = 2 n {\displaystyle N=2^{n}} if it is applied to a register of n {\displaystyle n} qubits.
The classical Fourier transform acts on a vector ( x 0 , x 1 , … , x N − 1 ) ∈ C N {\displaystyle (x_{0},x_{1},\ldots ,x_{N-1})\in \mathbb {C} ^{N}} and maps it to the vector ( y 0 , y 1 , … , y N − 1 ) ∈ C N {\displaystyle (y_{0},y_{1},\ldots ,y_{N-1})\in \mathbb {C} ^{N}} according to the formula
where ω N = e 2 π i N {\displaystyle \omega _{N}=e^{\frac {2\pi i}{N}}} is an N-th root of unity.
Similarly, the quantum Fourier transform acts on a quantum state | x ⟩ = ∑ j = 0 N − 1 x j | j ⟩ {\textstyle |x\rangle =\sum _{j=0}^{N-1}x_{j}|j\rangle } and maps it to a quantum state ∑ j = 0 N − 1 y j | j ⟩ {\textstyle \sum _{j=0}^{N-1}y_{j}|j\rangle } according to the formula
(Conventions for the sign of the phase factor exponent vary; here the quantum Fourier transform has the same effect as the inverse discrete Fourier transform, and conversely.)
Since ω N l {\displaystyle \omega _{N}^{l}} is a rotation, the inverse quantum Fourier transform acts similarly but with
In case that | x ⟩ {\displaystyle |x\rangle } is a basis state, the quantum Fourier transform can also be expressed as the map
Equivalently, the quantum Fourier transform can be viewed as a unitary matrix (or quantum gate) acting on quantum state vectors, where the unitary matrix F N {\displaystyle F_{N}} is the DFT matrix
where ω = ω N {\displaystyle \omega =\omega _{N}} . For example, in the case of N = 4 = 2 2 {\displaystyle N=4=2^{2}} and phase ω = i {\displaystyle \omega =i} the transformation matrix is
See also: Generalizations of Pauli matrices § Construction: The clock and shift matrices
Most of the properties of the quantum Fourier transform follow from the fact that it is a unitary transformation. This can be checked by performing matrix multiplication and ensuring that the relation F F † = F † F = I {\displaystyle FF^{\dagger }=F^{\dagger }F=I} holds, where F † {\displaystyle F^{\dagger }} is the Hermitian adjoint of F {\displaystyle F} . Alternately, one can check that orthogonal vectors of norm 1 get mapped to orthogonal vectors of norm 1.
From the unitary property it follows that the inverse of the quantum Fourier transform is the Hermitian adjoint of the Fourier matrix, thus F − 1 = F † {\displaystyle F^{-1}=F^{\dagger }} . Since there is an efficient quantum circuit implementing the quantum Fourier transform, the circuit can be run in reverse to perform the inverse quantum Fourier transform. Thus both transforms can be efficiently performed on a quantum computer.
The quantum gates used in the circuit of n {\displaystyle n} qubits are the Hadamard gate and the dyadic rational phase gate R k {\displaystyle R_{k}} :
H = 1 2 ( 1 1 1 − 1 ) and R k = ( 1 0 0 e i 2 π / 2 k ) {\displaystyle H={\frac {1}{\sqrt {2}}}{\begin{pmatrix}1&1\\1&-1\end{pmatrix}}\qquad {\text{and}}\qquad R_{k}={\begin{pmatrix}1&0\\0&e^{i2\pi /2^{k}}\end{pmatrix}}}
The circuit is composed of H {\displaystyle H} gates and the controlled version of R k {\displaystyle R_{k}} :
An orthonormal basis consists of the basis states
These basis states span all possible states of the qubits:
where, with tensor product notation ⊗ {\displaystyle \otimes } , | x j ⟩ {\displaystyle |x_{j}\rangle } indicates that qubit j {\displaystyle j} is in state x j {\displaystyle x_{j}} , with x j {\displaystyle x_{j}} either 0 or 1. By convention, the basis state index x {\displaystyle x} is the binary number encoded by the x j {\displaystyle x_{j}} , with x 1 {\displaystyle x_{1}} the most significant bit.
The action of the Hadamard gate is H | x j ⟩ = ( 1 2 ) ( | 0 ⟩ + e 2 π i x j 2 − 1 | 1 ⟩ ) {\displaystyle H|x_{j}\rangle =\left({\frac {1}{\sqrt {2}}}\right)\left(|0\rangle +e^{2\pi ix_{j}2^{-1}}|1\rangle \right)} , where the sign depends on x i {\displaystyle x_{i}} .
The quantum Fourier transform can be written as the tensor product of a series of terms:
Using the fractional binary notation
the action of the quantum Fourier transform can be expressed in a compact manner:
To obtain this state from the circuit depicted above, a swap operation of the qubits must be performed to reverse their order. At most n / 2 {\displaystyle n/2} swaps are required.7
Because the discrete Fourier transform, an operation on n qubits, can be factored into the tensor product of n single-qubit operations, it is easily represented as a quantum circuit (up to an order reversal of the output). Each of those single-qubit operations can be implemented efficiently using one Hadamard gate and a linear number of controlled phase gates. The first term requires one Hadamard gate and ( n − 1 ) {\displaystyle (n-1)} controlled phase gates, the next term requires one Hadamard gate and ( n − 2 ) {\displaystyle (n-2)} controlled phase gate, and each following term requires one fewer controlled phase gate. Summing up the number of gates, excluding the ones needed for the output reversal, gives n + ( n − 1 ) + ⋯ + 1 = n ( n + 1 ) / 2 = O ( n 2 ) {\displaystyle n+(n-1)+\cdots +1=n(n+1)/2=O(n^{2})} gates, which is quadratic polynomial in the number of qubits. This value is much smaller than for the classical Fourier transformation.8
The circuit-level implementation of the quantum Fourier transform on a linear nearest neighbor architecture has been studied before.910 The circuit depth is linear in the number of qubits.
The quantum Fourier transform on three qubits, F 8 {\displaystyle F_{8}} with n = 3 , N = 8 = 2 3 {\displaystyle n=3,N=8=2^{3}} , is represented by the following transformation:
where ω = ω 8 {\displaystyle \omega =\omega _{8}} is an eighth root of unity satisfying ω 8 = ( e i 2 π 8 ) 8 = 1 {\displaystyle \omega ^{8}=\left(e^{\frac {i2\pi }{8}}\right)^{8}=1} .
The matrix representation of the Fourier transform on three qubits is:
The 3-qubit quantum Fourier transform can be rewritten as:
The following sketch shows the respective circuit for n = 3 {\displaystyle n=3} (with reversed order of output qubits with respect to the proper QFT):
As calculated above, the number of gates used is n ( n + 1 ) / 2 {\displaystyle n(n+1)/2} which is equal to 6 {\displaystyle 6} , for n = 3 {\displaystyle n=3} .
See also: Hadamard transform § Quantum computing applications
Using the generalized Fourier transform on finite (abelian) groups, there are actually two natural ways to define a quantum Fourier transform on an n-qubit quantum register. The QFT as defined above is equivalent to the DFT, which considers these n qubits as indexed by the cyclic group Z / 2 n Z {\displaystyle \mathbb {Z} /2^{n}\mathbb {Z} } . However, it also makes sense to consider the qubits as indexed by the Boolean group ( Z / 2 Z ) n {\displaystyle (\mathbb {Z} /2\mathbb {Z} )^{n}} , and in this case the Fourier transform is the Hadamard transform. This is achieved by applying a Hadamard gate to each of the n qubits in parallel.1112 Shor's algorithm uses both types of Fourier transforms, an initial Hadamard transform as well as a QFT.
The Fourier transform can be formulated for groups other than the cyclic group, and extended to the quantum setting.13 For example, consider the symmetric group S n {\displaystyle S_{n}} .1415 The Fourier transform can be expressed in matrix form
where [ λ ( g ) ] q , p {\displaystyle [\lambda (g)]_{q,p}} is the ( q , p ) {\displaystyle (q,p)} element of the matrix representation of λ ( g ) {\displaystyle \lambda (g)} , P ( λ ) {\displaystyle {\mathcal {P}}(\lambda )} is the set of paths from the root node to λ {\displaystyle \lambda } in the Bratteli diagram of S n {\displaystyle S_{n}} , Λ n {\displaystyle \Lambda _{n}} is the set of representations of S n {\displaystyle S_{n}} indexed by Young diagrams, and g {\displaystyle g} is a permutation.
The discrete Fourier transform can also be formulated over a finite field F q {\displaystyle F_{q}} , and a quantum version can be defined.16 Consider N = q = p n {\displaystyle N=q=p^{n}} . Let ϕ : G F ( q ) → G F ( p ) {\displaystyle \phi :GF(q)\to GF(p)} be an arbitrary linear map (trace, for example). Then for each x ∈ G F ( q ) {\displaystyle x\in GF(q)} define
for ω = e 2 π i / p {\displaystyle \omega =e^{2\pi i/p}} and extend F q , ϕ {\displaystyle F_{q,\phi }} linearly.
Coppersmith, D. (2002). An approximate Fourier transform useful in quantum factoring (Preprint). arXiv:quant-ph/0201067. /wiki/ArXiv_(identifier) ↩
Draper, Thomas G. (7 Aug 2000). "Addition on a Quantum Computer". arXiv:quant-ph/0008033. /wiki/ArXiv_(identifier) ↩
Ruiz-Perez, Lidia; Juan Carlos, Garcia-Escartin (2 May 2017). "Quantum arithmetic with the quantum Fourier transform". Quantum Information Processing. 16 (6): 152. arXiv:1411.5949v2. Bibcode:2017QuIP...16..152R. doi:10.1007/s11128-017-1603-1. S2CID 10948948. /wiki/ArXiv_(identifier) ↩
Şahin, Engin (2020). "Quantum arithmetic operations based on quantum Fourier transform on signed integers". International Journal of Quantum Information. 18 (6): 2050035. arXiv:2005.00443v3. Bibcode:2020IJQI...1850035S. doi:10.1142/s0219749920500355. ISSN 1793-6918. /wiki/ArXiv_(identifier) ↩
Nielsen, Michael A.; Chuang, Isaac L. (2012). Quantum Computation and Quantum Information. doi:10.1017/CBO9780511976667. ISBN 978-1-107-00217-3. 978-1-107-00217-3 ↩
Hales, L.; Hallgren, S. (November 12–14, 2000). "An improved quantum Fourier transform algorithm and applications". Proceedings 41st Annual Symposium on Foundations of Computer Science. pp. 515–525. CiteSeerX 10.1.1.29.4161. doi:10.1109/SFCS.2000.892139. ISBN 0-7695-0850-2. S2CID 424297. 0-7695-0850-2 ↩
Kurgalin, Sergei; Borzunov, Sergei (2021). Concise guide to quantum computing: algorithms, exercises, and implementations. Texts in computer science. Cham: Springer. ISBN 978-3-030-65054-4. 978-3-030-65054-4 ↩
Fowler, A.G.; Devitt, S.J.; Hollenberg, L.C.L. (July 2004). "Implementation of Shor's algorithm on a linear nearest neighbour qubit array". Quantum Information and Computation. 4 (4): 237–251. doi:10.26421/QIC4.4-1. /wiki/Doi_(identifier) ↩
Maslov, Dmitri (15 November 2007). "Linear depth stabilizer and quantum Fourier transformation circuits with no auxiliary qubits in finite-neighbor quantum architectures". Physical Review A. 76 (5): 052310. arXiv:quant-ph/0703211. Bibcode:2007PhRvA..76e2310M. doi:10.1103/PhysRevA.76.052310. S2CID 18645435. /wiki/ArXiv_(identifier) ↩
Fourier Analysis of Boolean Maps– A Tutorial –, pp. 12-13[full citation needed] https://www.staff.uni-mainz.de/pommeren/Kryptologie/Bitblock/A_Nonlin/Fourier.pdf ↩
Lecture 5: Basic quantum algorithms, Rajat Mittal, pp. 4-5 https://web.archive.org/web/20210713134541/https://www.cse.iitk.ac.in/users/rmittal/prev_course/s19/reports/5_algo.pdf ↩
Moore, Cristopher; Rockmore, Daniel; Russell, Alexander (2003). Generic Quantum Fourier Transforms (Preprint). arXiv:quant-ph/0304064. /wiki/ArXiv_(identifier) ↩
Kawano, Yasuhito; Sekigawa, Hiroshi (July 2016). "Quantum Fourier transform over symmetric groups — improved result". Journal of Symbolic Computation. 75: 219–243. doi:10.1016/j.jsc.2015.11.016. /wiki/Doi_(identifier) ↩
Beals, Robert (1997). "Quantum computation of Fourier transforms over symmetric groups". Proceedings of the twenty-ninth annual ACM symposium on Theory of computing - STOC '97. pp. 48–53. doi:10.1145/258533.258548. ISBN 0-89791-888-6. 0-89791-888-6 ↩
de Beaudrap, Niel; Cleve, Richard; Waltrous, John (8 November 2002). "Sharp Quantum versus Classical Query Complexity Separations". Algorithmica. 34 (4): 449–461. doi:10.1007/s00453-002-0978-1. /wiki/Doi_(identifier) ↩