Quantum Computing
Programming and Algorithms
Cars.com Tech Tailgate 2016
Stephen Habegger
2
Quantum Computing
•Cryptography
•Authentication
•Data Compression
•Database
•Etc.
3
Quantum Computing
•Mathematics
•Quantum Physics
•Quantum Computer Architecture
•Quantum Algorithms
•Building a Quantum Circuit
• www.research.ibm.com/quantum/
•Quantum Computing Software
•Quantum Computing Hardware
•Questions
4
Mathematics
5
Complex Numbers
● Imaginary
● Complex
● Complex Conjugate
● Modulus
6
Complex Numbers
● Polar Representation
● Euler’s Formula https://en.wikipedia.org/wiki/Complex_number
7
Linear Algebra: Matrix Multiplication
8
Linear Algebra: Tensor Product
9
Quantum Physics
10
Light Polarization
Unpolarized
Light
Vertical
Polarization
Filter
Vertically
Polarized
Light
Horizontal
Polarization
Filter
No
Light
11
Light Polarization
Unpolarized
Light
Vertical
Polarization
Filter
Vertically
Polarized
Light
Horizontal
Polarization
Filter
Horizontally
Polarized
Light
(New Basis)
Diagonal
Polarization
Filter
Diagonally
Polarized
Light
(New Basis)
12
Qubits: The Bloch Sphere
13
Quantum Computer
Architecture
14
State Vectors
The state of a bit/qubit can be represented by a vector.
In the case of a qubit this serves as a complementary
representation to the Bloch sphere, where the
probability of measuring a given state is given by the
modulus of the associated value.
15
State Transitions
•Operations on bits/qubits can be described as
matrices
•Multiplying a matrix which represents an operation
by an input state vector returns the resulting output
state vector
16
Multiple Qubits
Multiple independent qubits (or operations on qubits)
can be represented by the tensor product of the two
state vectors (or operation matrices)
17
Classical Logic Gates
IDENTITY NOT AND
OR XOR
18
Quantum Logic Gates
X (NOT) Z S
T
Y
Hadamard (H) Sqrt NOT
19
Reversible Logic Gates: Toffoli
20
Reversible Logic Gates: Toffoli
21
Quantum AND Gate via Toffoli
22
Quantum Algorithms
23
General Quantum Algorithm
1.Qubits start in some classical state
- e.g. 0000 or 1001
2.System is placed into a superposition of states
3.Act upon qubits using unitary operations
4.Measure some of the qubits (collapsing to a classical
state)
24
Deutsch’s Algorithm
•Determines whether a function is “balanced” or
“constant”
•Operates on functions in the space
•Classical algorithms require 2 calls to the function,
while the quantum algorithm requires 1. This is
achieved by a “change of basis” in the problem
space.
25
Deutsch’s Algorithm
Balanced Function Constant Function
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
26
Deutsch’s Algorithm
www.research.ibm.com/quantum/
CONSTANT
BALANCED
27
Grover’s Algorithm
Find an element in a set in expected time
1.Start with a selector function
2.Repeat times
a.Perform phase inversion using selector function (selected
element takes opposite phase from other elements)
b.Perform inversion about the mean (amplitude of selected
element is increased)
3.Measure
28
Grover’s Algorithm
Phase Inversion Inversion About Mean
29
Grover’s Algorithm
30
Cryptography
•Public key cryptography (RSA)
• Relies on difficulty of factoring large numbers (with large
prime factors)
• Shor’s algorithm can factor integers in polynomial
expected time
•Quantum private key generation & eavesdropping
• Classical bits randomly generated and transmitted as
qubits in randomly selected bases
• Qubits measured in randomly selected bases
• Subset of qubits transmitted/measured in same bases are
compared; rest are used as private key
31
Quantum Computing
Software
32
Quantum Assembly
•Based on QRAM architecture
• Provably equivalent to Quantum Circuit and Quantum Turing
Machine architectures
•Act upon a register of qubits
•Commands
• INITIALIZE
• SELECT
• APPLY
• CONCAT
• TENSOR
• INVERSE
• MEASURE
•QASM (IBM, MIT, etc.)
33
Higher-Level Quantum Languages
•Types (other than quantum bit sequences)
•Functions (must be reversible)
•QCL
• C-like syntax
• QReg type
• User-defined operators and functions
•Q
•QFC
• Flowchart-type syntax
• Classical control statements
34
Quantum Computing
Hardware
35
Quantum Hardware
•Challenges
• Allow entanglement
• Avoid decoherence
•Ion Trap
• Confine ionized atoms in electromagnetic field
• Excited vs ground state (optical pumping via lasers)
•Optical Quantum Computers
• Light polarization
36
Questions
37
Appendix A: Resources
38
Resources
Yanofsky, Noson S.; Mannucci, Mirco A. (2008-08-11). Quantum Computing for
Computer Scientists. Cambridge University Press - A.
Perry, Riley Tipton (2012-07-11). Quantum Computing from the Ground Up.
Wspc.
IBM Quantum Experience. www.research.ibm.com/quantum/
Microsoft Language-Integrated Quantum Operations: LIQUi|>.
https://www.microsoft.com/en-us/research/project/language-integrated-
quantum-operations-liqui/
Quantum Simulator. https://github.com/shabegger/quantum-emulate
39
Appendix B: Phase Inversion
Calculations
40
Grover Phase Inversion
41
Grover Phase Inversion
42
Grover Phase Inversion
43
Grover Phase Inversion
44
Grover Phase Inversion
45
Grover Phase Inversion
46
Grover Phase Inversion
47
Grover Phase Inversion
48
Grover Phase Inversion

Quantum Computing