Quantum Fourier Operators and Their Application

*Eric Sakk*

## **Abstract**

The application of the quantum Fourier transform (QFT) within the field of quantum computation has been manifold. Shor's algorithm, phase estimation and computing discrete logarithms are but a few classic examples of its use. These initial blueprints for quantum algorithms have sparked a cascade of tantalizing solutions to problems considered to be intractable on a classical computer. Therefore, two main threads of research have unfolded. First, novel applications and algorithms involving the QFT are continually being developed. Second, improvements in the algorithmic complexity of the QFT are also a sought after commodity. In this work, we review the structure of the QFT and its implementation. In order to put these concepts in their proper perspective, we provide a brief overview of quantum computation. Finally, we provide a permutation structure for putting the QFT within the context of universal computation.

**Keywords:** quantum Fourier transform, quantum computation, quantum circuit, entanglement, unitary operators, permutation operators

### **1. Introduction**

The quantum Fourier transform (QFT) has been applied in a number of different contexts within the field of quantum computation [1–3]. As this operator is central to so many quantum algorithms, a major thrust of current research is directed toward its efficient implementation [4–9]. The QFT calculation is, to a degree, based upon the discrete Fourier transform (DFT) where, given a discrete sequence

$$\mathbf{x} = \{\mathbf{x}\_0, \mathbf{x}\_2, \dots, \mathbf{x}\_{N-1}\} \tag{1}$$

of length *N*, the DFT of *x* can be computed as

$$DFT\{\mathbf{x}\} = \mathbf{F}\mathbf{x} \tag{2}$$

with DFT matrix elements

$$F\_{jk} = \frac{1}{\sqrt{N}} e^{j\frac{2\pi jk}{N}} \quad j, k = 0, 1, \cdots, N - 1 \tag{3}$$

Since the DFT matrix is *N* � *N*, the computational complexity of computing *DFT x*f g is <sup>O</sup> *<sup>N</sup>*<sup>2</sup> � �. If the input sequence length of the input sequence *<sup>x</sup>* can be written as *<sup>N</sup>* <sup>¼</sup> <sup>2</sup>*<sup>n</sup>* (i.e. a power of two for some positive integer, *<sup>n</sup>*), there exist fast Fourier transform (FFT) implementations that can compute *DFT x*f g with Oð Þ *N* log *N* complexity. While there are other FFT implementations that do not require *<sup>N</sup>* <sup>¼</sup> <sup>2</sup>*n*, the 'radix-2' implementation will be the starting point as it is relevant when introducing quantum computational bases. Before elevating the DFT to its quantum description, in Section 2 we will take a brief tour of quantum computation in order to provide some necessary context. We will then, in Section 3, develop the QFT operator and discuss its quantum implementation. Finally, in Section 4, we will discuss the QFT in the context of universal computation and its formulation in terms of permutation matrices.

### **2. Quantum computation**

A starting point for quantum computation begins with choosing a qubit representation for the computational basis [3]

$$|\mathbf{0}\rangle \equiv \begin{pmatrix} \mathbf{1} \\ \mathbf{0} \end{pmatrix}, |\mathbf{1}\rangle \equiv \begin{pmatrix} \mathbf{0} \\ \mathbf{1} \end{pmatrix} \tag{4}$$

reversible. This requirement, in turn, constrains computations that are implemented by quantum operators to be *reversible*. Therefore, logical

*<sup>I</sup>* <sup>¼</sup> 1 0

*Quantum Fourier Operators and Their Application DOI: http://dx.doi.org/10.5772/intechopen.94902*

*<sup>X</sup>* <sup>¼</sup> 0 1

*<sup>X</sup>*∣0i ¼ 0 1

**2.2 Tensor product (Kronecker product)**

0 1 � �, *<sup>H</sup>* <sup>¼</sup> <sup>1</sup>

operators:

defined to be

**15**

for matrices *A*, *B*,*C*, *D*.

using Eq. (2), the basis becomes

