Quantum computing, non-determinism, probabilistic systems... and the logic behind

83
Quantum computing, non-determinism, probabilistic systems... and the logic behind Alejandro Díaz-Caro Université Paris-Ouest Nanterre La Défense Séminaire Modal’X January 31, 2013

Transcript of Quantum computing, non-determinism, probabilistic systems... and the logic behind

Page 1: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Quantum computing, non-determinism,probabilistic systems... and the logic behind

Alejandro Díaz-CaroUniversité Paris-Ouest Nanterre La Défense

Séminaire Modal’XJanuary 31, 2013

Page 2: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Outline

A brief and fast introduction to quantum computing

A brief and fast introduction to λ-calculus

A brief and fast introduction to typed λ-calculus

How does it relates to intuitionistic logic?(a word on the Curry-Howard correspondence)

What I am doingAlgebraic calculi and vectorial typingNon-determinism, a simpler problem

Work-in-progressFrom non-determinism to probabilities

2 / 27

Page 3: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Outline

A brief and fast introduction to quantum computing

A brief and fast introduction to λ-calculus

A brief and fast introduction to typed λ-calculus

How does it relates to intuitionistic logic?(a word on the Curry-Howard correspondence)

What I am doingAlgebraic calculi and vectorial typingNon-determinism, a simpler problem

Work-in-progressFrom non-determinism to probabilities

3 / 27

Page 4: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to quantum computingA bit of history

Richard Feynman’s quote (1982)I’m not happy with all the analyses that go with just the classical theory,because nature isn’t classical, and if you want to make a simulation ofnature, you’d better make it quantum mechanical, and by golly it’s awonderful problem, because it doesn’t look so easy.

1985 David Deutsch → 1st. model of Quantum Turing Machine1993 Charles Benett et.al. → Teleportation algorithm1994 Peter Shor → Fast factorisation algorithm1996 Lov Grover → Fast search algorithm1998 Isaac Chuang et.al. → 1st (1 qubit) quantum computer2001 Lieven Vandersypen et.al. → 7 qubit quantum computer

. . . factorising the number 15...

4 / 27

Page 5: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to quantum computingA bit of history

Richard Feynman’s quote (1982)I’m not happy with all the analyses that go with just the classical theory,because nature isn’t classical, and if you want to make a simulation ofnature, you’d better make it quantum mechanical, and by golly it’s awonderful problem, because it doesn’t look so easy.

1985 David Deutsch → 1st. model of Quantum Turing Machine1993 Charles Benett et.al. → Teleportation algorithm1994 Peter Shor → Fast factorisation algorithm1996 Lov Grover → Fast search algorithm1998 Isaac Chuang et.al. → 1st (1 qubit) quantum computer2001 Lieven Vandersypen et.al. → 7 qubit quantum computer

. . . factorising the number 15...

4 / 27

Page 6: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to quantum computingA bit of history

Richard Feynman’s quote (1982)I’m not happy with all the analyses that go with just the classical theory,because nature isn’t classical, and if you want to make a simulation ofnature, you’d better make it quantum mechanical, and by golly it’s awonderful problem, because it doesn’t look so easy.

1985 David Deutsch → 1st. model of Quantum Turing Machine1993 Charles Benett et.al. → Teleportation algorithm1994 Peter Shor → Fast factorisation algorithm1996 Lov Grover → Fast search algorithm1998 Isaac Chuang et.al. → 1st (1 qubit) quantum computer2001 Lieven Vandersypen et.al. → 7 qubit quantum computer

. . . factorising the number 15...

4 / 27

Page 7: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingQuantum vs. Classic, side by side

I Classic computing Bit: 0, 1Quantum computing Qubit: Normalised vector from C2. Wechoose the basis |0〉, |1〉 where |0〉 = (0, 1)T and |1〉 = (1, 0)T

I Classic computing 2-bits system: one from 00, 01, 10, 00Quantum computing 2-qubits system: One from the tensorproduct of the two corresponding spaces. A canonical base for it is|00〉, |01〉, |10〉, |11〉, where |xy〉 = |x〉 ⊗ |y〉.

I Classic computing Reading data: No problemQuantum computing Measuring the system: Measurement ofα|0〉+ β|1〉 returns a bit, and the system collapses to

I |0〉 if 0 was measured, with probability p0 = |α|2I |1〉 if 1 was measured, with probability p1 = |β|2.

5 / 27

Page 8: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingQuantum vs. Classic, side by side

I Classic computing Bit: 0, 1Quantum computing Qubit: Normalised vector from C2. Wechoose the basis |0〉, |1〉 where |0〉 = (0, 1)T and |1〉 = (1, 0)T

I Classic computing 2-bits system: one from 00, 01, 10, 00Quantum computing 2-qubits system: One from the tensorproduct of the two corresponding spaces. A canonical base for it is|00〉, |01〉, |10〉, |11〉, where |xy〉 = |x〉 ⊗ |y〉.

I Classic computing Reading data: No problemQuantum computing Measuring the system: Measurement ofα|0〉+ β|1〉 returns a bit, and the system collapses to

I |0〉 if 0 was measured, with probability p0 = |α|2I |1〉 if 1 was measured, with probability p1 = |β|2.

5 / 27

Page 9: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingQuantum vs. Classic, side by side

I Classic computing Bit: 0, 1Quantum computing Qubit: Normalised vector from C2. Wechoose the basis |0〉, |1〉 where |0〉 = (0, 1)T and |1〉 = (1, 0)T

