You are on page 1of 41

From Intuitionistic Linear Logic

to Quantum computing

Alejandro Díaz-Caro
UNIVERSIDAD NACIONAL DE QUILMES
& CONICET / UNIVERSIDAD de BUENOS AIRES
Buenos Aires, Argentina

Joint work with Gilles Dowek

Seminaire de l’équipe QUACS @ Université Paris-Saclay


May 24, 2023 – Saclay, France
Linear Logic and Linear functions
Motivation
[ADC & Gilles Dowek – FSCD 2022 & Extended version at arXiv:2201.11221, 2023]

Linear Logic ←→ Linear Algebra

Linearity expressed by its models (linear maps)

Lambda-calculus is the language of functions

Linear lambda-calculus is the language of linear functions

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 1 / 20


Motivation
[ADC & Gilles Dowek – FSCD 2022 & Extended version at arXiv:2201.11221, 2023]

Linear Logic ←→ Linear Algebra

Linearity expressed by its models (linear maps)

Lambda-calculus is the language of functions

Linear lambda-calculus is the language of linear functions

But, how?
Linear in the algebraic sense. . .

f (v + w ) = f (v ) + f (w )
f (a.v ) = a.f (v )

This is not easily expressible with lambda-terms

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 1 / 20


Interstitial rules
Addition and multiplication by scalar

Γ ⊢ A Γ ⊢ A sum Γ ⊢ A prod
Γ⊢A Γ⊢A

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 2 / 20


Interstitial rules
Addition and multiplication by scalar

Γ ⊢ A Γ ⊢ A sum Γ ⊢ A prod
Γ⊢A Γ⊢A
Now some proofs cannot be reduced, e.g.
π1 π2
Γ⊢A Γ⊢B
&
Γ ⊢ A & B prodi
Γ ⊢ A&B
&e
Γ⊢A

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 2 / 20


Interstitial rules
Addition and multiplication by scalar

Γ ⊢ A Γ ⊢ A sum Γ ⊢ A prod
Γ⊢A Γ⊢A
Now some proofs cannot be reduced, e.g.
π1 π2
Γ⊢A Γ⊢B
&
Γ ⊢ A & B prodi
Γ ⊢ A&B
&e
Γ⊢A

Commute sum either with the intro or with the elim


π1 π2 π1 π2
Γ ⊢ A prod Γ ⊢ B prod Γ⊢A Γ⊢B
&i
Γ⊢A Γ⊢B Γ ⊢ A&B
&i &e
Γ ⊢ A&B Γ ⊢ A prod
&e
Γ⊢A Γ⊢A

We chose to commute with the introduction as much as possible


Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 2 / 20
The LS -calculus
Intuitionistic linear logic connectives

Mult Add PL
Truth 1 ⊤ ⊤
Falsehood 0 ⊥
Implication ⊸ ⇒
Conjunction ⊗ & ∧
Disjunction ⊕ ∨

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 3 / 20


The LS -calculus
Intuitionistic linear logic connectives

Mult Add PL
Truth 1 ⊤ ⊤
Falsehood 0 ⊥
Implication ⊸ ⇒
Conjunction ⊗ & ∧
Disjunction ⊕ ∨
Proof-terms (a is scalar from some semiring (S, +, ·))
introductions eliminations connective
t =x |t +t |a•t | a.⋆ | t;t (1)
| λx.t | tt (⊸)
|t ⊗t | let x ⊗ y = t in t (⊗)
| ⟨⟩ (⊤)
| err(t) (0)
| ⟨t, t⟩ | π1 (t) | π2 (t) (&)
| inl(t) | inr(t) | match t {(x 7→ t) (y 7→ t)} (⊕)
Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 3 / 20
The LS -calculus
Some rules
Some deduction rules

1i (a) Γ ⊢ t : 1 ∆ ⊢ u : A 1e Γ ⊢ t : A Γ ⊢ u : A sum Γ ⊢ t : A prod(a)


