Top Banner
Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012
24

Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Dec 22, 2015

Download

Documents

Julien Hurry
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Quantum ComputingMAS 725Hartmut KlauckNTU20.2.2012

Page 2: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Quantum Computing

Suppose we have a supply of qubits in some basis state

We want to apply a unitary transformation Corresponding to a function we wish to compute So that measuring the resulting state gives us a

desired output This unitary transformation must be the product of

“few” simple, local, unitary transformations I.e., unitary transformation on 2 or 3 qubits This means to build a quantum circuit

Page 3: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

What is the difference to probabilistic computations Randomized/probabilistic computations can be

described similarly Keeping track of the probability distribution as a

vector of probabilities Important difference: amplitudes can be negative,

allowing for negative interference effects Undesirable computations can “cancel each

other out”

Page 4: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

“Parallel” Computing?

Assume f is a function we can compute efficiently We want to compute some property of f, for

instance “if f(x)=1 for some x?” We first need an f-oracle: a unitary way to compute

f Uf: for f:{0,1}n {0,1}: Uf maps |xi|0i to |xi|f(x)i Apply Uf Hn to n+1 qubits in the state |0n+1i

Result:

Page 5: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

“Parallel” Computing?

What can we do with the resulting state?

Measuring now just yields the uniform distribution on x,f(x) We do (at least) get “really random” values of x To determine interesting properties of f we usually have to

work harder and employ interference effects.

Page 6: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Time for the first algorithm

Deutsch’s Algorithm Setup: Input is in a Black Box A function f:{0,1} {0, 1}

unknown to us (is the input) Access: We can read f(0) or read f(1)

Either f(0)=f(1) or f(0) f(1) Problem: decide which is the case

Page 7: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch’s Problem

How many times do we have to query the Black Box?

Any deterministic algorithm that must not err has to read f(0) and f(1).

Any randomized algorithm with only 1 query has error probability ½ (i.e. is as good as tossing a coin for an answer....)

Page 8: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Quantum queries

In a deterministic query algorithm the result of previous queries determines the next position to query

Randomized queries: In our case there is a probability distribution on 0 and 1, that determines whether we query f(0) or f(1)

Quantum queries can be in superposition instead We have to model a quantum query as a unitary

operator

Page 9: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Quantum queries

Definition of query operation: Uf |ii|ai=|ii|a©f(i)i for all i,a2{0,1}; © is XOR operation: 0©0=0; 0©1=1; 1©1=0

Then Uf is defined for all basis states and ) Uf is defined

Page 10: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

First Idea: “Parallel” computation

Uf: Query to the oracle Two qubits

(H­­­­­­­­­I) |00i I: Identity=1/21/2 (|00i+|10i)

Apply Uf Result: 1/21/2 ( |0,f(0) i+ |1,f(1)i­) What now­­­­­­?

Page 11: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch’s Algorithm

Start with |01i Apply­ H­­­­­­­H Result:

1/2 (|0i +|1i)­(|0i -|1i) Apply Uf Result:

1/2 ( |0,f(0)i-|0,f(0)©1i+|1,f(1)i-|1,f(1)©1i­)

Page 12: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch’s Algorithm

Idea for the analysis:Effect of Uf on |xi­­­1/21/2(|0i- |1i):

results in (-1)f(x)|xi­­­1/21/2(|0i-|1i)

Because:Uf |0i ­ 1/21/2( |0i-|1i­) = |0i ­ 1/21/2 ( |f(0)i -|f(0) © 1i­)= (-1)f(0) |0i ­ 1/21/2( |0i-|1i)

Page 13: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch’s Algorithm

Uf |1i ­ 1/21/2( |0i-|1i­) = |1i ­ 1/21/2 ( |f(1)i -|f(1) © 1i­)= (-1)f(1) |1i ­ 1/21/2 ( |0i-|1i)

We can disregard the second qubit now

Page 14: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch’s Algorithm

Now apply Hadamard transform (on the remaining qubit)

State before the transformation:f(0) = f(1): § 1/21/2 (|0i+|1i)f(0) f(1): § 1/21/2 (|0i-|1i)

Case 1: f(0)=f(1):H § 1/21/2 (|0i+|1i) = § |0i

Case 2: f(0) F(1):H §­1/21/2 (|0i-|1i) = §­|1i

Measurement decides between both cases perfectly

Page 15: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch’s Algorithm

H

Uf

H|0i

|1i

MeasurementH

Page 16: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Quantum Circuits

We write algorithms as circuits on n qubits, unitary transformations are written as boxes

Initial states of qubits are denoted on the left side

Page 17: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch-Josza Algorithm

f:{0,1}n {0,1} Is f balanced (50% 0, 50% 1) or constant?

Promise: f is either balanced or constant, if not the output of the algorithm can be anything

We show an algorithm with 1 query and no error Any deterministic algorithm needs : 2n/2+1 queries!

Why? We give an adversary argument:

Fix f depending on the queries of the algorithm, f(x1)=0,...,f(xl)=0

Before l > 2n/2 the algorithm cannot make a “safe” decision

Algorithm can be forced to make an error (f might still be balanced or constant)

Page 18: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch Josza Algorithm

H

Uf

H­­n|0in

|1i

MeasureH­­n

nn n

Page 19: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Reminder: Hadamard Transformation

x,z2{0,1}n and x¢z= xizi

H­­n |xi=

1/2n/2 (|0i +(-1)x(1) |1i)­­(|0i +(-1)x(n) |1i)

Page 20: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Uf Gate/Black Box

Uf |xi|ai=|xi|a © f(x) i­ for all x2{0,1}n,a2{0,1} f:{0,1}n !­{0,1} © ist XOR Operation: 0©0=0; 0©1=1; 1©1=0

Page 21: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch Josza Algorithm

n Qubits in state |0ni 1 Qubit in state |1i Apply H­n+1 , then Uf

Result:

Apply H­n , then measure Apply: 0n iff f is constant

Page 22: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch Josza

Then Hadamard

Amplitude of |0ni:

f constant ) § 1 f balanced ) 0

Page 23: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

A remark

The Deutsch Josza problem can be solved easily by a randomized algorithm that is allowed to err with some small probability

We will soon see quantum algorithms that “do better”

Page 24: Quantum Computing MAS 725 Hartmut Klauck NTU 20.2.2012.

Deutsch-Josza Algorithm

Deterministic: 2n/2+1 queries Quantum: 1 query, O(n) gates (local

transformations), no error Randomized algorithms are also efficient, but they

need to make errors