22
Quantum Computing and Quantum Programming Language Choon Oh Lee ISILab, KAIST

Quantum Computing and Quantum Programming Language Choon Oh Lee ISILab, KAIST

Embed Size (px)

Citation preview

Quantum Computing and Quantum Programming Language

Choon Oh Lee

ISILab, KAIST

Motivation

• Moore’s Law– Number of transistors per square inch dou-

bles every two years.

– Expected be broken down in 2020• Atomic scales are reached

• Incoherent by any particle

– Solutions• Fatalists: Noise-based Computing

• Optimists: Quantum Computing

Bit vs. Qubit

or

or

NAND and NOR gate

Value

Realization

Computation

Universalcompo-nent

various candidates(Ion trap, NMR, etc.)

Controlled Not gate

0 1

0 V

5 V

0 0 1 0 1 0 1 0 0 1

ADDER

0 1 1 1 0

S S S S S

Q. Circuit

S S S S S

0 1 1 1 0

Measuring

How’s qubit possible?

• The legendary experiment– By David Wineland and Christopher Monroe

– Steps1. Pin Barium ion in vacuum room

2. Optical freezing on ion to deactivate it

3. Expose ion on laser pulse for certain time– Barium ion had superposition

4. Slightly push ion using laser beam – One ion existed on two different spots

– Remarks

• Superposition is collapsed in 25~50 microsecond

• NIST scientists succeed to make first controlled not gate based on this experiment

Conceptual Models

• Quantum Circuit

• Matrix Mechanics

Computational Model

Algorithmic Model

A

C

B

D

M

M

2 by 1 2 by 12 by 22 by 22 by 22 by 24 by 4

Quantum Gates

• Pauli Gates – Identity (I)

– Not Gate (X)

– Y Gate

– Z Gate

Quantum Gates

• Hadamard Gate (H)– Make a qubit superpositioned.

Quantum Gates

• Controlled Not Gate (cNot)– Apply NOT gate on second bit when first bit

is 1.

Quantum Gates

• Measurement (M) – Technically, it’s not a gate

– It measures a qubit to determine its value

– Output of measurement would be 0 or 1• Probability to be 0:

• Probability to be 1:

– After it measures qubit, qubit becomes just bit

Algorithms

• Quantum Teleportation– Qubits cannot be copied or moved

– How to teleport a qubit

1. Prepare two entangled qubits,

2. Alice and Bob take each qubit initially

3. Alice wants to send an another qubit to Bob

Algorithms

• Quantum Teleportation

H M

M

Z

Alice’s qubit

Bob’s qubit

Originalqubit

Same qubit

Algorithms

• Quantum Teleportation

– Initial state

H M

M

Z

Alice’s qubit

Bob’s qubit

Originalqubit

Same qubit

Algorithms

• Quantum Teleportation

– Previous state

– Current state

H M

M

Z

Alice’s qubit

Bob’s qubit

Originalqubit

Same qubit

Algorithms

• Quantum Teleportation

– Previous state

– Current state

H M

M

Z

Alice’s qubit

Bob’s qubit

Originalqubit

Same qubit

Algorithms

• Quantum Teleportation

– Rearrange current state

H M

M

Z

Alice’s qubit

Bob’s qubit

Originalqubit

Same qubit

Algorithms

• Quantum Teleportation

– Measure first two qubits

H M

M

Z

Alice’s qubit

Bob’s qubit

Originalqubit

Same qubit

Algorithms

• Grover’s Search Algorithm– Searching desired items from database

– Instead of checking every items in data-base, algorithm increases probabilities that desired items can be found decreasing oth-ers’

– Idea is simple, but point is quantum parallelism!

Algorithms

• Grover’s Search Algorithm

0 1 2 3 4 5 6 7

Probability(amplitude)2

0 1 2 3 4 5 6 7

Probability(amplitude)2

1. Apply Hadamard gates to make superposition

Algorithms

• Grover’s Search Algorithm

0 1 2 3 4 5 6 7

Probability(amplitude)2

0 1 2 3 4 5 6 7

Probability(amplitude)2

2. Apply function f

Algorithms

• Grover’s Search Algorithm

0 1 2 3 4 5 6 7

Probability(amplitude)2

3. Flip probability based on average point

0 1 2 3 4 5 6 7

Probability(amplitude)2

Average line

Average line

Algorithms

• Shor’s Factoring Algorithm– Great algorithm that attracted the world’s at-

tention to quantum computing

– Proposed shortcut to break RSA system• The source of RSA’s power is hardness of factor-

ization of a big number which is product of two prime numbers

– Best known way to factor a number, N1. Find a and b where N divides (a2 – b2)

2. If N doesn’t divide (a + b) and (a – b),

3. Then, gcd(N, (a + b)) is one of factors of N

4. Another factor is then N / gcd(N, (a + b))

Algorithms

• Shor’s Factoring Algorithm– Algorithm

input: an odd integer n

1. Choose g in [2…n-1] randomly

2. Calculate d = gcd(g, n)

3. If d ≠ 1, return d

4. Calculate r where gr = 1 (mod n)

5. If r is even, and n doesn’t divide gr/2+1 or gr/2-1, then return gcd(n, gr/2+1)

6. Re-find r or g

– Shor used superpositioned qubits to repre-sent g and QFT to calculate r