I Classic computing 2-bits system: one from 00, 01, 10, 00Quantum computing 2-qubits system: One from the tensorproduct of the two corresponding spaces. A canonical base for it is|00〉, |01〉, |10〉, |11〉, where |xy〉 = |x〉 ⊗ |y〉.

I Classic computing Reading data: No problemQuantum computing Measuring the system: Measurement ofα|0〉+ β|1〉 returns a bit, and the system collapses to

I |0〉 if 0 was measured, with probability p0 = |α|2I |1〉 if 1 was measured, with probability p1 = |β|2.

5 / 27

Page 10: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingCont.

I Classic computing computation: Logic gates NOT, AND, etc...Quantum computing operations: Unitary matrices (U†U = I )

Example:

H =1√2

(1 11 −1

) H|0〉 =1√2

(|0〉+ |1〉)

H|1〉 =1√2

(|0〉 − |1〉)

We can also combine them:(H ⊗ I ) = Apply H to the first qubit, and identity to the second

I No-cloning theorem “There is no universal cloning machine”i.e. @U s.t. U|φψ〉 = |ψψ〉 for an arbitrary qubit |ψ〉

I Entanglement 1√2|00〉+ 1√

2|11〉 is a 2-qubit system but cannot be

written as |ψ〉 ⊗ |φ〉...Consequence: Measuring the first qubit... both collapse!

6 / 27

Page 11: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingCont.

I Classic computing computation: Logic gates NOT, AND, etc...Quantum computing operations: Unitary matrices (U†U = I )

Example:

H =1√2

(1 11 −1

) H|0〉 =1√2

(|0〉+ |1〉)

H|1〉 =1√2

(|0〉 − |1〉)

We can also combine them:(H ⊗ I ) = Apply H to the first qubit, and identity to the second

I No-cloning theorem “There is no universal cloning machine”i.e. @U s.t. U|φψ〉 = |ψψ〉 for an arbitrary qubit |ψ〉

I Entanglement 1√2|00〉+ 1√

2|11〉 is a 2-qubit system but cannot be

written as |ψ〉 ⊗ |φ〉...Consequence: Measuring the first qubit... both collapse!

6 / 27

Page 12: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingCont.

I Classic computing computation: Logic gates NOT, AND, etc...Quantum computing operations: Unitary matrices (U†U = I )

Example:

H =1√2

(1 11 −1

) H|0〉 =1√2

(|0〉+ |1〉)

H|1〉 =1√2

(|0〉 − |1〉)

We can also combine them:(H ⊗ I ) = Apply H to the first qubit, and identity to the second

I No-cloning theorem “There is no universal cloning machine”i.e. @U s.t. U|φψ〉 = |ψψ〉 for an arbitrary qubit |ψ〉

I Entanglement 1√2|00〉+ 1√

2|11〉 is a 2-qubit system but cannot be

written as |ψ〉 ⊗ |φ〉...Consequence: Measuring the first qubit... both collapse!

6 / 27

Page 13: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingExample: Deutsh’s algorithm

Objective: To know if a 1-bit function f : B → B is constant or not.Oracle: Uf |x , y〉 = |x , y ⊕ f (x)〉 where ⊕ is the addition modulo 2.

Uf |x , 0〉 = |x , f (x)〉

First attempt:

Uf (H ⊗ I )|00〉 = Uf

(1√2

(|00〉+ |10〉))

=1√2

(|0, f (0)〉+ |1, f (1)〉)︸ ︷︷ ︸Superposition of results

Only one call to Uf ... but how to read the results?

Deutsch’s algorithm:

(H ⊗ I )Uf (H ⊗ H)|00〉 = · · · =

±|0〉|−〉 if f (0) = f (1)±|1〉|−〉 if f (0) 6= f (1)

with |−〉 = 1√2

(|0〉 − |1〉)

Measuring the first qubit, we have the answer...with only one call to the oracle

7 / 27

Page 14: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingExample: Deutsh’s algorithm

Objective: To know if a 1-bit function f : B → B is constant or not.Oracle: Uf |x , y〉 = |x , y ⊕ f (x)〉 where ⊕ is the addition modulo 2.

Uf |x , 0〉 = |x , f (x)〉

First attempt:

Uf (H ⊗ I )|00〉 = Uf

(1√2

(|00〉+ |10〉))

=1√2

(|0, f (0)〉+ |1, f (1)〉)︸ ︷︷ ︸Superposition of results

Only one call to Uf ... but how to read the results?

Deutsch’s algorithm:

(H ⊗ I )Uf (H ⊗ H)|00〉 = · · · =

±|0〉|−〉 if f (0) = f (1)±|1〉|−〉 if f (0) 6= f (1)

with |−〉 = 1√2

(|0〉 − |1〉)

Measuring the first qubit, we have the answer...with only one call to the oracle

7 / 27

Page 15: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A physics free introduction to quantum computingExample: Deutsh’s algorithm

Objective: To know if a 1-bit function f : B → B is constant or not.Oracle: Uf |x , y〉 = |x , y ⊕ f (x)〉 where ⊕ is the addition modulo 2.

Uf |x , 0〉 = |x , f (x)〉

First attempt:

Uf (H ⊗ I )|00〉 = Uf

(1√2

(|00〉+ |10〉))

=1√2

(|0, f (0)〉+ |1, f (1)〉)︸ ︷︷ ︸Superposition of results

Only one call to Uf ... but how to read the results?

