Download Research Status, Winter 2009 - Cove

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Theoretical and experimental justification for the Schrödinger equation wikipedia , lookup

Quantum dot cellular automaton wikipedia , lookup

Wave–particle duality wikipedia , lookup

Relativistic quantum mechanics wikipedia , lookup

Renormalization wikipedia , lookup

Renormalization group wikipedia , lookup

Topological quantum field theory wikipedia , lookup

Double-slit experiment wikipedia , lookup

Basil Hiley wikipedia , lookup

Delayed choice quantum eraser wikipedia , lookup

Scalar field theory wikipedia , lookup

Bohr–Einstein debates wikipedia , lookup

Probability amplitude wikipedia , lookup

Particle in a box wikipedia , lookup

Algorithmic cooling wikipedia , lookup

Density matrix wikipedia , lookup

Quantum electrodynamics wikipedia , lookup

Quantum decoherence wikipedia , lookup

Bell test experiments wikipedia , lookup

Coherent states wikipedia , lookup

Quantum field theory wikipedia , lookup

Copenhagen interpretation wikipedia , lookup

Path integral formulation wikipedia , lookup

Max Born wikipedia , lookup

Hydrogen atom wikipedia , lookup

Measurement in quantum mechanics wikipedia , lookup

Bell's theorem wikipedia , lookup

Quantum dot wikipedia , lookup

Symmetry in quantum mechanics wikipedia , lookup

Quantum fiction wikipedia , lookup

Many-worlds interpretation wikipedia , lookup

Quantum entanglement wikipedia , lookup

Orchestrated objective reduction wikipedia , lookup

History of quantum field theory wikipedia , lookup

EPR paradox wikipedia , lookup

Interpretations of quantum mechanics wikipedia , lookup

T-symmetry wikipedia , lookup

Canonical quantization wikipedia , lookup

Quantum group wikipedia , lookup

Quantum machine learning wikipedia , lookup

Quantum key distribution wikipedia , lookup

Quantum cognition wikipedia , lookup

Quantum state wikipedia , lookup

Hidden variable theory wikipedia , lookup

Quantum teleportation wikipedia , lookup

Quantum computing wikipedia , lookup

Transcript
Cove: A Practical Quantum
Computer Programming
Framework
Matt Purkeypile (DCS3)
Winter 2009
Quantum Computing
• Quantum computers operate on qubits (quantum bits),
which can be 0, 1, or a combination of the two
(superposition).
– Changes to one qubit may impact another through
entanglement.
– n qubits can represent 2n numbers at once.
• Existing (classical) computers keep getting faster, but
still operate on bits.
– Simulating a quantum computer leads to an exponential slow
down.
– Requires 2n complex numbers to simulate n qubits, 2n x 2n
complex matrix for an operation.
• With quantum computers several things can be done
efficiently: simulation of quantum systems, factoring, and
unsorted database search to name a few.
What is Cove?
• Cove is a software framework that allows for
quantum computation to be performed using a
classical language.
• Two key components: interfaces and
implementations.
– Interfaces specify what needs to be provided to
program quantum computers.
– Implementations specify how.
– If users code to interfaces, implementations can be
swapped out with ideally no change to user code.
– A prototype implementation is part of the project. This
simulates a quantum computer locally on a PC.
• Implemented in C#
Cove Example: Entanglement
What did I do last term?
• Completed more work in the local
simulation implementation.
– Got it to the point where it can carry out
simple examples such as entanglement.
– Also able to carry out many operations
without “slicing”.
• Completed a major revision and
restructuring of the dissertation.
– While still lengthy, I’m much more comfortable
with the structure now.
Factoring
• Shor’s algorithm (1994) allows for efficient
factoring on a quantum computer.
– Spurred more interest in quantum computing as it
was the first “real world” algorithm.
– Quantum computers first thought of in the early
1980’s.
• Efficient factoring allows for cracking codes.
– Such as the commonly used RSA algorithm.
– Why? N=pq is easy to calculate when given pq, but
hard if only given N. (Sometimes see the term “one
way functions”.)
High Level View of Factoring
• Most of steps of the algorithm can be carried out
classically.
• A probabilistic algorithm: may have to repeat runs until
the answer is achieved.
Trivial Example
• Goal: Factor 15. Result is 3 and 5.
– This has been done on quantum computers in the lab.
– A simple example that can easily be worked out by
hand.
• Step 1, let:
– N = 15 (the number we are factoring)
– n = number of (qu)bits needed to express N, in this
case 4.
– m = 8 (a randomly selected number between 1 and N)
Step 2
• Calculate
f ( x)  m x mod N
– Need to calculate with enough x’s to find the period. x
= 0, 1, 2, ….
– In general, go to at least n2 values: 0 – 15 in this case.
(It seems like guessing would be faster, but isn’t.)
• Given this we can find the period (P).
– Essentially where f(x) repeats.
– In other words f(x + P) = f(x) for every x.
• This is the part of the algorithm where a
quantum computer is used and makes it
efficient.
Result
f (0)  80 mod15  1
f (1)  81 mod15  8
f (2)  82 mod15  4
f (3)  83 mod15  2
f (4)  84 mod15  1
f (5)  85 mod15  8
f (6)  86 mod15  4
f (7)  87 mod15  2
f (8)  88 mod15  1
f (9)  89 mod15  8
f (10)  810 mod15  4
f (11)  811 mod15  2
f (12)  812 mod15  1
f (13)  813 mod 15  8
f (14)  814 mod15  4
f (15)  815 mod15  2
Graphically this is easier to see…
Using the result
• The period is 4, as it repeats 1, 8, 4, 2,…
– This concludes step 2
• Step 3: is the period even?
– If not we start over using a different randomly
selected m.
• Step 4: Utilize the period (P):
8
4/2
 1  8  1  65
