Quantum Fourier transform in computational basis


The quantum Fourier transform, with exponential speed-up compared to the classical fast Fourier transform, has played an important role in quantum computation as a vital part of many quantum algorithms (most prominently, Shor’s factoring algorithm). However, situations arise where it is not sufficient to encode the Fourier coefficients within the quantum amplitudes, for example in the implementation of control operations that depend on Fourier coefficients. In this paper, we detail a new quantum scheme to encode Fourier coefficients in the computational basis, with fidelity \(1 - \delta \) and digit accuracy \(\epsilon \) for each Fourier coefficient. Its time complexity depends polynomially on \(\log (N)\), where N is the problem size, and linearly on \(1/\delta \) and \(1/\epsilon \). We also discuss an application of potential practical importance, namely the simulation of circulant Hamiltonians.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2
Fig. 3
Fig. 4


  1. 1.

    \(\left| y_k - {\tilde{y}}_k \right| < \epsilon \), where \({\tilde{y}}_k\) is the truncated value of \(y_k\) with accuracy \(\epsilon = 2^{-p_0}\).

  2. 2.

    \(\left| \left\langle {\Psi ^{\text {final}}}\right| \left( \frac{1}{\sqrt{N}} \sum _{k=0}^{N-1} \left| {k}\right\rangle \left| {{\tilde{y}}_k}\right\rangle \right) \right| \ge 1 - \delta \), where \(\left| {\Psi ^{\text {final}}}\right\rangle \) is the state obtained through the QFTC algorithm.

  3. 3.

    \(\Vert \hbox {e}^{-iCt} - \widetilde{\hbox {e}^{-iCt}}\Vert \le \delta \), where \(\widetilde{\hbox {e}^{-iCt}}\) represents the operator that is actually performed by this algorithm.


  1. 1.

    Shor, P.: Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM J. Comput. 26, 1484 (1997)

    MathSciNet  Article  MATH  Google Scholar 

  2. 2.

    Deutsch, D.: Quantum theory, the Church-Turing principle and the universal quantum computer. Proc. R. Soc. Lond. A Math. Phys. Eng. Sci. 400, 97 (1985). doi:10.1098/rspa.1985.0070

    ADS  MathSciNet  Article  MATH  Google Scholar 

  3. 3.

    Bergland, G.: A guided tour of the fast Fourier transform. IEEE Spectr. 6, 41 (1969)

    ADS  Article  Google Scholar 

  4. 4.

    Cleve, R., Watrous, J.: Fast parallel circuits for the quantum Fourier transform. In: 41st Annual Symposium on Foundations of Computer Science Proceedings, pp. 526–536 (2000)

  5. 5.

    Kitaev, A.Y.: Quantum measurements and the Abelian stabilizer problem. arXiv:quant-ph/9511026 (1995)

  6. 6.

    Brassard, G., Høyer, P., Tapp, A.: Quantum counting. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) Automata, languages and programming No. 1443 in Lecture Notes in Computer Science, pp. 820–831. Springer, Berlin (1998)

    Google Scholar 

  7. 7.

    Brassard, G., Hoyer, P., Mosca, M., Tapp, A.: Quantum amplitude amplification and estimation. Contemp. Math. 305, 53–74 (2002)

    MathSciNet  Article  MATH  Google Scholar 

  8. 8.

    Benenti, G., Strini, G.: Quantum simulation of the single-particle Schrödinger equation. Am. J. Phys. 76, 657 (2008)

    ADS  Article  Google Scholar 

  9. 9.

    Kassal, I., Jordan, S.P., Love, P.J., Mohseni, M., Aspuru-Guzik, A.: Polynomial-time quantum algorithm for the simulation of chemical dynamics. Proc. Natl. Acad. Sci. 105(48), 18681 (2008)

    ADS  Article  Google Scholar 

  10. 10.

    Szkopek, T., Roychowdhury, V., Yablonovitch, E., Abrams, D.S.: Eigenvalue estimation of differential operators with a quantum algorithm. Phys. Rev. A 72, 062318 (2005)

    ADS  Article  Google Scholar 

  11. 11.

    Hales, L., Hallgren, S.: An improved quantum Fourier transform algorithm and applications. In: 41st Annual Symposium on Foundations of Computer Science Proceedings, pp. 515–525 (2000)

  12. 12.

    Schützhold, R.: Pattern recognition on a quantum computer. Phys. Rev. A 67, 062311 (2003)

    ADS  MathSciNet  Article  Google Scholar 

  13. 13.

    van Dam, W., Hallgren, S., Ip, L.: Quantum algorithms for some hidden shift problems. SIAM J. Comput. 36, 763 (2006)

    MathSciNet  Article  MATH  Google Scholar 

  14. 14.

    Jordan, S.P.: Fast quantum algorithm for numerical gradient estimation. Phys. Rev. Lett. 95, 050501 (2005)

    ADS  Article  Google Scholar 

  15. 15.

    Qiang, X., Loke, T., Montanaro, A., Aungskunsiri, K., Zhou, X., O’Brien, J.L., Wang, J.B., Matthews, J.C.F.: Efficient quantum walk on a quantum processor. arXiv:1510.08657 [quant-ph] (2015)

  16. 16.

    Harrow, A.W., Hassidim, A., Lloyd, S.: Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103, 150502 (2009)

    ADS  MathSciNet  Article  Google Scholar 

  17. 17.

    Lloyd, S., Mohseni, M., Rebentrost, P.: Quantum algorithms for supervised and unsupervised machine learning. arXiv:1307.0411 (2013)

  18. 18.

    Rebentrost, P., Mohseni, M., Lloyd, S.: Quantum support vector machine for big data classification. Phys. Rev. Lett. 113(13), 130503 (2014)

    ADS  Article  Google Scholar 

  19. 19.

    Giovannetti, V., Lloyd, S., Maccone, L.: Architectures for a quantum random access memory. Phys. Rev. A 78(5), 052310 (2008)

    ADS  Article  MATH  Google Scholar 

  20. 20.

    Grover, L., Rudolph, T.: Creating superpositions that correspond to efficiently integrable probability distributions. arXiv:quant-ph/0208112 (2002)

  21. 21.

    Kaye, P., Mosca, M.: Quantum networks for generating arbitrary quantum states. arXiv:quant-ph/0407102 (2004)

  22. 22.

    Soklakov, A.N., Schack, R.: Efficient state preparation for a register of quantum bits. Phys. Rev. A 73, 012307 (2006)

    ADS  Article  Google Scholar 

  23. 23.

    Buhrman, H., Cleve, R., Watrous, J., de Wolf, R.: Quantum fingerprinting. Phys. Rev. Lett. 87, 167902 (2001)

    ADS  Article  Google Scholar 

  24. 24.

    Nielsen, M.A., Chuang, I.L.: Quantum computation and quantum information. Cambridge University Press, Cambridge (2010)

    Google Scholar 

  25. 25.

    Ramos, G.U.: Roundoff error analysis of the fast Fourier transform. Math. Comput. 25(116), 757–768 (1971)

    MathSciNet  Article  Google Scholar 

  26. 26.

    Tasche, M., Zeuner, H.: Worst and average case roundoff error analysis for FFT. BIT Numer. Math. 41(3), 563–581 (2001)

    MathSciNet  Article  MATH  Google Scholar 

  27. 27.

    Bell, R.: Introductory Fourier transform spectroscopy. Elsevier, Amsterdam (2012)

    Google Scholar 

  28. 28.

    Delanty, M., Steel, M.: Discretely-observable continuous time quantum walks on Moöbius strips and other exotic structures in 3D integrated photonics. Phys. Rev. A 86, 043821 (2012)

    ADS  Article  Google Scholar 

  29. 29.

    Yoneda, T., Sung, Y.M., Lim, J.M., Kim, D., Osuka, A.: PdII complexes of [44]- and [46] Decaphyrins: the largest Hückel aromatic and antiaromatic, and Möbius aromatic macrocycles. Angew. Chem. Int. Ed. Engl. 53, 13169 (2014)

    Article  Google Scholar 

  30. 30.

    Olson, B.J., Shaw, S.W., Shi, C., Pierre, C., Parker, R.G.: Circulant matrices and their application to vibration analysis. Appl. Mech. Rev. 66, 040803 (2014)

    ADS  Article  Google Scholar 

  31. 31.

    Cheng, B., Fan, J., Jia, X., Jia, J.: Parallel construction of independent spanning trees and an application in diagnosis on mobius cubes. J. Supercomput. 65, 1279 (2013)

    Article  Google Scholar 

  32. 32.

    Golub, G.H., Van Loan, C.F.: Matrix computations, vol. 3. JHU Press, Baltimore (2012)

    Google Scholar 

  33. 33.

    Mülken, O., Blumen, A.: Continuous-time quantum walks: models for coherent transport on complex networks. Phys. Rep. 502, 37 (2011)

    ADS  MathSciNet  Article  Google Scholar 

  34. 34.

    Childs, A.M.: Quantum information processing in continuous time. Ph.D. thesis, Massachusetts Institute of Technology (2004)

  35. 35.

    Childs, A.M., Kothari, R.: Limitations on the simulation of non-sparse hamiltonians. arXiv preprint arXiv:0908.4398 (2009)

  36. 36.

    Cuccaro, S.A., Draper, T.G., Kutin, S.A., Moulton, D.P.: A new quantum ripple-carry addition circuit. arXiv:quant-ph/0410184 (2004)

  37. 37.

    Draper, T.G., Kutin, S.A., Rains, E.M., Svore, K.M.: A logarithmic-depth quantum carry-lookahead adder. Quantum Info. Comput. 6, 351–369 (2006)

    MathSciNet  MATH  Google Scholar 

  38. 38.

    Álvarez-Sánchez, J.J., Álvarez-Bravo, J.V., Nieto, L.M.: A quantum architecture for multiplying signed integers. J. Phys. Conf. Ser. 128, 012013 (2008)

    Article  Google Scholar 

  39. 39.

    Vedral, V., Barenco, A., Ekert, A.: Quantum networks for elementary arithmetic operations. Phys. Rev. A 54, 147 (1996)

    ADS  MathSciNet  Article  Google Scholar 

  40. 40.

    Draper, T.G.: Addition on a quantum computer. arXiv:quant-ph/0008033 (2000)

  41. 41.

    Ruiz-Perez, L., Garcia-Escartin, J.C.: Quantum arithmetic with the quantum Fourier transform. arXiv:1411.5949 [quant-ph] (2014)

  42. 42.

    Maynard, C.M., Pius, E.: A quantum multiply-accumulator. Quantum Inf. Process. 13(5), 1127 (2013). doi:10.1007/s11128-013-0715-5

    ADS  MathSciNet  Article  MATH  Google Scholar 

  43. 43.

    Maynard, C.M., Pius, E.: Integer arithmetic with hybrid quantum-classical circuits. arXiv:1304.4069 (2013)

  44. 44.

    Pavlidis, A., Gizopoulos, D.: Fast quantum modular exponentiation architecture for Shor’s factoring algorithm. Quantum Info. Comput. 14(7&8), 649–682 (2014)

    MathSciNet  Google Scholar 

  45. 45.

    Kline, M.: Calculus: an intuitive and physical approach. Courier Corporation, North Chelmsford (1998)

    Google Scholar 