operations such as AND, OR, and XOR (exclusive-or) would not be a quantum mechanical possibility unless some additional input information were to be preserved. This is because, in the absence of information about the input, measuring the output of these operations is not enough to ascertain the values of the inputs. Hence, these boolean processes, by themselves, are not reversible. However, there is a theory of reversible computation that can augment these logical operations so that input information is recoverable. Furthermore, much thought has gone into phrasing reversible computation in the context of unitary operators. Given the discussion so far, it is appropriate to give a short list of standard single qubit

> ffiffi 2 p

1 0 � �, *<sup>Y</sup>* <sup>¼</sup> <sup>0</sup> �*<sup>i</sup>*

apply such operators, consider the action of *X* on the basis vector ∣0i

powerful quantum algorithms (e.g. QFT computation) [3, 10].

Furthermore, assuming the dimensions are compatible for matrix

The computational basis can be extended to any number of qubits using the tensor product. For example, if two qubits are required for the computational space,

*A* ⊗ *B* ¼

multiplication, the following identity often proves useful

1 0 � �∣0i ¼ 0 1

*i* 0

The reader can check that these are all unitary. As a simple example of how to

where ∣0i and ∣1i are 'swapped', indicating a form of logical inversion. *H* is a Hadamard transform (i.e. a DFT for a sequence of length N=2). *X*, *Y* and *Z* are Pauli matrices. *R<sup>ϕ</sup>* is a generalization of *Z* ¼ *R<sup>π</sup>* and *I* ¼ *R*0. While these are single quhit operators, the next sections discuss how they can be extended to the multiple qubit case. Amazingly, this set of quantum operators can be applied to devise some very

The Kronecker product of an *m* � *n* matrix *A* with a *p* � *q* matrix *B* is

1 0 � � <sup>1</sup>

*a*11*B a*12*B* ⋯ *a*1*nB a*21*B a*22*B* ⋯ *a*2*nB* ⋮ ⋮⋮⋮

*am*1*B am*2*B* ⋯ *amnB*

ð Þ *A* ⊗ *B* ð Þ¼ *C* ⊗ *D* ð Þ *AC* ⊗ ð Þ *BD* (12)

� �, *<sup>R</sup><sup>ϕ</sup>* <sup>¼</sup> 1 0

� �, *<sup>Z</sup>* <sup>¼</sup> 1 0

0 � � 0 *e<sup>i</sup><sup>ϕ</sup>*

0 �1

<sup>¼</sup> <sup>0</sup> 1 � �

� � (8)

� � (9)

¼ ∣1i (10)

*:* (11)

This qubit basis forms a complete orthonormal set so that any single qubit quantum mechanical state can be written as the linear superposition

$$|\psi\rangle = a|0\rangle + \beta|1\rangle. \tag{5}$$

where the coefficients *α* and *β* are complex scalars. If h*ψ*∣ represents the Hermitian conjugate of ∣*ψ*i, according to quantum mechanics, the inner product

$$
\langle \psi | \psi \rangle = \left| a \right|^2 + \left| \beta \right|^2 = \mathbf{1} \tag{6}
$$

is normalized so that *ψ* represents a probability density function. This implies that, at any given instance in its time evolution, a quantum system can simultaneously be in the logical states <sup>∣</sup>0<sup>i</sup> and <sup>∣</sup>1<sup>i</sup> with their associated probabilities j j *<sup>α</sup>* <sup>2</sup> and j j *β* 2 . This is in stark contrast to classical digital computation whose operations must always exclusively evaluate to a value of either 0 or 1. Quantum computation allows an algorithm to simultaneously visit *both* logical states ∣0i and ∣1i of a single qubit. If *n* qubits (i.e. multiple qubits) are applied, then a quantum system, in principal, has the potential to simultaneously visit 2*<sup>n</sup>* logical states (again, with their associated probabilities). This exponential computational capacity is the source of quantum parallelism. However, there is a catch. Only when some observable is measured can we ascertain the current logical state of the system. Hence, quantum computers require large samples of measurements in order to build up the statistics necessary to determine the outcome of any given algorithm.

### **2.1 Unitary operators**

The time evolution operator *U* associated with a quantum system must be unitary meaning that

$$U^{\dagger}U = I \tag{7}$$

