72
Small-Depth Small-Depth Quantum Circuits Quantum Circuits Frederic Green Frederic Green Department of Math/CS Department of Math/CS Clark University Clark University Worcester, MA Worcester, MA

Small-Depth Quantum Circuits Frederic Green Department of Math/CS Clark University Worcester, MA

Embed Size (px)

Citation preview

Small-Depth Small-Depth Quantum Quantum CircuitsCircuitsFrederic GreenFrederic Green

Department of Math/CSDepartment of Math/CS

Clark UniversityClark University

Worcester, MAWorcester, MA

Some Background

• Computers (as we know them) obey the laws of classical physics.

• But Nature is quantum mechanical!

• Feynman (ca. 1981) noted that “quantum mechanical computers” can probably simulate physical systems more efficiently than classical ones.• Deutsch (1985) introduced quantum Turing machines, and found evidence that they can solve hard problems more efficiently than classical Turing machines.• Shor (1994) found an efficient quantum algorithm to factor a number. No known classical algorithm can do this.

In This Talk:

• What is quantum computation?

(Answer: Quantum circuits.)

• How do we measure its efficiency?

(Answer: Computational complexity theory.)

Start with an intro to quantum computing…

Two Important Questions:

• Can we build a quantum computer?

• If we could build one, would it be useful?

• Ignore first question above; concentrate on second.

What is quantum computation?

Approach from the point of view of classicalprobabilistic computation.

Example: Miller-Rabin primality test. Very roughlystated:

To determine if n is prime:Randomly generate a bunch of numbers m < n.

Check that mk = 1 (mod n), or -1, for certain (carefully chosen!) k.If so, return TRUE, else FALSE.

As we generate more and more bits of m, the number ofpossible “configurations of memory” increases exponentially.But the right answer is obtained with very high probability.

A picture of this process:

time

“possible configuration of memory”

(only one when we start out)

t=0

t=1

t=2

t=3

|n|

2|n|

|n|

2|n|

Desired configurations

m

Interpretation:

• At any step of the computation, memorycan be in any one of a large number ofconfigurations.

• Each configuration occurs with a certainprobability; represent this set of probabilitiesas a vector (2n components for n bits).

• The vector of probabilities evolves over timeaccording to a certain set of rules determinedby the algorithm.

“Vector of probabilities”

t=0

t=1

t=2

t=3

t=4

Evolution of probabilities (classical formulation):

Let v(t) = vector of probabilities at time t.vi(t) = probability that we are in configuration i at time t.

I.e., there is a matrix M such that,

v(t+1) = Mv(t)

Mi j is simply the probability that configuration j yields configuration i.

It’s not hard to see that v(t) evolves linearly.

So (of course!) Mi j is a real number in [0,1].

M must leave ivi(t) invariant (probabilities sum to 1).

Evolution of probabilities (quantum formulation):

Let v(t) = vector of probability amplitudes at time t.vi(t) is a complex number whose norm squared |vi(t)|2 = probability that we are in configuration i at time t.

I.e., there is a matrix U such that,

v(t+1) = Uv(t)Ui j is a complex number whose norm squared is theprobability that configuration j yields configuration i.

As in the classical case, v(t) evolves linearly.

So (of course!) Ui j is not necessarily a real number in [0,1].

U must leave i |vi(t)|2 invariant (probabilities sum to 1).

Hence U is unitary: UU† = 1.

Measurement

After the computation has evolved, wemay measure the configuration.

The matrix U, applied to the initial configuration,determines the probability that we end up inany given configuration.

Once the bits of the configuration have beenmeasured, they will retain their measured valueuntil acted on again (“collapse of the wavefunction”).

WHY?

Don’t ask!

Consequences

• Configurations can actually cancel!

• Because of unitarity, quantum computationis reversible!

t=0

t=1

t=2

Cancel

t=3

Cancel

t=4

t=4

Left with exactlywhat we want!(we hope!)

Building Blocks of Quantum Information

Bits:

Qubit:

Computational basis state:

(Column vector with one non-zero entry correspondingto a single (classical) configuration of memory.)

More generally, a quantum state is a linear combination, or “superposition” of computational basis states.

Building Blocks of Quantum Computation

• Construct our unitary transformations fromone of a set of quantum gates.• The following are universal: sufficient for realizingany unitary transformation!

Controlled-Not (“CNOT”)

Building Blocks of Quantum Computation

• Construct our unitary transformations fromone of a set of quantum gates.• The following are universal: sufficient for realizingany unitary transformation!

Controlled-Not (“CNOT”) Toffoli

Building Blocks of Quantum Computation

• Construct our unitary transformations fromone of a set of quantum gates.• The following are universal: sufficient for realizingany unitary transformation!

Controlled-Not (“CNOT”)

Hadamard

H =

Toffoli

Building Blocks of Quantum Computation

• Construct our unitary transformations fromone of a set of quantum gates.• The following are universal: sufficient for realizingany unitary transformation!

Controlled-Not (“CNOT”)

Hadamard

H =

Toffoli

Phase

S =

Building Blocks of Quantum Computation