Deutsch’s algorithm:

(H ⊗ I )Uf (H ⊗ H)|00〉 = · · · =

±|0〉|−〉 if f (0) = f (1)±|1〉|−〉 if f (0) 6= f (1)

with |−〉 = 1√2

(|0〉 − |1〉)

Measuring the first qubit, we have the answer...with only one call to the oracle

7 / 27

Page 16: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Outline

A brief and fast introduction to quantum computing

A brief and fast introduction to λ-calculus

A brief and fast introduction to typed λ-calculus

How does it relates to intuitionistic logic?(a word on the Curry-Howard correspondence)

What I am doingAlgebraic calculi and vectorial typingNon-determinism, a simpler problem

Work-in-progressFrom non-determinism to probabilities

8 / 27

Page 17: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusHistory and intuitions

Introduced in 1936 by Alonzo Church (Alan Turing’s doctoral adviser)

Motivation: Investigating the foundations of mathematics(in particular, the concept of recursion)

Why we still use itI Recursive functions are fundamental within computer scienceI It is the simplest model to study properties of computation

Two fundamental simplificationsI Anonymity of functions:

Example: sqsum(x , y) = x2 + y2

is written anonymously as (x , y) 7→ x2 + y2

No names neededI All the functions are in a single variable:

Example: (x , y) 7→ x2 + y2

is written as x 7→ (y 7→ x2 + y2)

A 2-vars function is a 1-var function, returninga 1-var function, which does the calculation

9 / 27

Page 18: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusHistory and intuitions

Introduced in 1936 by Alonzo Church (Alan Turing’s doctoral adviser)

Motivation: Investigating the foundations of mathematics(in particular, the concept of recursion)

Why we still use itI Recursive functions are fundamental within computer scienceI It is the simplest model to study properties of computation

Two fundamental simplificationsI Anonymity of functions:

Example: sqsum(x , y) = x2 + y2

is written anonymously as (x , y) 7→ x2 + y2

No names neededI All the functions are in a single variable:

Example: (x , y) 7→ x2 + y2

is written as x 7→ (y 7→ x2 + y2)

A 2-vars function is a 1-var function, returninga 1-var function, which does the calculation

9 / 27

Page 19: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusHistory and intuitions

Introduced in 1936 by Alonzo Church (Alan Turing’s doctoral adviser)

Motivation: Investigating the foundations of mathematics(in particular, the concept of recursion)

Why we still use itI Recursive functions are fundamental within computer scienceI It is the simplest model to study properties of computation

Two fundamental simplificationsI Anonymity of functions:

Example: sqsum(x , y) = x2 + y2

is written anonymously as (x , y) 7→ x2 + y2

No names needed

I All the functions are in a single variable:Example: (x , y) 7→ x2 + y2

is written as x 7→ (y 7→ x2 + y2)

A 2-vars function is a 1-var function, returninga 1-var function, which does the calculation

9 / 27

Page 20: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusHistory and intuitions

Introduced in 1936 by Alonzo Church (Alan Turing’s doctoral adviser)

Motivation: Investigating the foundations of mathematics(in particular, the concept of recursion)

Why we still use itI Recursive functions are fundamental within computer scienceI It is the simplest model to study properties of computation

Two fundamental simplificationsI Anonymity of functions:

Example: sqsum(x , y) = x2 + y2

is written anonymously as (x , y) 7→ x2 + y2

No names neededI All the functions are in a single variable:

Example: (x , y) 7→ x2 + y2

is written as x 7→ (y 7→ x2 + y2)

A 2-vars function is a 1-var function, returninga 1-var function, which does the calculation

9 / 27

Page 21: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusFormalisation

Language of terms (a grammar)

M,N ::= x | λx .M | MN

I A variable x ∈ Vars is a λ-termI If M is a term, and x is a variable, λx .M is a term (x 7→ M)I If M and N are two terms, MN is a term (application)

These are the only possible terms.

A rewrite rule (β-reduction)

(λx .M)N → M[x := N]

Example: Let x2 + 1 be a λ-term (with some encoding)

f (x) = x2 + 1 is written λx .x2 + 1

f (N) is written (λx .x2 + 1)N which β-reduces to

(x2 + 1)[x := N] = N2 + 1

10 / 27

Page 22: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusFormalisation

Language of terms (a grammar)

M,N ::= x | λx .M | MN

I A variable x ∈ Vars is a λ-termI If M is a term, and x is a variable, λx .M is a term (x 7→ M)I If M and N are two terms, MN is a term (application)

These are the only possible terms.

A rewrite rule (β-reduction)

(λx .M)N → M[x := N]

Example: Let x2 + 1 be a λ-term (with some encoding)

f (x) = x2 + 1 is written λx .x2 + 1

f (N) is written (λx .x2 + 1)N which β-reduces to

(x2 + 1)[x := N] = N2 + 1

10 / 27

Page 23: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusFormalisation

Language of terms (a grammar)

M,N ::= x | λx .M | MN

I A variable x ∈ Vars is a λ-termI If M is a term, and x is a variable, λx .M is a term (x 7→ M)I If M and N are two terms, MN is a term (application)

These are the only possible terms.

A rewrite rule (β-reduction)

(λx .M)N → M[x := N]

Example: Let x2 + 1 be a λ-term (with some encoding)

f (x) = x2 + 1 is written λx .x2 + 1

f (N) is written (λx .x2 + 1)N which β-reduces to

(x2 + 1)[x := N] = N2 + 1