Download references


The authors would like to thank Ashley Montanaro for constructive comments and Jeremy O’Brien, Jonathan Matthews, Xiaogang Qiang, Lyle Noakes, Chuheng Zhang and Hanwen Zha for helpful discussions.

Author information



Corresponding author

Correspondence to J. B. Wang.


Appendix 1: Quantum arithmetic

Addition and multiplication are basic elements of arithmetic in classical computer. There have been several proposals on how to build quantum adders and multipliers [36,37,38,39], constructed predominately using CNOT gates and Toffoli gates. Draper’s addition quantum circuits, however, utilize the quantum Fourier transformation (QFT) [40]. QFT-based multiplication and related quantum arithmetic have also been proposed [41,42,43,44]. In this appendix, for completeness, we outline the construction of the quantum arithmetic gates required for the QFTC algorithm in detail.

We show here, using QFT-based circuits and fixed-point number representation, all elementary quantum arithmetic gates used to construct the QFTC circuit (including adders, multipliers and cosine gates) have \({\mathcal {O}}(\mathrm {poly}(n))\) complexity, where n is the number of qubits (number of digits) representing the number. With accuracy \(\epsilon \), this results in \({\mathcal {O}}(\mathrm {polylog}(1/\epsilon ))\) complexity.

QFT multiply–adder

