Quantum Fourier transform explained

In quantum computing, the quantum Fourier transform (QFT) is a linear transformation on quantum bits, and is the quantum analogue of the discrete Fourier transform. The quantum Fourier transform is a part of many quantum algorithms, notably Shor's algorithm for factoring and computing the discrete logarithm, the quantum phase estimation algorithm for estimating the eigenvalues of a unitary operator, and algorithms for the hidden subgroup problem. The quantum Fourier transform was discovered by Don Coppersmith.[1] With small modifications to the QFT, it can also be used for performing fast integer arithmetic operations such as addition and multiplication.[2] [3]

The quantum Fourier transform can be performed efficiently on a quantum computer with a decomposition into the product of simpler unitary matrices. The discrete Fourier transform on

2n

amplitudes can be implemented as a quantum circuit consisting of only

O(n2)

Hadamard gates and controlled phase shift gates, where

n

is the number of qubits.[4] This can be compared with the classical discrete Fourier transform, which takes

O(n2n)

gates (where

n

is the number of bits), which is exponentially more than

O(n2)

.

The quantum Fourier transform acts on a quantum state vector (a quantum register), and the classical Discrete Fourier transform acts on a vector. Both types of vectors can be written as lists of complex numbers. In the quantum case it is a sequence of probability amplitudes for all the possible outcomes upon measurement (the outcomes are the basis states, or eigenstates). Because measurement collapses 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

O(nlogn)

gates to achieve an efficient approximation, provided that a controlled phase gate is implemented as a native operation.[5]

Definition

The quantum Fourier transform is the classical discrete Fourier transform applied to the vector of amplitudes of a quantum state, which usually has length

N=2n

.

(x0,x1,\ldots,xN-1)\inCN

and maps it to the vector

(y0,y1,\ldots,yN-1)\inCN

according to the formula:

yk=

1
\sqrt{N
} \sum_^ x_n \omega_N^, \quad k=0,1,2, \ldots,N-1, where

\omegaN=

2\pii
N
e
and
n
\omega
N
is an N-th root of unity.

Similarly, the quantum Fourier transform acts on a quantum state |x\rangle = \sum_^ x_i |i\rangle and maps it to a quantum state \sum_^ y_i |i\rangle according to the formula:

yk=

1
\sqrt{N
} \sum_^ x_n \omega_N^, \quad k=0,1,2, \ldots,N-1,

(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 vice versa.)

Since

n
\omega
N
is a rotation, the inverse quantum Fourier transform acts similarly but with:

xn=

1
\sqrt{N
} \sum_^ y_k \omega_N^, \quad n=0,1,2, \ldots,N-1,

In case that

|x\rangle

is a basis state, the quantum Fourier Transform can also be expressed as the map

QFT:|x\rangle\mapsto

1
\sqrt{N
} \sum_^ \omega_N^ |k\rangle.

Equivalently, the quantum Fourier transform can be viewed as a unitary matrix (or quantum gate) acting on quantum state vectors, where the unitary matrix

FN

is the DFT matrix

FN=

1
\sqrt{N
} \begin1&1&1&1&\cdots &1 \\1&\omega&\omega^2&\omega^3&\cdots&\omega^ \\1&\omega^2&\omega^4&\omega^6&\cdots&\omega^\\ 1&\omega^3&\omega^6&\omega^9&\cdots&\omega^\\\vdots&\vdots&\vdots&\vdots&&\vdots\\1&\omega^&\omega^&\omega^&\cdots&\omega^\end

where

\omega=\omegaN

. For example, in the case of

N=4=22

and phase

\omega=i

the transformation matrix is

F4=

1
2

\begin{bmatrix} 1&1&1&1\\ 1&i&-1&-i\\ 1&-1&1&-1\\ 1&-i&-1&i \end{bmatrix}

Properties

Unitarity

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

FF\dagger=F\daggerF=I

holds, where

F\dagger

is the Hermitian adjoint of

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\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.

Circuit implementation

The quantum gates used in the circuit of

n

qubits are the Hadamard gate and the phase gate

Rk

:

H=

1
\sqrt{2
} \begin 1 & 1 \\ 1 & -1 \end \qquad\text \qquad R_k = \begin 1 & 0 \\ 0 & e^ \end

The circuit is composed of

H

gates and the controlled version of

Rk

:

An orthonormal basis consists of the basis states

|0\rangle,\ldots,|2n-1\rangle.

These basis states span all possible states of the qubits:

|x\rangle=|x1x2\ldotsxn\rangle=|x1\rangle|x2\rangle|xn\rangle

where, with tensor product notation

,

|xj\rangle

indicates that qubit

j

is in state

xj

, with

xj

either 0 or 1. By convention, the basis state index

x

is the binary number encoded by the

xj

, with

x1

the most significant bit.

The action of the Hadamard gate is

H|x
i\rangle=\left(1
\sqrt{2
}\right)\left(|0\rangle+e^|1\rangle \right) , where the sign depends on

xi

.

The quantum Fourier transform can be written as the tensor product of a series of terms:

QFT(|x\rangle)=

1
\sqrt{N
} \bigotimes_^ \left(|0\rangle + \omega_N^ |1\rangle \right).

Using the fractional binary notation

[0.x1\ldotsxm]=

m
\sum
k=1

xk2-k.

the action of the quantum Fourier transform can be expressed in a compact manner:

QFT(|x1x2\ldotsxn\rangle)=

1
\sqrt{N
} \ \left(|0\rangle + e^|1\rangle\right) \otimes \left(|0\rangle + e^|1\rangle\right) \otimes \cdots \otimes \left(|0\rangle + e^|1\rangle\right).

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

swaps are required.

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)

controlled phase gates, the next term requires one Hadamard gate and

