Open access peer-reviewed chapter

# Quantum Fourier Operators and Their Application

Written By

Eric Sakk

Submitted: June 30th, 2020 Reviewed: November 4th, 2020 Published: January 6th, 2021

DOI: 10.5772/intechopen.94902

From the Edited Volume

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

Edited by Juan Manuel Velazquez Arcos

Chapter metrics overview

View Full Metrics

## 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, 2, 3]. As this operator is central to so many quantum algorithms, a major thrust of current research is directed toward its efficient implementation [4, 5, 6, 7, 8, 9]. The QFT calculation is, to a degree, based upon the discrete Fourier transform (DFT) where, given a discrete sequence

x=x0x2xN1E1

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

DFTx=FxE2

with DFT matrix elements

Fjk=1Nei2πNjkj,k=0,1,,N1E3

Since the DFT matrix is N×N, the computational complexity of computing DFTx is ON2. If the input sequence length of the input sequence x can be written as N=2n (i.e. a power of two for some positive integer, n), there exist fast Fourier transform (FFT) implementations that can compute DFTx with ONlogN complexity. While there are other FFT implementations that do not require N=2n, 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]

010,101E4

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

ψ=α0+β1.E5

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

ψψ=α2+β2=1E6

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 0 and 1 with their associated probabilities α2 and β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 0 and 1 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 2n 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

UU=IE7

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 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=1001,H=121111,Rϕ=100eE8
X=0110,Y=0ii0,Z=1001E9

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 0

X0=01100=011010=01=1E10

where 0 and 1 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ϕ is a generalization of Z=Rπ and I=R0. 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

AB=a11Ba12Ba1nBa21Ba22Ba2nBam1Bam2BamnB.E11

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

ABCD=ACBDE12

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

000=00=1010=1000101=01=1001=0100210=10=0110=0010311=11=0101=0001E13

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

0122n1.E14

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

k1k2kn=k1k2knE15

where ki01 for i=1,,n. In other words, k1k2kn represents the binary expansion

k=k12n1+k22n2++kn121+kn20=t=1nkt2ntE16

for the kth basis vector kk1k2kn. 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 qqn1qn2q1q0.

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 0. For example, when using n=1 qubit, 0 in decimal is equivalent to 0 in binary; however,, when using n=3 qubits, 0 in decimal is equivalent to 000 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 2n basis vectors that can be used to construct a quantum state. Hence, all 2n basis vectors will simultaneously evolve with their associated probabilities; again, this is the source of quantum parallelism.

### 2.3 Quantum circuits

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 q1q0 where two unitary operators H and Z act on single qubits as

Hq1,Zq0E17

and the result is desired to be combined as

Hq1Zq0.E18

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

HZq1q0.E19

However, by construction, q1q0=q1q0. Therefore,

Hq1Zq0=HZq1q0E20

making it straightforward to develop multiple qubit quantum systems from unitary operators. The schematic representation of HZq1q0 is show in Figure 1.

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 operator

CNOT=1000010000010010.E21

where c represents the control bit, t represents the target XOR function and q1q0=ct. This operator is a permutation matrix that is consistent with Table 1 in that it swaps the 11 and 10 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 control bit q1 is preserved from input to output.

cintincouttout
0000
0101
1011
1110

### Table 1.

Controlled NOT.

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]. Figure 2 shows a schematic representation of the CNOT circuit corresponding to Table 1. In this circuit, the control bit is used to swap the target q0 (using an X gate) if q1=1.

For the sake of this work, we point out that an equally valid interpretation of the quantum CNOT function can be realized if the roles of the control and target are interchanged where q1q0=tc (see Table 2). In this case the CNOT operator becomes

tincintoutcout
0000
0111
1010
1101

### Table 2.

Controlled NOT where q1q0=tc.

CNOT=1000000100100100.E22

which is a permutation matrix that swaps the 11 and 01 qubits and corresponds to the circuit in Figure 3.

We shall have more to say about this implementation in the following sections. For now, with this brief overview of quantum computation, we can now introduce the quantum Fourier transform.

## 3. The quantum Fourier transform

It should be clear that the DFT matrix in Eq. (2) is unitary where

FF=IE23