10 / 27

Page 24: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusFormalisation

Language of terms (a grammar)

M,N ::= x | λx .M | MN

I A variable x ∈ Vars is a λ-termI If M is a term, and x is a variable, λx .M is a term (x 7→ M)I If M and N are two terms, MN is a term (application)

These are the only possible terms.

A rewrite rule (β-reduction)

(λx .M)N → M[x := N]

Example: Let x2 + 1 be a λ-term (with some encoding)

f (x) = x2 + 1 is written λx .x2 + 1

f (N) is written (λx .x2 + 1)N which β-reduces to

(x2 + 1)[x := N] = N2 + 1

10 / 27

Page 25: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx) → xx [x := λx .xx ] = (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .xM is normalising if it can end e.g. (λx .λy .y)ΩM is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?

11 / 27

Page 26: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx)

→ xx [x := λx .xx ] = (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .xM is normalising if it can end e.g. (λx .λy .y)ΩM is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?

11 / 27

Page 27: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx) → xx [x := λx .xx ]

= (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .xM is normalising if it can end e.g. (λx .λy .y)ΩM is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?

11 / 27

Page 28: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx) → xx [x := λx .xx ] = (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .xM is normalising if it can end e.g. (λx .λy .y)ΩM is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?

11 / 27

Page 29: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx) → xx [x := λx .xx ] = (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .x

M is normalising if it can end e.g. (λx .λy .y)ΩM is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?

11 / 27

Page 30: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx) → xx [x := λx .xx ] = (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .xM is normalising if it can end e.g. (λx .λy .y)Ω

M is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?

11 / 27

Page 31: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx) → xx [x := λx .xx ] = (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .xM is normalising if it can end e.g. (λx .λy .y)ΩM is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?

11 / 27

Page 32: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to λ-calculusNormal form

Not every computation ends well...

Consider λx .xx(the function that takes an argument, and applies it to itself)

Ω = (λx .xx)(λx .xx) → xx [x := λx .xx ] = (λx .xx)(λx .xx) = Ω

So Ω→ Ω→ Ω→ · · ·

NormalisationM is in normal form, if it does not rewrite e.g. λx .xM is normalising if it can end e.g. (λx .λy .y)ΩM is strongly normalising if it always ends e.g. (λx .x)(λx .x)

How can we know if a λ-term is (strongly) normalising?11 / 27

Page 33: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Outline

A brief and fast introduction to quantum computing

A brief and fast introduction to λ-calculus

A brief and fast introduction to typed λ-calculus

How does it relates to intuitionistic logic?(a word on the Curry-Howard correspondence)

What I am doingAlgebraic calculi and vectorial typingNon-determinism, a simpler problem

Work-in-progressFrom non-determinism to probabilities

12 / 27

Page 34: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 35: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 36: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”

Typing rulesax

Γ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 37: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 38: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 39: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 40: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 41: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 42: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivation

axxτ⇒τ ` x : τ ⇒ τ

⇒I` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 43: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivationax

xτ⇒τ ` x : τ ⇒ τ⇒I

` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 44: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivationax

xτ⇒τ ` x : τ ⇒ τ⇒I

` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 45: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusSimply types

Static way of classify λ-terms (i.e. without reducing it)

Terms M,N ::= x | λx .M | MNTypes τ, σ ::= c | τ ⇒ σ

I c is a base type I τ ⇒ σ is the functional type

Context: set of typed variables Γ = xτ11 , . . . , x

τnn

Γ ` M : τ “M has type τ in context Γ”Typing rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

Example of type derivationax

xτ⇒τ ` x : τ ⇒ τ⇒I

` λx .x : (τ ⇒ τ)⇒ (τ ⇒ τ)

axxτ ` x : τ

⇒I` λx .x : τ ⇒ τ

⇒E` (λx .x)(λx .x) : τ ⇒ τ

Verification: (λx .x)(λx .x) rewrites to λx .x (of type τ ⇒ τ)

13 / 27

Page 46: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusNormalisation

Ω does not have a type in this theory

Moreover...

Theorem (Strong normalisation)If M has a type, M is strongly normalising

Slogan “Well-typed programs cannot go wrong” — [R. Milner’78]

14 / 27

Page 47: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusNormalisation

Ω does not have a type in this theory

Moreover...

Theorem (Strong normalisation)If M has a type, M is strongly normalising

Slogan “Well-typed programs cannot go wrong” — [R. Milner’78]

14 / 27

Page 48: Quantum computing, non-determinism, probabilistic systems... and the logic behind

A brief and fast introduction to typed λ-calculusNormalisation

Ω does not have a type in this theory

Moreover...

Theorem (Strong normalisation)If M has a type, M is strongly normalising

Slogan “Well-typed programs cannot go wrong” — [R. Milner’78]

14 / 27

Page 49: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Outline

A brief and fast introduction to quantum computing

A brief and fast introduction to λ-calculus

A brief and fast introduction to typed λ-calculus

How does it relates to intuitionistic logic?(a word on the Curry-Howard correspondence)

What I am doingAlgebraic calculi and vectorial typingNon-determinism, a simpler problem

Work-in-progressFrom non-determinism to probabilities

15 / 27

Page 50: Quantum computing, non-determinism, probabilistic systems... and the logic behind

How does it relates to intuitionistic logics?A word on the Curry-Howard correspondence

Classical logic: a well-formed statement assumed true or false

Intuitionistic logic: a statement is true (false) if there is a constructiveproof that it is true (false)

Law of excluded middle is not an axiom!(and cannot be proved neither) in intuitionistic logic

Minimal intuitionistic logic

axΓ, τ ` τ

Γ, τ ` σ⇒I

Γ ` τ ⇒ σ

Γ ` τ ⇒ σ Γ ` τ⇒E

Γ ` σTyping rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

The λ-term is the proof of the statementProofs... are programs! Haskell Curry and William Howard,

between 1934 and 1969

More complex logics corresponds to more complex typing systems

16 / 27

Page 51: Quantum computing, non-determinism, probabilistic systems... and the logic behind

How does it relates to intuitionistic logics?A word on the Curry-Howard correspondence

Classical logic: a well-formed statement assumed true or false

Intuitionistic logic: a statement is true (false) if there is a constructiveproof that it is true (false)

Law of excluded middle is not an axiom!(and cannot be proved neither) in intuitionistic logic

Minimal intuitionistic logic

axΓ, τ ` τ

Γ, τ ` σ⇒I

Γ ` τ ⇒ σ

Γ ` τ ⇒ σ Γ ` τ⇒E

Γ ` σTyping rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

The λ-term is the proof of the statementProofs... are programs! Haskell Curry and William Howard,

between 1934 and 1969

More complex logics corresponds to more complex typing systems

16 / 27

Page 52: Quantum computing, non-determinism, probabilistic systems... and the logic behind

How does it relates to intuitionistic logics?A word on the Curry-Howard correspondence

Classical logic: a well-formed statement assumed true or false

Intuitionistic logic: a statement is true (false) if there is a constructiveproof that it is true (false)

Law of excluded middle is not an axiom!(and cannot be proved neither) in intuitionistic logic

Minimal intuitionistic logic

axΓ, τ ` τ

Γ, τ ` σ⇒I

Γ ` τ ⇒ σ

Γ ` τ ⇒ σ Γ ` τ⇒E

Γ ` σ

Typing rulesax

Γ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

The λ-term is the proof of the statementProofs... are programs! Haskell Curry and William Howard,

between 1934 and 1969

More complex logics corresponds to more complex typing systems

16 / 27

Page 53: Quantum computing, non-determinism, probabilistic systems... and the logic behind

How does it relates to intuitionistic logics?A word on the Curry-Howard correspondence

Classical logic: a well-formed statement assumed true or false

Intuitionistic logic: a statement is true (false) if there is a constructiveproof that it is true (false)

Law of excluded middle is not an axiom!(and cannot be proved neither) in intuitionistic logic

Minimal intuitionistic logic

axΓ, τ ` τ

Γ, τ ` σ⇒I

Γ ` τ ⇒ σ

Γ ` τ ⇒ σ Γ ` τ⇒E

Γ ` σTyping rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

The λ-term is the proof of the statementProofs... are programs! Haskell Curry and William Howard,

between 1934 and 1969

More complex logics corresponds to more complex typing systems

16 / 27

Page 54: Quantum computing, non-determinism, probabilistic systems... and the logic behind

How does it relates to intuitionistic logics?A word on the Curry-Howard correspondence

Classical logic: a well-formed statement assumed true or false

Intuitionistic logic: a statement is true (false) if there is a constructiveproof that it is true (false)

Law of excluded middle is not an axiom!(and cannot be proved neither) in intuitionistic logic

Minimal intuitionistic logic

axΓ, τ ` τ

Γ, τ ` σ⇒I

Γ ` τ ⇒ σ

Γ ` τ ⇒ σ Γ ` τ⇒E

Γ ` σTyping rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

The λ-term is the proof of the statementProofs... are programs! Haskell Curry and William Howard,

between 1934 and 1969

More complex logics corresponds to more complex typing systems

16 / 27

Page 55: Quantum computing, non-determinism, probabilistic systems... and the logic behind

How does it relates to intuitionistic logics?A word on the Curry-Howard correspondence

Classical logic: a well-formed statement assumed true or false

Intuitionistic logic: a statement is true (false) if there is a constructiveproof that it is true (false)

Law of excluded middle is not an axiom!(and cannot be proved neither) in intuitionistic logic

Minimal intuitionistic logic

axΓ, τ ` τ

Γ, τ ` σ⇒I

Γ ` τ ⇒ σ

Γ ` τ ⇒ σ Γ ` τ⇒E

Γ ` σTyping rules

axΓ, xτ ` x : τ

Γ, xτ ` M : σ⇒I

Γ ` λx .M : τ ⇒ σ

Γ ` M : τ ⇒ σ Γ ` N : τ⇒E

Γ ` MN : σ

The λ-term is the proof of the statementProofs... are programs! Haskell Curry and William Howard,

between 1934 and 1969

More complex logics corresponds to more complex typing systems16 / 27

Page 56: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Outline

A brief and fast introduction to quantum computing

A brief and fast introduction to λ-calculus

A brief and fast introduction to typed λ-calculus

How does it relates to intuitionistic logic?(a word on the Curry-Howard correspondence)

What I am doingAlgebraic calculi and vectorial typingNon-determinism, a simpler problem

Work-in-progressFrom non-determinism to probabilities

17 / 27

Page 57: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Untyped algebraic extensionsTwo origins:

I Vaux’09 (from Linear Logic)I Arrighi,Dowek’08 (for Quantum computing)

Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]