⊢ a.⋆ : 1 Γ, ∆ ⊢ t;u : A Γ⊢t +u :A Γ⊢a•t :A

Γ⊢t:A ∆⊢u:B ⊗ Γ ⊢ t : A ⊗ B ∆, x : A, y : B ⊢ u : C
i ⊗e
Γ, ∆ ⊢ t ⊗ u : A ⊗ B Γ, ∆ ⊢ let x ⊗ y = t in u : C
Γ⊢t:A Γ⊢u:B Γ ⊢ t : A&B Γ ⊢ t : A&B
&i &e1 &e2
Γ ⊢ ⟨t, u⟩ : A & B Γ ⊢ π1 (t) : A Γ ⊢ π2 (t) : B
Some reduction rules

(a.⋆);t−→ a•t
a. ⋆ + b.⋆−→ (a + b).⋆
a • b.⋆−→ (a · b).⋆

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 4 / 20


The LS -calculus
Some rules
Some deduction rules

1i (a) Γ ⊢ t : 1 ∆ ⊢ u : A 1e Γ ⊢ t : A Γ ⊢ u : A sum Γ ⊢ t : A prod(a)


⊢ a.⋆ : 1 Γ, ∆ ⊢ t;u : A Γ⊢t +u :A Γ⊢a•t :A

Γ⊢t:A ∆⊢u:B ⊗ Γ ⊢ t : A ⊗ B ∆, x : A, y : B ⊢ u : C
i ⊗e
Γ, ∆ ⊢ t ⊗ u : A ⊗ B Γ, ∆ ⊢ let x ⊗ y = t in u : C
Γ⊢t:A Γ⊢u:B Γ ⊢ t : A&B Γ ⊢ t : A&B
&i &e1 &e2
Γ ⊢ ⟨t, u⟩ : A & B Γ ⊢ π1 (t) : A Γ ⊢ π2 (t) : B
Some reduction rules π1 π2 π3 π4
Γ⊢A Γ⊢B Γ⊢A Γ⊢B
&i &
Γ ⊢ A&B Γ ⊢ A & B sumi
(a.⋆);t−→ a•t Γ ⊢ A&B
a. ⋆ + b.⋆−→ (a + b).⋆
a • b.⋆−→ (a · b).⋆ π1 π3 π2 π4
⟨t1 , t2 ⟩+⟨u1 , u2 ⟩−→ ⟨t1 +u2 , t2 +u2 ⟩ −→ Γ ⊢ A Γ ⊢ A sum Γ ⊢ B Γ ⊢ B sum
Γ⊢A Γ⊢B
&i
Γ ⊢ A&B

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 4 / 20


The LS -calculus
Some rules
Some deduction rules

1i (a) Γ ⊢ t : 1 ∆ ⊢ u : A 1e Γ ⊢ t : A Γ ⊢ u : A sum Γ ⊢ t : A prod(a)


⊢ a.⋆ : 1 Γ, ∆ ⊢ t;u : A Γ⊢t +u :A Γ⊢a•t :A

Γ⊢t:A ∆⊢u:B ⊗ Γ ⊢ t : A ⊗ B ∆, x : A, y : B ⊢ u : C
i ⊗e
Γ, ∆ ⊢ t ⊗ u : A ⊗ B Γ, ∆ ⊢ let x ⊗ y = t in u : C
Γ⊢t:A Γ⊢u:B Γ ⊢ t : A&B Γ ⊢ t : A&B
&i &e1 &e2
Γ ⊢ ⟨t, u⟩ : A & B Γ ⊢ π1 (t) : A Γ ⊢ π2 (t) : B
Some reduction rules π1 π2 π3 π4
Γ1 ⊢ A ∆1 ⊢ B Γ 2 ⊢ A ∆2 ⊢ B
⊗i ⊗i
Ξ⊢A⊗B Ξ⊢A⊗B
(a.⋆);t−→ a•t sum
Ξ⊢A⊗B
a. ⋆ + b.⋆−→ (a + b).⋆
a • b.⋆−→ (a · b).⋆ Ξ = Γ1 , ∆1 = Γ2 , ∆2
⟨t1 , t2 ⟩+⟨u1 , u2 ⟩−→ ⟨t1 +u2 , t2 +u2 ⟩
let x ⊗ y = (t + u) in v −→ (let x ⊗ y = t in v ) + (let x ⊗ y = u in v )

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 4 / 20