and F is the Hermitian conjugate of F. Because of this unitarity, the potential for using the DFT within the context of quantum computation naturally follows. However, such an application requires a decomposition involving tensor products of unitary operations typically applied in quantum computation. As with the FFT, the choice of the decomposition dictates the algorithmic complexity. There is much introductory literature available regarding the QFT [3, 12, 13, 14]. Given a specific quantum algorithm where the QFT is applied, current research endeavors reside in attempts to improve the computational complexity [4, 7, 9, 15, 16].

The QFT matrix is defined as

Q=1Nj=0N1k=0N1ei2πNjkkj.E24

For example, with N=2n and n = 1, we recover the Hadamard matrix

Q=121111,E25

or, for n = 2,

Q=1211111i1i11111i1i.E26

As expected, this operator is unitary where, with

Q=1Nj=0N1k=0N1ei2πNjkjk,E27

it should be clear that

QQ=1Nj=0N1k=0N1ei2πNjkkj1Nj=0N1k=0N1ei2πNjkjk=1Nk=0N1k=0N1j=0N1j=0N1ei2πNjkjkkjjk=1Nk=0N1k=0N1j=0N1j=0N1ei2πNjkjkδjjkk=1Nk=0N1k=0N1j=0N1ei2πNjkkkk=1Nk=0N1k=0N1Nδkkkk=k=0N1kk=I.E28

In general, given a state vector

ψ=j=0N1ajjE29

the QFT operates on ψ to form

Ψ=QFTψ=QFTj=0N1ajj=j=0N1ajQFTj=j=0N1ajQj.E30

Given this result, let us consider the QFT of a single n qubit basis vector j where N=2n. First, observe that while

QFTj=Qj=12n/2j=0N1k=0N1ei2πNjkkjj=12n/2j=0N1k=0N1ei2πNjkkδjj=12n/2k=02n1ei2π2njkk,E31

given Eqs. (15) and (16), it will be more helpful to express this relation as

QFTj=12n/2k1=01k2=01kn=01ei2πjt=1nkt2tk1k2kn.=12n/2k1=01k2=01kn=01ei2πjk121+k222++kn12n1+kn2nk1k2kn.=12n/2k1=01k2=01kn=01ei2πjk121+k222++kn12n1+kn2nk1k2kn.=12n/2v=1nkv=01ei2πjkv2vkv.E32

This leads to the result that

Qj=12n/2v=1n0+ei2πj2v1.E33

### 3.1 QFT qubit representation

To forge a path toward efficient implementation, it is important to recognize how Eq. (33) can be decomposed into a set of operators relevant to quantum computation (see Section 2.1). First, consider the n=1 single qubit case,

Qj=120+ei2πj21.E34

Then, for each qubit state j=0,1, it follows that

Q0=120+1=1211Q1=1201=1211E35

as expected since Q=H for the single qubit case. Hence, it should be nn surprise that the v=1 contribution to Eq. (10) should be a Hadamard gate.

To handle the phase factors in the other contributions to the tensor product (where v2), the keen eye will recognize that the terms ei2πj2v could lead to a unitary quantum mechanical operator. Before leveraging this observation in a QFT algorithm, it will be helpful to consider the qubit representation j=j1j2jn. As the index v ranges from 1 to n, the index j in the term ei2πj2v experiences successive divisions by 2 (i.e. successive right shifts of its binary representation by one bit):

v=1:j21j1j2jn1.jnv=2:j22j1j2jn2.jn1jnv=n1:j2n1j1.j2jn1jnv=n:j2n0.j1j2jn1jnE36

Since these values appear in the phase factor, the integer parts will only result in integer multiples of 2π and can therefore be discarded. Eq. (33) can then be expressed as