M,N ::= x | λx .M | MN | M + N | α.M | 0 α ∈ (S,+,×), a ring.

β-reduction: (λx .M)N → M[x := N]

“Algebraic” reductions:α.M + β.N → (α + β).M,

α.β.M → (α× β).M,M(N1 + N2) → MN1 + MN2,(M1 + M2)N → M1N + M2N,

. . .(oriented version of the axioms of

vectorial spaces)

Vectorial space of values

B = vars. and abs.

Space of values ::= Span(B)

Value == result of the computation, if it ends

18 / 27

Page 58: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Untyped algebraic extensionsTwo origins:

I Vaux’09 (from Linear Logic)I Arrighi,Dowek’08 (for Quantum computing)

Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]

M,N ::= x | λx .M | MN | M + N | α.M | 0 α ∈ (S,+,×), a ring.

β-reduction: (λx .M)N → M[x := N]

“Algebraic” reductions:α.M + β.N → (α + β).M,

α.β.M → (α× β).M,M(N1 + N2) → MN1 + MN2,(M1 + M2)N → M1N + M2N,

. . .(oriented version of the axioms of

vectorial spaces)

Vectorial space of values

B = vars. and abs.

Space of values ::= Span(B)

Value == result of the computation, if it ends

18 / 27

Page 59: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Untyped algebraic extensionsTwo origins:

