Download Surrey seminar on CQP - School of Computing Science

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

Ensemble interpretation wikipedia , lookup

Renormalization wikipedia , lookup

Topological quantum field theory wikipedia , lookup

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

Relativistic quantum mechanics wikipedia , lookup

Double-slit experiment wikipedia , lookup

Renormalization group wikipedia , lookup

Algorithmic cooling wikipedia , lookup

Bohr–Einstein debates wikipedia , lookup

Scalar field theory wikipedia , lookup

Basil Hiley wikipedia , lookup

Delayed choice quantum eraser wikipedia , lookup

Bell test experiments wikipedia , lookup

Particle in a box wikipedia , lookup

Quantum field theory wikipedia , lookup

Path integral formulation wikipedia , lookup

Max Born wikipedia , lookup

Quantum decoherence wikipedia , lookup

Copenhagen interpretation wikipedia , lookup

Coherent states wikipedia , lookup

Measurement in quantum mechanics wikipedia , lookup

Hydrogen atom wikipedia , lookup

Density matrix wikipedia , lookup

Quantum electrodynamics wikipedia , lookup

Quantum dot wikipedia , lookup

Probability amplitude wikipedia , lookup

Quantum fiction wikipedia , lookup

Many-worlds interpretation wikipedia , lookup

Symmetry in quantum mechanics wikipedia , lookup

Bell's theorem wikipedia , lookup

Orchestrated objective reduction wikipedia , lookup

Quantum entanglement wikipedia , lookup

Interpretations of quantum mechanics wikipedia , lookup

History of quantum field theory wikipedia , lookup

Quantum computing wikipedia , lookup

Quantum group wikipedia , lookup

Quantum machine learning wikipedia , lookup

Canonical quantization wikipedia , lookup

T-symmetry wikipedia , lookup

Quantum state wikipedia , lookup

Quantum cognition wikipedia , lookup

EPR paradox wikipedia , lookup

Hidden variable theory wikipedia , lookup

Quantum key distribution wikipedia , lookup

Quantum teleportation wikipedia , lookup

Transcript
Communicating Quantum Processes
Simon Gay
Department of Computing Science
University of Glasgow
Rajagopal Nagarajan
Department of Computer Science
University of Warwick
This work was presented at the Second International Workshop on Quantum
Programming Languages, Turku, Finland, July 2004, and at the
ACM Symposium on Principles of Programming Languages (POPL),
Long Beach, California, January 2005.
Overview
Quantum computing has the potential to solve some hard
problems efficiently.
Only a few algorithms are known and at present there are no techniques
for generic improvement of algorithmic performance.
Physical implementations of quantum computers of useful size are a
long way in the future.
Shor’s algorithm (1994) can efficiently factorize large integers.
O(n2 log n log log n)
A practical implementation of Shor’s algorithm would kill much of our
present cryptographic technology.
Surrey Seminar: Communicating Quantum Processes
2
Overview
Quantum cryptographic techniques are secure even in the
presence of quantum computers.
Quantum cryptography is much easier to implement than
quantum computing. City-scale demonstrations have taken
place, and components are commercially available.
Quantum cryptography (and other quantum communication
systems) will definitely be an important practical technology
in the near future.
Surrey Seminar: Communicating Quantum Processes
3
Overview
Although quantum cryptographic protocols have been proved
mathematically to be secure, we believe that there is a need
for verification of systems which combine quantum
communication with classical computation and communication.
Computer science has a range of theories, techniques and
tools which have been successfully used to verify classical
communication and cryptographic systems.
Formal modelling languages, specification logics, type theory,
model-checking tools, automated theorem-proving, ...
Our research programme: to apply these techniques to
combined quantum/classical systems.
Surrey Seminar: Communicating Quantum Processes
4
Outline
Background on quantum computing.
Quantum communication: dense coding.
The language CQP (pi calculus + quantum operations).
illustration through the above examples
formal semantics and type system
Future work.
Surrey Seminar: Communicating Quantum Processes
5
Qubits
In classical computing the fundamental unit of information is the
bit. The value of a bit is either 0 or 1.
In quantum computing the fundamental unit of information is the
quantum bit or qubit.
A qubit has two basis states: |0 and |1 (physics notation).
A general state of a qubit is |0 + |1 where  and  are
2
2
complex numbers, usually normalized so that     1
If both  and  are non-zero then the state is said to be a
superposition.
Surrey Seminar: Communicating Quantum Processes
6
Measurement
A qubit can be measured to produce a classical value.
If a qubit is in state |0 + |1 then the outcome of a
measurement is probabilistic.
With probability  2 the result is 0 and the qubit enters state |0.
With probability  2 the result is 1 and the qubit enters state |1.
1
1
0 
1
Example: measure a qubit which is in state
2
2
with probability 0.5 the result is 0 and the qubit enters state |0
with probability 0.5 the result is 1 and the qubit enters state |1
Surrey Seminar: Communicating Quantum Processes
7
Systems of Multiple Qubits
For example, consider a system of 2 qubits.
There are 4 basis states: |0|0 |0|1 |1|0 |1|1
A general state is a superposition of the basis states:
 0 0   0 1  1 0  1 1
