Fast Quantum Algorithms

Fast Quantum Algorithms

Chapter 5 Fast Quantum Algorithms For this part of the notes, we follow Ref. [Nielsen and Chuang, 2011]. 5.1 The Quantum Fourier Transform You should all have seen the discrete Fourier transform (DFT) where a set of N complex numbers x0, . , xN 1 { − } are Fourier transformed into N new complex numbers y0, . , yN 1 according to { − } N 1 1 − i 2πmk y = e N x . k √ m N m=0 X The Fourier transformation is extremely useful, e.g. to detect periods in a signal where x0, . , xN 1 { − } could be the amplitude of some signal as a function of discretized time. The Fourier transformed signal y0, . , yN 1 then describes the frequency content. Solving the Schrödinger equation on a lattice, DFT is { − } what takes you between real space and momentum (k) space. The quantum Fourier transform (QFT) is a unitary n-qubit operation, transforming the initial N = 2n basis states 0 ,..., N 1 into a new basis in a way which looks mathematically identical to the DFT, {| i | − i} N 1 1 − i 2πjk j e N k . (5.1) | i → √N | i kX=0 The action on an arbitrary state is N 1 N 1 − − x j y k , j| i → k| i j=0 X kX=0 where the amplitudes yk are the DFT transforms of the amplitudes xm. One may easily verify that the new states are normalized and form an orthogonal set, and thus that the QFT is a unitary transform. The QFT can be used to find periods and also to extract eigenvalues of unitary operators to a high precision. But before discussing these issues in more detail, let’s see if we can find an effective implementation of the QFT. Remember that there are operators that need exponentially many single- and two-qubit gates for implementation, so what about the QFT? 5.1.1 Another definition We’ll now rewrite the definition of the QFT in a way that is more transparent for constructing a circuit. First we need a simple way to number the basis states. We simply number the n-qubit state j using the | i 25 n 1 n 2 1 0 binary n-bit representation of j = j12 − + j22 − + + jn 12 + jn2 . E.g. in the 4 qubit case the state ··· − 5 = 0101 = 0 1 0 1 . To proceed with the construction we also need to remember the definition of | i | i | 1i| 2i| 3i| 4i binary fractions 0.j j j . j = j /2 + j /22 + j /23 + j /2n, 1 2 3 n 1 2 3 ··· n e.g. 0.101 = 0.5 + 0.125 = 0.625, and more generally 2 m l+1 0.j j . j = j /2 + j /2 + + j /2 − . l l+1 m l l+1 ··· m Using this notation we can write the QFT in Eq. (5.1) as i2π0.jn i2π0.jn 1jn i2π0.j1j2...jn 0 + e 1 0 + e − 1 ... 0 + e 1 | i | i | i | i | i | i j = j1, j2, . , jn n/2 . (5.2) | i | i → 2 The algebraic manipulations connecting the two expressions are straightforward, but need some afterthought. Observing that n 1 0 n k k12 − kn2 1 n l = + + = k 2− + + k 2− = k 2− , (5.3) 2n 2n ··· 2n 1 ··· n l Xl=0 from Eq.(5.1) we have: N 1 1 − i 2πjk j e N k (5.4) | i → √N | i kX=0 1 1 n l 1 i2πj kl2− = e l=1 k1 . kn √N ··· P | i kX1=0 kXn=0 1 1 n l 1 i2πjkl2− = e kl √N ··· | i kX1=0 kXn=0 Ol=1 n 1 l 1 i2πjkl2− = e kl √N | i Ol=1 kXl=0 n 1 l = ( 0 + ei2πj2− 1 ) √N | i | i Ol=1 1 1 2 n = ( 0 + ei2πj2− 1 )( 0 + ei2πj2− 1 ) ... ( 0 + ei2πj2− 1 ) √N | i | i | i | i | i | i 1 i2π0.jn i2π0.jn 10.jn i2π0.j1...jn = ( 0 + e 1 )( 0 + e − 1 ) ... ( 0 + e 1 ) √N | i | i | i | i | i | i where in the last step we have used that n n j2− = j1/2 + j2/4 + . jn/2 = 0.j1 . jn (5.5) ... 1 n 2 n 3 n 2 n 3 j2− = j 2 − + j 2 − + . j /2 = j 2 − + j 2 − + + 0.j 1 2 n 1 2 ··· n and that the integer part of j 2l disappears in the exponent since it is multiplied by 2π. · 5.1.2 An efficient implementation Using the form of the QFT in Eq. (5.2) it is straightforward to implement the desired transformation with a quantum a circuit. We realize that we have to implement conditional phase shifts on each qubit, therefore 26 we define the single qubit operator 1 0 Rk = i2π/2k . " 0 e # Now let’s see what happens an input state j , j , . , j when it passes through the circuit in Fig. 5.1. The | 1 2 ni first Hadamard gate produces the state ( 0 + 1 )/√2 if j = 0 and ( 0 1 )/√2 if j = 1, i.e. | i | i 1 | i − | i 1 1 i2π0.j1 0 + e 1 j2, . , jn , √2 | i | i | i i2π0.j1 i2πj1/2 since e = e = 1 for j1 = 1 and +1 otherwise. The controlled-R2 gate rotates the component − 2 2 1 of the first qubit by ei2π/2 if j = 1, i.e. it applies the phase ei2πj2/2 . Therefore, it produces the state | i 2 2 1 i2πj2/2 i2πj1/2 1 i2π0.j1j2 0 + e e 1 j2, . , jn = 0 + e 1 j2, . , jn . √2 | i | i | i √2 | i | i | i After all the controlled-Rk operations on the first qubit, the state is 1 i2π0.j1j2...jn 0 + e 1 j2, . , jn . √2 | i | i | i The Hadamard on the second qubit produces 1 i2π0.j1j2...jn i2π0.j2 0 + e 1 0 + e 1 j3, . , jn , √22 | i | i | i | i | i and the controlled R2 to Rn 1 gates yield the state − 1 i2π0.j1j2...jn i2π0.j2...jn 0 + e 1 0 + e 1 j3, . , jn . √22 | i | i | i | i | i We continue in this fashion for all qubits, obtaining the final state 1 0 + ei2π0.j1j2...jn 1 0 + ei2π0.j2...jn 1 ... 0 + ei2π0.jn 1 . √2n | i | i | i | i | i | i We now need to reverse the order of the qubits, which can be achieved using a series of SWAP gates. The number of gates needed are n on the first qubit plus n 1 on the second and so on, adding up to − n(n + 1)/2 = O(n2) gates. Then we need on the order of n SWAP gates, not changing the scaling. Thus we can implement the QFT for n qubits using on the order of O(n2) gates. The best classical algorithm (FFT) needs O(n2n) gates, indicating why the QFT could be used for speedup. This does not translate in an immediate speed-up for computing classical FFT, because we cannot access the amplitudes when measuring the Fourier-transformed quantum state, and we don’t even know how to efficiently prepare the input state to be transformed. However, in the next section we’ll see one problem where the quantum Fourier transform is useful. 5.2 Phase estimation The aim of this algorithm is to estimate the angle in the eigenvalue ei2πϕ corresponding to an eigenvector u of a unitary operator U. The vector u is given, as well as a circuit (black box, oracle) effectively | i | i implementing controlled-U n operations. A circuit solving a first stage of this problem is shown in Fig. 5.2 and an overview circuit showing the whole algorithm is given in Fig. 5.3. Two qubit registers are needed, the first has t qubits which are initialized to zero. The number of qubits t is determined by the required 27 Figure 5.1: An efficient circuit to perform the quantum Fourier transform. (From Nielsen & Chuang), Fig. 5.1. Figure 5.2: A circuit performing the first step of the phase estimation algorithm. (From Nielsen & Chuang), Fig. 5.2. accuracy in the estimate of ϕ. The second register is large enough to represent the eigenvector u , and it is | i also initialized to u and remains in this state throughout the computation. The initial set of Hadamard gates | i puts all qubits of register 1 in an equal superposition of 0 and 1 . If the k-th control qubit is in the state k | i | i 2k k 1 a unitary operation U 2 will be performed on the second register, picking up a phase ei2πϕ = ei2πϕ2 . | i The first step (k = 0) gives for example: 1 1 i2πϕ CU ( 0 + 1 ) u = 0 + e 1 u . (5.6) √2 | i | i | i √2 | i | i | i 28 The final state of the first register in this first step is 2t 1 1 t 1 t 2 1 0 1 − 0 + ei2π2 − ϕ 1 0 + ei2π2 − ϕ 1 ... 0 + ei2π2 ϕ 1 0 + ei2π2 ϕ 1 = ei2πkϕ k . √2t | i | i | i | i | i | i | i | i √2t | i k=0 X (5.7) By comparison with (5.4) we see that this state is nothing else than the Fourier transform of the state 2tϕ = ϕ ϕ . ϕ , where in the last step we have assumed that the phase ϕ has an exact representation | i | 1 2 ti in t bits as ϕ = 0.ϕ1ϕ2 . ϕt (with a slight abuse of notation).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us