Introduction to Quantum Computing and Its Applications to Cyber Security
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to Quantum Computing and its Applications to Cyber Security Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 [email protected] These slides and audio/video recordings of this class lecture are at: http://www.cse.wustl.edu/~jain/cse570-19/ Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-1 Overview 1. What is a Quantum and Quantum Bit? 2. Matrix Algebra Review 3. Quantum Gates: Not, And, or, Nand 4. Applications of Quantum Computing 5. Quantum Hardware and Programming Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-2 What is a Quantum? Quantization: Analog to digital conversion Quantum = Smallest discrete unit Quantum Wave Theory: Light is a wave. It has a frequency, phase, amplitude Quantum Mechanics: Light behaves like discrete packets of energy that can be absorbed and released Wave Photon = One quantum of light energy Photon Photons can move an electron from one energy level to next higher level Photons are released when an electron moves from one level to lower energy level Electrons Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-3 Probabilistic Behavior Young’s Double-Slit Experiment 1801 Photons The two waves exiting the slits interfere. Interference is constructive at some spots and destructive at others ⇒ Probabilistic Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-4 Quantum Bits 1. Computing bit is a binary scalar: 0 or 1 10 or 2. Quantum bit (Qubit) is a 2×1 vector: 01 3. Vector elements of Qubits are complex numbers x+iy 4. Modulus of a complex Number |x+= iy | ( x + iy )( x− i y ) =xy22+ Conjugate Example: | (1+ 2|) = (1+= 2ii ) (1−= 2i) 1+ 4 5 5. Probability of each element in a qubit vector is proportional to its modulus squared a Pa=||||22 /(| a2 + | a ) 0 ⇒ 0 01 222 a1 Pa=|1 ||| /(| a01 + | a ) 1+ 2ii |1 + 2 | (1+− 2ii )(1 2 ) 5 5/(5+= 2) 5/7 ⇒ = = ⇒=P 1−ii |1 − | (1−+ii )(1 ) 2 2/(5+= 2) 2/7 Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-5 Polar Representation Complex numbers in polar coordinates: (x+= iy) reiθ = r( cos()θθ + isin ()) r y 22 θ r= xy + x θ = tan−1(/ y x) Imaginary 2π = 360o (-1+i) (1+i) π o 1 1 /4=45 Real -1 1 -1 C 12+ ieiπ /4 2( cos(ππ / 4)+ i sin( / 4)) = = −+ 3π /4 1 i 2e 2( cos(3ππ / 4)+ i sin(3 / 4)) Exercise: Find the complex and polar representation of C Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-6 Qubit Interpretation [Source: Johnston, et al. 2019] If a single photon is emitted from the source, the photon reaches position A or B with some probability ⇒ Photon has a superposition (rather than position) Each position has a different path length and, therefore, different amplitude and phase Ref: E. R. Johnston, N. Harrigan, and M. Gimeno-Segovia, "Programming Quantum Computers," O'reilly, 2019, ISBN:9781492039686, 320 pp. Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-7 Bra-Ket Notation The vector ψ is denoted in bra-kets | ψ > Brackets: { }, [ ], < > Bra <a| Ket |a> Example: Ket-zero and ket-one 10 =>=> |0 |1 01 Bra is the transpose of the complex-conjugate of a Ket. Example: Bra-zero and Bra-one [1 0] = <0 | [0 1] = <1| Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-8 Matrix Multiplication Matrix multiplication ×: bb aaa 01 01 00 01 02 × bb10 11 aaa10 11 12 bb20 21 aaa00b 00++ 01b 10 02 b 20 a 00 bbb 01 ++aa 01 11 02 21 = a bbb++aa+ aabbb + a 10 00 11 10 12 20 10 01 11 11 12 21 Example: 01 111 101 11×= 21 2 11 1 00 000 3×2 2×3 3×3 Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-9 Tensor Product Tensor Product ⊗ : m×n ⊗ k×l results in mk×nl matrix bbb aa 00 01 02 = 00 01 = A Bbbb10 11 12 aa10 11 bbb20 21 22 bbb00 01 02 bbb00 01 02 abbb00 10 11 12 abbb 01 10 11 12 bbb20 21 22 bbb20 21 22 AB⊗= bbb00 01 02 bbb00 01 02 abbb10 10 11 12 abb 11 10 11b 12 bbb20 21 22 bbb20 21 22 aaaaaa00bbbbbb 00 00 01 00 02 01 00 01 01 01 02 aaaaaa00bbbbbb 10 00 11 00 12 01 10 01 11 01 12 aaaaaabbbbbb = 00 20 00 21 00 22 01 20 01 21 01 22 aaaaaa10bb 00 10 01 10b 02 11 b 00 11 bb 01 11 02 aabba bbbbaaa 10 10 10 11 10 12 11 10 11 11 11 12 aa10b 20a 10b 21a 10b 22aa 11b 20 11b 21 11b 22 Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-10 Tensor Product (Cont) b Example 1: 00 a00b 00 a00 b 10 a00b 10 a 00 bb a b 00 00 10 00 aa10 ⊗=10 = b bab 10 10 10 10 a20 a b b00 20 00 a 20 a b b10 20 10 3×1 2×1 6×1 01 000101 Example 2: ⊗=[101] 11 1 01101 2×2 1×3 2×6 Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-11 Multiple Qubits and QuBytes 10 One Qbit: | 0>= |1 >= 01 10 00 110 1 0 0 Two Qbits: |00>= |0 >⊗ | 0 > = ⊗ = |01 >= |10 >= |11 >= 000 0 1 0 Tensor Product 00 01 1 0 0000 00 0 1 0000 00 0 0 1000 00 0 0 01 0 000 Three Qbits: 0 0 00 1 0 00 0 0 00 0 1 00 0 0 0000 10 0 0 0000 01 | 000>> | 001 | 010 >>>>>> | 011 | 100 | 101 | 110 | 111 In a k-qubit register, each of the 2k positions can be any complex number QuByte=8-Qubits = 256-element vector Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-12 Homework 19A Given two matrices: 11+ i 1 AB= = 10− ii Compute: A× BA, ⊗ B Compute the probabilities of each element of AB× Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-13 Quantum Gates 1. Quantum NOT Gate 2. Quantum AND Gate 3. Quantum OR Gate 4. Quantum NAND Gate 5. Quantum √NOT Gate Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-14 Quantum NOT Gate NOT: 01 NOT = 10 01 0 1 01 1 ? ×= ×= 10 1 0 10 0 ? NOT |1>= |0 > NOT |0 >= |? > Exercise: Fill in the ?’s Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-15 Quantum AND Gate AND: 1110 AND = 0001 1000 1110 0 1 0 0 1 1 1 ? × = 0001 0 0 1 0 0 0 0 ? 0001 AND | 00>>>> | 01 |10 |11 = |0> |0> |0> |?> 2×4 4×1 2×1 Exercise: Fill in the ?’s Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-16 Quantum OR Gate OR: 1000 OR = 0111 1000 1000 0 1 0 0 1 0 0 0 × = 0111 0 0 1 0 0 1 1 1 0001 OR | 00>>>> | 01 |10 |11 = |0> |1> |1> |1> Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-17 Quantum NAND Gate NAND: 0001 NAND = 1110 1000 0001 0 1 0 0 0 0 0 1 × = 1110 0 0 1 0 1 1 1 0 0001 NAND | 00>>>> | 01 |10 |11 = |1> |1> |1> |0> Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-18 Quantum √NOT Gate √NOT: √NOT ×√NOT = NOT 1 11− NOT = 2 11 111111−− 0 1 11 − 1 1 ×= ×= 222211 1 1 11 0 1 |1> |0> 1111− −− 1 1 11 11 − 1 0 × = ×= 2211 1 0 22 11 1 1 |0> |1> Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-19 Controlled NOT Gate CNOT: If the control bit is 0, no change to the 2nd bit If control bit is 1, the 2nd bit is complemented • 1000 ⊕ 0100 CNOT = 0001 0010 1000 1 0 0 0 1 0 0 0 0100 0 1 0 0 0 1 0 0 × = 0001 0 0 1 0 0 0 0 1 00100001 001 0 CNOT | 00>>>> | 01 |10 |11 = |00> |01> |11> |10> Controlled NOT gate can be used to produce two bits that are entangled ⇒ Two bits behave similarly even if far apart ⇒ Can be used for teleportation of information Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-20 Quantum Gates: Summary 01 1110 NOT= AND= 10 0001 Classical 1000 0001 OR= NAND= 0111 1110 1000 1 1− 1 0100 NOT= CNOT= Non-Classical 2 1 1 0001 0010 The first 4 gates above are similar to the classical gates. The last two are non-classical gate. There are many other classical/non-classical quantum gates, e.g., Rotate, Copy, Read, Write, … Using such gates one can design quantum circuits Washington University in St. Louis http://www.cse.wustl.edu/~jain/ ©2019 Raj Jain 19-21 Quantum Applications It has been shown that quantum computation makes several problems easy that are hard currently.