where *U*† is the conjugate transpose of *U*. A major implication of this requirement is that the forward time system evolution must (at least mathematically) be *Quantum Fourier Operators and Their Application DOI: http://dx.doi.org/10.5772/intechopen.94902*

Fourier transform (FFT) implementations that can compute *DFT x*f g with Oð Þ *N* log *N* complexity. While there are other FFT implementations that do not require *<sup>N</sup>* <sup>¼</sup> <sup>2</sup>*n*, the 'radix-2' implementation will be the starting point as it is relevant when introducing quantum computational bases. Before elevating the DFT to its quantum description, in Section 2 we will take a brief tour of quantum computation in order to provide some necessary context. We will then, in Section 3, develop the QFT operator and discuss its quantum implementation. Finally, in Section 4, we will discuss the QFT in the context of universal computation and its

*Real Perspective of Fourier Transforms and Current Developments in Superconductivity*

A starting point for quantum computation begins with choosing a qubit

0 

This qubit basis forms a complete orthonormal set so that any single qubit

where the coefficients *α* and *β* are complex scalars. If h*ψ*∣ represents the Hermitian conjugate of ∣*ψ*i, according to quantum mechanics, the inner product

is normalized so that *ψ* represents a probability density function. This implies that, at any given instance in its time evolution, a quantum system can simultaneously be in the logical states <sup>∣</sup>0<sup>i</sup> and <sup>∣</sup>1<sup>i</sup> with their associated probabilities j j *<sup>α</sup>* <sup>2</sup> and

. This is in stark contrast to classical digital computation whose operations must always exclusively evaluate to a value of either 0 or 1. Quantum computation allows an algorithm to simultaneously visit *both* logical states ∣0i and ∣1i of a single qubit. If *n* qubits (i.e. multiple qubits) are applied, then a quantum system, in principal, has the potential to simultaneously visit 2*<sup>n</sup>* logical states (again, with their associated probabilities). This exponential computational capacity is the source of quantum parallelism. However, there is a catch. Only when some observable is measured can we ascertain the current logical state of the system. Hence, quantum computers require large samples of measurements in order to build up the statistics necessary

The time evolution operator *U* associated with a quantum system must be

*U*†

where *U*† is the conjugate transpose of *U*. A major implication of this requirement is that the forward time system evolution must (at least mathematically) be

, <sup>∣</sup>1i � <sup>0</sup>

1 

∣*ψ*i ¼ *α*∣0i þ *β*∣1i*:* (5)

h i *<sup>ψ</sup>*j*<sup>ψ</sup>* <sup>¼</sup> j j *<sup>α</sup>* <sup>2</sup> <sup>þ</sup> j j *<sup>β</sup>* <sup>2</sup> <sup>¼</sup> <sup>1</sup> (6)

*U* ¼ *I* (7)

(4)

<sup>∣</sup>0i � <sup>1</sup>

quantum mechanical state can be written as the linear superposition

formulation in terms of permutation matrices.

representation for the computational basis [3]

to determine the outcome of any given algorithm.

**2.1 Unitary operators**

unitary meaning that

**2. Quantum computation**

j j *β* 2

**14**

reversible. This requirement, in turn, constrains computations that are implemented by quantum operators to be *reversible*. Therefore, logical operations such as AND, OR, and XOR (exclusive-or) would not be a quantum mechanical possibility unless some additional input information were to be preserved. This is because, in the absence of information about the input, measuring the output of these operations is not enough to ascertain the values of the inputs. Hence, these boolean processes, by themselves, are not reversible. However, there is a theory of reversible computation that can augment these logical operations so that input information is recoverable. Furthermore, much thought has gone into phrasing reversible computation in the context of unitary operators. Given the discussion so far, it is appropriate to give a short list of standard single qubit operators:

$$I = \begin{bmatrix} \mathbf{1} & \mathbf{0} \\ \mathbf{0} & \mathbf{1} \end{bmatrix}, H = \frac{\mathbf{1}}{\sqrt{2}} \begin{bmatrix} \mathbf{1} & \mathbf{1} \\ \mathbf{1} & -\mathbf{1} \end{bmatrix}, R\_{\phi} = \begin{bmatrix} \mathbf{1} & \mathbf{0} \\ \mathbf{0} & e^{i\phi} \end{bmatrix} \tag{8}$$