Vectors

Definition (The set V)


1 ∈ V, If A, B ∈ V, A&B ∈ V A ∈ V, d(A) = number of 1

Definition (One-to-one correspondance) Example


n
A ∈ V with d(A) = n ←→ S a
⟨⟨a.⋆, b.⋆⟩, c.⋆⟩ ↔ b
⊢ t : A (t irreductible) −→ unique vector t ∈ S n | {z } c
|{z}
(1 & 1) & 1
v ∈ S n −→ unique irreductible proof vA S3

Lemma (Vector operations)


t +u =t +u
a • t = at

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 5 / 20


A vector space of terms
If (S, +, ·) is a field. . .

Definition (Equivalence)
t≡r iff ∃s s.t. t →∗ v ∗← r .

Definition (Null vector)


If A = 1, 0A = 0.⋆
0A proof of A ∈ V, defined by
If A = A1 & A2 , 0A = ⟨0A1 , 0A2 ⟩

Theorem (Vector space)


If A ∈ V and t, t1 , t2 , and t3 are closed proofs of A, then

1. (t1 + t2 ) + t3 ≡ t1 + (t2 + t3 ) 5. a • b • t ≡ (a · b) • t
2. t1 + t2 ≡ t2 + t1 6. 1 • t ≡ t
3. t + 0A ≡ t 7. a • (t1 + t2 ) ≡ a • t1 + a • t2
4. t + (−1) • t ≡ 0A 8. (a + b) • t ≡ a • t + b • t
Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 6 / 20
Matrices
Theorem (Matrices)

A, B ∈ V 

d(A) = m

⇒∃ ⊢t:A⇒B s.t. ∀v ∈ S m tvA = Mv
d(B) = n 

M ∈ S m×n

Example
a b

c d is expressed as t = λx.((π1 (x);⟨a.⋆, b.⋆⟩) + (π2 (x);⟨c.⋆, d.⋆⟩))

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 7 / 20


Matrices
Theorem (Matrices)

A, B ∈ V 

d(A) = m

⇒∃ ⊢t:A⇒B s.t. ∀v ∈ S m tvA = Mv
d(B) = n 

M ∈ S m×n

Example
a b

c d is expressed as t = λx.((π1 (x);⟨a.⋆, b.⋆⟩) + (π2 (x);⟨c.⋆, d.⋆⟩))
 
t ⟨e.⋆, f .⋆⟩ → π1 ⟨e.⋆, f .⋆⟩;⟨a.⋆, b.⋆⟩ + π2 ⟨e.⋆, f .⋆⟩;⟨c.⋆, d.⋆⟩
→∗ (e.⋆);⟨a.⋆, b.⋆⟩ + (f .⋆);⟨c.⋆, d.⋆⟩
 

→∗ e • ⟨a.⋆, b.⋆⟩ + f • ⟨c.⋆, d.⋆⟩



→ ⟨ae.⋆, be.⋆⟩ + ⟨cf .⋆, df .⋆⟩
→∗ ⟨(ae + cf ).⋆, (be + df ).⋆⟩

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 7 / 20


Linearity. The main theorem
Theorem (Linearity)
Let A be any proposition, B ∈ V, ⊢ t : A ⊸ B, and u, v ∈ A, then

t(u + v ) ≡ (tu) + (tv ) t(a • u) ≡ a • (tu)

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 8 / 20


Linearity. The main theorem
Theorem (Linearity)
Let A be any proposition, B ∈ V, ⊢ t : A ⊸ B, and u, v ∈ A, then