2
84/2  1  82  1  63
Check the result
• gcd(65, 15) = 5 and gcd(63, 15) = 3
– This is can be done efficiently on classical computers
[1].
• Step 5: we have found the factors 5 and 3.
– May only obtain one of the factors for many numbers.
– Simple to obtain the second factor if not found, basic
algebra: pq=N, we know N and either p or q.
– Start over with a different m if the gcd of the results
are 1.
[1] M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 1
ed. Cambridge, UK: Cambridge University Press, 2000.
Why a quantum computer?
• A quantum computer speeds things up by doing step 2
(finding the period) efficiently.
– Qubits are put in a superposition to represent all possible x’s at
once (in the first register).
– In the case of factoring 15 we need 12 qubits (2(4) + 4, as we
need two registers) [2]
• Next f(x) is performed on the qubits in superposition.
– One calculation on a quantum computer, many more classically.
– The result is put in the second register.
• Measure Register2- Collapses the superpositions.
• The period is then obtained via the quantum Fourier
transform followed by a measurement
• The rest of the algorithm is done classically.
[2]
N. S. Yanofsky and M. A. Mannucci, Quantum Computing for Computer
Scientists, 1 ed. New York, NY: Cambridge University Press, 2008.
What is really happening after first
measurement?
f(x) for m=8, N=15 after measurement of 4
5
f(x)
4
3
2
1
0
1
2
3
4
5
6
7
8
x
9
10
11
12
13
14
15
How about QFT and the second
measurement?
How does this scale?
• 15 is a trivial example, how about a 128 bit number?
• We need 384 qubits (128 * 3) to do the quantum part of
the algorithm.
– The quantum operations that are performed are done once, just
on more qubits. Similar to adding two integers: same technique,
more bits.
• If we do it classically we have to calculate f(x) many
times.
– It isn’t how easy it is to calculate f(x), it is how many times.
– Need to go from 0 to n2 , this is a huge number of calculations for
a 128 bit number. This means 2(2*128) or ~1.16 x 1077
– The results have to be stored somewhere (taking up memory)
and then we still have find the period!
– Or we can just use 384 qubits and run through a set of quantum
operations, so the quantum computer scales quite well.
• Quantum Fourier Transform also finds the period in one
operation.
Goals for Winter 2009
• Get Shor’s algorithm (factoring) working in Cove.
– Requires additional work on the local simulation
prototype.
• Fill in the sections for Shor’s algorithm in the
dissertation.
• Incorporate feedback from the Fall 2008 draft.
– Includes making the message more consistent.
• Ideally, all of the major content in the dissertation
by the end of the term.
– This leaves a few months for editing and cleanup.
– Won’t be perfect, but the “meat” will be there.
– Goal: Defend in late June 2009.
Questions?
(Courtesy of XKCD)
https://cove.purkeypile.com/
[email protected]