where       
2
2
2
2
1
A measurement of both qubits has the following outcome:
With probability  2 the result is 0 and the new state is |0|0.
With probability  2 the result is 1 and the new state is |0|1.
With probability  2 the result is 2 and the new state is |1|0.
2
With probability  the result is 3 and the new state is |1|1.
Surrey Seminar: Communicating Quantum Processes
8
Systems of Multiple Qubits
For example, consider a system of 2 qubits.
There are 4 basis states: |0|0 |0|1 |1|0 |1|1
A general state is a superposition of the basis states:
 0 0   0 1  1 0  1 1
where       
2
2
2
2
1
A measurement of the first qubit has the following outcome:
 0 0  0 1
2
2
With prob.    result 0 and new state
2
2
 
With prob.   
2
2
result 1 and new state
 1 0  1 1
Surrey Seminar: Communicating Quantum Processes
 
2
2
9
Quantum Parallelism
Suppose we have a function f : {0,1}  {0,1} from which we
can derive a transformation F on qubits, such that
F 0  f (0 )
F 1  f (1)
Transformations extend linearly to superpositions, so
F( 0   1 )   f (0)   f (1)
For a function on n bits we can compute 2n function applications
simultaneously. Magic! This is quantum parallelism and is the
basis for the simplistic claim that quantum computing can
deliver exponential efficiency gains for general problems.
BUT the only way to extract information is to measure, so we
get either f(0) or f(1) and we don’t even know which it is!
Surrey Seminar: Communicating Quantum Processes
10
Deutsch’s Problem
Suppose we have a black box which computes an unknown
function f : {0,1}  {0,1} , and we want to know whether or not
f is a constant function.
Classically we can’t do better than calculating f(0) and f(1) and
comparing the results.
But suppose we can ask for a quantum version of the black box.
It’s not reasonable to expect F such that
F 0  f (0 )
F 1  f (1)
in general, because quantum theory requires F to be invertible
and f might not be invertible.
Surrey Seminar: Communicating Quantum Processes
11
Deutsch’s Problem
It is reasonable to ask for a transformation F such that
F x y  x y  f ( x)
so let’s assume that this is the quantum version of the black box.
We will make use of the superposed qubit states
1
1
 
(0  1)
 
(0  1)
2
2
and apply F to the state
1
   (0 0  0 1  1 0  1 1)
2
Surrey Seminar: Communicating Quantum Processes
12
Deutsch’s Problem
 
1
(0  1)
2
F x 0  x f ( x)
 
1
(0  1)
2
F x y  x y  f ( x)
F x 1  x 1 f ( x )
1
x (0  1)
If f(x)=0 then F x  
2
1
x (1  0 )
If f(x)=1 then F x  
2
( 1)f ( x )
Therefore F x  
x ( 0  1 )  ( 1)f ( x ) x 
2
Surrey Seminar: Communicating Quantum Processes
13
Deutsch’s Problem
 
1
(0  1)
2
 