t(u + v ) ≡ (tu) + (tv ) t(a • u) ≡ a • (tu)

It does not extend directly to arbitrary B: Let t = λx.λy .yx : 1 ⊸ (1 ⊸ 1) ⊸ 1

t(1. ⋆ + 2.⋆) −→∗ λy .y 3.⋆ (t1.⋆) + (t2.⋆) −→∗ λy .(y 1.⋆) + (y 2.⋆)

But they are observationally equivalent!

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 8 / 20


Linearity. The main theorem
Theorem (Linearity)
Let A be any proposition, B ∈ V, ⊢ t : A ⊸ B, and u, v ∈ A, then

t(u + v ) ≡ (tu) + (tv ) t(a • u) ≡ a • (tu)

It does not extend directly to arbitrary B: Let t = λx.λy .yx : 1 ⊸ (1 ⊸ 1) ⊸ 1

t(1. ⋆ + 2.⋆) −→∗ λy .y 3.⋆ (t1.⋆) + (t2.⋆) −→∗ λy .(y 1.⋆) + (y 2.⋆)

But they are observationally equivalent!


Let t1 , t2 proof of A t1 ∼ t2
if ∀B ∈ V and ∀c s.t. x : A ⊢ c : B, we have (t1 /x)c ≡ (t2 /x)c

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 8 / 20


Linearity. The main theorem
Theorem (Linearity)
Let A be any proposition, B ∈ V, ⊢ t : A ⊸ B, and u, v ∈ A, then

t(u + v ) ≡ (tu) + (tv ) t(a • u) ≡ a • (tu)

It does not extend directly to arbitrary B: Let t = λx.λy .yx : 1 ⊸ (1 ⊸ 1) ⊸ 1

t(1. ⋆ + 2.⋆) −→∗ λy .y 3.⋆ (t1.⋆) + (t2.⋆) −→∗ λy .(y 1.⋆) + (y 2.⋆)

But they are observationally equivalent!


Let t1 , t2 proof of A t1 ∼ t2
if ∀B ∈ V and ∀c s.t. x : A ⊢ c : B, we have (t1 /x)c ≡ (t2 /x)c

Theorem (Generalized linearity)


Let A, B be any propositions, ⊢ t : A ⊸ B, and u, v ∈ A, then

t(u + v ) ∼ (tu) + (tv ) t(a • u) ∼ a • (tu)


Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 8 / 20
Linearity

Corollary
Let A, B ∈ V, d(A) = m, d(B) = n, and ⊢ t : A ⊸ B, then

F : Sm → Sn
u 7→ tu A

is linear.

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 9 / 20


The ⊙ connective: adding some non-determinism
Harmony
With generalized elimination rules
Example 1

Γ⊢A Γ⊢B ∧ Γ ⊢ A ∧ B Γ, A ⊢ C Γ ⊢ A ∧ B Γ, B ⊢ C
i ∧e1 ∧e2
Γ⊢A∧B Γ⊢C Γ⊢C
π1 π2
Γ⊢A Γ⊢B ∧ π3
i −→ (π1 /A)π3
Γ⊢A∧B Γ, A ⊢ C
∧e1
Γ⊢C
Example 2

Γ⊢A ∨ Γ⊢B ∨ Γ⊢A∨B Γ, A ⊢ C Γ, B ⊢ C


i1 i2 ∨e
Γ⊢A∨B Γ⊢A∨B Γ⊢C
π1
Γ⊢A ∧ π2 π3
i1 −→ (π1 /A)π2
Γ⊢A∨B Γ, A ⊢ C Γ, B ⊢ C
∧e
Γ⊢C
Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 10 / 20
Not harmony
Insufficiency [Prior 1960]

Γ⊢A Γ ⊢ A tonk B Γ, B ⊢ C
tonki tonke
Γ ⊢ A tonk B Γ⊢C
π1
Γ⊢A π2
tonki
Γ ⊢ A tonk B Γ, B ⊢ C
tonke
Γ⊢C

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 11 / 20


