American University in Cairo AUC Knowledge Fountain
Capstone and Graduation Projects Student Research
Winter 12-30-2020
Quantum Simulation of the Schrodinger Equation using IBM's Quantum Computers
Mohamed Abouelela [email protected]
Follow this and additional works at: https://fount.aucegypt.edu/capstone
Part of the Quantum Physics Commons
Recommended Citation Abouelela, Mohamed, "Quantum Simulation of the Schrodinger Equation using IBM's Quantum Computers" (2020). Capstone and Graduation Projects. 20. https://fount.aucegypt.edu/capstone/20
This Dissertation/Thesis is brought to you for free and open access by the Student Research at AUC Knowledge Fountain. It has been accepted for inclusion in Capstone and Graduation Projects by an authorized administrator of AUC Knowledge Fountain. For more information, please contact [email protected]. Quantum Simulation of the Schr¨odingerEquation using IBM’s Quantum Computers
by
Mohamed Abouelela
A Thesis Presented for the Bachelor of Science in Physics
Thesis Advisor: Dr. Tarek El Sayed
Department of Physics American University in Cairo Egypt, December 2020 Contents
List of Figures 3
List of Tables 3
Abstract 5
1 Introduction 6
2 Quantum Computation 7 2.1 Qubits ...... 7 2.2 Quantum Gates and Quantum Logic ...... 8 2.3 Bernstein-Vazirani Algorithm ...... 11 2.3.1 The Algorithm ...... 11 2.3.2 Running on QASM and IBMq ...... 13
3 Quantum Simulation 15 3.1 Initialisation ...... 15 3.2 Time-Dependant Schr¨odingerEquation ...... 15 3.2.1 Quantum Fourier Transform ...... 16 3.2.2 Momentum Operator ...... 19 3.2.3 Algorithm Overview ...... 21
4 Results 22 4.1 Infinite Square Well ...... 22 4.2 Free Particle ...... 24 4.3 Particle in a Step Potential ...... 25 4.4 Quantum Tunneling ...... 27 4.4.1 Barrier Through the |x111xxi Bases ...... 29 4.4.2 Barrier Through the |x11xxxi Bases ...... 30
5 Running 4-qubit Simulations on ibm vigo 31 5.1 Infinite Square Well ...... 31 5.1.1 QASM ...... 31 5.1.2 ibmq vigo ...... 31 5.2 Free Particle ...... 32 5.2.1 QASM ...... 32 5.2.2 ibmq vigo ...... 32 5.3 Particle in a Step Potential ...... 33 5.3.1 QASM ...... 33 5.3.2 ibmq vigo ...... 33 5.4 Quantum Tunneling ...... 34 5.4.1 QASM ...... 34 5.4.2 ibmq vigo ...... 34
6 Discussion & Conclusion 35
References 36
Appendix 1 38 List of Figures
1 The state of a qubit can be represented in the image of a Bloch Sphere. This can be easily θ iφ θ interpreted by the more general form of the wavefunction: |ψi = cos 2 |0i + e sin 2 |1i, where θ is the polar angle that determines the probabilities of the measurement, and φ is the az- imuthal angle known as the phase, which has no effect on the probabilities of the measurement. Figure courtesy of Nielsen. 1 ...... 7 2 A quantum circuit schematic of the CNOT Gate. The control is represented by a dot, while the target is box with the ’+’ ...... 10 3 The quantum circuit of Bernstein-Vazirani’s Algorithm...... 11 4 A quantum circuit representation of the unitary property of the Hadamard gate...... 12 5 The oracle acting on an input |xi ...... 13 6 Histogram produced by QASM and IBM’s quantum computer [20 pt] ...... 14 Quantum circuit implementation of the QFT, where φ = 2πi . Figure 1 7 N 2N ...... 18 8 Quantum Fourier Transform followed by its inverse. Notice how φ is negative in the inverse QFT. Figure courtesy of Nielsen and Chang 1 ...... 19 1 9 Quantum circuit simulating the Hamiltonian H = Z1 ⊗ Z2 ⊗ Z3 as shown by Nielsen . . . . 20 10 The momentum operator for a 3-qubit system...... 20 11 Quantum circuit representation of the time evolution operator for a single time step...... 21 12 A visualisation of the 6-qubit initialisation of the half sine with the potential at half of the simulation space ...... 23 13 Results from QASM: Left-hand side showing the initial state, right-hand side showing state after 15 iterations ...... 23 14 The Gaussian curve that will be initialised onto the qubits, with µ = 0 and σ = 0.4 . . . . . 24 15 Three different states of the free particle as measured by QASM with a ∆t = 0.3 ...... 24 16 Three different states of the particle in a step potential of V = 2 simulation as measured by QASM with ∆t = 0.1 ...... 25 17 Three different states of the particle in a step potential of V = 3 simulation as measured by QASM with ∆t = 0.1 ...... 25 18 Three different states of the particle in a step potential of V = 5 simulation as measured by QASM with ∆t = 0.1 ...... 26 19 A potential barrier with the incident particle energy below the potential barrier height 2 [10 pt] 27 20 An incident sinusoidal wavefunciton quantum tunneling through a barrier. The wavefunciton exponentially decays within the potential barrier. 2 [10 pt] ...... 28 21 Three different states of the quantum particle tunneling through a potential barrier of height V = 1.75...... 29 22 Three different states of the quantum particle tunneling through a potential barrier of height V = 1.75...... 30 23 Two states of the eigenstate in an infinite well simulation as measured by QASM with ∆t = 0.1 31 24 Two states of the eigenstate in an infinite well simulation as measured by ibmq vigo with ∆t = 0.1 ...... 31 25 Three states of the free particle simulation as measured by QASM with ∆t = 0.1 ...... 32 26 Three states of the free particle simulation as measured by ibmq vigo with ∆t = 0.1 . . . . . 32 27 Three states of the step potential simulation at V = 2 as measured by the QASM simulator with ∆t = 0.1 ...... 33 28 Three states of the step potential simulation with V = 2 as measured by ibmq vigo with ∆t = 0.1 33
2 29 Three states of the quantum tunneling simulation with V = 1.75 as measured by the QASM simulator with ∆t = 0.1 ...... 34 30 Three states of the quantum tunneling simulation with V = 1.75 as measured by ibmq vigo with ∆t = 0.1 ...... 34
31 A 6-qubit implementation of the Quantum Fourier Transform. Note that the q0 is the ancillary qubit...... 38
32 A 6-qubit implementation of the Inverse Quantum Fourier Transform. Note that the q0 is the ancillary qubit...... 38
33 A 6-qubit implementation of the momentum operator with φ = π. Note that the q0 is the ancillary qubit ...... 39 34 The potential used for the 6-qubit simulation, to apply a potential V on the highest order qubit. 40 35 A filter for the states |x111xxi. The Toffoli gate’s controls are two of the 2nd, 3rd, or 4th highest order qubits, and its target is the ancillary qubit. The controlled phase gate’s control is the ancillary qubit, while the target is the remaining high order qubit from the stated three. . . 40 36 A filter for the states |x11xxxi. The CNOT gates’ control is on the 3rd highest order qubit, and its target is the ancillary qubit. The controlled phase gate’s control is the ancillary qubit, while the target is the 5th highest order qubit...... 41
List of Tables
1 List of commonly used quantum gates. Row 1: Hadamard Gate - NOT Gate. Row 2: Phase Gate - Controlled Phase Gate. Row 3: Controlled NOT Gate - Controlled Controlled NOT (Toffoli) Gate ...... 10
3 Acknowledgements
I am profoundly grateful to have had Dr. Tarek Elsayed as my thesis advisor. I would like to thank him for his patience, and for putting so much effort in teaching me something new, giving me the opportunity to research and unlock a new passion I never knew I had.
I would also like to thank my colleague, Mohamed Eltohfa, for helping me throughout this period as my thesis partner. I would like to thank for teaching me to look at problems through other perspectives.
I would like to thank the every professor in the physics department at AUC for having a strong impact on me as a student and continue to push me forward to reach my goals: Dr. Mohamed Swillam, Dr. Mohammad Alfiky, Dr. Ashraf Alfiky, Dr. Ahmed Hamed, Dr. Nageh Allam, Dr. Amr Shaarawi, Dr. Salah Elsheikh, Dr. Hosny Omar, Dr. Karim Addas, Dr. Mo- hamed Orabi, and Dr. Ezzeldin Soliman.
I thank Miss Lobna Abdelrehim and Farah Lotfy for guiding throughout my years at uni- versity. Their impact was truly great.
I would like to thank my family for their continued emotional support and their belief in following my dreams and passion.
Finally I would like to thank my friends that I have made along the away. Their support is truly appreciated.
4 Abstract
This thesis explores the capabilities of a quantum computer to simulate quantum systems. We give an introduction to the basics of quantum computing with the Bernstein-Vazirani algorithm as a demonstration. Four quantum systems are then simulated using IBM’s QASM simulator using 6 qubits: the free particle, eigenstate of an infinite-well, particle in a step potential, and quantum tunneling. Because of the high number of gates, a 6-qubit simulation will not be feasible on current quantum computers. The number of qubits was, thus, reduced to 4 qubits, and was simulated on IBM’s 5 qubit quantum computers (ibmq 5 vigo). We conclude that quantum simulations on quantum computers are theoretically achievable, as shown by the QASM simulator; however, no useful information can be extracted using the real quantum computers, due to high noise and high errors.
5 1 Introduction
In his 1982 paper Simulating Physics with Computers, Richard Feynman popularised the idea of a non-Turing machine that would simulate quantum systems. 3 This non-Turing machine, as he would describe, would be the quantum computer. His idea was motivated by the existent diffi- culties, and the inability to get an exact solution to a quantum mechanical problem. The general concept is to let a quantum mechanical system simulate another quantum mechanical system. Throughout the 1990s several algorithms have been developed by scientists that demonstrate a quantum computer’s ability to run simulations much more efficiently than that of classical computers. Shor’s factorisation algorithm 4, Grover’s search algorithm 5, and Deutsch-Jozsa’s oracle algorithm 6 are a few examples.
Over the past few years, there has been a deep interest within the scientific community over quantum computers as companies like Google, IBM, Rigetti, and D-Wave proceeded to build their quantum computers. The goal is to build a computer with more qubits that suffers less from decoherence. Such a goal is required to achieve quantum supremacy, which is the ability of a quantum device to perform a computational task that a classical computer is not realistically capable of performing 7. In 2018, researchers at Google published a paper where they demon- strated how quantum supremacy was achieved by their quantum computer Sycamore 8. They showed that a task, which would take 10,000 years to compute on a supercomputer, only took 200 seconds on Sycamore. Moreover, just recently at the start of December 2020, researchers at the University of Science and Technology of China also published that they were able to demonstrate quantum supremacy using a photon-based quantum computer 9. The task, which could be solved by the quantum device in a few minutes, would otherwise be solved in 2.5 billion years by a classical supercomputer, according to the research group. These two demonstrations, by the research groups, provide a glimpse of the bright future of quantum simulation research.
In this thesis, we will explain some of the fundamentals and basics of quantum computing. We will show a simple example using Bernstein-Vazirani’s algorithm 10 using these fundamental concepts. We will then introduce four quantum mechanical systems, which will then be simulated on IBM’s quantum simulator, QASM ∗. These demonstrations include 6-qubit simulations of a free particle, an eigenstate in an infinite well, reflection and transmission through a step potential, and quantum tunneling. These simulations will also be run on one of IBM’s 5-qubit quantum computers, ibmq vigo, and compared to the results computed by the QASM simulator.
∗The QISKitcode is available here: https://github.com/Abou-el-ela/Schrodinger-Equation
6 2 Quantum Computation 2.1 Qubits In classical computing, the bit is the smallest unit of information, the value of which can be the binary digits 0 or 1. When a series of bits are put together, they can represent another binary number, which can be processed later to be another piece of information (e.g. the alphabet in ASCII). A quantum computer, on the other hand, has the quantum bit, or qubit is the fundamental unit of information. The qubit takes advantage of superposition, and can be expressed as a linear combination of a state of |0i and a state of |1i. We can describe this superposition similar to how we describe a 1/2 spin particle:
|ψi = α |0i + β |1i (1) The coefficients are complex numbers, whose absolute squares represent the measurement probabilities of each state,
2 P0 = |α| 2 (2) P1 = |β|
and are normalised, |α|2 +|β|2 = 1. This can be best represented by the Bloch Sphere, shown in Fig. 1.
Fig. 1: The state of a qubit can be represented in the image of a Bloch Sphere. This can be easily interpreted by θ iφ θ the more general form of the wavefunction: |ψi = cos 2 |0i + e sin 2 |1i, where θ is the polar angle that determines the probabilities of the measurement, and φ is the azimuthal angle known as the phase, which has no effect on the probabilities of the measurement. Figure courtesy of Nielsen. 1
The quantum computer gets more power when more qubits are added. As an example, suppose we have 2 qubits, |ψai and |ψbi; we can represent their superposition state as the tensor
7 product |ψai ⊗ |ψbi, where:
|ψai ⊗ |ψbi = (αa|0ia + βa|1ia) ⊗ (αb|0i + βb|1ib) (3)
= αaαb|0ia|0ib + αaβb|0ia|1ib + βaαb|1ia|0ib + βaβb|1ia|1ib
= γ1|00i + γ2|01i + γ3|10i + γ4|11i (4)
We can clearly see that from only 2 qubits, we were able to get 4 pieces of information. In fact, the pieces of information increase by an exponential factor 2N , where N is the number of qubits. 2 For classical bits, however, that number scales by N. This gives a great advantage for quantum computers to simulate quantum systems, since the Hilbert Space also increases by an exponential factor 2N , where N, is the number of particles 1,2 As an example, if we 1 were to simulate 500 quantum particles with spin 2 , then the pieces of information, in this case coefficients, that will be required is 2500, which is more than the number of atoms in the universe 1. For a classical computer, that would be impossible to calculate. However, we expect that it would be, in principle, possible using a quantum computer with slightly more than 500 qubits, depending on the number of ancilla qubits (we will discuss more about the ancilla qubit in a later section).
2.2 Quantum Gates and Quantum Logic Gates are the basis of computational logic. In classical computing, gates are used to process and manipulate bits. The most basic of these classical gates include a NOT gate, which turns a |0i into a |1i, or vica versa, the OR gate, which returns a |1i if at least one of the input bits is |1i, and the AND gate, which returns |1i only if both of the input bits are |1i. In quantum computing, on the other hand, there are quantum gates. There is a specific criterion for a quan- tum gate that must be met, and it’s that it must be reversible; meaning that given an operation on a qubit, there must be an inverse. This reversibility is not seen in classical computing, e.g. there does not exist a reverse classical AND gate. Quantum gates can be represented in terms of unitary matrices, since they can be thought of as operators that operate on qubits. These unitary matrices, by definition, have the property UU † = 1, where U † is the complex conjugate transpose of U 11. The simplest example of such an operator is the quantum NOT gate, which is represented by Eq.(5).
0 1 X = (5) 1 0
Operating the NOT gate on an initial state |ψii = |0i gives us the result in Eq.(6).
8 |ψf i = X |ψii
0 1 1 = 1 0 0 (6) 0 = = |1i 1
Another basic and commonly used quantum gate is the Hadamard gate, Eq. (7).
1 1 1 H = √ (7) 2 1 −1
This gate is one of the gates that use the effects of quantum mechanics, as it sets up a superposition on a qubit. Suppose a qubit in the initial state as before, |ψii = |0i, is acted on by an H-Gate. The final state of the qubit, as shown in Eq. (8), will be a superposition state of equal probabilities between 0 and 1:
|ψf i = H |ψii
1 1 1 1 = √ 2 1 −1 0 (8) 1 1 1 1 = √ = √ |0i + √ |1i 2 1 2 2
We notice from Table 1 that there are multi-qubit gates, such as the CNOT, CCNOT, and CP gates. These gates are split into two parts, the control and the target. If we take the CNOT as an example, the target will change its state only if the control is 1. A good way to visualise it is by drawing all the possible states before the gate and after:
|00i −→ |00i |01i −→ |01i (9) |10i −→ |11i |11i −→ |10i
9 Quantum Gates
1 1 0 1 H = √1 X = 2 1 −1 1 0
1 0 0 0 1 0 0 1 0 0 Rφ = CRφ = 0 eiφ 0 0 1 0 0 0 0 eiφ
1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 CX = CCX = 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0
Table 1: List of commonly used quantum gates. Row 1: Hadamard Gate - NOT Gate. Row 2: Phase Gate - Controlled Phase Gate. Row 3: Controlled NOT Gate - Controlled Controlled NOT (Toffoli) Gate
Fig. 2: A quantum circuit schematic of the CNOT Gate. The control is represented by a dot, while the target is box with the ’+’
10 2.3 Bernstein-Vazirani Algorithm 2.3.1 The Algorithm The unitary and unique quantum properties of quantum gates and quantum computing can be best seen in a quantum circuit implementing Bernstein-Vazirani’s algorithm. Suppose there is a black box, which we will refer to as the Oracle, that holds an N-bit long number that we would like to know. This secret number acts like a key, and the black box will only accept the correctly guessed number. Let’s take the binary 1010 as an example. A classical computer would start counting up from 0000 to 1111, until it successfully guesses the correct key 1. This process can take up to 2N guesses before getting the number. Using quantum logic, Bernstein and Vazirani showed a quantum computer would reduce the process to one attempt 10, using only a series of Hadamard gates and CNOT gates. The implementation of the algorithm can be seen in Fig. 3.
Fig. 3: The quantum circuit of Bernstein-Vazirani’s Algorithm.
The horizontal lines in Fig. 3 correspond to the qubits, q0, q1, ... and the circuit is read from left to right. Vertically, we are using the convention where the quantum register, q3, corresponds to the highest order qubit and q0 to the lowest order qubit. We have an additional ancillary qubit, q4, which we use to assist us with the calculations, but is then discarded and not measured in the end. At the very bottom, there is the classical register, denoted by C and a double line. This register is the classical part of the quantum computer, and it is where it comes into contact with classical gates such as the measurement gate, as can be seen from the figure.
Quantum computers are initialised by default such that all the qubits are |0i. To start building the Bernstein-Vazirani circuit, we start by adding Hadamard gates to all the qubits. The Hadamard gates will transform the |0i state to a superposition of equal probability, which can be rewritten as |+i = √1 (|0i + |1i). When we do this on a series of qubits, the coupled 2 states can be expressed as,
11 H⊗n 1 X |00 ... 0i −→ √ |xi, (10) 2n x∈{0,1}n
where n is the number of qubits, and |xi is the computational basis. Let us imagine that the Z-gate and the CNOT gates do not exist for a moment. If we were to put another series of Hadamard gates immediately and apply a measurement, we would get back the initial state |00 ... 0i, Fig.4.
Fig. 4: A quantum circuit representation of the unitary property of the Hadamard gate.
From Fig.4, it can be difficult to see how the unitary property can be put into use. This is where the oracle becomes useful. The oracle can be thought of as a function, f, which performs the following operation, which can be also represented in circuit form in Fig.5:
f |xi → (−1)s·x|xi (11)
The s corresponds to a number, in binary representation, that the oracle holds, and s · x is the sum of the bitwise product, s · x = s0x0 ⊕ s1x1 ⊕ ... ⊕ sn−1xn−1. Meaning that f returns the value 1 when s · xmod2 = 1 and 0 when s · xmod2 = 0. As it turns out, the implementation of this oracle requires the use of an ancillary qubit. An ancillary qubit is an extra qubit that is used to hold information and to assist with the calculation, but is not measured at the end of the circuit and is discarded. In our example from Fig.3, we can see that the ancillary qubit is the bottom-most qubit, q4. It is initialised differently from the rest of the qubits as it has a Z-gate after the Hadamrd gate which initialises it in a |−i = √1 (|0i − |1i). We can think of it 2 as having a phase shift of π on its |1i. This qubit will then be the target to a series of CNOT gates. In our example, we take the s = 1010. This is implemented by having the controls of the CNOT on the qubits, whose values would represent 1, while leaving the 0’s to be empty. The target of the CNOT gates is the ancillary qubit. What these CNOTs do is that they apply a phase shift on the qubits that satisfy the CNOT control condition. Meaning that in Fig.3, the first CNOT will apply a phase shift of π on the states |xxx1xi, and the second CNOT on the |x1xxxi Notice that even though we won’t measure the ancillary qubit, I have added it when representing the previous state to highlight its importance in applying these phase shifts. This is what corresponds to the −1s·x factor; it determines which states will have a negative factor, and which won’t. This is a crucial step such that when we add the final series of Hadamard gates they will return |0i for the qubits that had not been applied a phase shift on, and |1i otherwise.
12 1 X H⊗n √ (−1)s·x|xi −→ |si (12) 2n x∈{0,1}n
Fig. 5: The oracle acting on an input |xi
2.3.2 Running on QASM and IBMq There are two methods to simulate a quantum circuit. The first method is using a quantum computer simulator. IBM’s QISKIT has multiple simulators in its library, namely the statevec- tor simulator and the Quantum Assembly Language simulator, or QASM. Both are simulators that do not use quantum computers, but are very useful when trying to check the accuracy of a circuit to easily debug it, before running it on the noisy and error-prone quantum computers. The difference between them is how they present the measurements. The statevector simulator assumes an ideal quantum device with no noise 12; the result of which is a perfect outcome of a proposed circuit with no errors. The QASM simulator, on the other hand, attempts to mimic a quantum computer by adding little noise to the result 12; however, that is not always the case, as we will see with the example we have at hand. QASM also operates by running the circuit multiple times, storing the number of times an outcome has occurs, which is similar to what an actual quantum computer does. The result can be then best seen by a plotting a histogram. We choose to use the QASM simulator in this thesis, as it is more accurately mimics a quantum computer than the statevector simulator. Running the circuit in Fig.3 with s = 1010 on the QASM simulator with 1024 shots, we get a perfect answer as shown in Fig.6a.
Simulating on a quantum computer is very different. Quantum computers are noisy ma- chines that are error-prone. By adding more gates, especially controlled gates, you increase the percentage of error of the final outcome. Hence, we expect that there would be discrepancies in the histogram, which is indeed the case as seen in Fig.6b. The quantum computer was able to guess 1010 correctly with an accuracy of 63%, and other outcomes being spread around due to noise error.
13 (a) QASM Simulator (b) ’ibmq vigo’ Quantum Computer
Fig. 6: Histogram produced by QASM and IBM’s quantum computer
14 3 Quantum Simulation
The aim of this thesis is to simulate single particle quantum systems using quantum computers. Simulating these systems can be split into two main parts. The first part is the wavefunction initialisation. The second part is creating and implementing a time-evolution algorithm that accurately evolves the wavefunction over time, and that bypasses the noncommutativity of the Hamiltonian operators. Once these two parts are resolved, we can tweak the values of the potential and kinetic energies of the system to simulate (i) the free particle, (ii) eigenstate of a particle in an infinite well, (iii) a particle reflecting and transmitting through a step potential, (iv) and quantum tunneling.
3.1 Initialisation To initialise the desired wavefunction, ψ(x), we need to discretise the domain, x, into grid points. That way, we can initialise the wavefunction over a series of N qubits. Since there are a finite amount of qubits, then we can say that the region of motion takes place between −d ≤ x ≤ d. 2d N That way, we can take equal intervals of ∆ = 2N , where 2 is the number of intervals. The wavefunction can then be discretised by:
2n−1 2n−1 X 1 X c (t)|ki = ψ (x , t) |ki, (13) k N k k=0 k=0 1 13 where xk ˙= − d + k + 2 ∆ , and |ki is the computational basis . Because the square of the coefficients of the computational bases represented probabilities, they must be normalised by: v u2n−1 u X 2 N ≡ t |ψ (xk, t)| (14) k=0
3.2 Time-Dependant Schr¨odingerEquation One of quantum mechanics’ postulates states that the time dependence of a quantum system can be represented by the time dependent Schr¨odingerequation, Eq.(15), ∂ H|ψ(t)i = i¯h |ψ(t)i, (15) ∂t
where H is the Hamiltonian of the system, and |ψ(t)i is the time-dependent wavefunction. By solving this differential equation, we get:
−iHt |ψ(t)i = e |ψiniti , (16)
where |ψiniti is the wavefunction evaluated at t = 0. Given that the Hamiltonian is the total energy of the system, we can rewrite it as H = K + V , where the terms are the potential and kinetic energy operators respectively. We notice, however, that V and K do not commute, meaning that eV +K 6= eV eK , making simulating the system not an easy task. Fortunately, we can use Trotter’s formula to resolve this issue and rewrite Eq.(16) to, 14,15
15 −i(K+V )t |ψ(t)i = e |ψiniti ,
t (17) −iK∆t −iV ∆t O(∆t2) ∆t = e e e |ψiniti .
The formula in Eq.(17) is accurate within the truncation error of O(∆t2). This could be improved to higher orders, but it would require more quantum gates to simulate, which is not favourable with current quantum devices.
3.2.1 Quantum Fourier Transform † If we recall from Hamiltonian mechanics, we can write K in terms of the momentum operator p2 as K = 2m . We initially start the quantum algorithm in the x-representation, where the the operator p is not diagonal. We can then use a Quantum Fourier Transform, QFT, to pass from the position-representation to the momentum-representation, then its inverse to revert back to the position-representation. The momentum operator can be then rewritten in the form,
2 −iK∆t † −i p ∆t e = F e 2m F. (18)
To understand how we can implement this in a quantum circuit, we need understand the Discrete Fourier Transform (DFT) first, since the Quantum Fourier Transform is merely a quantum implementation of it. Suppose we have two sequences, X = {x0, x1, ..., xk, ..., xN−1} and Xe = {xe0, xe1, ..., xek, ..., xeN−1}, where DFT maps elements from X to their corresponding transformations in Xe in the form of 16:
N−1 X 2πi k·j x¯k = xj · e N (19) j=0
As shown by Nielsen 1, we can translate the DFT to the QFT by:
†The 6-qubit circuit for the QFT and its inverse can be found in Appendix A.
16 2n−1 1 X n |xi → e2πijk/2 |ki 2n/2 k=0
1 1 1 X X 2πix Pn k 2−l = ... e ( l=1 l ) |k . . . k i 2n/2 1 n k1=0 kn=0
1 1 n 1 X X O −l = ... e2πixkl2 |k i 2n/2 l k1=0 kn=0 l=1
n " 1 # 1 O X −l = e2πixkl2 |k i 2n/2 l l=1 kl=0
n 1 O h −l i = |0i + e2πix2 |1i , 2n/2 l=1
to finally arrive at,
1 2πi x 2πi x QF TN |xi = √ |0i + e 2 |1i ⊗ |0i + e 22 |1i ⊗ ... N 2πi x 2πi x ⊗ |0i + e 2n−1 |1i ⊗ |0i + e 2n |1i , (20)
where N = 2n.
This can be then implemented to a quantum circuit using a series of Hadamard gates and Controlled Phase gates, Fig.7. The QFT is made out of unitary gates, so it itself is unitary, i.e. taking its inverse should be possible by taking the mirror image of it and changing the signs of φN , Fig.8. As an example, let’s apply a two qubit system, where the Eq.(20) will be on the Right-Hand-Side (RHS) and the matrix operation by the gates in Fig.8 will be the Left-Hand- Side, and then compare both results. Starting with an initial state of x = 1, the RHS can be written as,
17 Quantum circuit implementation of the QFT, where φ = 2πi . Figure 1 Fig. 7: N 2N
1 2πi x 2πi x QFT |xi = |0i + e 2 |1i ⊗ |0i + e 22 |1i 2/2 2 x=1
1 πi = |0i − |1i ⊗ |0i + e 2 |1i 22/2
1 iπ iπ RHS = |00i − |01i + e 2 |10i − e 2 |11i . 2
From the circuit, to get the rotation to operate on the first qubit, we need the second qubit iπ/2 to be in a state of |1i. Thus, we get that q1 → |0i + e |1i and q2 → |−i = |0i − |1i. By combining them with a tensor product we get,
1 LHS = |0i + eiπ/2 |1i ⊗ (|0i − |1i) 2 1 = |00i − |01i + eiπ/2 |10i − eiπ/2 |11i . 2
Comparing the quantum circuit (LHS) and the results of Eq.(20), we can see that the quan- tum circuit can act as an implementation of the Quantum Fourier Transform.
18 Fig. 8: Quantum Fourier Transform followed by its inverse. Notice how φ is negative in the inverse QFT. Figure courtesy of Nielsen and Chang 1
3.2.2 Momentum Operator
2 ‡ To derive the momentum operator, e−ik ∆t, we go back to how binary numbers are repre- sented. An n-bit number can be expressed by their binary representation as,
n−1 k = kn−12 + ··· + k12 + k0, (21)