I Vaux’09 (from Linear Logic)I Arrighi,Dowek’08 (for Quantum computing)

Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]

M,N ::= x | λx .M | MN | M + N | α.M | 0 α ∈ (S,+,×), a ring.

β-reduction: (λx .M)N → M[x := N]

“Algebraic” reductions:α.M + β.N → (α + β).M,

α.β.M → (α× β).M,M(N1 + N2) → MN1 + MN2,(M1 + M2)N → M1N + M2N,

. . .(oriented version of the axioms of

vectorial spaces)

Vectorial space of values

B = vars. and abs.

Space of values ::= Span(B)

Value == result of the computation, if it ends

18 / 27

Page 60: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Untyped algebraic extensionsTwo origins:

I Vaux’09 (from Linear Logic)I Arrighi,Dowek’08 (for Quantum computing)

Equivalent formalisms [Díaz-Caro,Perdrix,Tasson,Valiron’10]

M,N ::= x | λx .M | MN | M + N | α.M | 0 α ∈ (S,+,×), a ring.

β-reduction: (λx .M)N → M[x := N]

“Algebraic” reductions:α.M + β.N → (α + β).M,

α.β.M → (α× β).M,M(N1 + N2) → MN1 + MN2,(M1 + M2)N → M1N + M2N,

. . .(oriented version of the axioms of

vectorial spaces)

Vectorial space of values

B = vars. and abs.

Space of values ::= Span(B)

Value == result of the computation, if it ends

18 / 27

Page 61: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Example: simple encoding of quantum computingTwo base vectors: |0〉 = λx .λy .x

|1〉 = λx .λy .y

We want a linear map H s.t.H|0〉 →

|+〉︷ ︸︸ ︷1√2

(|0〉+ |1〉)

H|1〉 → 1√2

(|0〉 − |1〉)︸ ︷︷ ︸|−〉

H := λx . x [|+〉] [|−〉]

H|+〉 = H(1√2

(|0〉+ |1〉)) → 1√2

(H|0〉+ H|1〉) → 1√2

(|+〉+ |−〉)

=1√2

(1√2

(|0〉+ |1〉) +1√2

(|0〉 − |1〉))→ 1√

2(√2|0〉) → |0〉

19 / 27

Page 62: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Example: simple encoding of quantum computingTwo base vectors: |0〉 = λx .λy .x

|1〉 = λx .λy .y

We want a linear map H s.t.H|0〉 →

|+〉︷ ︸︸ ︷1√2

(|0〉+ |1〉)

H|1〉 → 1√2

(|0〉 − |1〉)︸ ︷︷ ︸|−〉

H := λx . x [|+〉] [|−〉]

H|+〉 = H(1√2

(|0〉+ |1〉)) → 1√2

(H|0〉+ H|1〉) → 1√2

(|+〉+ |−〉)

=1√2

(1√2

(|0〉+ |1〉) +1√2

(|0〉 − |1〉))→ 1√

2(√2|0〉) → |0〉

19 / 27

Page 63: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Example: simple encoding of quantum computingTwo base vectors: |0〉 = λx .λy .x

|1〉 = λx .λy .y

We want a linear map H s.t.H|0〉 →

|+〉︷ ︸︸ ︷1√2

(|0〉+ |1〉)

H|1〉 → 1√2

(|0〉 − |1〉)︸ ︷︷ ︸|−〉

H := λx . x [|+〉] [|−〉]

H|+〉 = H(1√2

(|0〉+ |1〉)) → 1√2

(H|0〉+ H|1〉) → 1√2

(|+〉+ |−〉)

=1√2

(1√2

(|0〉+ |1〉) +1√2

(|0〉 − |1〉))→ 1√

2(√2|0〉) → |0〉

19 / 27

Page 64: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Example: simple encoding of quantum computingTwo base vectors: |0〉 = λx .λy .x

|1〉 = λx .λy .y

We want a linear map H s.t.H|0〉 →

|+〉︷ ︸︸ ︷1√2

(|0〉+ |1〉)

H|1〉 → 1√2

(|0〉 − |1〉)︸ ︷︷ ︸|−〉

H := λx . x [|+〉] [|−〉]

H|+〉 = H(1√2

(|0〉+ |1〉)) → 1√2