Not harmony
Insufficiency [Prior 1960]

Γ⊢A Γ ⊢ A tonk B Γ, B ⊢ C
tonki tonke
Γ ⊢ A tonk B Γ⊢C
π1
Γ⊢A π2
tonki
Γ ⊢ A tonk B Γ, B ⊢ C
tonke
Γ⊢C

Excessiveness
Γ ⊢ A Γ ⊢ B ⌣i Γ ⊢ A ⌣ B Γ, A ⊢ C Γ, B ⊢ C
⌣e
Γ⊢A⌣B Γ⊢C
π1 π2
Γ ⊢ A Γ ⊢ B ⌣i π3 π4 (π1 /A)π3
Γ⊢A⌣B Γ, A ⊢ C Γ, B ⊢ C
⌣e (π2 /A)π4
Γ⊢C

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 11 / 20


⊙ connective
[ADC & G. Dowek, ICTAC 2021 & TCS 2023]

In PL
Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ ⊢ A ⊙ B Γ, A ⊢ C Γ ⊢ A ⊙ B Γ, B ⊢ C Γ⊢A⊙B Γ, A ⊢ C Γ, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢C Γ⊢C Γ⊢C

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 12 / 20


⊙ connective
[ADC & G. Dowek, ICTAC 2021 & TCS 2023]

In PL
Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ⊢A⊙B Γ⊢A⊙B Γ⊢A⊙B Γ, A ⊢ C Γ, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢A Γ⊢B Γ⊢C

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 12 / 20


⊙ connective
[ADC & G. Dowek, ICTAC 2021 & TCS 2023]

In PL
Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ⊢A⊙B Γ⊢A⊙B Γ⊢A⊙B Γ, A ⊢ C Γ, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢A Γ⊢B Γ⊢C

In LL, an additive connective


Γ⊢A Γ⊢B ⊙
i
Γ⊢A⊙B
Γ⊢A⊙B Γ⊢A⊙B Γ ⊢ A ⊙ B ∆, A ⊢ C ∆, B ⊢ C
⊙e1 ⊙e2 ⊙e
Γ⊢A Γ⊢A Γ, ∆ ⊢ C

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 12 / 20


The L⊙S -calculus
Deduction rules
Γ⊢t:A Γ⊢u:B ⊙
i
Γ ⊢ [t, u] : A ⊙ B
Γ⊢t :A⊙B Γ⊢t :A⊙B
⊙e1 ⊙e2
Γ ⊢ π1⊙ (t) : A Γ ⊢ π2⊙ (t) : B
Γ⊢t :A⊙B ∆, x : A ⊢ u : C ∆, y : B ⊢ v : C

⊙e
Γ, ∆ ⊢ match t {(x 7→ u) (y 7→ v )} : C
Reduction rules
π1⊙ [t, u] → t Remark:
{⊙i , ⊙e1 , ⊙e2 } = {&1 , &e1 , &e2 }
π2⊙ [t, u] → u

match [t, u] {(x 7→ v ) (y 7→ w )} → (t/x)v New set V:
match⊙ [t, u] {(x 7→ v ) (y 7→ w )} → (u/y )w 1∈V
[t, u] + [v , w ] → [t + v , u + w ] If A, B ∈ V, A ⊙ B ∈ V
a • [t, u] → [a • t, a • u]

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 13 / 20


Measurement in the L⊙C -calculus
Preliminaires

Definition (Qubits: Qn )
Q0 = 1 Qn+1 = Qn ⊙ Qn

Definition (Norm)
Let t closed irreductible proof of Qn .
▶ If n = 0, t = a.⋆ ∥t∥2 = |a|2
▶ If n = n′ + 1, t = [t1 , t2 ] ∥t∥2 = ∥t1 ∥2 + ∥t2 ∥2

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 14 / 20


Measurement in the L⊙C -calculus
Preliminaires

Definition (Qubits: Qn )
Q0 = 1 Qn+1 = Qn ⊙ Qn

