• Non ci sono risultati.

Introduction to Probabilistic and Quantum Programming

N/A
N/A
Protected

Academic year: 2021

Condividi "Introduction to Probabilistic and Quantum Programming"

Copied!
122
0
0

Testo completo

(1)

Introduction to Probabilistic and Quantum Programming

Part I

Ugo Dal Lago

BISS 2014, Bertinoro

(2)

Organization

I Webpage

I http://www.cs.unibo.it/~dallago/BISS2014/

I Email

I dallago@cs.unibo.it

I Schedule

I Monday, March 3rd, 2014: 11.30-13.30

I Monday, March 3rd, 2014: 17.30-19.30

I Tuesday, March 4th, 2014: 11.30-13.30

I Tuesday, March 4th, 2014: 17.30-18.30

I Wednesday, March 5th, 2014: 15.00-17.00

I Friday, March 7th, 2014: 9.00-11.00

I Friday, March 7th, 2014: 15.00-17.00

(3)

Organization

I Three Parts

I Probabilistic and Quantum Computation (this file!);

I A Survey on Probabilistic and Quantum Programming;

I Functional Programming in presence of Probabilistic and Quantum Effects.

I Exam

I There will be no written exam.

I If you need to be credited for this course, you can proceed as follows:

1. Choose one among the papers listen in the course’s webpage, and contact the teacher;

2. Read the paper carefully, trying to understand the details of (a part of) it;

3. Write a self-contained essay (10 to 15 pages) in which you

“paraphrase” what you have read.

(4)

Section 1

Classical and Probabilistic Systems

(5)

Notation

I Sets: A, B, C, . . .;

I Cartesian Products: A× B;

I Natural Numbers: 1,2,3,. . .

I Real Numbers: R;

1,3

7, 17463, π, . . .

I Complex Numbers: C;

1 + 5i, 1

√2i, . . .

I Vectors: An;

I Matrices: Bm×n.

(6)

State of a Physical System

I Instantaneous description of the physical entities forming the system;

I Can change over time;

I Is very often an element of Rd;

I In classical physics, the state of a system is uniquely determined.

(7)

Example: Particle in R

2

at a Given Time

(1, 1)

(8)

Example: Particle in R

2

at a Given Time

(1, 1, 0, 1) Position

Momentum

(9)

Example: Particle in R

2

Dynamically

(10)

Example: Particle in R

2

Dynamically

(11)

Composing Physical Systems

I If the states of two physical systems live in Rne Rm

(respectively), how should we represent the physical system obtained by composing the two systems?

I We should keep track of the first and the second state.

I Solution: Rn× Rm=Rn+m.

(12)

How to Discretize Time (and the State Space)

I Traditionally, time is just a number from R.

I But sometimes, it suffices to consider the state of the system only at certain instants.

0,α, 2α, 3α, 4α, . . .

I Time becomes an element N, which is discrete.

I Why?

I Abstraction;

I Simulation.

I Sometimes also states become discrete. . .

I E.g., in Turing Machines.

I Often one can also assume that there are finitely many states.

I The system is in one of then states S = {x1, . . . , xn} ⊆ Rn.

I For the sake of simplicity, let us focus our attention on finite state systems.

(13)

How to Discretize Time (and the State Space)

I Traditionally, time is just a number from R.

I But sometimes, it suffices to consider the state of the system only at certain instants.

0, α,2α, 3α, 4α, . . .

I Time becomes an element N, which is discrete.

I Why?

I Abstraction;

I Simulation.

I Sometimes also states become discrete. . .

I E.g., in Turing Machines.

I Often one can also assume that there are finitely many states.

I The system is in one of then states S = {x1, . . . , xn} ⊆ Rn.

I For the sake of simplicity, let us focus our attention on finite state systems.

(14)

How to Discretize Time (and the State Space)

I Traditionally, time is just a number from R.

I But sometimes, it suffices to consider the state of the system only at certain instants.

0, α, 2α,3α, 4α, . . .

I Time becomes an element N, which is discrete.

I Why?

I Abstraction;

I Simulation.

I Sometimes also states become discrete. . .

I E.g., in Turing Machines.

I Often one can also assume that there are finitely many states.

I The system is in one of then states S = {x1, . . . , xn} ⊆ Rn.

I For the sake of simplicity, let us focus our attention on finite state systems.

(15)

How to Discretize Time (and the State Space)

I Traditionally, time is just a number from R.

I But sometimes, it suffices to consider the state of the system only at certain instants.

0, α, 2α, 3α,4α, . . .

I Time becomes an element N, which is discrete.

I Why?

I Abstraction;

I Simulation.

I Sometimes also states become discrete. . .

I E.g., in Turing Machines.