$$X = \begin{bmatrix} \mathbf{0} & \mathbf{1} \\ \mathbf{1} & \mathbf{0} \end{bmatrix}, Y = \begin{bmatrix} \mathbf{0} & -i \\ i & \mathbf{0} \end{bmatrix}, Z = \begin{bmatrix} \mathbf{1} & \mathbf{0} \\ \mathbf{0} & -\mathbf{1} \end{bmatrix} \tag{9}$$

The reader can check that these are all unitary. As a simple example of how to apply such operators, consider the action of *X* on the basis vector ∣0i

$$X|\mathbf{0}\rangle = \begin{bmatrix} \mathbf{0} & \mathbf{1} \\ \mathbf{1} & \mathbf{0} \end{bmatrix} |\mathbf{0}\rangle = \begin{bmatrix} \mathbf{0} & \mathbf{1} \\ \mathbf{1} & \mathbf{0} \end{bmatrix} \begin{bmatrix} \mathbf{1} \\ \mathbf{0} \end{bmatrix} = \begin{bmatrix} \mathbf{0} \\ \mathbf{1} \end{bmatrix} = |\mathbf{1}\rangle \tag{10}$$

where ∣0i and ∣1i are 'swapped', indicating a form of logical inversion. *H* is a Hadamard transform (i.e. a DFT for a sequence of length N=2). *X*, *Y* and *Z* are Pauli matrices. *R<sup>ϕ</sup>* is a generalization of *Z* ¼ *R<sup>π</sup>* and *I* ¼ *R*0. While these are single quhit operators, the next sections discuss how they can be extended to the multiple qubit case. Amazingly, this set of quantum operators can be applied to devise some very powerful quantum algorithms (e.g. QFT computation) [3, 10].

### **2.2 Tensor product (Kronecker product)**

The Kronecker product of an *m* � *n* matrix *A* with a *p* � *q* matrix *B* is defined to be

$$A \otimes B = \begin{bmatrix} a\_{11}B & a\_{12}B & \cdots & a\_{1n}B \\\\ a\_{21}B & a\_{22}B & \cdots & a\_{2n}B \\\\ \vdots & \vdots & \vdots & \vdots \\\\ a\_{m1}B & a\_{m2}B & \cdots & a\_{mn}B \end{bmatrix} \cdot \tag{11}$$

Furthermore, assuming the dimensions are compatible for matrix multiplication, the following identity often proves useful

$$(A \otimes B)(C \otimes D) = (AC) \otimes (BD) \tag{12}$$

for matrices *A*, *B*,*C*, *D*.

The computational basis can be extended to any number of qubits using the tensor product. For example, if two qubits are required for the computational space, using Eq. (2), the basis becomes

$$|0\rangle \equiv |00\rangle = |0\rangle \otimes |0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix}$$

$$|1\rangle \equiv |01\rangle = |0\rangle \otimes |1\rangle = \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 0 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix}$$

$$|2\rangle \equiv |10\rangle = |1\rangle \otimes |0\rangle = \begin{pmatrix} 0 \\ 1 \\ 1 \end{pmatrix} \otimes \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \end{pmatrix}$$

$$|3\rangle \equiv |11\rangle = |1\rangle \otimes |1\rangle = \begin{pmatrix} 0 \\ 1 \\ 1 \end{pmatrix} \otimes \begin{pmatrix} 0 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 1 \end{pmatrix}$$

**2.3 Quantum circuits**

on single qubits as

**Figure 1**.

operator

**Figure 1.**

**17**

and the result is desired to be combined as

*Quantum Fourier Operators and Their Application DOI: http://dx.doi.org/10.5772/intechopen.94902*

Eq. (12) tells us that this action is equivalent to

However, by construction, ∣*q*1i ⊗ ∣*q*0i ¼ ∣*q*1*q*0i. Therefore,

*CNOT* ¼

control bit ∣*q*1i is preserved from input to output.

*Two qubit quantum circuit for H*ð Þ ⊗ *Z* ∣*q*1*q*0i*.*