Definition (Norm)
Let t closed irreductible proof of Qn .
▶ If n = 0, t = a.⋆ ∥t∥2 = |a|2
▶ If n = n′ + 1, t = [t1 , t2 ] ∥t∥2 = ∥t1 ∥2 + ∥t2 ∥2
u
Convention u closed irreductible proof of Qn =⇒ alternative expression of the n-qubit ∥u∥ .
Example: √12 |0⟩ + √12 |1⟩ can be expressed by [ √12 .⋆, √12 .⋆] or by [1.⋆, 1.⋆].

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 14 / 20


Measurement in the L⊙C -calculus
Preliminaires

Definition (Qubits: Qn )
Q0 = 1 Qn+1 = Qn ⊙ Qn

Definition (Norm)
Let t closed irreductible proof of Qn .
▶ If n = 0, t = a.⋆ ∥t∥2 = |a|2
▶ If n = n′ + 1, t = [t1 , t2 ] ∥t∥2 = ∥t1 ∥2 + ∥t2 ∥2
u
Convention u closed irreductible proof of Qn =⇒ alternative expression of the n-qubit ∥u∥ .
Example: √12 |0⟩ + √12 |1⟩ can be expressed by [ √12 .⋆, √12 .⋆] or by [1.⋆, 1.⋆].

We can asign probabilities to the non-deterministic reductions of match⊙

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 14 / 20


Measurement in the L⊙C -calculus
Definition (Measurement of n qubits)
measn = λx.match⊙ x {(y 7→ [y , 0Qn−1 ]) (z 7→ [0Qn−1 , z])} ⊢ measn : Qn ⊸ Qn

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 15 / 20


Measurement in the L⊙C -calculus
Definition (Measurement of n qubits)
measn = λx.match⊙ x {(y 7→ [y , 0Qn−1 ]) (z 7→ [0Qn−1 , z])} ⊢ measn : Qn ⊸ Qn

Definition (Bits: B)
B=1⊕1 0 = inl(1.⋆) 1 = inr(1.⋆)
Convention Proofs of bits are taken modulo normalization.
a • 0 with a ̸= 0 represents the Boolean 0 a • 1 with a ̸= 0 represents the Boolean 1

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 15 / 20


Measurement in the L⊙C -calculus
Definition (Measurement of n qubits)
measn = λx.match⊙ x {(y 7→ [y , 0Qn−1 ]) (z 7→ [0Qn−1 , z])} ⊢ measn : Qn ⊸ Qn

Definition (Bits: B)
B=1⊕1 0 = inl(1.⋆) 1 = inr(1.⋆)
Convention Proofs of bits are taken modulo normalization.
a • 0 with a ̸= 0 represents the Boolean 0 a • 1 with a ̸= 0 represents the Boolean 1

Definition (Classical output of the measurement)


meas′1 = λx.match⊙ x {(y 7→ y ;0) (z 7→ z;1)} ⊢ meas′1 : Qn ⊸ B

Example
meas′1 [a.⋆, b.⋆]
2
|b|2
Reduces to a.0 with probability |a|2|a|
+|b|2 Reduces to b.1 with probability |a|2 +|b|2

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 15 / 20


Example: Deutsch’s algorithm
Preliminaires

Definition (The four boolean functions)


if = λx.λy .λz.match x {(w1 7→ w1 ;y ) (w2 7→ w2 ;z)} ⊢ if : B ⊸ A ⊸ A ⊸ A
if 0 u v → 1 • u if 1 u v → 1 • v
The four Boolean functions mapping 0 to a and 1 to b are λx.if x a b

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 16 / 20


Example: Deutsch’s algorithm
Preliminaires

Definition (The four boolean functions)


if = λx.λy .λz.match x {(w1 7→ w1 ;y ) (w2 7→ w2 ;z)} ⊢ if : B ⊸ A ⊸ A ⊸ A
if 0 u v → 1 • u if 1 u v → 1 • v
The four Boolean functions mapping 0 to a and 1 to b are λx.if x a b

