Vectorial types, non-determinism and probabilistic systems: Towards a computational quantum logic
1. Vectorial types, non-determinism and
probabilistic systems
Towards a computational quantum logic
Alejandro Díaz-Caro
Université Paris-Ouest Nanterre
INRIA Paris – Rocquencourt
Quantum Computing at Nancy
March 21, 2013
2. A proof-as-programs approach to quantum logic
Motivation
Curry-Howard correspondence
Intuitionistic logics ⇐⇒ Typed λ-calculus
hypotheses free variables
implication elimination (modus ponens) application
implication introduction abstraction
A proof is a program
(the formula it proves is a type for the program)
2 / 11
3. A proof-as-programs approach to quantum logic
Motivation
Curry-Howard correspondence
Intuitionistic logics ⇐⇒ Typed λ-calculus
hypotheses free variables
implication elimination (modus ponens) application
implication introduction abstraction
A proof is a program
(the formula it proves is a type for the program)
Goal: To find a quantum Curry-Howard correspondence
Between what?
A quantum λ-calculus (quantum control/quantum data)
Any logic, even if we need to define it!
2 / 11
4. A proof-as-programs approach to quantum logic
Motivation
Curry-Howard correspondence
Intuitionistic logics ⇐⇒ Typed λ-calculus
hypotheses free variables
implication elimination (modus ponens) application
implication introduction abstraction
A proof is a program
(the formula it proves is a type for the program)
Goal: To find a quantum Curry-Howard correspondence
Between what?
A quantum λ-calculus (quantum control/quantum data)
Any logic, even if we need to define it!
Computational quantum logic
We want a logic such that its proofs are quantum programs
2 / 11
5. Untyped algebraic extensions to λ-calculus
Two origins:
Alg [Vaux’09] (from Linear Logic)
Lineal [Arrighi,Dowek’08] (for Quantum computing)
Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]
3 / 11
6. Untyped algebraic extensions to λ-calculus
Two origins:
Alg [Vaux’09] (from Linear Logic)
Lineal [Arrighi,Dowek’08] (for Quantum computing)
Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]
t, r ::= v | tr | t + r | α.t | 0 α ∈ (S, +, ×), a ring
v ::= x | λx.t
3 / 11
7. Untyped algebraic extensions to λ-calculus
Two origins:
Alg [Vaux’09] (from Linear Logic)
Lineal [Arrighi,Dowek’08] (for Quantum computing)
Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]
t, r ::= v | tr | t + r | α.t | 0 α ∈ (S, +, ×), a ring
v ::= x | λx.t
β-reduction: (λx.t)v → t[x := v]
“Algebraic” reductions:
α.t + β.t → (α + β).t,
α.β.t → (α × β).t,
t(r1 + r2 ) → tr1 + tr2 ,
(t1 + t2 )r → t1 r + t2 r,
...
(oriented version of the axioms of
vectorial spaces)
3 / 11
8. Untyped algebraic extensions to λ-calculus
Two origins:
Alg [Vaux’09] (from Linear Logic)
Lineal [Arrighi,Dowek’08] (for Quantum computing)
Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]
t, r ::= v | tr | t + r | α.t | 0 α ∈ (S, +, ×), a ring
v ::= x | λx.t
β-reduction: (λx.t)v → t[x := v]
“Algebraic” reductions:
α.t + β.t → (α + β).t, Vectorial space of values
α.β.t → (α × β).t, B = { vars. and abs. }
t(r1 + r2 ) → tr1 + tr2 ,
(t1 + t2 )r → t1 r + t2 r, Space of values ::= Span(B)
...
(oriented version of the axioms of
vectorial spaces)
Value == result of the computation, if it ends
3 / 11
9. Example: simple encoding of quantum computing
[Arrighi,Dowek’08]
|0 = λx.λy .x
Two base vectors:
|1 = λx.λy .y
4 / 11
10. Example: simple encoding of quantum computing
[Arrighi,Dowek’08]
|0 = λx.λy .x
Two base vectors:
|1 = λx.λy .y
|+
1
H|0 → √ (|0 + |1 )
We want a linear map H s.t. 2
1
H|1 → √ (|0 − |1 )
2
|−
4 / 11
11. Example: simple encoding of quantum computing
[Arrighi,Dowek’08]
|0 = λx.λy .x
Two base vectors:
|1 = λx.λy .y
|+
1
H|0 → √ (|0 + |1 )
We want a linear map H s.t. 2
1
H|1 → √ (|0 − |1 )
2
|−
H := λx. {x [|+ ] [|− ]}
4 / 11
13. vec
Typed Lineal : λ
[Arrighi,Díaz-Caro,Valiron’12]
T +R ≡ R +T
T + (R + S) ≡ (T + R) + S
T , R ::= U | X | α.T | T + R 1.T ≡ T
U ::= X | U → T | ∀X.U | ∀X.U α.(β.T ) ≡ (α × β).T
α.T + α.R ≡ α.(T + R)
α.T + β.T ≡ (α + β).T
5 / 11
14. vec
Typed Lineal : λ
[Arrighi,Díaz-Caro,Valiron’12]
T +R ≡ R +T
T + (R + S) ≡ (T + R) + S
T , R ::= U | X | α.T | T + R 1.T ≡ T
U ::= X | U → T | ∀X.U | ∀X.U α.(β.T ) ≡ (α × β).T
α.T + α.R ≡ α.(T + R)
α.T + β.T ≡ (α + β).T
vec
Most important property of λ
Γ t: i αi .Ti ⇒ t →∗ i αi .ri
where Γ ri : Ti
t →∗ i αi .ri ⇒ Γ t: i αi .Ti + 0.R
5 / 11
15. vec
Typed Lineal : λ
[Arrighi,Díaz-Caro,Valiron’12]
T +R ≡ R +T
T + (R + S) ≡ (T + R) + S
T , R ::= U | X | α.T | T + R 1.T ≡ T
U ::= X | U → T | ∀X.U | ∀X.U α.(β.T ) ≡ (α × β).T
α.T + α.R ≡ α.(T + R)
α.T + β.T ≡ (α + β).T
vec
Most important property of λ
Γ t: i αi .Ti ⇒ t →∗ i αi .ri
where Γ ri : Ti
t →∗ i αi .ri ⇒ Γ t: i αi .Ti + 0.R
A type system capturing the “vectorial” structure of terms
. . . to check for properties of probabilistic processes
. . . to check for properties of quantum processes
. . . or whatever application needing the structure of the vector
5 / 11
16. vec
Typed Lineal : λ
[Arrighi,Díaz-Caro,Valiron’12]
T +R ≡ R +T
T + (R + S) ≡ (T + R) + S
T , R ::= U | X | α.T | T + R 1.T ≡ T
U ::= X | U → T | ∀X.U | ∀X.U α.(β.T ) ≡ (α × β).T
α.T + α.R ≡ α.(T + R)
α.T + β.T ≡ (α + β).T
vec
Most important property of λ
Γ t: i αi .Ti ⇒ t →∗ i αi .ri
where Γ ri : Ti
t →∗ i αi .ri ⇒ Γ t: i αi .Ti + 0.R
A type system capturing the “vectorial” structure of terms
. . . to check for properties of probabilistic processes
. . . to check for properties of quantum processes
. . . or whatever application needing the structure of the vector
Still far from the main goal: (for a quantum Curry-Howard correspondence)
vec
λ −→ “vectorial” programs (not only quantum)
5 / 11
17. vec
Typed Lineal : λ
[Arrighi,Díaz-Caro,Valiron’12]
T +R ≡ R +T
T + (R + S) ≡ (T + R) + S
T , R ::= U | X | α.T | T + R 1.T ≡ T
U ::= X | U → T | ∀X.U | ∀X.U α.(β.T ) ≡ (α × β).T
α.T + α.R ≡ α.(T + R)
α.T + β.T ≡ (α + β).T
vec
Most important property of λ
Γ t: i αi .Ti ⇒ t →∗ i αi .ri
where Γ ri : Ti
t →∗ i αi .ri ⇒ Γ t: i αi .Ti + 0.R
A type system capturing the “vectorial” structure of terms
. . . to check for properties of probabilistic processes
. . . to check for properties of quantum processes
. . . or whatever application needing the structure of the vector
Still far from the main goal: (for a quantum Curry-Howard correspondence)
vec
λ −→ “vectorial” programs (not only quantum)
The logic behind −→ not easy to define
5 / 11
19. Non-determinism
Simplifying Lineal
t, r ::= x | λx.t | tr | t + r
t+r→t t+r→r
Restricting to Linear Logic: Highly informative quantitative version
of strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]
6 / 11
20. Non-determinism
Simplifying Lineal
t, r ::= x | λx.t | tr | t + r
t+r→t t+r→r
Restricting to Linear Logic: Highly informative quantitative version
of strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]
However this is a restriction
6 / 11
21. Non-determinism
Simplifying Lineal
t, r ::= x | λx.t | tr | t + r
t+r→t t+r→r
Restricting to Linear Logic: Highly informative quantitative version
of strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]
However this is a restriction
Full calculus: 2nd order intuitionistic logic [Díaz-Caro,Petit’12]
6 / 11
22. Non-determinism
Simplifying Lineal
t, r ::= x | λx.t | tr | t + r
t+r→t t+r→r
Restricting to Linear Logic: Highly informative quantitative version
of strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]
However this is a restriction
Full calculus: 2nd order intuitionistic logic [Díaz-Caro,Petit’12]
2nd order intuitionistic logic ↔ A non linear fragment of Linear Logic
First logic related to (a fragment of) Lineal
6 / 11
24. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
7 / 11
25. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
7 / 11
26. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
A∧B ≡B ∧A We want t + r = r + t
7 / 11
27. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
A∧B ≡B ∧A We want t + r = r + t
π1 (t + r) does not make any sense in this setting
7 / 11
28. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
A∧B ≡B ∧A We want t + r = r + t
π1 (t + r) does not make any sense in this setting
Instead: πA (t + r) (when t : A or r : A)
7 / 11
29. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
A∧B ≡B ∧A We want t + r = r + t
π1 (t + r) does not make any sense in this setting
Instead: πA (t + r) (when t : A or r : A)
If both have type A, then this is a non-deterministic projector
7 / 11
30. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
A∧B ≡B ∧A We want t + r = r + t
π1 (t + r) does not make any sense in this setting
Instead: πA (t + r) (when t : A or r : A)
If both have type A, then this is a non-deterministic projector
λ+
A proof system where equivalent propositions get the same proofs
A∧B ≡B ∧A A ∧ (B ∧ C ) ≡ (A ∧ B) ∧ C
A ⇒ (B ∧ C ) ≡ (A ⇒ B) ∧ (A ⇒ C )
7 / 11
31. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
A∧B ≡B ∧A We want t + r = r + t
π1 (t + r) does not make any sense in this setting
Instead: πA (t + r) (when t : A or r : A)
If both have type A, then this is a non-deterministic projector
λ+
A proof system where equivalent propositions get the same proofs
A∧B ≡B ∧A A ∧ (B ∧ C ) ≡ (A ∧ B) ∧ C
A ⇒ (B ∧ C ) ≡ (A ⇒ B) ∧ (A ⇒ C )
Curry-Howard correspondence with 2nd order intuitionistic logic
Non-deterministic projector
7 / 11
32. Non-determinism
[Díaz-Caro,Dowek’12–13]
t + r → t and t + r → r Uncontrolled non-determinism
π(t + r) → t and π(t + r) → r A projector controlling it
Non-determinism naturally arise by considering some isomorphisms
between propositions to be equivalences
A∧B ≡B ∧A We want t + r = r + t
π1 (t + r) does not make any sense in this setting
Instead: πA (t + r) (when t : A or r : A)
If both have type A, then this is a non-deterministic projector
λ+
A proof system where equivalent propositions get the same proofs
A∧B ≡B ∧A A ∧ (B ∧ C ) ≡ (A ∧ B) ∧ C
A ⇒ (B ∧ C ) ≡ (A ⇒ B) ∧ (A ⇒ C )
Curry-Howard correspondence with 2nd order intuitionistic logic
Non-deterministic projector
From non-determinism to probabilities?
7 / 11
33. From non-determinism to probabilities
Work-in-progress (in collaboration with G. Dowek)
Premise: The algebraic calculi are too complex
Do we really need them?
8 / 11
34. From non-determinism to probabilities
Work-in-progress (in collaboration with G. Dowek)
Premise: The algebraic calculi are too complex
Do we really need them?
πA (t + πA (r + s) + s)
πA (r + s)
91
t r s
8 / 11
35. From non-determinism to probabilities
Work-in-progress (in collaboration with G. Dowek)
Premise: The algebraic calculi are too complex
Do we really need them?
πA (t + πA (r + s) + s) πA (t + πA (r + s) + s)
1 1 1
3 3 3
πA (r + s) πA (r + s)
→ 1
1
2
2
91 91
t r s t r s
1 1 1
∼ t+ r+ s
3 6 2
8 / 11
36. From non-determinism to probabilities
Generalising for any non-deterministic abstract rewrite system
Definition (Oracle)
f (a) = b if a → b if a → bi with i = 1, . . . , n
Ω = set of all the oracles there are n oracles
9 / 11
37. From non-determinism to probabilities
Generalising for any non-deterministic abstract rewrite system
Definition (Oracle)
f (a) = b if a → b if a → bi with i = 1, . . . , n
Ω = set of all the oracles there are n oracles
E.g. Rewrite system
Ω = {f , g , h, i}, with
a
f (a) = b1 g (a) = b1
Ô f (b2 ) = c1 g (b2 ) = c2
b1 b2
h(a) = b2 i(a) = b2
Ô h(b2 ) = c1 i(b2 ) = c2
c1 c2
9 / 11
38. From non-determinism to probabilities
Theorem
(Ω, A, P) is a probability space
Ω is the set of all possible oracles
A is the set of events (Lebesgue measurable subsets of Ω)
P is the probability function (a Lebesgue measure over A)
10 / 11
39. From non-determinism to probabilities
Theorem
(Ω, A, P) is a probability space
Ω is the set of all possible oracles
A is the set of events (Lebesgue measurable subsets of Ω)
P is the probability function (a Lebesgue measure over A)
Work-in-progress:
Translation to/from LinealQ from/to λp (1)
+
(1)
LinealQ : Lineal in call-by-name, with scalars taken from Q∗
λp : λ+ with probability rewriting
+
10 / 11
40. From non-determinism to probabilities
Theorem
(Ω, A, P) is a probability space
Ω is the set of all possible oracles
A is the set of events (Lebesgue measurable subsets of Ω)
P is the probability function (a Lebesgue measure over A)
Work-in-progress:
Translation to/from LinealQ from/to λp (1)
+
Theorem (From LinealQ to λp )
+
pi
t →∗ i pi .ri ⇒ t →∗ ri with probability p1 +···+pn
Theorem (From λp to LinealQ )
+
t →∗ ri with probability pi , for i = 1, . . . , n ⇒ t →∗ i pi . ri
(1)
LinealQ : Lineal in call-by-name, with scalars taken from Q∗
λp : λ+ with probability rewriting
+
10 / 11
41. Summarising
The long-term aim is to define a computational quantum logic
11 / 11
42. Summarising
The long-term aim is to define a computational quantum logic
We have
A λ-calculus extension able to express quantum programs
A complex type system characterising the structure of the vectors
A linear non-deterministic model related to linear logic
A Curry-Howard correspondence between λ+ and 2nd order
intuitionistic logic
An easy way to move from non-determinism to probabilities, without
changing the model
11 / 11
43. Summarising
The long-term aim is to define a computational quantum logic
We have
A λ-calculus extension able to express quantum programs
A complex type system characterising the structure of the vectors
A linear non-deterministic model related to linear logic
A Curry-Howard correspondence between λ+ and 2nd order
intuitionistic logic
An easy way to move from non-determinism to probabilities, without
changing the model
We need
To move from probabilities to quantum, without loosing the
connections to logic
No-cloning (Move back to call-by-value [Arrighi,Dowek’08])
Measurement: we need to check for orthogonality
α.M + β.N → M with prob. |α|2 , if M ⊥ N
11 / 11