QFTj=12n/2[0+ei2πjn2110+ei2πjn121+jn2210+ei2πj121+j222++jn2n1.E37

It is often this version of the QFT that is used as a starting point for quantum circuit implementation when N=2n [3].

As an example, consider the two qubit case where n=2 and j=j1j2, then

Qj=Qj1j2=120+ei2πj22110+ei2πj121+j2221E38

If we let j1j2=01, then

Qj=Q01=120+ei2π12110+ei2π021+1221=12010+i1=1200+i0110i11E39

which corresponds to the column 01 entries in Eq. (26). If not already obvious, it should be emphasized that the tensor product is not commutative and that consistent qubit ordering is instrumental to the success of this calculation.

### 3.2 Quantum implementation

Based upon Eq. (37), it is sensible to introduce an iterable version of the R operator introduced in Section 2.1:

Rv=100ei2π2v.E40

Furthermore, because each qubit contribution contains phase terms involving the binary expansion of j, one approach to addressing these interactions is to introduce a controlled version of Rv:

CRv=I00Rv.E41

This operator can be used to induce the correct phase factor as follows. Assume tc is the target/control structure for single qubits jrjs were s>r in the binary representation of j. Then, the following holds true

CRvjr0=jr0CRvjr1=ei2π2vjrjr1E42

Hence, the control bit determines when to introduce the phase factor involving the target bit.

The goal of this section is to introduce enough nomenclature in order to put the next section of this work in context. The reader is encouraged to visit the provided references in order to fill in the details of a generalized quantum circuit that can implement an n qubit QFT. For now, we provide an n=2 qubit example to illustrate an algorithm for performing the QFT. Whatever principled series of operations is chosen, the goal of the quantum algorithm (and, hence, the associated quantum circuit) is to reproduce Eq. (11). Starting with j=j1j2,

1. Apply H to j1 so that

j1j2Hj1j2=120+ei2πj1211j2E43

2. Apply CR2 to target qubit j1 controlled by j2. This yields

120+ei2πj1211j2120+ei2πj222+j1211j2E44

3. Apply H to j2

120+ei2πj222+j1211j2120+ei2πj222+j1211120+ei2πj2211=120+ei2πj2210+ei2πj211E45

Comparing this result with either Eq. (33) or Eq. (37), it is clear that this algorithm, derived using quantum reversible operators, recovers the QFT from Eq. (38) with one slight difference: the bit ordering is reversed. Given n qubits, it is possible to apply n/2 swaps using, for example, tensor products involving an X operator (see Section 2.1) in order to reverse the bit order. Such bit reversal permutations are reminiscent of the radix-2 FFT algorithm. If one generalizes this algorithm to n qubits, it can be shown that the algorithmic complexity is On2. With N=2n, this is a considerable improvement over NlogN=n2n for the radix-2 FFT. However, algorithmic improvements and variations have been developed that can further reduce QFT complexity to Onlogn [9, 15].

## 4. QFT permutations

Universal computation, by its very nature, must involve some set of permutation operators [17, 18, 19, 20]. As with other universal gates applied in quantum computation, in this section, we show that the QFT can generate operators that have the properties of a permutation. Consider a successive application of the QFT such as Q2=QQ and let us analyze the matrix elements of such an operation:

QQj,k=1Nm=0N1(ei2πNjmjm)(ei2πNmkmk)=1Nm=0N1ei2πNmj+kmmjk=0j+k0modN1j+k=0modNPQ2j,k.E46

For an n qubit system qn1q1q0, it should be clear that PQ2 is a permutation operator that leaves the position of q0 unchanged and inverts the order of the remaining qubits to form q1qn1q0. For example, the CNOT operator in Eq. (22) is equal to PQ2 for n=2

CNOT=Q2=1000000100100100=PQ2E47

having properties similar to that of a Sylvester shift matrix (i.e. a generalization of a Pauli matrix). It is sensible that a CNOT operation followed by a CNOT operation should result in the identity operation and, hence, that PQ2PQ2=Q4=I (i.e. a double inversion recovers the original qubit sequence). These results can be generalized for any n. For example, with n=3, Eq. (46) becomes

PQ2=1000000000000001000000100000010000001000000100000010000001000000E48

which, after the appropriate sequence of swaps, can be transformed into a Toffoli (CCNOT) gate. Hence, PQ2 can be thought of as a generalization of swap permutation operators and the QFT can be phrased as its square root. For example, it is common to define a two qubit swap operator as

Sw=1000001001000001E49

along with its square root

Sw=10000121+i121+i00121+i121+i00001.E50

In a similar manner, Eq. (46) leads us to the following

Theorem 1Given theN×Ninversion permutation matrix defined as

PQ2j,k=0j+k0mod N1j+k=0mod N,E51

it follows that

Q=PQ2E52

where Q is a QFT matrix.

In addition, given that Q4=I we have the following

Corollary 1 Any algorithm that iteratively applies the QFT can result in only one of the following outcomes

1. Qk=PQ2 if k=1mod 4.

2. Qk=PQ2 if k=2mod 4.

3. Qk=Q1 if k=3mod 4.

4. Qk=I if k=0mod 4.

These results indicate a deeper connection between universal computation, permutations and the QFT. Furthermore, decomposing the QFT calculation into a product of permutations indicates a potential for reducing the computational complexity of QFT implementations.

## 5. Conclusions

In this work, we have revisited the quantum Fourier transform which is central to many algorithms applied in the field of quantum computation. As a natural extension of the discrete Fourier transform, the QFT can be implemented using efficient tensor products of quantum operators. Part of the thrust of current research deals with reducing the QFT computational complexity. With this goal in mind, we have phrased the QFT as a permutation operator. Future research will be directed toward quantum circuit implementation using QFT permutation operators within the context of universal computation.

## Acknowledgments

This research is funded by a grant from the National Science Foundation NSF #1560214.

## References

1. 1. Shor, PW.: Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer. SIAM J. Comput., 1997; 26:1484–1509
2. 2. Josza, R.: Quantum Algorithms and the Fourier Transform. Proc. R. Soc. Lond. A, 1998; 454:323–337
3. 3. Nielsen, MA., Chuang, IL.: Quantum Computation and Quantum Information. Cambridge University Press. 2011
4. 4. Barenco, A., Ekert, A., Suominen, KA., Torma, P. : Approximate quantum Fourier transform and decoherence. Phys. Rev. A, 1996; 54
5. 5. Fowler, A., Hollenberg, LCL. : Scalability of Shor’s algorithm with a limited set of rotation gate. Phys. Rev. A, 2004; 70
6. 6. Pavlidis,A., Gizopoulos, D.: Fast Quantum Modular Exponentiation Architecture for Shor’s Factorization Algorithm. Quantum Information and Computation, 2014; 14
7. 7. Prokopenya,AN.: Approximate Quantum Fourier Transform and Quantum Algorithm for Phase Estimation. International Workshop on Computer Algebra in Scientific Computing, 2015; 391–405
8. 8. Ruiz-Perez, L., Garcia-Escartin, JC.: Quantum arithmetic with the quantum Fourier transform. Quantum Inf. Process., 2017; 16
9. 9. Nam, Y., Su, Y., Maslov, D.: Approximate quantum Fourier transform with O(n log(n)) T gates. NPJ Quantum Information, 2020; 6(26)
10. 10. Barenco,A., Bennett,CH., Cleve, R., DiVincenzo,DP., Margolus, N., Shor,P., Sleator,T., Smolin,J.A., Weinfurter, H. : Elementary gates for quantum computation. Phys. Rev. A, 1995; 52
11. 11. Open-Source Quantum Development. https://qiskit.org/ [Accessed: 1 September 2020]
12. 12. Quantum Fourier Transform. https://qiskit.org/textbook/ch-algorithms/quantum-fourier-transform.html [Accessed: 1 September 2020]
13. 13. QC - Quantum Computing Series. https://medium.com/@jonathan_hui/qc-quantum-computing-series-10ddd7977abd [Accessed: 1 September 2020]
14. 14. Camps, D., Van Beeumen, R., Yang, C.: Quantum Fourier Transform Revisited.Numerical Linear Algebra with Applications. 2020
15. 15. Hales,L.,Hallgren,S.: An Improved Quantum Fourier Transform Algorithm and Applications. Proceedings 41st Annual Symposium on Foundations of Computer Science, 12-14 Nov. 2000,Redondo Beach, CA, USA
16. 16. Wang, SP., Sakk, E.: Quantum Algorithms: Overviews, Foundations, and Speedup. ICCSP 2021, Zhuhai, China; January 8-10, 2021
17. 17. DiVincenzo,DP.: Two-bit gates are universal for quantum computation. Phys. Rev. A, 1995. 51:1015–1022
18. 18. Planat,M., Ul Haq,R.: The Magic of Universal Quantum Computing with Permutations. Advances in Mathematical Physics, 2020
19. 19. de Almeida,AAA., Dueck,GW., daSilva,ACR.: CNOT Gate Optimizations via Qubit Permutations. Journal of Low Power Electronics, 2019; 15:182–192
20. 20. Ouyangab,Y.,Shen,Y.,Chen,L.: Faster quantum computation with permutations and resonant couplings. Linear Algebra and its Applications, 2020; 592:270–286

Written By

Eric Sakk

Submitted: June 30th, 2020 Reviewed: November 4th, 2020 Published: January 6th, 2021