We begin by describing a quantum multiply–adder for real inputs a and b between 0 and 1. Let \(\left| {a}\right\rangle = \left| {a_1}\right\rangle \left| {a_2}\right\rangle \cdots \left| {a_m}\right\rangle \) represent the fixed-point number \(a = 0.a_1 a_2 \cdots a_m\) (same for b). Using this representation, the quantum multiply–adder (QMA), as shown in Fig. 5a, can realize the following transformation,

$$\begin{aligned} \Pi ^\pm _{m,n}\left| {a}\right\rangle \left| {b}\right\rangle \left| {c}\right\rangle = \left| {a}\right\rangle \left| {b}\right\rangle \left| {c \pm a\times b}\right\rangle , \end{aligned}$$

where m and n denote the number of digits of a and b, respectively.

In quantum multiply–adders, the outputs, unlike the inputs, can be negative and we use the complemental code \(c^{(C)} = c_0.c_1 c_2 \cdots c_{m+n} \in [0,2)\) to represent the output \(c \in (-1,1)\) and \(c = c^{(C)}\) if c is non-negative and \(c = c^{(C)}-2\) if c is negative. \(\left| {c}\right\rangle \) is composed of \(\left| {c_0}\right\rangle \left| {c_1}\right\rangle \cdots \left| {c_{m+n}}\right\rangle \). Note that this quantum multiply–adder also applies to any fixed-point-represented numbers by cleverly choosing the appropriate positions of the fractional points.