(H|0〉+ H|1〉) → 1√2

(|+〉+ |−〉)

=1√2

(1√2

(|0〉+ |1〉) +1√2

(|0〉 − |1〉))→ 1√

2(√2|0〉) → |0〉

19 / 27

Page 65: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Example: simple encoding of quantum computingTwo base vectors: |0〉 = λx .λy .x

|1〉 = λx .λy .y

We want a linear map H s.t.H|0〉 →

|+〉︷ ︸︸ ︷1√2

(|0〉+ |1〉)

H|1〉 → 1√2

(|0〉 − |1〉)︸ ︷︷ ︸|−〉

H := λx . x [|+〉] [|−〉]

H|+〉 = H(1√2

(|0〉+ |1〉)) → 1√2

(H|0〉+ H|1〉) → 1√2

(|+〉+ |−〉)

=1√2

(1√2

(|0〉+ |1〉) +1√2

(|0〉 − |1〉))→ 1√

2(√2|0〉) → |0〉

19 / 27

Page 66: Quantum computing, non-determinism, probabilistic systems... and the logic behind

My thesis: On vectorial typing [Díaz-Caro’11]In one slide

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

Most important property of Vectorial

TheoremIf Γ ` M :

∑i αi .τi then M ↓=

∑i αi .Bi where Γ ` Bi : τi

If M ↓=∑

i αi .Bi then Γ ` M :∑

i αi .τi + 0.σ, where Γ ` Bi : τi

Long-term goal: a Curry-Howard approach to define a quantumlogic from a quantum programming language

20 / 27

Page 67: Quantum computing, non-determinism, probabilistic systems... and the logic behind

My thesis: On vectorial typing [Díaz-Caro’11]In one slide

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

Most important property of Vectorial

TheoremIf Γ ` M :

∑i αi .τi then M ↓=

∑i αi .Bi where Γ ` Bi : τi

If M ↓=∑

i αi .Bi then Γ ` M :∑

i αi .τi + 0.σ, where Γ ` Bi : τi

Long-term goal: a Curry-Howard approach to define a quantumlogic from a quantum programming language

20 / 27

Page 68: Quantum computing, non-determinism, probabilistic systems... and the logic behind

My thesis: On vectorial typing [Díaz-Caro’11]In one slide

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

Most important property of Vectorial

TheoremIf Γ ` M :

∑i αi .τi then M ↓=

∑i αi .Bi where Γ ` Bi : τi

If M ↓=∑

i αi .Bi then Γ ` M :∑

i αi .τi + 0.σ, where Γ ` Bi : τi

Long-term goal: a Curry-Howard approach to define a quantumlogic from a quantum programming language

20 / 27

Page 69: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Simplifying the problem: non-determinism

M,N ::= x | λx .M | MN | M + N

M + N → M M + N → N

I Restricting to Linear Logic: Highly informative quantitative versionof strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]

I Full calculus: 2nd order propositional logic [Díaz-Caro,Petit’12]

I Naturally arise by considering some isomorphisms betweenpropositions [Díaz-Caro,Dowek’12]

e.g. τ ∧ σ ≡ σ ∧ ττ ⇒ (σ1 ∧ σ2) ≡ (τ ⇒ σ1) ∧ (τ ⇒ σ2)

21 / 27

Page 70: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Simplifying the problem: non-determinism

M,N ::= x | λx .M | MN | M + N

M + N → M M + N → N

I Restricting to Linear Logic: Highly informative quantitative versionof strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]

I Full calculus: 2nd order propositional logic [Díaz-Caro,Petit’12]

I Naturally arise by considering some isomorphisms betweenpropositions [Díaz-Caro,Dowek’12]

e.g. τ ∧ σ ≡ σ ∧ ττ ⇒ (σ1 ∧ σ2) ≡ (τ ⇒ σ1) ∧ (τ ⇒ σ2)

21 / 27

Page 71: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Simplifying the problem: non-determinism

M,N ::= x | λx .M | MN | M + N

M + N → M M + N → N

I Restricting to Linear Logic: Highly informative quantitative versionof strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]

I Full calculus: 2nd order propositional logic [Díaz-Caro,Petit’12]

I Naturally arise by considering some isomorphisms betweenpropositions [Díaz-Caro,Dowek’12]

e.g. τ ∧ σ ≡ σ ∧ ττ ⇒ (σ1 ∧ σ2) ≡ (τ ⇒ σ1) ∧ (τ ⇒ σ2)

21 / 27

Page 72: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Simplifying the problem: non-determinism

M,N ::= x | λx .M | MN | M + N

M + N → M M + N → N

I Restricting to Linear Logic: Highly informative quantitative versionof strong normalisation [Díaz-Caro,Manzonetto,Pagani’13]

I Full calculus: 2nd order propositional logic [Díaz-Caro,Petit’12]

I Naturally arise by considering some isomorphisms betweenpropositions [Díaz-Caro,Dowek’12]

e.g. τ ∧ σ ≡ σ ∧ ττ ⇒ (σ1 ∧ σ2) ≡ (τ ⇒ σ1) ∧ (τ ⇒ σ2)

21 / 27

Page 73: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Outline

A brief and fast introduction to quantum computing

A brief and fast introduction to λ-calculus

A brief and fast introduction to typed λ-calculus

How does it relates to intuitionistic logic?(a word on the Curry-Howard correspondence)

What I am doingAlgebraic calculi and vectorial typingNon-determinism, a simpler problem