I Often one can also assume that there are finitely many states.

I The system is in one of then states S = {x1, . . . , xn} ⊆ Rn.

I For the sake of simplicity, let us focus our attention on finite state systems.

(16)

How to Discretize Time (and the State Space)

I Traditionally, time is just a number from R.

I But sometimes, it suffices to consider the state of the system only at certain instants.

0, α, 2α, 3α, 4α, . . .

I Time becomes an element N, which is discrete.

I Why?

I Abstraction;

I Simulation.

I Sometimes also states become discrete. . .

I E.g., in Turing Machines.

I Often one can also assume that there are finitely many states.

I The system is in one of then states S = {x1, . . . , xn} ⊆ Rn.

I For the sake of simplicity, let us focus our attention on finite state systems.

(17)

How to Discretize Time (and the State Space)

I Traditionally, time is just a number from R.

I But sometimes, it suffices to consider the state of the system only at certain instants.

0, α, 2α, 3α, 4α, . . .

I Time becomes an element N, which is discrete.

I Why?

I Abstraction;

I Simulation.

I Sometimes also states become discrete. . .

I E.g., in Turing Machines.

I Often one can also assume that there are finitely many states.

I The system is in one of then states S = {x1, . . . , xn} ⊆ Rn.

I For the sake of simplicity, let us focus our attention on finite state systems.

(18)

How to Discretize Time (and the State Space)

I Traditionally, time is just a number from R.

I But sometimes, it suffices to consider the state of the system only at certain instants.

0, α, 2α, 3α, 4α, . . .

I Time becomes an element N, which is discrete.

I Why?

I Abstraction;

I Simulation.

I Sometimes also states become discrete. . .

I E.g., in Turing Machines.

I Often one can also assume that there are finitely many states.

I The system is in one of then states S = {x1, . . . , xn} ⊆ Rn.

I For the sake of simplicity, let us focus our attention on finite state systems.

(19)

Example: Particle in R

2

, Dynamically

(20)

Example: Particle in R

2

, Dynamically

(21)

Probabilistic Systems, Statically

I In classical physics, the state of any system is univocally determined.

I For reasons of abstraction and complexity, one ofter uses a probabilistic representation of states.

I Exmple: a dice.

I The state, at a given time, is described by a function P :S → R such thatP

x∈SP(x) = 1, or by a vector inR|S|:

 P(x1)

... P(xn)

 =

 p1

... pn



I This is a mixed state.

(22)

Probabilistic Systems, Dynamically

I In any given state xi, the system can evolve into any state xj with probabilitypij.

I As an example:

1 2 1 2

1 2

1 2

1 2 1 2

tt tc ct cc

(23)

Example: Particle in R

2

, Dynamically

3 4

3 4 3

4 3 4 1 4

1 4

1 4 1

4

(24)

Dynamics: Matrix Representation

I Suppose we work in a system withn states:

S = {x1, . . . , xn} ⊆ Rm.

I The dynamic evolution of the system is described, compactly, by the matrix M inRn×n:

M =





p11 p12 · · · p1n

p21 p22 · · · p2n

... ... . .. ... pn1 pn2 · · · pnn





I A transition step corresponds to multiplying M and P (the latter seen as a vector).

I In other words, the system can be seen as a so-called Markov Chain.

(25)

Example: Particle in R

2

, Dynamically

3 4

3 4 3

4

3 4 1 4

1 4

1 4 1

4

x

1

x

2

x

3

x

4

M =





0 0 0 34

3 4 1

4 1 4 0 0 34 0 0

1

4 0 34 14





(26)

Intermezzo: Linearity

I Vectors in Rn support:

I Binary Sums:

x1

... xn

 +

y1

... yn

 =

x1+ y1

... xn+ yn

I Products by Scalars inR:

α

x1

... xn

 =

αx1

... αxn

I Multiplication with a matrix gives rise to a linear map:

M(αx) = α(Mx);

M(x + y) = Mx + My.

(27)

Classical Systems as Specific Probabilistic Systems

I A puro state is a function P :S → R such that P(xi) = 1 for a given xi.

I The system is inxi, without any uncertainty.

I If the matrixM = (pij) is such that for every i∈ {1, . . . , n}

there isj∈ {1, . . . , n} such that pij = 1, then M is classical.

I A classical matrix turns pure states into pure states!

I As an example:

(28)

Classical Systems as Specific Probabilistic Systems

I A puro state is a function P :S → R such that P(xi) = 1 for a given xi.

I The system is inxi, without any uncertainty.

I If the matrixM = (pij) is such that for every i∈ {1, . . . , n}

there isj∈ {1, . . . , n} such that pij = 1, then M is classical.

I A classical matrix turns pure states into pure states!

I As an example:

(29)

Classical Systems as Specific Probabilistic Systems

I A puro state is a function P :S → R such that P(xi) = 1 for a given xi.

I The system is inxi, without any uncertainty.

I If the matrixM = (pij) is such that for every i∈ {1, . . . , n}

there isj∈ {1, . . . , n} such that pij = 1, then M is classical.

I A classical matrix turns pure states into pure states!

I As an example:

(30)

Classical Systems as Specific Probabilistic Systems

I A puro state is a function P :S → R such that P(xi) = 1 for a given xi.

I The system is inxi, without any uncertainty.

I If the matrixM = (pij) is such that for every i∈ {1, . . . , n}

there isj∈ {1, . . . , n} such that pij = 1, then M is classical.

I A classical matrix turns pure states into pure states!

I As an example:

1

1

1

1 x

1

x

2

x

3

x

4

M =





0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0





(31)

Section 2

Probabilistic Computational Models

(32)

Incepting Probability into Algorithms

I In what we have seen so far, probability has been seen a way to facilitate modeling of existing systems, e.g.

Modeling Model ?

System

I Probability, however, can also be seen as a very powerful way to compute.

I Algorithms can “flip a coin”;

I This is somehow a paradigm shift: probabilism is not there for modeling uncertainty, but rather for the purpose of relaxing determinism as an algorithm design principle.

I This “new” computation paradigm is called probabilistic computation.

I Your algorithms (then your programs) can be seen and treated as probabilistic systems.

(33)

Incepting Probability into Algorithms

I In what we have seen so far, probability has been seen a way to facilitate modeling of existing systems, e.g.

Modeling Model Verification

System

I Probability, however, can also be seen as a very powerful way to compute.

I Algorithms can “flip a coin”;

I This is somehow a paradigm shift: probabilism is not there for modeling uncertainty, but rather for the purpose of relaxing determinism as an algorithm design principle.

I This “new” computation paradigm is called probabilistic computation.

I Your algorithms (then your programs) can be seen and treated as probabilistic systems.

(34)

Incepting Probability into Algorithms

I In what we have seen so far, probability has been seen a way to facilitate modeling of existing systems, e.g.

Modeling Model Verification

System

I Probability, however, can also be seen as a very powerful way to compute.

I Algorithms can “flip a coin”;

I This is somehow a paradigm shift: probabilism is not there for modeling uncertainty, but rather for the purpose of relaxing determinism as an algorithm design principle.

I This “new” computation paradigm is called probabilistic computation.

I Your algorithms (then your programs) can be seen and treated as probabilistic systems.

(35)

But Why?

I Achieving Better Performances

I Allowing computation to proceed probabilistically somehow allows to exploit different computation paths at the same time.

I Of course, each computation path comes with its own probability.

I . . . but all this can (sometime) be turned into a way to alleviate exponential blowups.

I Allowing a Form of “Confusion” in Computation

I Deterministic computation has its own shortcomings.

I In particular, in some interactive scenarios probabilistic computation is a way to make computation unpredictable.

(36)

But Why?

I Achieving Better Performances

I Allowing computation to proceed probabilistically somehow allows to exploit different computation paths at the same time.

I Of course, each computation path comes with its own probability.

I . . . but all this can (sometime) be turned into a way to alleviate exponential blowups.

I Allowing a Form of “Confusion” in Computation

I Deterministic computation has its own shortcomings.

I In particular, in some interactive scenarios probabilistic computation is a way to make computation unpredictable.

(37)

Example

(38)

Another Example

I Suppose given a public-key encryption scheme Π = (GEN , ENC , DEC ) and an adversary A.

I Consider the following experiment:

1. GEN(1n) is run to obtain keys (pk , sk ).

2. AdversaryA is given pk, and outputs a pair of messages m0, m1of the same length.

3. A bitb is chosen and a ciphertext c is computed as ENC(pk , mb) and given back toA.

4. A outputs a bit b0.

5. The output of the experiment is defined to be1 if b0= b and0 otherwise.

I If the output is1, the adversay wins.

I Is it possible to design Π in such a way that any adversary can win with probability not (too much) bigger than 12.

(39)

Another Example

I Suppose given a public-key encryption scheme Π = (GEN , ENC , DEC ) and an adversary A.

I Consider the following experiment:

1. GEN(1n) is run to obtain keys (pk , sk ).

2. AdversaryA is given pk, and outputs a pair of messages m0, m1of the same length.

3. A bitb is chosen and a ciphertext c is computed as ENC(pk , mb) and given back toA.

4. A outputs a bit b0.

5. The output of the experiment is defined to be1 if b0= b and0 otherwise.

I If the output is1, the adversay wins.

I Is it possible to design Π in such a way that any adversary can win with probability not (too much) bigger than 12.

(40)

Another Example

I Suppose given a public-key encryption scheme Π = (GEN , ENC , DEC ) and an adversary A.

I Consider the following experiment:

1. GEN(1n) is run to obtain keys (pk , sk ).

2. AdversaryA is given pk, and outputs a pair of messages m0, m1of the same length.

3. A bitb is chosen and a ciphertext c is computed as ENC(pk , mb) and given back toA.

4. A outputs a bit b0.

5. The output of the experiment is defined to be1 if b0= b and0 otherwise.

I If the output is1, the adversay wins.

I Is it possible to design Π in such a way that any adversary can win with probability not (too much) bigger than 12.

(41)

Another Example

I Suppose given a public-key encryption scheme Π = (GEN , ENC , DEC ) and an adversary A.

I Consider the following experiment:

1. GEN(1n) is run to obtain keys (pk , sk ).

2. AdversaryA is given pk, and outputs a pair of messages m0, m1of the same length.

3. A bitb is chosen and a ciphertext c is computed as ENC(pk , mb) and given back toA.

4. A outputs a bit b0.

5. The output of the experiment is defined to be1 if b0= b and0 otherwise.

I If the output is1, the adversay wins.

I Is it possible to design Π in such a way that any adversary can win with probability not (too much) bigger than 12.

(42)

Section 3

Quantum Systems

(43)

Quanta and Computation

I Starting from the beginning of the XX century, physical sciences faced a series of revolutions.

I The principles of classical physics were proved not to hold when the involved magnitudes become as little as those in atoms, or as big as those found astrophysics.

I One of the answers to the subsequent crisis was the introduction of quantum mechanics.

I It is a complex, non-intuitive, theory;

I Mathematically, it is highly not trivial;

I In 1982, Richard Feynman suggests, for the first time, that quantum mechanics can form the basis of a new model of computation, more efficient than the one introduced by Turing and later generalized to a proper model of

computation.

(44)

Quanta and Computation

I Starting from the beginning of the XX century, physical sciences faced a series of revolutions.

I The principles of classical physics were proved not to hold when the involved magnitudes become as little as those in atoms, or as big as those found astrophysics.

I One of the answers to the subsequent crisis was the introduction of quantum mechanics.

I It is a complex, non-intuitive, theory;

I Mathematically, it is highly not trivial;

I In 1982, Richard Feynman suggests, for the first time, that quantum mechanics can form the basis of a new model of computation, more efficient than the one introduced by Turing and later generalized to a proper model of

computation.

(45)

Quanta and Computation

I Starting from the beginning of the XX century, physical sciences faced a series of revolutions.

I The principles of classical physics were proved not to hold when the involved magnitudes become as little as those in atoms, or as big as those found astrophysics.

I One of the answers to the subsequent crisis was the introduction of quantum mechanics.

I It is a complex, non-intuitive, theory;

I Mathematically, it is highly not trivial;

I In 1982, Richard Feynman suggests, for the first time, that quantum mechanics can form the basis of a new model of computation, more efficient than the one introduced by Turing and later generalized to a proper model of

computation.

(46)

Quanta and Computation

I Starting from the beginning of the XX century, physical sciences faced a series of revolutions.

I The principles of classical physics were proved not to hold when the involved magnitudes become as little as those in atoms, or as big as those found astrophysics.

I One of the answers to the subsequent crisis was the introduction of quantum mechanics.

I It is a complex, non-intuitive, theory;

I Mathematically, it is highly not trivial;

I In 1982, Richard Feynman suggests, for the first time, that quantum mechanics can form the basis of a new model of computation, more efficient than the one introduced by Turing and later generalized to a proper model of

computation.

(47)

State of a Quantum System H

n

I It is a vector in Cn:

x =

 c1

... cn



I The following condition must hold:

Xn i=1

||ci||2 = 1

I We can write

x = c1x1+ . . . + cnxn,

where thexi are always0 except in the ith coordinate, which is1 (x1, . . . , xn is the computational base of the system).

I What does xi represent? It is an observable of the system.

I Every orthonormal base forCn corresponds to one such observable property.

(48)

Evolution of a Quantum System H

n

I The system evolves linearly, thus its dynamics can be described by a matrix:

 d1

... dn

 =



a11 · · · a1n

... ... an1 · · · ann



 c1

... cn



I It must be that Pn

i=1||di||2= 1.

I A necessary and sufficient condition is that Q = (aij) must be unitary: Q = Q−1.

I Q is the conjugate transpose ofQ. As an example,

a11 · · · a1n

... ... an1 · · · ann

=

a11 · · · an1 ... ... a1n · · · ann

I The product of two unitary matrices is again unitary.

(49)

Measurement in a Quantum System H

n

I Given a Quantum Systemx = (ci), the quantity||ci||2 should not be interpreted as the probability of being in state xi.

I The only way to observe the state of a quantum system is by way of measurements:

I When measuring the state of a system, it goes fromx = (ci) to each of the statesxj with probability equals to||cj||2.

I At that point the system is in a classical state, i.e., it can be observed without being altered.

I Everything depends on the chosen base, which corresponds to the desired observable.

I Again: measuring a quantum system can alter its state!

(50)

Composing two Quantum Systems H

n

and H

m

I Given two quantum systems with computational bases x1, . . . , xn;

y1, . . . , ym;

their composition has computational basis (x1, y1), . . . , (xn, ym).

I Thus, we get the system

Hnm = Hn⊗ Hm.

I Let us indicate the pair(xi, xj) by xi⊗ xj;

(51)

Composing two Quantum Systems H

n

and H

m

I We can extend this operation to all states of Hn and Hm: Xn

i=1

cixi

!

 Xm j=1

djyj

 = Xn

i=1

Xm j=1

cidjxi⊗ yj.

I A quantum statex is sometimes indicated as|xi.

I Another notational abuse:

|xi ⊗ |yi = |xi|yi = |xyi.

I If a state x of Hn⊗ Hm is such thatx = y⊗ z, then x is said to be decomposable, and otherwise entangled.

I Given two unitary transforms Qn, Qm on Hn and Hm (respectively), we can buildQn⊗ Qm. . .

(52)

Example: H

2

I The states of the system are the unitary vectors inC2.

I The states of the orthonormal base|x1i, |x2i are sometime denoted with|0i e |1i.

I Unitary transforms: examples:

I =

1 0 0 1



X =

0 1 1 0



Y =

0 −i i 0



Z =

 1 0

−1 0



H = 1

√2

1 1 1 −1



I States of H2 are said to be qubits.

(53)

Example: H

2

⊗ H

2

I States of the systems are the unitary vectors in C4 ∼=C2⊗ C2.

I Let us consider two example states inH2⊗ H2.

I The state|01i is decomposable: |01i = |0i ⊗ |1i.

I The state

1

2|00i + 1

2|11i is entangled

I A unitary transform on H2⊗ Hn which cannot be decomposed as two unitary transforms on H2 is:

CNOT =



1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0



(54)

A Game

A B C

(55)

A Game

A

B C

(56)

A Game

A

B C

(57)

A Game

A

B C

(58)

A Game

A

B C

(59)

A Game

A

B C

(60)

A Game

A B C 0 1 0 0

1 0

(61)

A Game

A

B C

0 1

0 0

1 0

(62)

A Game

A

B C

0 1

0 0

1 0

(63)

A Game

A

B C

0 1

0 0

1 0

(64)

A Game

A

B C

0 1

0 0

1 0

(65)

A Game

A

B C

0 1

0 0

1 0

(66)

When do A, B and C Win?

A B C

Even

Odd

(67)

When do A, B and C Win?

A B C

1 0 0 1

0

1

(68)

When do A, B and C Win?

A B C

1 0 0 1

0

1

A



(69)

When do A, B and C Win?

A B C

1 0 0 1

0 1 A



A



+ B



+ C



= Odd

A



+ B



+ C



= Even

A



+ B



+ C



= Even

A



+ B



+ C



= Even

(70)

A, B e C Cannot Win!

2A



+2A



+2B



+2B



+2C



+2C



= Odd

(71)

A, B e C Cannot Win!

2A



+2A



+2B



+2B



+2C



+2C



= Odd

(72)

Quantum Strategies

A

|1yzi →q

1

2|1yzi +q

1 2|0yzi

|0yzi →q

1

2|1yzi −q

12|0yzi

|1yzi →q

1

2|1yzi +q

1 2|0yzi

|0yzi →q

1

2|1yzi −q

1 2|0yzi

If arrives. . . r1

2|111i + r1

2|000i → 1

2|111i +1

2|011i +1

2|100i −1 2|000i

(73)

Quantum Strategies

A

|1yzi →q

1

2|1yzi +q

1 2|0yzi

|0yzi →q

1

2|1yzi −q

12|0yzi

|1yzi →q

1

2|1yzi +q

1 2|0yzi

|0yzi →q

1

2|1yzi −q

1 2|0yzi

If arrives. . . r1

2|111i + r1

2|000i → 1

2|111i +1

2|011i +1

2|100i −1 2|000i

(74)

Quantum Strategies

A

|1yzi →q

1

2|1yzi +q

1 2|0yzi

|0yzi →q

1

2|1yzi −q

12|0yzi

|1yzi →q

1

2|1yzi +q

1 2|0yzi

|0yzi →q

1

2|1yzi −q

1 2|0yzi

If arrives. . . r1

2|111i + r1

2|000i → 1

2|111i +1

2|011i +1

2|100i −1 2|000i

(75)

Suppose that A, B, C Receive  . . .

r1

2|111i + r1

2|000i → 1

4|111i +1

4|110i +1

4|111i −1 4|110i +1

4|101i + 1

4|100i −1

4|101i +1 4|100i +1

4|011i + 1

4|010i −1

4|011i +1 4|010i +1

4|001i + 1

4|000i +1

4|001i −1 4|000i

= 1

2|111i +1

2|100i +1

2|010i −1 2|001i

(76)

Suppose that A, B, C Receive  . . .

r1

2|111i + r1

2|000i → 1

4|111i +1

4|110i +1

4|111i −1 4|110i +1

4|101i + 1

4|100i −1

4|101i +1 4|100i +1

4|011i + 1

4|010i −1

4|011i +1 4|010i +1

4|001i + 1

4|000i +1

4|001i −1 4|000i

= 1

2|111i +1

2|100i +1

2|010i −1 2|001i

(77)

Section 4

Probabilistic Computational Models

(78)

Probabilistic Turing Machines

I Generalizing ordinary Turing Machines to the probabilistic setting is a relatively easy task.

I A Turing Machine is a quadruple(Q, Σ, δ, F ).

I In presence of determinism,

δ : Q× Σ → Q × Σ × {←, ↓, →}.

I When evolution is nondeterministic,

δ : Q× Σ → P(Q × Σ × {←, ↓, →}).

I When evolution is probabilistic,

δ : Q× Σ → D(Q × Σ × {←, ↓, →}).

whereD(A) is the set of all functions f from A to R such thatP

a∈Af (a) = 1.

I In PTMs, any computationρ : C1 → C2 → . . . → Cn has a probability.

(79)

Probabilistic Turing Machines

I Generalizing ordinary Turing Machines to the probabilistic setting is a relatively easy task.

I A Turing Machine is a quadruple(Q, Σ, δ, F ).

I In presence of determinism,

δ : Q× Σ → Q × Σ × {←, ↓, →}.

I When evolution is nondeterministic,

δ : Q× Σ → P(Q × Σ × {←, ↓, →}).

I When evolution is probabilistic,

δ : Q× Σ → D(Q × Σ × {←, ↓, →}).

whereD(A) is the set of all functions f from A to R such thatP

a∈Af (a) = 1.

I In PTMs, any computationρ : C1 → C2 → . . . → Cn has a probability.

(80)

Probabilistic Turing Machines

I Generalizing ordinary Turing Machines to the probabilistic setting is a relatively easy task.

I A Turing Machine is a quadruple(Q, Σ, δ, F ).

I In presence of determinism,

δ : Q× Σ → Q × Σ × {←, ↓, →}.

I When evolution is nondeterministic,

δ : Q× Σ → P(Q × Σ × {←, ↓, →}).

I When evolution is probabilistic,

δ : Q× Σ → D(Q × Σ × {←, ↓, →}).

whereD(A) is the set of all functions f from A to R such thatP

a∈Af (a) = 1.

I In PTMs, any computationρ : C1 → C2 → . . . → Cn has a probability.

(81)

Probabilistic Turing Machines

I Generalizing ordinary Turing Machines to the probabilistic setting is a relatively easy task.

I A Turing Machine is a quadruple(Q, Σ, δ, F ).

I In presence of determinism,

δ : Q× Σ → Q × Σ × {←, ↓, →}.

I When evolution is nondeterministic,

δ : Q× Σ → P(Q × Σ × {←, ↓, →}).

I When evolution is probabilistic,

δ : Q× Σ → D(Q × Σ × {←, ↓, →}).

whereD(A) is the set of all functions f from A to R such thatP

a∈Af (a) = 1.

I In PTMs, any computationρ : C1 → C2 → . . . → Cn has a probability.

(82)

PTMs, Languages and Functions

I In PTM, termination and acceptance of a string become probabilistic events.

I A PTM can terminate with probability1 even if there is the possibility of nontermination.

I A given string s∈ Σ is accepted with a probability between 0 and 1, included.

I How can we define language recognition?

I One can consider different, alternative, constraints on the error probability:

I It must be 0.

I It must be smaller than 12;

I It must be smaller than a given fixed constant ε, itself smaller than 12.

I One can stipulate that the given result is the one with highest probability.

(83)

Section 5

Quantum Computational Models

(84)

No-Cloning Theorem

I Let us consider a quantum system Hn with computational basex1, . . . , xn.

I A unitary transformation Q on Hn⊗ Hnis a cloning map if Q|xi|x1i = |xi|xi.