1
(0  1)
2
F x   ( 1)f ( x ) x 
Therefore
F   
if f(0) = f(1)
F   
if f(0)  f(1)
There is a transformation H such that
H  0
H  1
so applying H to the first qubit gives
0 
if f(0) = f(1)
1
if f(0)  f(1)
Surrey Seminar: Communicating Quantum Processes
14
Deutsch’s Problem
We end up with the following state:
0 
if f(0) = f(1)
1
if f(0)  f(1)
and now measuring the first qubit gives us the desired
information about f , and we only used the quantum
black box once.
Quantum parallelism was used to calculate f(0) and f(1) ;
a global property of f ended up being encoded in a single place
so that it could be extracted by a measurement.
Developing quantum algorithms for interesting problems seems
to be very difficult.
Surrey Seminar: Communicating Quantum Processes
15
Entanglement
A state of n qubits which is not of the form 1 2  n
is said to be entangled.
The simplest example: 2 qubits in state
1
(0 0  1 1)
2
Suppose we measure the first qubit from this state:
With probability 0.5 the result is 0 and the new state is |0|0.
With probability 0.5 the result is 1 and the new state is |1|1.
In both cases, the two qubits now have the same state.
Measuring the second qubit is guaranteed to give the same
result as the first measurement, even if the qubits are
physically separated by any distance.
Surrey Seminar: Communicating Quantum Processes
16
Transformation / Evolution
Evolution of a quantum system is described by a Hermitian
operator.
Concretely, for a system of n qubits, an operator is a 2n  2n
matrix A such that A 1  A *
where A* is the conjugate transpose.
Example:
The Hadamard operator H is defined by
H0  
H1  

Represent  0   1 by  
 
then
Surrey Seminar: Communicating Quantum Processes
1 1 1 
H


2 1  1
17
Controlled Not
The controlled not operator applies to 2 qubits.
CNot 0 x  0 x
CNot 1 x  1 1  x
Using H and CNot we can prepare an entangled state:
CNot((H  id)( 0 0 ))  CNot(  0 )
1
1

CNot 0 0 
CNot 1 0
2
2
1
1

0 0 
11
2
2
Surrey Seminar: Communicating Quantum Processes
18
Pauli Operators
The Pauli operators will be useful in a moment. They apply to
single qubits.
0 0  0
1 0  1
2 0  0
 3 0  i 1
0 1  1
1 1  0
2 1   1
3 1  i 0
 1 0
0  

 0 1
 0 1
1  

 1 0
1 0 
2  

 0  1
 0  i
3  

i 0
Surrey Seminar: Communicating Quantum Processes
19
The No Cloning Theorem
There is no unitary transformation U such that for all Ψ
U(   s )    
( s is some standard initial state for the second qubit).
Proof: (Dieks; Wootters & Zurek; 1982)
U(   s )    
Take inner product:
U(   s )    
   (   )2