Work-in-progressFrom non-determinism to probabilities

22 / 27

Page 74: Quantum computing, non-determinism, probabilistic systems... and the logic behind

From non-determinism to probabilitiesWork-in-progress (in collaboration with G. Dowek)

Premise: The algebraic calculus is too complexDo we really need it?

M + (N + P) + P

N + P

''M N P

7→

M + (N + P) + P

13

13

13

N + P12

12

''M N P

∼ 13M +

16N +

12P

23 / 27

Page 75: Quantum computing, non-determinism, probabilistic systems... and the logic behind

From non-determinism to probabilitiesWork-in-progress (in collaboration with G. Dowek)

Premise: The algebraic calculus is too complexDo we really need it?

M + (N + P) + P

N + P

''M N P

7→

M + (N + P) + P

13

13

13

N + P12

12

''M N P

∼ 13M +

16N +

12P

23 / 27

Page 76: Quantum computing, non-determinism, probabilistic systems... and the logic behind

From non-determinism to probabilitiesWork-in-progress (in collaboration with G. Dowek)

Premise: The algebraic calculus is too complexDo we really need it?

M + (N + P) + P

N + P

''M N P

7→

M + (N + P) + P

13

13

13

N + P12

12

''M N P

∼ 13M +

16N +

12P

23 / 27

Page 77: Quantum computing, non-determinism, probabilistic systems... and the logic behind

From non-determinism to probabilitiesGeneralising for any non-deterministic abstract rewrite system

Definition (Degree)ρ(M) = ]N | M → N

Definition (Oracle)f (M) = N if M → N (if ρ(M) = n there are n oracles)

Ω = set of all the oracles

E.g. Rewrite system

M

N1 N2

P1 P2

Ω = f , g , h, i, with

f (M) = N1 g(M) = N1f (N2) = P1 g(N2) = P2

h(M) = N2 i(M) = N2h(N2) = P1 i(N2) = P2

24 / 27

Page 78: Quantum computing, non-determinism, probabilistic systems... and the logic behind

From non-determinism to probabilitiesGeneralising for any non-deterministic abstract rewrite system

Definition (Degree)ρ(M) = ]N | M → N

Definition (Oracle)f (M) = N if M → N (if ρ(M) = n there are n oracles)

Ω = set of all the oracles

E.g. Rewrite system

M

N1 N2

P1 P2

Ω = f , g , h, i, with

f (M) = N1 g(M) = N1f (N2) = P1 g(N2) = P2

h(M) = N2 i(M) = N2h(N2) = P1 i(N2) = P2

24 / 27

Page 79: Quantum computing, non-determinism, probabilistic systems... and the logic behind

From non-determinism to probabilitiesGeneralising for any non-deterministic abstract rewrite system (cont.)

Definition (Box)B ⊆ Ω of the form

B = f | f (M1) = N1, . . . , f (Mn) = Nn

Definition (Probability function)Let B = f | f (M1) = N1, . . . , f (Mn) = Nn

m(B) =1

ρ(M1)× · · · × ρ(Mn)

P(S) = inf∑B∈C

m(B) | C is a countable family of boxes s.t. S ⊆⋃B∈C

B

A = A ⊆ Ω | A is Lebesgue measurable

25 / 27

Page 80: Quantum computing, non-determinism, probabilistic systems... and the logic behind

From non-determinism to probabilitiesGeneralising for any non-deterministic abstract rewrite system (cont.)

Theorem(Ω,A,P) is a probability space

I Ω is the set of all possible oraclesI A is the set of events (Lebesgue measurable subsets of Ω)I P is the probability function

Proof.We show that it satisfies the Kolmogorov axioms.

26 / 27

Page 81: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Summarising

The long-term aim is to define a quantum computational logic

We haveI A λ-calculus extension able to express quantum programsI A complex type system characterising the structure of the vectorsI A strong relation between non-determinism and second order

propositional logicI A restricted non-deterministic model related to linear logicI An easy way to move from non-determinism to probabilities, without

changing the model

We needI To move from probabilities to quantum, without loosing the

connections to logicI No-cloning (partially solved [Arrighi,Dowek’08])I Measurement: we need to check for orthogonality

α.M + β.N → M with prob. |α|2, if M ⊥ N

27 / 27

Page 82: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Summarising

The long-term aim is to define a quantum computational logic

We haveI A λ-calculus extension able to express quantum programsI A complex type system characterising the structure of the vectorsI A strong relation between non-determinism and second order

propositional logicI A restricted non-deterministic model related to linear logicI An easy way to move from non-determinism to probabilities, without

changing the model

We needI To move from probabilities to quantum, without loosing the

connections to logicI No-cloning (partially solved [Arrighi,Dowek’08])I Measurement: we need to check for orthogonality

α.M + β.N → M with prob. |α|2, if M ⊥ N

27 / 27

Page 83: Quantum computing, non-determinism, probabilistic systems... and the logic behind

Summarising

The long-term aim is to define a quantum computational logic

We haveI A λ-calculus extension able to express quantum programsI A complex type system characterising the structure of the vectorsI A strong relation between non-determinism and second order

propositional logicI A restricted non-deterministic model related to linear logicI An easy way to move from non-determinism to probabilities, without

changing the model

We needI To move from probabilities to quantum, without loosing the

connections to logicI No-cloning (partially solved [Arrighi,Dowek’08])I Measurement: we need to check for orthogonality

α.M + β.N → M with prob. |α|2, if M ⊥ N

27 / 27