1 of 30

This week:

  • Deutsch’s algorithm, Simon’s algorithm

  • Programming quantum algorithms!

2 of 30

Deutsch’s algorithm

3 of 30

Deutsch’s algorithm

  • One of the very first algorithms to provide evidence of the power of quantum algorithms over classical.

  • We will understand the algorithm.

  • You will be asked to code this as part of the next homework.

4 of 30

The problem

Determine if a given function

 

is constant or balanced.

constant:

 

balanced:

 

 

 

 

 

0

1

0

1

0

1

0

1

or

0

1

0

1

0

1

0

1

or

5 of 30

The problem

Determine if a given function

 

is constant or balanced.

How is the function given to you?

“Black-box” access

 

 

 

 

Q: How many queries to the black-box does it take to solve the problem (with certainty) classically?

A: 2 queries are necessary and sufficient.

Deutsch’s algorithm does it�in one query!

6 of 30

Querying a function quantumly

In the quantum setting: what does it mean to query a function as a black-box?

 

 

 

This is not a unitary transformation in general!

Why?

 

 

 

 

 

 

7 of 30

Querying a function quantumly

 

 

 

This is looking kind of different from what a classical algorithm had access to…

Is this more powerful..?

Remark: It’s easy to see that a classical algorithm requires 2 queries even if it has access to:

 

 

 

 

8 of 30

What does quantum computation buy us?

?

 

 

 

 

1. Let’s try putting the first qubit in superposition:

 

 

 

 

 

 

 

 

 

 

 

 

 

9 of 30

What does quantum computation buy us?

 

1. Let’s try putting the first qubit in superposition:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How do we “extract” it though?

 

10 of 30

What does quantum computation buy us?

 

2. Let’s try putting the second qubit in superposition:

 

 

 

 

 

 

?

 

 

 

 

 

11 of 30

What does quantum computation buy us?

 

2. Let’s try putting the second qubit in superposition:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Interesting that the global phase �depends on f(x)!�Still just a global phase though..

 

12 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

..any other ideas??

13 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

Put both qubits in superposition!

14 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

3. Both qubits in superposition:

 

 

?

15 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

3. Both qubits in superposition:

 

 

 

 

 

 

16 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

3. Both qubits in superposition:

 

 

 

 

 

 

 

 

 

 

 

 

 

Let’s focus on the first qubit

and ignore the second

17 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

3. Both qubits in superposition:

 

 

 

 

 

 

 

 

 

 

 

Let’s focus on the first qubit

and ignore the second

18 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

3. Both qubits in superposition:

 

 

 

 

 

 

 

 

 

 

 

?

 

19 of 30

What does quantum computation buy us?

 

 

 

1. First qubit in superposition:

In summary:

2. Second qubit in superposition:

 

 

 

 

 

 

 

 

 

3. Both qubits in superposition:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

up to a global phase

these two states can be

distinguished perfectly!!

20 of 30

Deutsch’s algorithm

 

 

(iii) Measure the first qubit in the Hadamard basis.

 

 

 

 

 

 

 

 

21 of 30

Simon’s algorithm

22 of 30

Simon’s algorithm

  • First example of a quantum algorithm solving a problem exponentially faster than the best classical randomized algorithm.

  • Like Deutsch, the speedup is in terms of queries to an oracle.

  • You will be asked to code this as part of the next homework.

23 of 30

The problem

You are given black-box access to a function

with the promise that there exists an

 

such that

 

if and only if

 

or

 

Find

 

 

 

 

.

.

.

.

.

.

 

.

.

.

.

.

.

 

 

 

 

24 of 30

The problem

You are given black-box access to a function

 

with the promise that there exists an

 

such that

 

if and only if

 

or

 

Find

 

Q: How many queries to the black-box does it take to solve the problem (with certainty) classically?

 

 

 

25 of 30

The problem

You are given oracle access to a function

 

with the promise that there exists an

 

such that

 

if and only if

 

or

 

Find

 

Q: How many queries does a classical randomized algorithm need to succeed “with high probability”?

 

Can be achieved by a “birthday paradox” style algorithm

26 of 30

The problem

You are given oracle access to a function

 

with the promise that there exists an

 

such that

 

if and only if

 

or

 

Find

 

Q: What about quantum queries?

 

27 of 30

Quantum queries

 

 

 

 

 

We model the black-box as a

acting as

28 of 30

Simon’s algorithm

Consists of:

(i) A quantum sub-routine to sample from a useful distribution many times.�(ii) Classical post-processing on the samples to recover the secrets.

 

 

Q: How many times do you need to sample to be able to recover s?

29 of 30

Simon’s algorithm

Consists of:

(i) A quantum sub-routine to sample from a useful distribution many times.�(ii) Classical post-processing of the samples to recover the secrets.

 

 

 

 

 

 

 

30 of 30

Simon’s algorithm

 

 

  1. Measure the second qubit (in the standard basis).

 

 

(v) Measure first qubit (in the standard basis)

Analysis: at the whiteboard

Quantum subroutine: