# Implementation of the Quantum Fourier Transform

## Abstract

The quantum Fourier transform has been implemented on a three bit nuclear magnetic resonance (NMR) quantum computer, providing a first step towards the realization of Shor’s factoring and other quantum algorithms. Implementation of the QFT is presented with fidelity measures, and state tomography. Experimentally realizing the QFT is a clear demonstration of NMR’s ability to control quantum systems.   
PACS numbers 03.67.-a, 03.67.Lx, 02.70.-c, 89.70.+c   

Quantum computers are devices that process information in a way that preserves quantum coherence. Unlike a classical bit, a quantum bit, or ‘qubit,’ can be in a superposition of $`0`$ and $`1`$ at once. This nonclassical feature of quantum information allows quantum computers to perform some computations faster than classical computers. For example, quantum computers, if constructed, could factor large numbers more rapidly , search data basis more quickly , and simulate quantum systems more efficiently  than is possible using current classical algorithms        .

A key subroutine of algorithms for factoring and simulation    is the quantum Fourier transform (QFT)   . In essence the QFT takes a ‘position’ state $`|x`$ to the corresponding ‘momentum’ state $`|p`$ and is defined as follows:

$$QFT_q|x\frac{1}{\sqrt{q}}\underset{p=0}{\overset{q1}{}}e^{2\pi iap/q}|p.$$
(1)   
Where $`q`$ is the dimension of the systems Hilbert space.

In general the $`QFT_q`$ transforms the input amplitudes as,

$$QFT_q\underset{x}{}f(x)|x\underset{p}{}\stackrel{~}{f}(p)|p.$$
(2)   
Where the coefficients $`\stackrel{~}{f}(p)`$ are

$$\stackrel{~}{f}(p)=\frac{1}{\sqrt{q}}\underset{a}{}e^{2\pi iap/q}f(x).$$
(3)   
For example, the two qubit QFT corresponds to the unitary operator,

$`QFT_4`$ $`=`$ $`{\displaystyle \frac{1}{2}}\left(\begin{array}{cccc}1& 1& 1& 1\\ 1& i& 1& i\\ 1& 1& 1& 1\\ 1& i& 1& i\end{array}\right).`$ (8)   
This operator shows the QFT separating the input states by 0 degrees in the first row and column, and then by 90 degrees, 180 degrees and 270 degrees, multiples of $`\frac{\pi }{2}`$.

Equation (4) shows that the QFT has effects similar to that of the classical Fourier transform. In particular, if $`f(a)`$ is periodic with period $`r`$, then $`\stackrel{~}{f}(c)`$ will exhibit a spike at $`c=r`$. This is the key to Shor’s algorithm which allows a quantum computer to factor very large numbers in polynomial time. The classical Fourier transform reveals the periodicity in functions, the QFT reveals periodicity of wavefunctions.

As formulated by Coppersmith, the QFT can be constructed from two basic unitary operations, $`A_j`$, operating on the jth qubit

$`A_j`$ $`=`$ $`{\displaystyle \frac{1}{\sqrt{2}}}\left(\begin{array}{cc}1& 1\\ 1& 1\end{array}\right)`$ (11)   
and $`B_{jk}`$ operating on the jth and kth qubits

$`B_{jk}`$ $`=`$ $`\left(\begin{array}{cccc}1& 0& 0& 0\\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& e^{i\theta _{jk}}\end{array}\right),`$ (16)   
where $`\theta _{jk}=\pi /2^{kj}`$.

To implement the QFT, these gates,

$$B_{j,j+1}B_{j,j+2}\mathrm{}B_{j,L1}A_j$$
(17)   
are implemented on the lead bit, $`j=L1`$. Repeating the above sequence of gates to all $`L`$ bits as $`j`$ is indexed from $`L1`$ to $`0`$ will complete the QFT. This sequence of quantum logic gates can be realized NMR. The idea of using nuclear spins as the basic unit of a quantum computer was proposed by Lloyd , and detailed schemes for using NMR as a method of quantum computing were proposed by Cory et al  and Gershenfeld and Chuang . In NMR a series of radio frequency pulses are used to control the excess magnetization of an ensemble of quantum states. NMR experiments are easily visualized by picturing the excess magnetization as a vector pointing in some direction and the pulses as rotations about the various axes. In addition, a bilinear coupling term in the Hamiltonian allows for quantum superposition.

The Hamiltonian of a three spin (qubit) NMR sample with $`J`$-coupling is

$`H`$ $`=`$ $`\begin{array}{c}\omega _1I_1^z+\omega _2I_2^z+\omega _3I_3^z+\\ 2\pi (J_{1,2}I_1^zI_2^z+J_{1,3}I_1^zI_3^z+J_{2,3}I_2^zI_3^z)\end{array}`$ (20)   
where $`I_i=\sigma _i/2`$. The three bit QFT was implemented via NMR using the three carbon-13 spins of an alanine sample. The resonant frequency of carbon-13 at 9.4 Tesla is approximately 100.617MHz. The carbonyl was labeled spin 1, $`C_\alpha `$ was labeled spin 2, and $`C_\beta `$ spin 3. The chemical shift of the three alanine carbons are 12587Hz, 0Hz, and -3435Hz respectively. Coupling constants between the three spins are $`J_{12}`$ = 54Hz, $`J_{23}`$ = 35Hz, and $`J_{13}`$ = 1.2Hz. Relaxation time $`T_1`$ for alanine is approximately 1.56s while $`T_2`$ is about 420ms.

The $`A_j`$ matrix described above can be broken up into idempotents $`E_+E_{}+\sigma _x(E_++E_{})`$. The pulse sequence of the $`A_j`$ gate can now be determined using the geometric algebra formalism ,

$$A_j=\left(\frac{\pi }{2}\right)_y^j\left(\pi \right)_x^j.$$
(21)   
This pulse program reads: apply a pulse along the $`y`$-axis that rotates spin $`j`$ 90 degrees, apply a pulse along the $`x`$-axis that rotates $`j`$ 180 degrees. Magnetization on the $`z`$-axis would be rotated to the positive $`x`$-axis. Since this experiment starts with the spins at thermal equilibrium (pointing along the $`z`$-axis) the above sequence for the $`A_j`$ gate can be replaced by the simpler $`\frac{\pi }{2}`$ pulse along the positive $`y`$-axis.

The $`B_{jk}`$ gate, which can be constructed using the coupling between qubits, In terms of idempotents reduces to $`1E_{}^{}{}_{}{}^{1}E_{}^{}{}_{}{}^{2}+e^{i\theta }E_{}^{}{}_{}{}^{1}E_{}^{}{}_{}{}^{2}`$. Again using geometric algebra this yields the following pulse sequence:

$`B_{jk}`$ $`=`$ $`\begin{array}{c}\left(\pi \right)_\varphi ^j\left(\frac{\theta }{2\pi J_{jk}}\right)\left(\pi \right)_\varphi ^j\\ \\ \left(\frac{\pi }{2}\right)_y^{j,k}\left(\frac{\theta }{2}\right)_x^{j,k}\left(\frac{\pi }{2}\right)_y^{j,k}.\end{array}`$ (25)   
The notation $`\theta /2\pi J_{jk}`$ represents an interval of spin evolution under the coupling Hamiltonian. The final three pulses effectively perform a rotation around the $`z`$-axis. These pulses are not necessary, however, since the same effect may be achieved by rotating the prior pulses of the experiment.

The complete pulse program is the combination of $`A_j`$ and $`B_{jk}`$ gates described above. In this implementation, the necessity of performing a swap gate has been removed by reordering the bits at the appropriate interval.

The complete pulse program is,

$`QFT_3`$ $`=`$ $`\begin{array}{c}\left(\frac{\pi }{2}\right)_{sin(\frac{3\pi }{8})x+cos(\frac{3\pi }{8})y}^1\left(\pi \right)_x^2\\ \\ \left(\frac{1}{8J_{12}}\right)\left(\pi \right)_x^3\left(\frac{1}{8J_{12}}\right)\left(\pi \right)_x^2\\ \\ \left(\frac{\pi }{2}\right)_{\frac{x+y}{\sqrt{2}}}^2\left(\frac{1}{16J_{13}}\right)\left(\pi \right)_x^2\\ \\ \left(\frac{1}{16J_{13}}\right)\left(\pi \right)_x^2\left(\frac{1}{8J_{23}}\right)\left(\pi \right)_x^1\\ \\ \left(\frac{1}{8J_{23}}\right)\left(\pi \right)_x^2\left(\pi \right)_x^1\left(\pi \right)_x^2\\ \\ \left(\pi \right)_x^3\left(\pi \right)_x^2\left(\frac{\pi }{2}\right)_y^3\left(\pi \right)_x^2.\end{array}`$ (37)   
This sequence includes a number of $`\left(\pi \right)`$ pulses to refocus couplings during the intervals they should be inactive.

The pulse sequence takes advantage of knowledge of the starting state of the system at the beginning and end of the program by replacing Hadamard transforms with $`\frac{\pi }{2}`$ pulses. In the middle of the sequence the full Hadamard was indeed used.

Figure 1 shows selected theoretical and experimental spectra following the quantum Fourier transform of the state $`I_z^1+I_z^2+I_z^3`$ on the three qubit NMR quantum computer.

The fidelity of the QFT calculated using the measure

$$F=\frac{1}{2}+\frac{1}{2}\frac{Tr(\rho _{theory}\rho _{exp})}{\sqrt{Tr(\rho _{theory}^2)}\sqrt{Tr(\rho _{exp}^2)}}$$
(38)   
is 87%. Here $`\rho `$ is the density matrix minus the part that is proportional to the identity (in NMR, this is called the ‘reduced’ density matrix; it should not be confused with the reduced density matrix got by partially tracing the density matrix for a composite quantum system over some of its subsystems). This measure reflects both imperfections in the applied pulses and delays, as well as decoherence. To a first approximation, decoherence during the course of the QFT attenuates the entire density matrix. This is shown in figure 2. Therefore, we can approximately separate the errors caused by experimental imperfections by renormalizing $`\rho _{exp}`$ to its attenuated average. Using this the fidelity of the operations themselves is above 98% over the 6 gates in (11).

The fidelity of 87% corresponds to an error rate of 97.7% over the six gates which, while high, does not attain the error rate of $`10^4`$ required for robust quantum computation . These errors arise primarily from spatial inhomogeneities in the radio frequency fields which we believe can be improved.

In conclusion, using NMR, the QFT has been implemented on a three bit quantum system and the fidelity with which we can transform an initially diagonal state has been measured. Although the fidelity does not reach that required for fault tolerant computing, it is easily high enough to permit studies on small quantum systems including quantum simulations. A particularly straightforward use of the QFT is in quantum chaos: as Balazs and Voros  pointed out, a simple version of the quantum baker’s map can be performed by QFTs and Schack  has shown how such a quantum map might be realized on a quantum computer .

The authors thank S. S. Somaroo and C. H. Tseng for helpful discussions. This work was supported by DARPA.