Therefore either    0 or    1
So φ and ψ are either orthogonal or identical.
Surrey Seminar: Communicating Quantum Processes
20
Dense Coding
A protocol allowing 2 classical bits of information to be
transmitted by sending 1 qubit and making use of entanglement.
Alice and Bob share an entangled pair of qubits: x, y.
Alice wishes to send n (0  n  3) to Bob. There is a quantum
channel q linking them.
Alice
x
1
x, y 
(0 0  1 1)
2
Bob
y
(0  n  3)
can transmit qubits
q
Surrey Seminar: Communicating Quantum Processes
21
Dense Coding
A protocol allowing 2 classical bits of information to be
transmitted by sending 1 qubit and making use of entanglement.
Alice and Bob share an entangled pair of qubits: x, y.
Alice wishes to send n (0  n  3) to Bob. There is a quantum
channel q linking them.
Alice(x:Qbit, q:^[Qbit], n:0..3) = ...
Bob(y:Qbit, q:^[Qbit]) = ...
System(x:Qbit, y:Qbit, n:0..3) =
(new q:^[Qbit])( Alice(x,q,n) | Bob(y,q) )
Surrey Seminar: Communicating Quantum Processes
22
Dense Coding
Alice selects a Pauli transformation corresponding to n,
applies it to x, and sends x to Bob.
Alice
x
1
x, y 
(0 0  1 1)
2
Bob
y
n
x
send x to Bob
Alice(x:Qbit, q:^[Qbit], n:0..3) =
{x *= n} . q![x] . Stop
Surrey Seminar: Communicating Quantum Processes
23
Dense Coding
Alice selects a Pauli transformation corresponding to n,
applies it to x, and sends x to Bob.
Alice
x
n
1
x, y 
(0 0  1 1)
2
eg. n=1
x
x, y 
Bob
y
1
(1 0  0 1)
2
send x to Bob
Alice(x:Qbit, q:^[Qbit], n:0..3) =
{x *= n} . q![x] . Stop
Surrey Seminar: Communicating Quantum Processes
24
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,
then measures x,y. The result uniquely determines n.
Alice
x
1
x, y 
(0 0  1 1)
2
Bob
y
n
x
send x to Bob
x, y
CNot
x, y
H
n
measure x,y
x, y
Surrey Seminar: Communicating Quantum Processes
25
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,
then measures x,y. The result uniquely determines n.
Alice
x
n
1
x, y 
(0 0  1 1)
2
Bob
y
eg. n=1
x
send x to Bob
x, y 
1
(1 0  0 1)
2
CNot
x, y
H
n
measure x,y
x, y
Surrey Seminar: Communicating Quantum Processes
26
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,
then measures x,y. The result uniquely determines n.
Alice
x
n
1
x, y 
(0 0  1 1)
2
Bob
y
eg. n=1
x
send x to Bob
x, y 
1
(1 0  0 1)
2
CNot
H
n
measure x,y
1
x, y 
(1 1  0 1)
2
x, y
Surrey Seminar: Communicating Quantum Processes
27
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,
then measures x,y. The result uniquely determines n.
Alice
x
n
1
x, y 
(0 0  1 1)
2
Bob
y
eg. n=1
x
send x to Bob
x, y 
1
(1 0  0 1)
2
CNot
H
n
measure x,y
1
x, y 
(1 1  0 1)
2
x, y  0 1
Surrey Seminar: Communicating Quantum Processes
28
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,
then measures x,y. The result uniquely determines n.
Alice
x
n
1
x, y 
(0 0  1 1)
2
Bob
y
eg. n=1
x
send x to Bob
x, y 
1
(1 0  0 1)
2
CNot
H
1
measure x,y
1
x, y 
(1 1  0 1)
2
x, y  0 1
Surrey Seminar: Communicating Quantum Processes
29
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,
then measures x,y. The result uniquely determines n.
Bob(y:Qbit, q:^[Qbit]) =
q?[z:Qbit] . {z,y *= CNot} . {z *= H} . Use(measure z,y)
Surrey Seminar: Communicating Quantum Processes
30
Dense Coding
Alice(x:Qbit, q:^[Qbit], n:0..3) =
{x *= n} . q![x] . Stop
Bob(y:Qbit, q:^[Qbit]) =
q?[z:Qbit] . {z,y *= CNot} . {z *= H} . Use(measure z,y)
System(x:Qbit, y:Qbit, n:0..3) =
(new q:^[Qbit])( Alice(x,q,n) | Bob(y,q) )
System is parameterized by x and y (and we must assume that
they are entangled).
Surrey Seminar: Communicating Quantum Processes
31
Dense Coding with Entanglement Server
We can make the system more self-contained: Alice and Bob
receive their entangled qubits from a third process.
(EPR source or entanglement server)
Alice’(s:^[Qbit], q:^[Qbit], n:0..3) =
s?[x:Qbit] . Alice(x,q,n)
Bob’(t:^[Qbit], q:^[Qbit]) =
t?[y:Qbit] . Bob(y,q)
Source(s:^[Qbit], t:^[Qbit]) =
(qbit x,y)({x *= H} . {x,y *= CNot} . s![x] . t![y] . Stop)
System(n:0..3) =
(new q, s, t:^[Qbit])( Alice’(s,q,n) | Bob’(t,q) | Source(s,t) )
Surrey Seminar: Communicating Quantum Processes
32
The Language CQP
This example has introduced our language CQP.
Defining a formal language for describing protocols is a
valuable step.
We have also defined a formal operational semantics.
It is based on the pi calculus, with the addition of global state
(for the qubits) and probabilistic reductions (arising from
measurements).
CQP has a static type system which, in addition to checking
correct use of values and channels, guarantees that qubits are
not syntactically copied (because of the No Cloning Theorem).
Surrey Seminar: Communicating Quantum Processes
33
Reduction in CQP
Communication
1
x, y 
( 0 0  1 1 ) ; q ; (q! [ x].Stop | q ?[ z : Qbit ].Use( z))
2
1
x, y 
( 0 0  1 1 ) ; q ; (Stop | Use( x ))
2
Surrey Seminar: Communicating Quantum Processes
34
Reduction in CQP
Measurement
1
x, y 
( 0 0  1 1 ) ; q ; Use(measure x, y )
2
1
 ( x, y  0 0 ; q ; Use(0)) 