Theorem (No-Cloning)

For n≥ 2, there is no cloning map.

I This does not mean that states of the computational base cannot be cloned.

I There is an analogous theorem about erasing maps.

(85)

No-Cloning Theorem

I Let us consider a quantum system Hn with computational basex1, . . . , xn.

I A unitary transformation Q on Hn⊗ Hnis a cloning map if Q|xi|x1i = |xi|xi.

Theorem (No-Cloning)

For n≥ 2, there is no cloning map.

I This does not mean that states of the computational base cannot be cloned.

I There is an analogous theorem about erasing maps.

(86)

No-Cloning Theorem

I Let us consider a quantum system Hn with computational basex1, . . . , xn.

I A unitary transformation Q on Hn⊗ Hnis a cloning map if Q|xi|x1i = |xi|xi.

Theorem (No-Cloning)

For n≥ 2, there is no cloning map.

I This does not mean that states of the computational base cannot be cloned.

I There is an analogous theorem about erasing maps.

(87)

No-Cloning Theorem

I Let us consider a quantum system Hn with computational basex1, . . . , xn.

I A unitary transformation Q on Hn⊗ Hnis a cloning map if Q|xi|x1i = |xi|xi.

Theorem (No-Cloning)

For n≥ 2, there is no cloning map.

I This does not mean that states of the computational base cannot be cloned.

I There is an analogous theorem about erasing maps.

(88)

About Measurements, Again

I Suppose we want to work with the system Hn⊗ Hm. A state of the system can be expressed as:

Xn i=1

Xm j=1

cij|xii|xji.

I If we observe the first component of the system (the

“rightmost” component of the tensor product), we get that:

I We will end up in a state|xki ⊗ |yi where xk is an element of the computational base, whiley is not necessarily one such.

I The probability of reaching|xki ⊗ |yi is equal to P(k) =

Xm j=1

||ckj||2.

I The state|xki ⊗ |yi can be expressed as follows:

p1 P(k)

Xm j=1

ckj|xki|yji

(89)

Boolean Circuits

I As we all know, they are networks of gates which compute very simple functions onF = {0, 1}.

I Example:

¬ x

y

I Every function f :Fn→ Fm is computable by a boolean circuit Cf.

I Could we have finite, universal, set of gates?

I Yes, e.g.,{∧, ∨, ¬}.

(90)

But... How About Turing Machines?

I Boolean circuits can be seen as a minimal computational model, whose expressive power turns out to be very poor.

I There are fundamental differences with Turing Machines:

I In boolean circuits, everything is (even potentially) finite.

I Functions computed by circuits and by TM are functions from different domains: Fn → Fmvs. F→ F.

I Boolean circuits are somehow complete, while TM are not, as we all know.

I Can we somehow reconcile the two worlds?

I A circuit family is a collection{Cn}n∈N.

I A circuit family computes a function fromF toF.

I A circuit family is said to be uniform if there is a TM which, on inputn, outputs (an enconding) of Cn.

Theorem

The class of functions computed by TMs equals the class of functions computed by uniform circuit families.

(91)

But... How About Turing Machines?

I Boolean circuits can be seen as a minimal computational model, whose expressive power turns out to be very poor.

I There are fundamental differences with Turing Machines:

I In boolean circuits, everything is (even potentially) finite.

I Functions computed by circuits and by TM are functions from different domains: Fn → Fmvs. F→ F.

I Boolean circuits are somehow complete, while TM are not, as we all know.

I Can we somehow reconcile the two worlds?

I A circuit family is a collection{Cn}n∈N.

I A circuit family computes a function fromF toF.

I A circuit family is said to be uniform if there is a TM which, on inputn, outputs (an enconding) of Cn.

Theorem

The class of functions computed by TMs equals the class of functions computed by uniform circuit families.

(92)

But... How About Turing Machines?

I Boolean circuits can be seen as a minimal computational model, whose expressive power turns out to be very poor.

I There are fundamental differences with Turing Machines:

I In boolean circuits, everything is (even potentially) finite.

I Functions computed by circuits and by TM are functions from different domains: Fn → Fmvs. F→ F.

I Boolean circuits are somehow complete, while TM are not, as we all know.

I Can we somehow reconcile the two worlds?

I A circuit family is a collection{Cn}n∈N.

I A circuit family computes a function fromF toF.

I A circuit family is said to be uniform if there is a TM which, on inputn, outputs (an enconding) of Cn.

Theorem

The class of functions computed by TMs equals the class of functions computed by uniform circuit families.

(93)

But... How About Turing Machines?

I Boolean circuits can be seen as a minimal computational model, whose expressive power turns out to be very poor.