making it straightforward to develop multiple qubit quantum systems from unitary operators. The schematic representation of ð Þ *H* ⊗ *Z* ∣*q*1*q*0i is show in

where *c* represents the control bit, *t* represents the target XOR function and ∣*q*1*q*0i ¼ ∣*ct*i. This operator is a permutation matrix that is consistent with **Table 1** in that it swaps the ∣11i and ∣10i qubits. The XOR operation, by itself, can act as an irreversible controlled NOT operation. For the sake of quantum computation, the CNOT operator is unitary and a reversible XOR function is achieved because the

There exist powerful tools for the simulation of quantum operations (referred to as '*quantum gates*') and for the rendering of multiple qubit quantum circuits [11].

With the groundwork laid for multiple qubits, it becomes possible to introduce more unitary operators that facilitate reversible computation. For example, the controlled NOT (CNOT) function can be phrased as a two qubit reversible XOR

One particularly useful application of Eq. (12) arises when building up *n* qubit quantum circuits (i.e. schematic depictions of quantum operations on qubits). For instance, assume a two qubit system ∣*q*1*q*0i where two unitary operators *H* and *Z* act

*H*∣*q*1i, *Z*∣*q*0i (17)

*H*∣*q*1i ⊗ *Z*∣*q*0i*:* (18)

ð Þj *<sup>H</sup>* <sup>⊗</sup> *<sup>Z</sup> <sup>q</sup>*1<sup>i</sup> <sup>⊗</sup> <sup>j</sup>*q*0<sup>i</sup> � �*:* (19)

*H*∣*q*1i ⊗ *Z*∣*q*0i ¼ ð Þ *H* ⊗ *Z* ∣*q*1*q*0i (20)

5*:* (21)

To generalize this example for *n* qubits, the set of computational basis vectors can, for the sake of brevity, be labeled in base 10 as

$$\{ |\mathbf{0}\rangle, |\mathbf{1}\rangle, |\mathbf{2}\rangle, \dots, |\mathbf{2}^n - \mathbf{1}\rangle \}. \tag{14}$$

On the other hand, in order to highlight the qubit values, this basis can equivalently be expressed in base 2 as

$$|k\_1 k\_2 \cdots k\_n\rangle = |k\_1\rangle \otimes |k\_2\rangle \otimes |\cdots \otimes |k\_n\rangle \tag{15}$$

where *ki* ∈f g 0, 1 for *i* ¼ 1, ⋯, *n*. In other words, f g *k*1, *k*2, ⋯, *kn* represents the binary expansion

$$k = k\_1 \mathfrak{L}^{n-1} + k\_2 \mathfrak{L}^{n-2} + \dots + k\_{n-1} \mathfrak{L}^1 + k\_n \mathfrak{L}^0 = \sum\_{t=1}^n k\_t \mathfrak{L}^{n-t} \tag{16}$$

for the *<sup>k</sup>th* basis vector <sup>∣</sup>*k*i � <sup>∣</sup>*k*1*k*2⋯*kn*i. We have chosen this bit index ordering as it will prove convenient for the QFT formulation in the next section. An equally acceptable (and, quite typical) bit index convention for an *n* qubit system could, for example, be <sup>∣</sup>*q*i � <sup>∣</sup>*qn*�<sup>1</sup>*qn*�<sup>2</sup>⋯*q*1*q*0i.

Eq. (15) tells us that the *n* qubit basis is derived from the tensor product of single qubits. This is important to keep in mind in order to avoid confusion when using the symbol ∣0i. For example, when using *n* ¼ 1 qubit, ∣0i in decimal is equivalent to ∣0i in binary; however,, when using *n* ¼ 3 qubits, ∣0i in decimal is equivalent to ∣000i in binary. Hence, the number of qubits *n* is the anchor for the relationship between Eq. (14) and Eq. (15). Assuming *n* qubits, there are 2*<sup>n</sup>* basis vectors that can be used to construct a quantum state. Hence, all 2*<sup>n</sup>* basis vectors will simultaneously evolve with their associated probabilities; again, this is the source of quantum parallelism.