Fig. 5

Quantum circuit of the multiply–adder, a quantum multiply–adder, b intermediate multiply–adder

The quantum multiply–adder can be decomposed into the following form, as shown in Fig. 5b:

$$\begin{aligned} \Pi ^\pm _{m,n} = ({\mathbb {I}}\otimes {\mathbb {I}}\otimes \mathrm {QFT}^\dagger )\times \mathfrak {\pi }^\pm _{m,n} \times ({\mathbb {I}}\otimes {\mathbb {I}}\otimes \mathrm {QFT}), \end{aligned}$$

where \(\mathfrak {\pi }^\pm _{m,n}\) represents an intermediate quantum multiply–adder,

$$\begin{aligned} \pi ^\pm _{m,n}\left| {a}\right\rangle \left| {b}\right\rangle \left| {\phi (c)}\right\rangle =\left| {a}\right\rangle \left| {b}\right\rangle \left| {\phi (c\pm a\times b)}\right\rangle \end{aligned}$$

with \(\left| {\phi (c)}\right\rangle :=\mathrm {QFT}\left| {c}\right\rangle \) and \(\left| {\phi _{k}(c)}\right\rangle = \frac{1}{\sqrt{2}}(\left| {0}\right\rangle +\hbox {e}^{2\pi i c\times 2^{m+n-k}}\left| {1}\right\rangle )\), \(k=1,2,\cdots ,m+n+1\).

Figure 6 shows a detailed quantum circuit construction of \(\mathfrak {\pi }^\pm _{m,n}\), using the QFT adders \(2^{-l} \Sigma ^\pm _{m,n}\), which act as follows:

$$\begin{aligned} \boxed {2^{-l} \Sigma ^\pm _{m,n}}\left| {b}\right\rangle \left| {\phi (c)}\right\rangle = \left| {b}\right\rangle \left| {\phi (c\pm 2^{-l} b)}\right\rangle . \end{aligned}$$

The QFT adders are constructed via controlled phase operations, as shown in Fig. 6c.