• Construct our unitary transformations fromone of a set of quantum gates.• The following are universal: sufficient for realizingany unitary transformation!

What Quantum Circuits Can Do: Entanglement

H0

0

What Quantum Circuits Can Do: Entanglement

H

• Measure one bit, and know that the other has the same value instantaneously, even if it is at the other end of the universe!• Einstein called this “spooky action at a distance” and believedthat it could prove the absurdity of quantum mechanics.• But it has been observed in the laboratory, and appears tobe useful for quantum computation.

0

0

What Quantum Circuits Can Do: Deutsch Algorithm

Suppose f is a boolean function f : {0,1} {0,1}.Classically, to evaluate the exclusive-or of f(0) and f(1) requires two evaluations.

With quantum circuits, we can compute it with only one!

What Quantum Circuits Can Do: Deutsch Algorithm

Suppose f is a boolean function f : {0,1} {0,1}.Classically, to evaluate the exclusive-or of f(0) and f(1) requires two evaluations.

With quantum circuits, we can compute it with only one!

Uf

Classical circuit to evaluate f

Note it’s just evaluated once

What Quantum Circuits Can Do: Deutsch Algorithm

Suppose f is a boolean function f : {0,1} {0,1}.Classically, to evaluate the exclusive-or of f(0) and f(1) requires two evaluations.

With quantum circuits, we can compute it with only one!

Uf

H

H H

H

What Quantum Circuits Can Do: Deutsch Algorithm

Suppose f is a boolean function f : {0,1} {0,1}.Classically, to evaluate the exclusive-or of f(0) and f(1) requires two evaluations.

With quantum circuits, we can compute it with only one!

Uf

H

H H

H

What Quantum Circuits Can Do: Deutsch Algorithm

Suppose f is a boolean function f : {0,1} {0,1}.Classically, to evaluate the exclusive-or of f(0) and f(1) requires two evaluations.

With quantum circuits, we can compute it with only one!

Uf

H

H H

H

Destructive interference and entanglement (of x with f(x))are crucial in this algorithm.

What Quantum Circuits Can Do: Factor Numbers(Shor’s Algorithm)

Factoring reduces to period finding:

Otherwise, it is useful to find the minimum rsuch that mr = 1 (mod n), the period of m mod n.

Start by “guessing” an m < n with gcd(m, n) = 1.If we find gcd(m, n) > 1, we have a factor!

This is the hard part. All other steps (includingthe guessing of m) are classical, based on elementarynumber theory.

• Crucial tool for finding the period: Fourier Transform

• This is the only quantum part of Shor’s algorithm!

g=e2r i/2k

The Quantum Fourier Transform (QFT)

Let (2k-th root of unity)

g=e2r i/2k

The Quantum Fourier Transform (QFT)

Let (2k-th root of unity)

The QFT acts on an k-bit quantum register:

g=e2r i/2k

The Quantum Fourier Transform (QFT)

Let (2k-th root of unity)

The QFT acts on an k-bit quantum register:

a QFT 2k/21 g ab

b=0

2k - 1

! b

k bits

Apply QFT (twice) to obtain a superposition withstates whose probability amplitudes depend onsums of powers of .

g

The powers of are arranged so that….

g

For those states in whichb doesn’t help us determinethe period, they (mostly)cancel.

(In fact, when r is a power of 2, the “bad” states cancel exactly.)

The powers of are arranged so that….

g

For those states in whichb doesn’t help us determinethe period, they (mostly)cancel.

For those states in whichb does help us determinethe period, they add.

(In fact, when r is a power of 2, the “bad” states cancel exactly.)

Shor’s algorithm is exponentially faster than any knownclassical algorithm for factoring.But this does not prove that quantum computers wouldbe exponentially faster. It is possible we have just notbeen clever enough to think up a polynomial-timeclassical algorithm for factoring. Grover’s database search algorithm (1996) does give aprovable quadratic speed-up over classical algorithms, butnot exponential.

There is one realm in which quantum circuits givea provable exponential improvement over classicalcircuits, and that is for constant-depth circuits.

Some Remarks on Complexity

Classical Circuits

Building blocks:

OR NOTx1

xn

ANDx1

xn

i=1

n

xi

i=1

n

xi

x x

A typical question in computational complexity:

How many of these gates are needed to computean explicit Boolean function of n inputs, as n increases?

Generally very difficult to answer such questions, especiallywhen you introduce more powerful circuit elements.

• • •

• • •

Some Classical Circuit Complexity

Suppose we would like to compute parity:

Plus our circuits can only have constant depth.

Answer (Razborov/Smolensky, 1987): No. Exponential size!

More generally, Smolensky proved that if q, p are distinctprimes, computing the MOD q function requires exponentialsize constant-depth circuits with AND, OR, and MOD p gates.

x15 x25 g 5 xn

…but we only have AND, OR, and NOT gates,and, as an added bonus, MOD3 gates, that determine ifthe number of 1’s in the input is divisible by 3.

Can it be done with a polynomial number of gates?

(i.e., is the number of ones odd?)

Analogous Quantum Circuits [Green, Homer, Moore & Pollett 2002]