(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(n2)

gates, which is quadratic polynomial in the number of qubits. This value is much smaller than for the classical Fourier transformation.[6]

The circuit-level implementation of the quantum Fourier transform on a linear nearest neighbor architecture has been studied before.[7] [8] The circuit depth is linear in the number of qubits.

Example

The quantum Fourier transform on three qubits,

F8

with

n=3,N=8=23

, is represented by the following transformation:

QFT:|x\rangle\mapsto

1
\sqrt{8
} \sum_^ \omega^ |k\rangle,

where

\omega=\omega8

is an eighth root of unity satisfying

\omega8=\left(e

i2\pi
8

\right)8=1

.

The matrix representation of the Fourier transform on three qubits is:

F8=

1
\sqrt{8
} \begin 1&1&1&1&1&1&1&1 \\1&\omega&\omega^2&\omega^3&\omega^4&\omega^5&\omega^6&\omega^7 \\1&\omega^2&\omega^4&\omega^6&1&\omega^2&\omega^4&\omega^6 \\1&\omega^3&\omega^6&\omega&\omega^4&\omega^7&\omega^2&\omega^5 \\1&\omega^4&1&\omega^4&1&\omega^4&1&\omega^4 \\1&\omega^5&\omega^2&\omega^7&\omega^4&\omega&\omega^6&\omega^3 \\1&\omega^6&\omega^4&\omega^2&1&\omega^6&\omega^4&\omega^2 \\1&\omega^7&\omega^6&\omega^5&\omega^4&\omega^3&\omega^2&\omega \\\end.

The 3-qubit quantum Fourier transform can be rewritten as:

QFT(|x1,x2,x3\rangle)=

1
\sqrt{8
} \ \left(|0\rangle + e^|1\rangle\right) \otimes \left(|0\rangle + e^|1\rangle\right) \otimes \left(|0\rangle + e^|1\rangle\right).

The following sketch shows the respective circuit for

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

which is equal to

6

, for

n=3

.

Relation to quantum Hadamard transform

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/2n\Z

. However, it also makes sense to consider the qubits as indexed by the Boolean group

(\Z/2\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.[9] [10] Shor's algorithm uses both types of Fourier transforms, an initial Hadamard transform as well as a QFT.

For other groups

The Fourier transform can be formulated for groups other than the cyclic group, and extended to the quantum setting.[11] For example, consider the symmetric group

Sn

.[12] [13] The Fourier transform can be expressed in matrix form

ak{F}n=

\sum
λ\inΛn

\sump,q

(λ)}\sum\sqrt{
g\inSn
dλ
n!
}[\lambda(g)]_|\lambda,p,q\rangle \langle g|

where

[λ(g)]q,p

is the

(q,p)

element of the matrix representation of

λ(g)

,

l{P}(λ)

is the set of paths from the root node to

λ

in the Bratteli diagram of

Sn

,

Λn

is the set of representations of

Sn

indexed by Young diagrams, and

g

is a permutation.

Over a finite field

Fq

, and a quantum version can be defined.[14] Here

N=q=pn

. Let

\phi:GF(q)GF(p)

be an arbitrary linear map (trace, for example). Then for each

x\inGF(q)

define

Fq,\phi:|x\rangle\mapsto

1
\sqrt{q
} \sum_ \omega^|y \rangle

for

\omega=e2\pi

and extend

Fq,\phi

linearly.

Further reading

External links

Notes and References

  1. Preprint . Coppersmith . D. . An approximate Fourier transform useful in quantum factoring . 2002 . quant-ph/0201067 .
  2. Draper. Thomas G.. quant-ph/0008033. Addition on a Quantum Computer. 7 Aug 2000.
  3. Ruiz-Perez. Lidia. Juan Carlos. Garcia-Escartin. Quantum arithmetic with the quantum Fourier transform. Quantum Information Processing. 1411.5949v2. 2 May 2017. 16. 6. 152 . 10.1007/s11128-017-1603-1. 2017QuIP...16..152R . 10948948.
  4. Book: 10.1017/CBO9780511976667 . Quantum Computation and Quantum Information . 2012 . Nielsen . Michael A. . Chuang . Isaac L. . 978-1-107-00217-3 .
  5. Book: Hales. L.. Hallgren. S.. Proceedings 41st Annual Symposium on Foundations of Computer Science . An improved quantum Fourier transform algorithm and applications . November 12–14, 2000. 515–525. 10.1109/SFCS.2000.892139. 0-7695-0850-2. 10.1.1.29.4161. 424297.
  6. Book: Kurgalin, Sergei . Concise guide to quantum computing: algorithms, exercises, and implementations . Borzunov . Sergei . 2021 . Springer . 978-3-030-65054-4 . Texts in computer science . Cham.
  7. Fowler . A.G. . Devitt . S.J. . Hollenberg . L.C.L. . Implementation of Shor's algorithm on a linear nearest neighbour qubit array . Quantum Information and Computation . July 2004 . 4 . 4 . 237–251 . 10.26421/QIC4.4-1 .
  8. Maslov . Dmitri . Linear depth stabilizer and quantum Fourier transformation circuits with no auxiliary qubits in finite-neighbor quantum architectures . Physical Review A . 15 November 2007 . 76 . 5 . 052310 . 10.1103/PhysRevA.76.052310 . 18645435 . quant-ph/0703211 . 2007PhRvA..76e2310M .
  9. https://www.staff.uni-mainz.de/pommeren/Kryptologie/Bitblock/A_Nonlin/Fourier.pdf Fourier Analysis of Boolean Maps– A Tutorial –, pp. 12-13
  10. https://www.cse.iitk.ac.in/users/rmittal/prev_course/s19/reports/5_algo.pdf Lecture 5: Basic quantum algorithms, Rajat Mittal, pp. 4-5
  11. Preprint . Moore . Cristopher . Rockmore . Daniel . Russell . Alexander . Generic Quantum Fourier Transforms . 2003 . quant-ph/0304064 .
  12. Kawano . Yasuhito . Sekigawa . Hiroshi . Quantum Fourier transform over symmetric groups — improved result . Journal of Symbolic Computation . July 2016 . 75 . 219–243 . 10.1016/j.jsc.2015.11.016 .
  13. Book: 10.1145/258533.258548 . Quantum computation of Fourier transforms over symmetric groups . Proceedings of the twenty-ninth annual ACM symposium on Theory of computing - STOC '97 . 1997 . Beals . Robert . 48–53 . 0-89791-888-6 .
  14. de Beaudrap . Niel . Cleve . Richard . Waltrous . John . Sharp Quantum versus Classical Query Complexity Separations . Algorithmica . 8 November 2002 . 34 . 4 . 449–461 . 10.1007/s00453-002-0978-1 .