Fig. 6

Quantum circuit of \(\mathfrak {\pi }^\pm _{m,n}\), (a), \(\mathfrak {\pi }^\pm _{m,n}\) gate (b), QFT adder, (c) detailed quantum circuit construction of the QFT adder \(2^{-l} \Sigma ^\pm _{m,n}\), \(R^\pm _k = \left| {0}\right\rangle \left\langle {0}\right| +\hbox {e}^{\pm 2\pi i/2^{k}}\left| {1}\right\rangle \left\langle {1}\right| \)

After applying the QFT adder \(2^{-m} \Sigma ^\pm _{m,n}\) (controlled by \(\left| {a_m}\right\rangle \)) in Fig. 6, we obtain

$$\begin{aligned} \left| {\phi (c)}\right\rangle \longrightarrow \left| {\phi (c \pm a_m 2^{-m} b)}\right\rangle . \end{aligned}$$

Proceeding in a similar fashion, it can be seen that the final output state of the intermediate multiply–adder is

$$\begin{aligned} \left| {\phi (c + a_m 2^{-m} b +\cdots + a_1 2^{-1}b)}\right\rangle = \left| {\phi (c \pm a \times b)}\right\rangle . \end{aligned}$$

To illustrate how the circuit works, take for example the evolution of \(\phi _{m+n-l}(c)\) after \(R^\pm _1,\ldots ,R^\pm _n\):

$$\begin{aligned} \left| {0}\right\rangle + \hbox {e}^{2\pi i c \times 2^{l}}\left| {1}\right\rangle \longrightarrow \left| {0}\right\rangle + \hbox {e}^{2\pi i c \times 2^{l} \pm b }\left| {1}\right\rangle . \end{aligned}$$

We then have

$$\begin{aligned} \left| {\phi _{k}(c)}\right\rangle \rightarrow \left| {\phi _{k}(c\pm 2^{-l}b)}\right\rangle . \end{aligned}$$

It is clear from Fig. 6c that the QFT adder uses \({\mathcal {O}}\big ((m+n)n\big )\) one- or two-qubit gates. Hence, the total complexity of the intermediate QFT multiply–adders is \({\mathcal {O}}\big ((m+n)mn\big )\). Thus, with QFT scaling \({\mathcal {O}}\big ((m+n)^2\big )\), the total complexity of the quantum multiply–adder \(\Pi ^\pm _{m,n}\) is \(\max \{{\mathcal {O}}(mn^2),{\mathcal {O}}(nm^2)\}\).

Note that if we choose \(l=0\) in \(2^{-l} \Sigma ^\pm _{m,n}\) and perform a QFT and an inverse QFT before and after the application of the QFT adder in Eq. 36, we have a quantum adder

$$\begin{aligned} \left| {b}\right\rangle \left| {c}\right\rangle \rightarrow \left| {b}\right\rangle \left| {c\pm b}\right\rangle . \end{aligned}$$

We can also add (or subtract) two numbers without having to destroy their original values encoded in the computational basis, i.e.

$$\begin{aligned} \left| {b}\right\rangle \left| {c}\right\rangle \left| {0}\right\rangle \rightarrow \left| {b}\right\rangle \left| {c}\right\rangle \left| {b}\right\rangle \rightarrow \left| {b}\right\rangle \left| {c}\right\rangle \left| {b \pm c}\right\rangle \end{aligned}$$

by using Eq. 40 twice.

Quantum sine and cosine gate

By implementing the Taylor series using the quantum multiply–adder, we are able to build a quantum sine (and cosine) gate. Suppose \(x = 0. x_1 x_2 \cdots x_n\) and \(x \in [0,1)\). We aim to build a sine gate calculating the value of \(\sin \pi x\), performing \(\left| {x}\right\rangle \left| {0^n}\right\rangle \left| {0^m}\right\rangle \rightarrow \left| {x}\right\rangle \left| {\sin \pi x}\right\rangle \left| {\Psi ^{\text {ancilla}}}\right\rangle \).

Fig. 7

