Communicating Quantum Processes
Simon GayDepartment of Computing Science
University of Glasgow, UK
Rajagopal NagarajanDepartment of Computer Science
University of Warwick, UK
Communicating Quantum Processes / POPL 2005 2
Overview
Quantum computing is of great interest because it has thepotential to solve some hard problems efficiently.
Only a few algorithms are known and at present there are no techniquesfor generic improvement of algorithmic performance.
Physical implementations of quantum computers of useful size are along way in the future.
Recent interest in quantum programming languages, includingsemantic studies, is very significant.
Communicating Quantum Processes / POPL 2005 3
Overview
Our work addresses quantum protocols rather than algorithms.
Quantum cryptography is much easier to implement thanquantum computing. City-scale demonstrations have takenplace, and components are commercially available.
Quantum cryptography (and other quantum communication systems)will become an important practical technology in the near future.
A range of protocols has been developed: cryptographic key distribution,communication protocols exploiting entanglement, ...
Quantum cryptographic techniques are provably secure even in thepresence of quantum computers.
Communicating Quantum Processes / POPL 2005 4
Overview
Although quantum cryptographic protocols have been provedmathematically to be secure, we believe that there is a needfor verification of systems which combine quantum andclassical computation and communication.
Computer science has a range of theories, techniques andtools which have been successfully used to verify classicalcommunication and cryptographic systems.
Formal modelling languages, specification logics, type theory,model-checking tools, automated theorem-proving, ...
Our research programme: to apply these techniques tocombined quantum/classical systems.
Communicating Quantum Processes / POPL 2005 5
Overview
We have defined a formal language, CQP, for modellingsystems which combine quantum and classical computationand communication.
CQP is based on a combination of the pi calculus andSelinger’s language QPL. Details of the semantics havealso been influenced by Jorrand & Lalire’s QPAlg.
CQP has a static type system which controls the use ofquantum state, corresponding to the no cloning theorem.The type system and the operational semantics are relatedby a Type Preservation theorem of the usual kind.
Communicating Quantum Processes / POPL 2005 6
Recall Concepts of Quantum Computation
Qubits: basis states |0 and |1 , superpositions |0 + |1
Measurement: measuring |0 + |1 has the result
0 with probability (and final state |0). 221 with probability (and final state |1).
Systems of multiple qubits:
for example a two-qubit system has basis states
|0|0 |0|1 |1|0 |1|1
Communicating Quantum Processes / POPL 2005 7
Recall Concepts of Quantum Computation
Unitary transformation: for example CNot and H defined by
)10(2
1
)10(2
1
H |0 =
H |1 =
CNot |0|x = |0|x
CNot |1|x = |1|1-x
Entanglement: a multi-qubit state which is not a tensor product
for example )1100(2
1
measuring the first qubit yields either |0|0 or |1|1and in either case both qubits now have the same value
Entanglement is used by several protocols as a resourcefor information transmission.
Communicating Quantum Processes / POPL 2005 8
Dense Coding
A protocol allowing 2 classical bits of information to betransmitted 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 quantumchannel q linking them.
Alice Bob
x y)1100(
21
y,x
(0 n 3)can transmit qubits
q
Communicating Quantum Processes / POPL 2005 9
Dense Coding
A protocol allowing 2 classical bits of information to betransmitted 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 quantumchannel 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) )
Communicating Quantum Processes / POPL 2005 10
Dense Coding
Alice uses n to select one of the 4 Pauli transformations,applies it to x, and sends x to Bob.
Alice Bob
x y)1100(
21
y,x
n
xsend x to Bob
Alice(x:Qbit, q:^[Qbit], n:0..3) ={x *= n} . q![x] . Stop
Communicating Quantum Processes / POPL 2005 11
Dense Coding
Alice Bob
x y)1100(
21
y,x
n
xsend x to Bob
Alice(x:Qbit, q:^[Qbit], n:0..3) ={x *= n} . q![x] . Stop
eg. n=1 )1001(2
1y,x
Alice uses n to select one of the 4 Pauli transformations,applies it to x, and sends x to Bob.
Communicating Quantum Processes / POPL 2005 12
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,then measures x,y. The result uniquely determines n.
Alice Bob
x y)1100(
21
y,x
n
xsend x to Bob
CNot
x, yH
x, ymeasure x,y
n
x, y
Communicating Quantum Processes / POPL 2005 13
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,then measures x,y. The result uniquely determines n.
Alice Bob
x y)1100(
21
y,x
n
xsend x to Bob
CNot
x, yH
x, ymeasure x,y
n
eg. n=1
)1001(2
1y,x
Communicating Quantum Processes / POPL 2005 14
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,then measures x,y. The result uniquely determines n.
Alice Bob
x y)1100(
21
y,x
n
xsend x to Bob
CNot
H
x, ymeasure x,y
n
eg. n=1
)1001(2
1y,x
)1011(2
1y,x
Communicating Quantum Processes / POPL 2005 15
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,then measures x,y. The result uniquely determines n.
Alice Bob
x y)1100(
21
y,x
n
xsend x to Bob
CNot
Hmeasure x,y
n
eg. n=1
)1001(2
1y,x
)1011(2
1y,x
10y,x
Communicating Quantum Processes / POPL 2005 16
Dense Coding
Bob receives x, applies CNot to x,y, applies H to x,then measures x,y. The result uniquely determines n.
Alice Bob
x y)1100(
21
y,x
n
xsend x to Bob
CNot
Hmeasure x,y
1
eg. n=1
)1001(2
1y,x
)1011(2
1y,x
10y,x
Communicating Quantum Processes / POPL 2005 17
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 x,y)
Communicating Quantum Processes / POPL 2005 18
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 x,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 thatthey are entangled).
Communicating Quantum Processes / POPL 2005 19
Dense Coding with Entanglement Server
We can make the system more self-contained: Alice and Bobreceive 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) )
A
S
Bq
s t
Communicating Quantum Processes / POPL 2005 20
The Language CQP
This example has introduced our language CQP.
Defining a formal language for describing protocols is avaluable 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 frommeasurements).
CQP has a static type system which, in addition to checkingcorrect use of values and channels, guarantees that qubits arenot syntactically copied.
Communicating Quantum Processes / POPL 2005 21
Reduction in CQP
Communication
))z(Use].Qbit:z?[q|Stop].x[!q(;q;)1100(2
1y,x
))x(Use|Stop(;q;)1100(2
1y,x
Communicating Quantum Processes / POPL 2005 22
Reduction in CQP
Measurement
)y,xmeasure(Use;q;)1100(2
1y,x
))3(Use;q;11y,x(21
))0(Use;q;00y,x(21
)0(Use;q;00y,x )3(Use;q;11y,x
21
21
Communicating Quantum Processes / POPL 2005 23
The No Cloning Theorem
There is no unitary transformation U such that for all )s(U
( s is some standard initial state for the second qubit).
This means that there is no procedure for duplicating anarbitrary quantum state.
Suppose that Alice continues with some behaviour, aftersending the qubit to Bob.
Alice(x:Qbit, q:^[Qbit], n:0..3) = {x *= n} . q![x] . Continue
If Continue refers to x, then the natural interpretation would bethat x has been copied. We cannot allow this.
Communicating Quantum Processes / POPL 2005 24
Typechecking for No Cloning
The static type system of CQP guarantees that Continue does not refer to x.
Technically: the fact that x is sent along q means that Continueis 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). Similarideas have recently been used to guarantee uniqueownership of packets in a network system (Ennals, Sharp & Mycroft, 2004).
Alice(x:Qbit, q:^[Qbit], n:0..3) = {x *= n} . q![x] . Continue
Communicating Quantum Processes / POPL 2005 25
Future Work
The purpose of defining CQP is to support formal reasoningabout quantum systems. There are several directions to explore.
Model checking: we are now using the probabilisticmodel checking tool PRISM to analyze quantum systems.In the future we will translate CQP models automatically intoPRISM, exploiting static analysis at the CQP level.
Logics for specification: need to be developed for bothautomatic and non-automatic verification.
Type-theoretic methods: can we get more from a type system?For example: can we develop type systems for high-levelproperties such as secrecy?