I There are fundamental differences with Turing Machines:

I In boolean circuits, everything is (even potentially) finite.

I Functions computed by circuits and by TM are functions from different domains: Fn → Fmvs. F→ F.

I Boolean circuits are somehow complete, while TM are not, as we all know.

I Can we somehow reconcile the two worlds?

I A circuit family is a collection{Cn}n∈N.

I A circuit family computes a function fromF toF.

I A circuit family is said to be uniform if there is a TM which, on inputn, outputs (an enconding) of Cn.

Theorem

The class of functions computed by TMs equals the class of functions computed by uniform circuit families.

(94)

Quantum Circuits

I They themselves consist in gate networks, which can be of three different kinds:

I Quantum gates, which compute unitary transforms on H2⊗ . . . ⊗ H2.

I Measurement gates, which observe the value of one qubit.

I The wires connecting gates are themselves of two types:

I Quanum channels, which connect quantum gates to other quantum gates or to measurement gates.

I Classic channels, which are the output wires of measurement gates and which control the application of quantum gates.

I Qubits cannot be duplicated.

I Example:

H • •

X

(95)

Quantum Circuits

I They themselves consist in gate networks, which can be of three different kinds:

I Quantum gates, which compute unitary transforms on H2⊗ . . . ⊗ H2.

I Measurement gates, which observe the value of one qubit.

I The wires connecting gates are themselves of two types:

I Quanum channels, which connect quantum gates to other quantum gates or to measurement gates.

I Classic channels, which are the output wires of measurement gates and which control the application of quantum gates.

I Qubits cannot be duplicated.

I Example:

H • •

X

(96)

Quantum Circuits

I They themselves consist in gate networks, which can be of three different kinds:

I Quantum gates, which compute unitary transforms on H2⊗ . . . ⊗ H2.

I Measurement gates, which observe the value of one qubit.

I The wires connecting gates are themselves of two types:

I Quanum channels, which connect quantum gates to other quantum gates or to measurement gates.

I Classic channels, which are the output wires of measurement gates and which control the application of quantum gates.

I Qubits cannot be duplicated.

I Example:

H • •

X

(97)

Quantum Circuits

I They themselves consist in gate networks, which can be of three different kinds:

I Quantum gates, which compute unitary transforms on H2⊗ . . . ⊗ H2.

I Measurement gates, which observe the value of one qubit.

I The wires connecting gates are themselves of two types:

I Quanum channels, which connect quantum gates to other quantum gates or to measurement gates.

I Classic channels, which are the output wires of measurement gates and which control the application of quantum gates.

I Qubits cannot be duplicated.

I Example:

H • •

X

(98)

Quantum Teleportation

• H •

(99)

Boolean Circuits as Quantum Circuits

I When can a boolean gate be considered a quantum gate?

I How to simulate copying?

I First of all:

I We need to allow boolean gates to have more than one outputs.

I Restrict to invertible gates.

I Every boolean circuit can then be seen as a quantum circuit.

I Are we loosing anything?

Theorem

Every boolean function can be computed by a quantum circuit.

(100)

Boolean Circuits as Quantum Circuits

I When can a boolean gate be considered a quantum gate?

I How to simulate copying?

I First of all:

I We need to allow boolean gates to have more than one outputs.

I Restrict to invertible gates.

I Every boolean circuit can then be seen as a quantum circuit.

I Are we loosing anything?

Theorem

Every boolean function can be computed by a quantum circuit.

(101)

Deutsch-Jozsa Algorithm

/n H⊗n

Uf

H⊗n

H

Riferimenti

Documenti correlati

Global Quartile Method , classifying stocks based on P/BV ratio, the value strategy has been the best performer, both from an absolute and risk-adjusted perspective, while the

The fidelity is central in the study of the stability of dynamical systems under Hamiltonian perturbations (classical errors), but can also be a useful tool in order to characterize

vinifera cultivars such as Cabernet Sauvignon and Pinot Noir had a lower mean amount of anthocyanins (1045 and 437 mg/kg FW respectively).. The results and the box plots of the

Accordingly, laminin-5 expression are responsible for a shift in integrin dominance, hence modulating keratinocyte migration during skin reepithelization [30] and the interplay

If one wishes to bridge the Planck scale quantum geometry they describe to a smooth and classical geometry, one needs coherent states which are superposition of spin networks peaked

Well-performing classes of states have been found for interesting multiparameter quantum metrology applications [54, 81], but the problem has yet to be explored in detail,

Oltre al culto della continuità mirante in linea generale a creare un trait d'union tra il passato ed il presente ed in particolare, nel contesto palestinese

Using as a starting point the quantum programming language Quipper and the quantum model checking system QPMC, we developed a tool, called Entangλe, for the translation of