Quantum circuits of the sine and cosine gates (\(\left| {0}\right\rangle \) represents a number of qubits in above circuits where the numbers are omitted). Pauli-X gates are used to transform \(\left| {0}\right\rangle \) into \(\left| {x}\right\rangle \), and the subscript for all the quantum multiply–adders in above circuits is \((p',p')\), a sine gate, b cosine gate

We now consider the error in the truncated Taylor series. First, the error introduced by imprecision in the n-digit representation of x is \({\mathcal {O}}(2^{-n})\), since the derivative of \(\sin \pi x\) is bounded. The Taylor series of \(\sin \pi x\) at around \(x=0\) is

$$\begin{aligned} \sin \pi x = \pi x - \frac{(\pi x)^3}{3!} + \frac{(\pi x)^5}{5!} - \cdots + (-1)^{t}\frac{(\pi x)^{2t+1}}{(2t+1)!} + \frac{(-1)^{t+1}\cos \pi z}{(2t+3)!}(\pi x)^{(2t+3)}. \end{aligned}$$

The remainder term for the kth term in the expansion is \(\frac{f^{(k+1)}(z)}{(k+1)!}x^{k+1}\), where \(z\in (0, x)\), according to Taylor’s Theorem [45]. As a result, in Eq. (42), the reminder term (error) is \(\frac{(-1)^{t+1}\cos \pi z}{(2t+3)!}(\pi x)^{(2t+3)}\) and is obviously bounded by \({\mathcal {O}}(2^{-n})\) for \(t=n\).

In the sine gate, the \(t+1\) terms \(\left\{ \pi x,\frac{(\pi x)^3}{3!},\cdots ,(-1)^{t}\frac{(\pi x)^{2t+1}}{(2t+1)!}\right\} \) are first calculated and then added (or subtracted) together. Suppose each of the \(t+1\) terms has an error within \(2^{-p}\). Taking \(p = n + \lceil \log n\rceil = {\mathcal {O}}(n)\), the error introduced by adding and subtracting will be \({\mathcal {O}}(t\times 2^{-p}) = {\mathcal {O}}(2^{-n})\). Suppose all multiply–adders have \(p'\) digits inputs. When errors in \(y_1,y_2\) are within \(2^{-(\ell +1)}\) and \(y_1,y_2\le 1-2^{-(\ell +1)}\), \((y_1+2^{-(\ell +1)})(y_2+2^{-(\ell +1)}) = y_1y_2 + 2^{-\ell }(y_1+y_2)/2 + 2^{-2\ell -2} \le y_1y_2 + 2^{-\ell }.\) It means that by applying the multiply–adders 2t times, the error will be \(2^{2t}\) times larger. Thus, we can choose a \(p'={\mathcal {O}}(p+2t)={\mathcal {O}}(n)\) which guarantees accuracy \(2^{-p}\) in all the powers of x and also all the \(t+1\) terms in the Taylor series.

