The quantum Fourier transform can be performed efficiently on a quantum computer with a decomposition into the product of simplerunitary matrices. The discrete Fourier transform on amplitudes can be implemented as aquantum circuit consisting of onlyHadamard gates andcontrolledphase shift gates, where is the number of qubits.[5] This can be compared with the classical discrete Fourier transform, which takes gates (where is the number of bits), which is exponentially more than.
The quantum Fourier transform acts on aquantum state vector (aquantum register), and the classicaldiscrete Fourier transform acts on a vector. Both types of vectors can be written as lists of complex numbers. In the classical case, the vector can be represented with e.g. an array offloating-point numbers, and in the quantum case it is a sequence ofprobability amplitudes for all the possible outcomes uponmeasurement (the outcomes are thebasis states, oreigenstates). Because measurementcollapses the quantum state to a single basis state, not every task that uses the classical Fourier transform can take advantage of the quantum Fourier transform's exponential speedup.
The best quantum Fourier transform algorithms known (as of late 2000) require only gates to achieve an efficient approximation, provided that acontrolledphase gate is implemented as a native operation.[6]
The quantum Fourier transform is the classical discrete Fourier transform applied to the vector of amplitudes of a quantum state, which has length if it is applied to a register of qubits.
Theclassical Fourier transform acts on avector and maps it to the vector according to the formula
Similarly, thequantum Fourier transform acts on a quantum state and maps it to a quantum state 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 is a rotation, theinverse quantum Fourier transform acts similarly but with
In case that is a basis state, the quantum Fourier transform can also be expressed as the map
Equivalently, the quantum Fourier transform can be viewed as aunitary matrix (orquantum gate) acting on quantum state vectors, where the unitary matrix is theDFT matrix
where. For example, in the case of and phase the transformation matrix is
Most of the properties of the quantum Fourier transform follow from the fact that it is aunitary transformation. This can be checked by performingmatrix multiplication and ensuring that the relation holds, where is theHermitian adjoint of. Alternately, one can check that orthogonal vectors ofnorm 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. 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 circuit is composed of gates and thecontrolled version of:
An orthonormal basis is composed of basis states
These basis states span all possible states of the qubits. As in, each is:
where, withtensor product notation, indicates that qubit is in state, with either 0 or 1. By convention, the basis state index is thebinary number encoded by the, with the most significant bit.
The action of the Hadamard gate is, where the sign depends on.
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, aswap operation of the qubits must be performed to reverse their order. At most swaps are required.[5]
Because the discrete Fourier transform, an operation onn qubits, can be factored into the tensor product ofn single-qubit operations, it is easily represented as aquantum circuit (up to an order reversal of the output). Each of those single-qubit operations can be implemented efficiently using oneHadamard gate and a linear number ofcontrolledphase gates. The first term requires one Hadamard gate and controlled phase gates, the next term requires one Hadamard gate and 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 gates, which is quadratic polynomial in the number of qubits. This value is much smaller than for the classical Fourier transformation.[7]
The circuit-level implementation of the quantum Fourier transform on a linear nearest neighbor architecture has been studied before.[8][9] Thecircuit depth is linear in the number of qubits.
Using the generalizedFourier transform on finite (abelian) groups, there are actually two natural ways to define a quantum Fourier transform on ann-qubitquantum register. The QFT as defined above is equivalent to the DFT, which considers these n qubits as indexed by the cyclic group. However, it also makes sense to consider the qubits as indexed by theBoolean group, and in this case the Fourier transform is theHadamard transform. This is achieved by applying aHadamard gate to each of the n qubits in parallel.[10][11]Shor's algorithm uses both types of Fourier transforms, an initial Hadamard transform as well as a QFT.
The Fourier transform can be formulated forgroups other than the cyclic group, and extended to the quantum setting.[12] For example, consider the symmetric group.[13][14] The Fourier transform can be expressed in matrix form
where is the element of the matrix representation of, is the set of paths from the root node to in theBratteli diagram of, is the set of representations of indexed byYoung diagrams, and is a permutation.
The discrete Fourier transform can also beformulated over a finite field, and a quantum version can be defined.[15] Consider. Let be an arbitrary linear map (trace, for example). Then for each define
^Kurgalin, Sergei; Borzunov, Sergei (2021).Concise guide to quantum computing: algorithms, exercises, and implementations. Texts in computer science. Cham: Springer.ISBN978-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.
^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.
^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.ISBN0-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.
Parthasarathy, K. R. (2006).Lectures on Quantum Computation, Quantum Error Correcting Codes and Information Theory. Tata Institute of Fundamental Research.ISBN978-81-7319-688-1.