2
1
2
x, y  0 0 ; q ; Use(0)
1
 ( x, y  1 1 ; q ; Use(3))
2
1
2
x, y  1 1 ; q ; Use(3)
Surrey Seminar: Communicating Quantum Processes
35
Typechecking for No Cloning
Suppose that Alice continues with some behaviour, after
sending the qubit to Bob.
Alice(x:Qbit, q:^[Qbit], n:0..3) =
{x *= n} . q![x] . Continue
The type system of CQP guarantees that Continue does not
refer to x.
Technically: the fact that x is sent along q means that Continue
is typechecked in an environment which does not contain x.
The details are based on several pi calculus type systems,
going back to Kobayashi, Pierce & Turner (1996).
Surrey Seminar: Communicating Quantum Processes
36
Teleportation
Alice and Bob share an entangled pair x,y of qubits.
Alice has a qubit z in an unknown state, and she wishes to
transmit this state to Bob (perhaps the physical form of z is not
suitable for a direct transfer).
Alice applies CNot to z,x and then applies H to z.
Then she measures z,x to yield a two-bit classical value which
she sends to Bob on a channel c.
Bob uses this value to select a Pauli transformation and applies
it to y. The result is that the final state of y is the same as the
initial state of z.
Surrey Seminar: Communicating Quantum Processes
37
Teleportation in CQP
Alice(x:Qbit, c:^[0..3], z:Qbit) =
{z,x *= CNot} . {z *= H} . c![measure z,x] . Stop
Bob(y:Qbit, c:^[0..3]) =
c?[r:0..3] . {y *= r} . Use(y)
System(x:Qbit, y:Qbit, z:Qbit) =
(new c:^[0..3])( Alice(x,c,z) | Bob(y,c) )
Surrey Seminar: Communicating Quantum Processes
38
How Teleportation Works
x and y are entangled:
x, y 
z has some general state:
Overall state:
1
(0 0  1 1)
2
z  0  1
z, x, y  ( 0   1 ) 
z, x, y 
1
(0 0  1 1)
2
1
( 000   011   100   111 )
2
Surrey Seminar: Communicating Quantum Processes
39
How Teleportation Works
z, x, y 
1
( 000   011   100   111 )
2
z,x *= CNot
z, x, y 
1
( 000   011   110   101 )
2
z *= H
1
z, x, y  ( 000   001   010   011   100   101   110   111 )
2
Surrey Seminar: Communicating Quantum Processes
40
How Teleportation Works
1
z, x, y  ( 000   001   010   011   100   101   110   111 )
2
measure z,x
z, x, y   000   001
result = 0
y *= 0
z, x, y  00  ( 0   1 )
z, x, y   010   011
result = 1
y *= 1
z, x, y  01  ( 0   1 )
z, x, y   100   101
result = 2
y *= 2
z, x, y  10  ( 0   1 )
z, x, y    110   111 result = 3
y *= 3
z, x, y  11  ( 0   1 )
In each case the final state of y is the same as the initial state
of z, (and there is no entanglement between z,x and y).
Surrey Seminar: Communicating Quantum Processes
41
Related Work
There are several papers on quantum programming languages
and our syntax has been influenced in particular by Selinger’s
QPL (2003).
Jorrand & Lalire (2004) have defined a quantum process
algebra (QPA), which is quite similar to CQP in several ways
(there has now been considerable influence in both directions).
The type system is one of our distinctive features.
Surrey Seminar: Communicating Quantum Processes
42
Future Work
The purpose of defining CQP is to support formal reasoning
about quantum systems. There are several directions to explore.
Verification tools: we are now working with PRISM models
constructed in its (low-level) language. In the future we aim
to construct PRISM models by translation from CQP.
Translation into non-probabilistic model-checking systems may
also be useful, for exploration of possibilities before analysis of
probabilities.
Translation into some existing simulation framework may also
be worthwhile.
Surrey Seminar: Communicating Quantum Processes
43
Future Work
Logics for specification: for both automatic and non-automatic
verification.
Example: a group at Technical University of Lisbon is
developing a Hoare-style logic for quantum systems, but
they have no formal syntax for describing systems.
{ pre } P { post }
ad hoc description of a system
Type-theoretic methods: can we get more from a type system?
For example: can we develop type systems for high-level
properties such as secrecy? (This is known for classical security
protocols.)
Surrey Seminar: Communicating Quantum Processes
44