Imagine (someday) we could have unbounded fan-in Toffoli gates,and gates that could reversibly fan out bits (classical only; qubitscannot be copied by the no-cloning theorem).

Analogous Quantum Circuits [Green, Homer, Moore & Pollett 2002]

Imagine (someday) we could have unbounded fan-in Toffoli gates,and gates that could reversibly fan out bits (classical only; qubitscannot be copied by the no-cloning theorem).

x1

x2

xn

x1x2

xn

bi=1

n

b xi

• • •

• • •

• •

Generalized Toffoli

Analogous Quantum Circuits [Green, Homer, Moore & Pollett 2002]

Imagine (someday) we could have unbounded fan-in Toffoli gates,and gates that could reversibly fan out bits (classical only; qubitscannot be copied by the no-cloning theorem).

x1

x2

xn

x1x2

xn

bi=1

n

b xi

• • •

• • •

• •

Generalized Toffoli

• • •

• • •

• •

x1

x2

xn

b bFanout

b x1b x2

b xn

=

Constant depth circuits built out of these gates alone are equivalent tothose built out of AND, OR and NOT (in constant depth).

What happens if we also allow the single-qubit gates(e.g., Hadamard and phase)?

• • •

• • •

• •

Fanout Gates are Powerful!

Fanout Gates are Powerful!

• • •

• • •

• •

H

H

H

H

H

H

H

H

• • •

• • •

• •

H

H

H

H

H

H

H

H

Fanout Gates are Powerful!

H

H

H

H

H

H

H

H

=

• • •

• • •

• •

H

H

H

H

H

H

H

H

Fanout Gates are Powerful!

H

H

H

H

H

H

H

H

=•

• =

• • •

• • •

• •

H

H

H

H

H

H

H

H

Fanout Gates are Powerful!

H

H

H

H

H

H

H

H

=•

• =

This is a parity gate!

• • •

• • •

• •

H

H

H

H

H

H

H

H

Fanout Gates are Powerful!

H

H

H

H

H

H

H

H

=•

• =

This is a parity gate!

• • •

• • •

• •

2

• • •

• • •

• •

H

H

H

H

H

H

H

H

Fanout Gates are Powerful

H

H

H

H

H

H

H

H

=•

• =

This is a parity gate!

• • •

• • •

• •

2

In the quantum circuitworld, the mere presenceof fanout allows us tocompute parity…

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times:

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times:

M M M M

n layers

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times. With fanout, we can do it inconstant depth:First diagonalize M, writing M = T†DT.

Thus Mn = T†DnT. The following does this in 5 layers:

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times. With fanout, we can do it inconstant depth:First diagonalize M, writing M = T†DT.

Thus Mn = T†DnT. The following does this in 5 layers:

T† D

D

D

T

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times. With fanout, we can do it inconstant depth:First diagonalize M, writing M = T†DT.

Thus Mn = T†DnT. The following does this in 5 layers:

T† D

D

D

T

layer 1

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times. With fanout, we can do it inconstant depth:First diagonalize M, writing M = T†DT.

Thus Mn = T†DnT. The following does this in 5 layers:

T† D

D

D

T

layer 2

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times. With fanout, we can do it inconstant depth:First diagonalize M, writing M = T†DT.

Thus Mn = T†DnT. The following does this in 5 layers:

T† D

D

D

T

layer 3

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times. With fanout, we can do it inconstant depth:First diagonalize M, writing M = T†DT.

Thus Mn = T†DnT. The following does this in 5 layers:

T† D

D

D

T

layer 4

Fanout Gates Allow Parallelization

Suppose we have a controlled unitary operator M that wewould like to apply n times. With fanout, we can do it inconstant depth:First diagonalize M, writing M = T†DT.

Thus Mn = T†DnT. The following does this in 5 layers:

T† D

D

D

T

layer 5

Consequence: Fanout Gates are REALLY Powerful!

• For quantum circuits, MOD q is as good as MOD p,for any q, p (prime or otherwise), up to polynomialsize and constant depth.

• Computing MOD q reduces to fanout and vice versa,for any q, in poly. size/constant depth.

(Contrast with the classical results of Razborov/Smolensky, where Mod q requires exponential size circuits with Mod p!)

(But wait, there’s more….)

Consequence: Fanout Gates are REALLY REALLY Powerful!

• Høyer and Spalek (2003) use a clever adaptation ofour parallelization method to show that threshold gatesreduce to fanout.

• The Quantum Fourier Transform can be donein constant depth, poly. size with just single-qubitand fanout gates.

For constant depth quantum circuits, “EVERYTHING”reduces to fanout!

• Hence, IF we could implement fanout gates, wecould do the quantum part of Shor’s algorithm inconstant time. (But that’s a big “if”!)

Open Problems, Current Work

• For physicists: Can we implement fanout?(One candidate technology: Ion trap)

• For complexity theorists: Can we implementfanout using single qubits and Toffoli gates?

(Ongoing work of Fang, Fenner, Green, Homer, Zhang strongly suggests “no”)

• For everyone: Can we come up with newquantum algorithms?