The Logic of Quantum Programs
The Logic of Quantum Programs
The Logic of Quantum Programs
Abstract
We present a logical calculus for reasoning about information flow in quan-
tum programs. In particular we introduce a dynamic logic that is capable
of dealing with quantum measurements, unitary evolutions and entangle-
ments in compound quantum systems. We give a syntax and a relational
semantics in which we abstract away from phases and probabilities. We
present a sound proof system for this logic, and we show how to character-
ize by logical means various forms of entanglement (e.g. the Bell states)
and various linear operators. As an example we sketch an analysis of the
teleportation protocol.
1 Introduction
In this paper we elaborate on the ideas presented in [2, 3, 9] and give a full-
fledged dynamic Logic for Quantum Programs LQP. It is well-known that PDL
(Propositional Dynamic Logic) and its fragment Hoare Logic are among the
main logical formalisms used in program verification for classical programs, i.e.
in checking that a given (classical) program meets the required specification. It
is natural to ask for a quantum version of PDL, to be used in the verification
of quantum programs. In our past work [3], we presented several such logical
systems, and later extending this system into a dynamic logic LQA of quantum
actions (i.e. compositions of measurements and unitary evolutions). In this
paper, we extend LQA into a logic for compound quantum systems. We present
a self-contained version of LQP such that no knowledge of LQA or LQM is
necessary to understand the basic concepts. Note the difference between our
logic and the approach with a similar name in [4]: our dynamic logic goes
much further in capturing essential properties of quantum systems and quantum
programs, as well as in recovering the ideas of traditional quantum logic [6, 7].
2 Quantum Frames
In this section we introduce quantum frames for single quantum systems and
quantum frames for compound quantum systems; in the later case we restrict
our attention ro n compound qubits.
∗ Oxford University Computing Laboratory
† Vrije Universiteit Brussel, Flanders Fund for Scientific Research Post-Doc
1
2.1 Single System Quantum Frames
A modal frame is a set of states, together with a family of binary relations
S? a
between states. A (generalized) PDL frame is a modal frame (Σ, {→}S∈L , {→
}a∈A ), in which the relations on the set of states Σ are of two types: the first,
called tests and denoted by S?, are labelled with subsets S of Σ, coming from
a given family L ⊆ P(Σ) of sets, called testable properties; the others, called
actions, are labelled with action labels a from a given set A.
Given a P DL frame, there exists a standard way to give a semantics to the
usual language of propositional dynamic logic. Classical P DL can be considered
S?
as a special case of such a logic, in which tests are given by classical tests: s → t
if and only if s = t ∈ S. Observe that classical tests, if executable, do not change
the current state.
In the context of quantum systems, a natural idea is to replace classical tests
by “quantum tests”, given by quantum measurements of a given property. Such
tests will obviously change the state of the system. To model them, we introduce
a special kind of P DL frames: quantum frames. The “tests” are essentially given
by projectors in a Hilbert space. In [3], we considered P DL with the above-
mentioned standard semantics, having the same clauses in the classical case, but
interpreted in quantum frames. What we obtained is a quantum PDL, whose
negation-free part with dynamic modalities for quantum tests is equivalent to
what is traditionally called “(orthomodular) quantum logic” [6, 7]. In this paper,
we extend the syntax of this logic to deal with unitary evolutions, entanglements
and some quantum protocols.
Definition 1. (Quantum Frames)
Given a Hilbert space H, the following steps construct a Quantum (PDL) Frame
S? U
Σ(H) := (Σ, {→}S∈L , {→}U ∈U )
1. Let Σ be the set of one dimensional subspaces of H, called the set of states.
We denote a state s = x of H using any of the non-zero vectors x ∈ H that
generate them. Note that any two vectors that differ only in phase (i.e.
x = λy, with λ ∈ C with |λ| = 1) will generate the same state x = y ∈ Σ.
2
4. There is a natural bijective correspondence between the family L of all
testable properties and the family W ofSall closed linear subspaces W
of H, bijection given by S 7→ WS =: S. Observe that, under this
correspondence, the image of the biorthogonal
S closure S of any arbitrary
set
S S ⊆ Σ is the closed linear subspace S ⊆ H generated by the union
S of all states in S.
3
So we identify a test of a “non-testable” property S with the quantum test of its
biorthogonal closure. Observe that S?† = S? (since projectors are self-adjoint).
Definition 2. (Non-orthogonality, or Measurement Relation).
S?
For all s, t ∈ Σ, let s → t if and only if s → t for some property S ∈ L. In other
words, s → t means that one can reach state t by doing some measurement
on state s. An important observation is that the measurement relation is the
same as non-orthogonality: s → t iff s 6⊥ t. The non-orthogonality relation
has indeed been used to introduce an accessibility relation in the orthoframe
semantics within quantum logic [7].
Definition 3. (Dynamic Modalities and Measurement Modalities)
For any property T ⊆ Σ and any partial map F : Σ → Σ induced on states by
a linear operator F , let [F ]T := F -1 (T ) = {s ∈ Σ : F (s) ∈ T if defined } and
hF iT := Σ\([F ](Σ\F )). Similarly, put T := {s ∈ Σ : ∀t(s → t ⇒ t ∈ T )} and
♦T := Σ\((Σ\T )).
Observe that [F ]T expresses the weakest precondition for the “program” F and
post-condition T . In particular, [S?]T expresses the weakest precondition ensur-
ing the satisfaction of property T in any state after the system passes a quantum
test of property S. Similarly, hS?iT means that one can perform a quantum
test of property S on the current state, ending up in a state having property
T . T means that property T will hold after any measurement (quantum test)
performed on the current state. Finally, ♦T means that property T is poten-
tially satisfied, in the sense that one can do some quantum test to reach a state
with property T .
Lemma 1. For every property S ⊆ Σ, we have S ⊥ = [S?]∅ = Σ \ ♦S and
S = ♦S.
Proposition 1. For every property S ⊆ Σ, if T ∈ L (i.e. is testable), then
S, S ⊥ , [S?]T ∈ L (are testable), and more generally [F ]T ∈ L, for every (map
on states induced by a) linear operator F .
Proposition 2. (Testable Properties) A property S ⊆ Σ is testable if and only
if any of the following equivalent conditions hold: (1) S = S; (2) S = ♦P ; (3)
∃T ∈ Σ such that P = T ⊥ ; (4) ∃T ∈ Σ such that P = T . The family L
of testable properties is a complete lattice with respect to inclusion, having as its
meet set-intersection S ∩ T , and as its join the biorthogonal closure of set-union
S t T := S ∪ T , called the quantum join of S and T . For every state s ∈ Σ,
the singleton
F {s} ∈ L isTtestable. For any arbitrary property S ⊆ Σ, we have
S = {{s} : s ∈ S} = {T ∈ L : S ⊆ T }, so the biorthogonal closure of S is
the strongest testable property implied by (the property) S.
Theorem 1. In every quantum frame Σ = Σ(H) the following properties for
quantum tests are provable:
S? S?
1. Partial functionality: If s → t and s → v then t = v.
∅? Σ?
2. Trivial tests: →= ∅ and →= ∆Σ , where ∆Σ = {(s, s) : s ∈ Σ} is the
identity relation on Σ × Σ.
4
S?
3. Adequacy: if s ∈ S then s → s
S?
4. Repeatability: If S ∈ L is testable and s → t, then t ∈ S
5. Compatibility: If S, T ∈ L are testable and S?; T ? = T ?; S? then S?; T ? =
(S ∩ T )?.
S? T? S? W?
6. Self-Adjointness: If s → w → t then t → v → s, for some v ∈ Σ and
S? S?
W ∈ L. In other words: if s → w→t then t → v→s, for some v ∈ Σ.
7. Universal Accessibility: For all s, t ∈ Σ, there exists a state w ∈ Σ such
that s → w → t.
Proofs: Partial functionality follows from the fact that projectors correspond to
partially defined maps in H. Trivial tests follows from the fact that projecting
on the empty space yields the empty space and that projecting on the total space
doesn’t change anything. Adequacy follows from the fact that for every x ∈ W
we have that PW (x) = x. Repeatability follows from the fact that PW (x) ∈ W
for every x ∈ H. Compatibility follows from the fact that if two projectors
commute, i.e. PW ◦ PV = PV ◦ PW , then PW ◦ PV = PW ∩V . Self-Adjointness
follows from the more general Adjointness theorem stated below, together with
the fact S?† = S?. Universal Accessibility can be proved by cases: If s 6⊥ t, i.e.
let s → t, then w = s ⇒ s → s → t. If s ⊥ t, i.e. let s 6→ t then let s = x, t = y
with x, y ∈ H. Take the superposition x + y ∈ H of x and y and note that
x + y 6= 0 (since from x + y = 0 ⇒ x = −y ⇒ s = t which contradicts s 6⊥ t).
Next observe that x 6⊥ (x + y) (Indeed, suppose x ⊥ (x + y) then hx | x + yi = 0
and then hx | xi + hx | yi = 0; but x ⊥ y implies hx | xi = 0. So from hx | xi = 0
follows that x = 0, which yields a contradiction). Similarly, we get y 6⊥ (x + y).
Taking now w = x + y, we can see that w ∈ Σ, s → w and w → t.
Theorem 2. In every quantum frame Σ(H) the following properties for unitary
transformation (stated for all U, U † inU) are provable:
U
1. Functionality: For every state s ∈ Σ we have ∃!t : s → t
U U† U†
2. Inverse-adjoint (bijectivity): s → t → w implies s = w. Similarly, s →
U
t → w implies s = w
Proofs: Functionality follows from the fact that unitary transformations are
well-defined on all states, i.e. the kernel of the linear map encoding the trans-
formation is ∅. Inverse-adjoint follows from the fact that unitary operators on
a Hilbert space have the property that U † = U -1 .
Theorem 3. (Adjointness) Let F be a linear transformation and let s, w, t ∈ Σ
F F†
be states: If s → w→t then there exists some state v ∈ Σ such that t → v→s.
5
Proof: To prove this theorem we use the definition of adjointness in a Hilbert
space: hF x | yi = hx | F † yi. From this, we get the equivalence: hF x | yi = 0
iff hx, F † yi = 0; or, otherwise stated, F x ⊥ y iff x ⊥ F † y. Taking the negation
of both sides and using the fact that the measurement relation s→t is the same
F
as non-orthogonality s 6⊥ t, we obtain the equivalence: ∃w(x → w → y) iff
F†
∃v(y → v → x). This proves the adjointness property. As a consequence:
Corrolary 1. For every property P ⊆ Σ and every linear map F we have:
P ⊆ [F ]hF † i♦P
6
γ := | 00i+ | 01i+ | 11i+ | 10i.
The following two results are well-known:
Proposition 3. Let H (i) and H (j) be two Hilbert spaces. There exists a bijec-
tive correspondence ψ between the linear maps F : H (i) → H (j) and the states
(i) (j)
of H (i) ⊗ H (j) . Given the bases {α }α and {β }β of these spaces, the corre-
(i) (j)
spondence ψ is given by the mapping F = Σαβ mαβ hα | −i.β into the state
(i) (j)
ψ(F ) = Σαβ mαβ .α ⊗ β .
Proposition 4. Let H = H ⊗n and let W = {x ⊗ | 0i⊗(n-1) : x ∈ H} be
given. Any linear map F : H → H induces a linear map F(1) : H → H in a
canonical manner: it is defined as the unique map on H satisfying F(1) (x) =
PW ◦ F (x ⊗ | 0i⊗(n-1) ). Conversely, any linear map G : H → H can be repre-
sented as G = F(1) for some linear map F : H → H.
Notation. The above results allow us to specify a compound state in H (i) ⊗H (j)
via some linear map F on H. Indeed, if F : H → H is any such linear map, let
F(1) : H → H be the map in the above proposition; this induces a corresponding
:= ◦ F ◦ -1 , where is the
(ij) (ij)
map F (1) : H (i) → H (j) , by putting F (1) j (1) i i
canonical isomorphism introduced above (between H and the i-th component
H (i) of H ⊗n ). Then we denote by F (ij) the state
(ij)
F (ij) := ψ(F(1) )
F ij = {s ∈ Σ : s{i,j} = F (ij) }
= {µ{i,j} (ψ ⊗ ψ 0 ) : ψ ∈ F (ij) , ψ 0 ∈ HN \{i,j} } ⊆ Σ
S 0 = {s ∈ Σ : sI ∈ S 0 }
7
or, more explicitly: S 0 = {µI (ψ ⊗ ψ 0 ) : ψ ∈ S 0 , ψ 0 ∈ HN \I }. An example is the
property F ij , which is {i, j}-local. The family of local properties is closed under
union, intersection but not under complementation.
Local transformations. Given I ⊆ N , a linear map F : H → H is I-local if it
“affects only the qubits in I”; in other words, if there exists a map G : HI → HI
such that:
F ◦ µI (ψ ⊗ ψ 0 ) = µI (G(ψ) ⊗ ψ 0 )
A map F : Σ → Σ is I-local if it is the map induced on Σ by an I-local linear
map on H. Examples are: all the tests SI ? of I-local properties; logic gates that
affect only the qubits in I, i.e. (maps on Σ induced by) unitary transformations
UI : H → H such that for all ψ, ψ 0 ∈ HI , we have UI ◦µI (ψ⊗ψ 0 ) = µI (U (ψ)⊗ψ 0 ),
for some U : HI → HI . The family of local maps is closed under composition.
Lemma 2. The main lemma in [5] states (in our notation) that, given a
quadruple of distinct indices i, j, k, l, let F, G, H, U, V : H → H be single-qubit
linear maps, then we have:
Gjk ? ◦ Vk ◦ Uj (F ij ∩ H kl ) ⊆ (H ◦ U † ◦ G ◦ V ◦ F )il
[5] and [1] use this as the main tool in explaining teleportation, quantum gate
teleportation and many other quantum protocols. We will use this work in our
logical treatment of such protocols, by taking this lemma as one of our main
axioms.
Observe that in the above Lemma, the order in which the operations Uj
and Vk are applied is in fact irrelevant. This is a consequence of the following
important property of local transformations:
Proposition 6. (Compatibility of local transformations affecting different sets
of qubits)
If I ∩ J = ∅, FI is an I-local map and GJ is a J-local map, then we have:
FI ◦ GJ = GJ ◦ FI
8
Proposition 7. ( “Agreement Property”) Let FI , GI : Σ → Σ be two I-local
maps on states, having the same domain2 : dom(F ) = dom(G). Then their
output-states agree on all non-I qubits, i.e.:
F (s)J = G(s)J
for all s ∈ Σ and all J such that I ∩ J = ∅. (We take this equality to imply in
particular that the right-hand is defined iff the left-hand is also defined.)
Dynamic Characterizations of Main Unitary Transformations.
It is well-known that a linear operator on a vector space in a given Hilbert space
is uniquely determined by the values it takes on the vectors of an (orthonormal)
basis. An important observation is that this fact is no longer “literally true”
when we move to “states” as one-dimensional subspaces instead of vectors. The
reason is that “phase”-aspects (or, in particular, the signs “+” and “−”) are
not “state” properties in our setting. In other words, two vectors that differ
only in phase, i.e x = λy where λ is a complex number with | λ |= 1, belong to
the same subspaces, so they correspond to the same state x = y.
Example 1. (Counterexample) Consider a 2 dimensional Hilbert space in
which we denote the basis vectors by | 0i and | 1i, a transformation I is given
by I(α| 0i + β| 1i) = α | 0i + β | 1i; and a transformation J is given by
J(α| 0i + β| 1i) = α | 0i − β | 1i. Although I and J induce different operators
on states, these operators map the basis states to the same images:
I(0) = I(| 0i) = 0 = J(| 0i) = J(0), I(1) = I(| 1i) = 1 = − | 1i = J(| 1i) =
J(1). But of course we do distinguish the subspaces generated by different
superpositions: I(+) = | 0i+ | 1i = + 6= − = | 0i− | 1i = J(+).
Proposition 8. A linear operator on the state space Σ(H1 ) of a 2 dimensional
Hilbert space is uniquely determined by its images on the states: | 0i, | 1i, | +i.
Corollary 2. A linear operator on the state space Σ(Hn ) of the space Hn is
uniquely determined by its images on the states:
{| xi1 ⊗ ...⊗ | xin :| xii ∈ {| 1ii , | 0ii , | +ii }}
0 1 +
X 1 0 +
Z 0 1 -
H + - 0
2 The domain of a map is defined by dom(F ) = {s ∈ Σ : F (s) is defined }. If F 0 is the
9
The transformation CN OT is given by the table:
00 01 0+ 11 10 1+ +0 +1 ++
CN OT 00 01 0+ 10 11 1+ β00 β01 γ
3 Syntax of LQP
The Basic Language of LQP
To build up the language of LQP , we are given a natural number n, and we put
N = {1, 2, . . . , n}. We start from a set Q of propositional variables, together
with an arity map,i.e. every p ∈ Q has an arity k ≤ n; a set C = {+, 1, ...} of
propositional constants; and a set U = {CN OT2 , X1 , H1 , Z1 , ...} of constants,
denoting basic programs, to be interpreted as unitary transformations; each such
program comes also with an arity k ≤ n. The syntax of LQP is an extension of
the classical syntax for P DL, with a set of propositional formulas and a set of
programs, defined by mutual induction:
ϕ ::= pI | ci | π i,j | ¬ϕ | ϕ∧ϕ | [π]ϕ
π ::= > | ϕ? | UI | π† | π∪π | π; π | π∗
10
∼ ϕ := [ϕ?]⊥. By means of the orthocomplement we define new propositional
constants 0i :=∼ 1i and −i :=∼ +i , and a binary operation for quantum join
ϕ t ψ :=∼ (∼ ϕ∧ ∼ ψ). This expresses superpositions: ϕ t ψ is true at any
state which is a superposition of states satisfying ϕ or ψ. We can also define
the quantum dual of a modality [π]ψ as < π ∼ > ψ :=∼ [π] ∼ ψ. Finally we
put < π >-1 ψ :=< (π † )∼ > ψ. As we’ll see, this captures the strongest post-
condition ensured by applying program π on a state satisfying (a precondition)
ψ.
Testable formulas. We call a program π deterministic if π is constructed
without the use of non-deterministic choice ∪ or iteration ∗. Next we define the
set of testable formulas ϕt of LQP to be a subset of the above given language,
constructed by induction in the following way:
with i, j ∈ I, J ⊆ I. Observe that local formulas are not closed under negation:
this is because the complement of a local property is not necessarily a local
property. But instead they are closed under set-theoretic difference, disjunction,
and also conjunction: this is because ϕ ∧ ψ is equivalent to ϕ ∧ ¬(ϕ ∧ ¬ψ).
Relabeling local formulas and programs. When we label a local formula
ϕI or a local program πI with a sequence of indices I, we can of course take
any other sequence J of indices, with |J| = |I|, and substitute all the I indices
in our formula (program) with the corresponding J indices; we denote by ϕJ ,
and respectively πJ , the corresponding formula, or program.
Notation. The unary map induced by a program: We want to capture in our
syntax the construction F(1) , by which a linear map F on H ⊗n was used to
describe a unary map F(1) on H. For this, we put: 0i ! := 0i ? ∪ (1i ?; Xi ), and
0I ! := 0i1 !; 0i2 !; ...; 0ik !, where I = (i1 , i2 , ..., ik ). This maps any qubit in I to 0.
Similarly, we put; 0I ? := (0i1 ∧ 0i2 ∧ ... ∧ 0ik )?. Finally we define:
π(i) : +0N \{i} !; π; 0N \{i} ?
11
This is the map we need (which encodes a single qubit transformation). In fact,
we shall only use π(1) in the rest of this paper.
4 Semantics of LQP
An LQP -model is a quantum frame equipped with a valuation function, mapping
each propositional variable p with arity k into a set || p ||⊆ Σ(H ⊗k ) of k-
qubit states. Give na sequence I of length i of indices, let be the canonical
isomorphism between H ⊗k and H ⊗I .
We will use the valuation map to give an interpretation || ϕ || ⊆ Σ to all our
formulas, in terms of properties of our n qubit system, i.e. sets of states in
Σ = Σ(H). In the same time, we give an interpretation || π || ⊆ Σ × Σ to all our
programs, in terms of binary relations between states. The two interpretations
are defined by mutual recursion.
Interpretation of Programs: The basic programs UI , with |I| = k, come
from a list of corresponding k-bit unitary transformations U : H ⊗k → H ⊗k . We
take || UI || to be the (map on states induced by the) unique linear map on H
such that:
|| ϕ ∧ ψ || = || ϕ || ∩ || ψ || , || ¬ϕ || = Σ\ || ϕ ||
|| 1i || = 1i , || + || = +i
π
and finally || [π]ϕ || ={s ∈ Σ|∀t : s → t ⇒ t ∈|| ϕ ||}.
12
The last clause obviously defines the weakest precondition [π]ϕ ensuring that
(postcondition) ϕ will be satisfied after executing program π. As for the propo-
sitional variables, we put:
|| pI || = {s ∈ H : sI ∈ I (|| p ||)}
|| π ij ||:= || π ||ij
13
Testability Axiom. ` p → [q?]p
Testability can be stated in its dual form by means of hq?ip → ♦p or equiva-
lently as hq?ip → hp?i>. This dual formulation of Testability allows us to give
a straightforward interpretation: if the property associated to p can be actu-
alized by a measurement (yielding an output state satisfying p), then we can
directly test the property p (by doing a measurement for p). The Test Gener-
alization Rule encodes the fact that is a universal quantifier over all possible
measurements.
Other LQP -axioms are:
Partial Functionality. ` ¬[p?]q → [p?]¬q
Adequacy. ` p ∧ q → hp?iq
Repeatability. ` [ψt ?]q → [p?]¬q for all testable formulas ψt
Universal Accessibility. ` hπip → [π 0 ]p
Unitary Functionality. ` ¬[U ]q ↔ [U ]¬q
Unitary Bijectivity 1. ` p ↔ [U ; U † ]p
Unitary Bijectivity 2. ` p ↔ [U † ; U ]p
Adjointness. ` p → [π]hπ † i♦p
Substitution Rule. From ` Θ infer ` Θ[pI \ϕI ]
Compatibility Rule. For all testable formulas ψ, ϕ and every variable p 6∈
ϕ, ψ:
From `< ϕ?; ψ? > p →< ψ?; ϕ? > p infer `< ϕ?; ϕ? > p →< (ϕ ∧ ψ)? > p
14
2. ` ϕ → [π]ψ
Moreover, in the context of the other axioms, this equivalence is itself equivalent
to the Adjointness Axiom.
Basic Axioms for constants (0, 1, +, −)
The first axiom says that ci ’s are “states” in the i-th part of the system, i.e. they
are atomic properties, which determine completely whether any other property
is jointly satisfied. We state in a weak, as well as in stronger version:
Atomicity (weak version). For all c ∈ {0, 1, +, −}: ` ci ∧ pi → (ci → pi )
Atomicity
V (strong version).
V For all c ∈ {0, 1, +, −}:
` i∈I ci ∧ pI → ( i∈I ci → pI )
The following axioms state that +i and -i are proper superpositions of 0i and
1i :
Proper Superposition Axioms: ` +i → ♦0i ∧ 1i and ` -i → ♦0i ∧ ♦1i .
Next two axioms assert that 1 and + are testable properties:
Constants are testable. ` ♦1i → 1i and ` ♦+i → +i .
Determinacy Axiom of Deterministic Programs. For deterministic pro-
grams π, π 0 :
` ( c(1) ,...,c(n) ∈{0,1,+}n (< π >-1 (c1 ∧ ... ∧ cn ) ↔< π >-1 (c1 ∧ ... ∧
V (1) (n) (1)
(n)
cn ))) → (< π > p ↔< π 0 > p)
This expresses the above-mentioned property of linear operators on H of being
uniquely determined by their values on all the states |x >1 ⊗...|x >n , with
|x >i ∈ {|0 >i , |1 >i , |+ >i }.
Agreement Axiom. If two I-local programs π, π 0 have the same domain, then
their output states agree on all non-I qubits: i.e. if I ∩ J = ∅ then
(< πI > > ↔< π 0 > >) → (< πI > pJ ↔< πI0 > pJ )
Compatibility of programs affecting different sets of qubits. If I ∩J = ∅
then
` [πI ; πJ ]p ↔ [πJ ; πI ]p
Entanglement Rule. From ` p1 → [π(1) ]q1 infer ` πij → [pi ?]qj
Entanglement Composition Axiom. For distinct indices i, j, k, l, programs
π, π 0 , π 00 and local {1}-programs σ1 , ρ1 we have:
` π ij ∧ π 0 kl → [σj ; ρk ; π 00 jk ?](π; σ1 ; π 00 ; ρ†1 ; π 0 )il
Trivial Entanglement ` pi,j → >ij This says that separation of the i, j-qubits
implies their trivial entanglement.
Theorem 5. (Teleportation Property). If ϕ1 is a 1-local testable property and
if ` ϕ1 → [π(1) ; σ(1) ]q1 , then ` ϕ1 ∧ σ 23 → [π 12 ?]q3 .
Proof: We apply the Entanglement Composition Axiom, taking i = 4, j = 1, k =
2, l = 3, and substituting the programs > for π, σ for π 0 , π for π 00 , ϕ1 ? for σ1 , and
id1 = X1 ; X1 for ρ1 . We obtain: ` >41 ∧σ 23 → [ϕ1 ?; id2 ; π 12 ?](>; p1 ?; π; id†1 ; σ)43 .
On the other hand, we have ` ϕ1 ∧ σ 23 → [04 !](p1 ∧ >41 ∧ σ 23 ) (since 04 ! is 4-
local and has the same domain as id4 , so by Agreement Axiom it agrees with
15
id4 on non-4 qubits, thus preserving ϕ1 and σ 23 ; but also ` [04 !]04 and using
the Trivial Entanglement Axiom, we get the conclusion). From these two to-
gether, we obtain: ` ϕ1 ∧ σ 23 → [04 !][π 12 ?](>; ϕ1 ?; π; id†1 ; σ)43 . But on the other
hand, we have ` (>; ϕ1 ?; π; id†1 ; σ)43 → [04 ?]q3 . (This is because we assumed
` ϕ1 → [π(1) ; σ(1) ]q1 , from which it follows that ` 01 → [>; ϕ1 ?; π(1) ; id†1 ; σ(1) ]q1 ,
using the fact that id† = id and ` [ϕ1 ?]ϕ1 , by Repeatability axiom and the testa-
bility of ϕ1 . Apply now Entanglement Rule, obtaining the above conclusion.)
From these two we get that: ` ϕ1 ∧ σ 23 → [04 !; π 12 ?; 04 ?]q3 . The desired con-
clusion follows from the Agreement Axiom and the fact that 04 !; π 12 ?; 04 ? and
π 12 ? are {1, 2, 4}-local programs with the same domain.
Characteristic Formulas. In order to formulate our next axioms (dealing
with special logic gates), we give some characteristic formulas for binary states,
considering two qubits indexed by i and j:
States Characteristic Formulas
16
Characteristic Axioms for CN OT . With the above notations, we put:
ij
Proposition 15. For all x, y ∈ {0, 1}: ` (Hi ; CN OTi,j (xi ∧ yj ) = βxy
Corollary. If i, j, k are all distinct then
i,j
` (CN OTij ; Hj ; (xi ∧ yj )?)(p) =k βxy ?(p).
Proof: From the above and H † = H, CN OT † = CN OT , we get
ij
` βxy → [CN OTi,j ; Hi ](xi ∧ yi )
and so
ij
` hCN OTij ; Hi ; (xi ∧ yj )?i> ↔ hβxy ?i>
The conclusion follows from this, together with the Agreement Axiom.
17
In our syntax, the quantum program described here is:
[
π= CN OT12 ; H1 ; (x1 ∧ y2 )?; X3y ; Z3x
x,y∈{0,1}
for all testable 1-local formulas ϕ1 . To show this, observe that by applying the
above Corollary (at the end of the last section) in which we take i = 1, j = 2, k =
3 and substitute p3 with [X3y ; X3x ]ϕ3 , we we obtain that the validity above (to
be proved) is equivalent to: ` ϕ1 ∧ β00 23 1,2
→ [βxy ?][X3y ; Z3x ]ϕ3 .
Replacing the logical Bell formulas with their definitions βxy ij
:= (Z1x ; X1y )ij , we
obtain the following equivalent validity: ` q1 ∧id23 → [((Z1x ; X1y )12 ?][X3y ; Z3x ]ϕ3 ,
where id = Z10 ; X10 is the identity. This last validity follows from applying the
Teleportation Property and the validity ` ϕ1 → [Z1x ; X1y ; X1y ; Z1x ]ϕ1 (due to
X -1 = X, Z -1 = Z).
Note. This proof of correctness can be easily adapted to cover Logic-Gate
Teleportation. Moreover, the whole range of quantum programs covered by the
“entanglement networks” in [5] can be similarly treated using our logic.
References
[1] S. Abramsky and B. Coecke, “A Categorical Semantics of Quantum Protocols.”,
to be published in the proceedings of the 19th IEEE conference on Logic in
Computer Science (LiCS’04). Available at arXiv:quant-ph/0402130.
[2] A. Baltag, “Dynamic and Epistemic Logics for Quantum Measurements”, Pre-
sented at PML04, Brussels 2004.
[3] A. Baltag and S. Smets, “The Logic of Quantum Actions”, preprint. Abstract at
http://emmy.nmsu.edu/IQSA/ has been accepted for presentation at Quantum
Structures 04 (IQSA), Denver 2004.
[4] O. Brunet and P. Jorrand, “Dynamic Quantum Logic for Quantum Programs”,
Grenoble 2003. Available at arXiv:quantph/0311143.
[5] B. Coecke, “The Logic of Entanglement”, March 2004, arXiv: quant-ph/0402014.
[6] M.L. Dalla Chiara and R. Giuntini, “Quantum Logics”, in D.M. Gabbay and F.
Guenthner, (eds.) Handbook of Philosophical Logic, Second Edition, vol. 6, Kluwer
Ac. Pub., Dordrecht, 129-228, 2002.
[7] R.I. Goldblatt, “Semantic Analysis of Orthologic”, Journal of Philosophical Logic,
3, 19-35, 1974.
[8] M. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information,
Cambridge University Press, 2000.
[9] S. Smets, “On Quantum Propositional Dynamic Logic”, Presented at PML’04,
Brussels 2004.
18