We conclude that we can choose \(t = {\mathcal {O}}(n)\) and \(p' = {\mathcal {O}}(n)\) so that the total accuracy of the sine gate is bounded by \(2^{-n}\). Figure 7 shows the quantum circuit for the sine and cosine gate. The complexity of the quantum sine gate can be calculated based on the scaling of quantum multiply–adders which equals to \({\mathcal {O}}(p'^3)\). The total complexity of the quantum sine gate is \({\mathcal {O}}(t p'^3) = {\mathcal {O}}(n^4)\) for accuracy \(2^{-n}\). To put it in another way, \({\mathcal {O}}(\text {polylog}(1/\epsilon ))\) one- or two-qubit gates are required to achieve accuracy \(\epsilon \).

Appendix 2: Implementing circulant operators

Fig. 8

Implementation of circulant matrices. Here \(R\left| {k}\right\rangle \left| {j}\right\rangle = \hbox {e}^{2\pi ikj/N}\left| {k}\right\rangle \left| {j}\right\rangle \)

Consider an arbitrary state \(\left| {s}\right\rangle \). We wish to obtain \(C\left| {s}\right\rangle \), where C is an arbitrary circulant matrix. Below, we present a possible algorithm for implementing a circulant matrix quantum operator (see Fig. 8).

Step 1 :

Perform the inverse QFT on \(\left| {s}\right\rangle \):

$$\begin{aligned} \sum _{k=0}^{N-1} s_k \left| {k}\right\rangle \rightarrow \sum _{k=0}^{N-1} {\mathfrak {s}}_k \left| {k}\right\rangle . \end{aligned}$$
Step 2 :

Add another register prepared to \(\sum _{j=0}^{N-1} c_j\left| {j}\right\rangle \) using \(O_x\) (\({{\varvec{x}}}={{\varvec{c}}}\) in Eq. 6):

$$\begin{aligned} \sum _{k=0}^{N-1} {\mathfrak {s}}_k \left| {k}\right\rangle \rightarrow \sum _{j,k=0}^{N-1} {\mathfrak {s}}_k c_j\left| {k}\right\rangle \left| {j}\right\rangle . \end{aligned}$$
Step 3 :

Apply the controlled phase gate so that \(\left| {k}\right\rangle \left| {j}\right\rangle \rightarrow \hbox {e}^{2\pi ikj/N}\left| {k}\right\rangle \left| {j}\right\rangle \):

$$\begin{aligned} \sum _{j,k=0}^{N-1} {\mathfrak {s}}_k c_j\left| {k}\right\rangle \left| {j}\right\rangle \rightarrow \sum _{j,k=0}^{N-1} {\mathfrak {s}}_k c_j \hbox {e}^{2\pi ijk/N}\left| {k}\right\rangle \left| {j}\right\rangle . \end{aligned}$$
Step 4 :

Apply Hadamard gates to \(\left| {j}\right\rangle \):

$$\begin{aligned} \sum _{j,k=0}^{N-1} {\mathfrak {s}}_k c_j \hbox {e}^{2\pi ijk/N}\left| {k}\right\rangle \left| {j}\right\rangle \rightarrow \sum _{j,k=0}^{N-1} {\mathfrak {s}}_k \left| {k}\right\rangle \left( F_k \left| {0^L}\right\rangle + \sqrt{1-F_k^2}\left| {0^\perp }\right\rangle \right) , \end{aligned}$$

where \(\left| {0^\perp }\right\rangle \) represents any states perpendicular to \(\left| {0^L}\right\rangle \).

Step 5 :

By post-selecting the ancillary qubit state \(\left| {0^L}\right\rangle \), the quantum state in the first register collapses to

$$\begin{aligned} \frac{1}{\sqrt{\sum _{k}|F_k {\mathfrak {s}}_k|^2}} \sum _{k=0}^{N-1} F_k {\mathfrak {s}}_k \left| {k}\right\rangle . \end{aligned}$$
Step 6 :

Perform the QFT:

$$\begin{aligned} \text {QFT}\sum _{k=0}^{N-1} {\mathfrak {s}}_k F_k \left| {k}\right\rangle \propto C\left| {s}\right\rangle . \end{aligned}$$

Note that the post-selection probability of obtaining the correct state in Step 5 is

$$\begin{aligned} p = \sum _{k=0}^{N-1} \left| {\mathfrak {s}}_k F_k \right| ^2, \end{aligned}$$

and p equals to 1 / N when C is unitary. Therefore, using amplitude amplification [7], \({\mathcal {O}}((\log N)^2/\sqrt{p})\) one- or two-qubit gates, as well as \({\mathcal {O}}(1/\sqrt{p})\) calls of \(O_x\), \(O_s\) and their inverses, are needed to implement a circulant matrix operation C, where \(O_s \left| {0^L}\right\rangle = \sum _{k=0}^{N-1}s_k\left| {k}\right\rangle \).

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Zhou, S.S., Loke, T., Izaac, J.A. et al. Quantum Fourier transform in computational basis. Quantum Inf Process 16, 82 (2017). https://doi.org/10.1007/s11128-017-1515-0

Download citation


  • Quantum algorithm
  • Quantum Fourier transform
  • Computational basis state
  • Controlled quantum gates