Definition (⊢ U : (B ⊸ B) ⊸ Q2 ⊸ Q2 )
       
⊙ ⊙
U = λf .λq. M0 π1 (π1 q) + M1 π2⊙ (π1⊙ q) + M2 π1⊙ (π2⊙ q) +
⊙ ⊙
M3 π2 (π2 q)

where M0 , M1 , M2 , and M3 are the proofs of 1 ⊸ Q2

M0 = λs.(s;if (f 0) [[1.⋆, 0.⋆], [0.⋆, 0.⋆]] [[0.⋆, 1.⋆], [0.⋆, 0.⋆]])


M1 = λs.(s;if (f 0) [[0.⋆, 1.⋆], [0.⋆, 0.⋆]] [[1.⋆, 0.⋆], [0.⋆, 0.⋆]])
M2 = λs.(s;if (f 1) [[0.⋆, 0.⋆], [1.⋆, 0.⋆]] [[0.⋆, 0.⋆], [0.⋆, 1.⋆]])
M3 = λs.(s;if (f 1) [[0.⋆, 0.⋆], [0.⋆, 1.⋆]] [[0.⋆, 0.⋆], [1.⋆, 0.⋆]])
Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 16 / 20
Example: Deutsch’s algorithm

Deutsch = λf .meas′2 ((H ⊗ I ) (U f | + −⟩))


⊢ Deutsch : (B ⊸ B) ⊸ B

Example
⊢f :B⊸B
▶ If f constant function, Deutsch f −→∗(1) a • 0, for some scalar a,
▶ If f if not constant, Deutsch f −→∗(1) a • 1 for some scalar a.

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 17 / 20


A categorical model of the LS -calculus
[ADC & O. Malherbe, draft at arXiv:2205.02142, 2022]

Definition (Cancellative semiring)


▶ (S, +) commutative monoid with identity 0
In particular {∗} is a
▶ (S, ·) commutative monoid with identity 1 cancellative semiring, with
▶ · distributes w.r.t. + 0=1=∗
▶ For any s ∈ S, 0 · s = 0
▶ Cancellative property: s1 + s = s2 + s implies s1 = s2

Definition (S-semimodule)
(A, +) commutative monoid with additive identity 0 and • : S × A → A satisfying:

(s · s ′ ) • a = s • (s ′ • a) 1•a=a
′ ′
s • (a + a ) = (s • a) + (s • a ) s •0=0•a=0
′ ′
(s + s ) • a = (s • a) + (s • a)

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 18 / 20


A categorical model of the LS -calculus
[ADC & O. Malherbe, draft at arXiv:2205.02142, 2022]

Definition (Category CSMS ) Theorem


Obj(CSMS ) = {A | A is a cancellative S-semimodule} CSMS is a symmetic monoidal closed
Arr(CSMS ) = {f | f is a S-homomorphism} category with product and coproduct

S = {∗} =⇒ non-deterministic calculus


+
S=R =⇒ probabilistic calculus
S=C =⇒ quantum calculus

J1K = S J0K = {∗}


JA ⊗ BK = JAK ⊗ JBK JA & BK = JAK × JBK
JA ⊸ BK = JBK JA ⊕ BK = JAK + JBK
JAK

J⊤K = {∗}

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 19 / 20


Summarizing
▶ We presented the LS -logic, an extension of intuitionistic linear logic with two interstitial
rules and its commuting rules to recover cut elimination.

▶ We have shown that its proof-language can express matrices in S m×n

▶ Moreover, we have shown that every term of type A ⊸ B is linear in the algebraic sense.

▶ We extended further with a non-harmonious connective: ⊙ (read “sup”).

▶ We have shown how to use its lack of harmony to encode the quantum measurement.

▶ Categorical model (semimodules over cancellative semirings).

Alejandro Díaz-Caro From Intuitionistic Linear Logic to Quantum computing 20 / 20

You might also like