<<



Quantum theory

y z

Ethan Bernstein

September

Abstract

In this pap er we study from a complexity theoretic viewp oint Our rst result

is the existence of an ecient universal quantum in Deutschs mo del of a quantum Turing

Machine This construction is substantially more complicated than the corresp onding construction

for classical Turing Machines in fact even simple primitives such as lo oping branching and comp osition

are not straightforward in the context of quantum Turing Machines We establish how these familiar

primitives can b e implemented and also introduce some new purely quantum mechanical primitives

such as changing the computational basis and carrying out an arbitrary unitary transformation of

p olynomially b ounded dimension

We also consider the precision to which the transition amplitudes of a need

to b e sp ecied We prove that O log T of precision suce to supp ort a T step computation This

justies the claim that that the quantum Turing Machine mo del should b e regarded as a discrete mo del

of computation and not an analog one

We give the rst formal evidence that quantum Turing Machines violate the mo dern complexity

theoretic formulation of the ChurchTuring thesis We show the existence of a problem relative to

an oracle that can b e solved in p olynomial time on a quantum Turing Machine but requires sup er

p olynomial time on a b oundederror probabilistic Turing Machine and thus not in the class BPP

The class BQP of languages that are eciently decidable with small error on a quantum

P

Turing Machine satises BPP  BQP  P Therefore there is no p ossibility of giving a math

ematical pro of that quantum Turing Machines are more p owerful than classical probabilistic Turing

Machines in the unrelativized setting unless there is a ma jor breakthrough in complexity theory

Introduction

Just as the theory of has its foundations in the ChurchTuring thesis computational com

plexity theory rests on a mo dern strengthening of this thesis which asserts that any reasonable mo del

of computation can b e eciently simulated on a probabilistic Turing Machine an ecient simulation is

one whose running time is b ounded by some p olynomial in the running time of the simulated machine

Here we take reasonable to mean in principle physically realizable Some mo dels of computation though

interesting for other reasons do not meet this criterion For example it is clear that that op er

ate on arbitrary length words in unit time or that exactly compute with innite precision real numbers are

A preliminary abstract of this work app eared as

y

Microsoft Corp oration One Microsoft Way Redmond WA ethanbmicrosoftcom Research supp orted by NSF

Grant CCR

z

Computer Science Division University of California Berkeley CA vaziranicsberkeleyedu Research sup

p orted by NSF Grant CCR

not realizable It has b een argued that the Turing Machine mo del actually the p olynomial time equiva

lent cellular automaton mo del is the inevitable choice once we assume that we can implement only nite

precision computational primitives Given the widespread b elief that NP BPP this would seem to put

a wide range of imp ortant computational problems the NP hard problems well b eyond the capability of

computers

However the Turing Machine fails to capture physically realizable devices for a funda

mental reason the Turing Machine is based on a classical mo del of the Universe whereas current

physical theory asserts that the Universe is quantum physical Can we get inherently new kinds of discrete

computing devices based on quantum physics Early work on the computational p ossibilities of quantum

physics asked the opp osite question do es quantum mechanics insistence on unitary restrict

the class of eciently computable problems They concluded that as far as deterministic computation is

concerned the only additional constraint imp osed by quantum is that the computation must b e

reversible and therefore by Bennetts work it follows that quantum computers are at least as p owerful as

classical computers The issue of the extra computational p ower of over probabilistic

computers was rst raised by by Feynman in In that pap er Feynman p ointed out a very curious

problem the natural simulation of a quantum physical system on a probabilistic Turing Machine requires

an exp onential slowdown Moreover it is unclear how to carry out the simulation more eciently In

view of Feynmans observation we must examine the foundations of theory

and the complexitytheoretic form of the ChurchTuring thesis and study the computational p ower of

computing devices based on quantum physics

A precise mo del of a quantum physical hereafter referred to as the quantum Turing Machine

was formulated by Deutsch There are two ways of thinking ab out quantum computers One way

that may app eal to computer scientists is to think of a quantum Turing Machine as a quantum physical

analogue of a probabilistic Turing Machine it has an innite tap e and a transition function and the

actions of the machine are lo cal and completely sp ecied by this transition function Unlike probabilistic

Turing Machines quantum Turing Machines allow branching with complex probability amplitudes but

imp ose the further requirement that the machines evolution b e timereversible This view is elab orated

in x Another way is to view a quantum computer as eecting a transformation in a space of complex

sup erp ositions of congurations Quantum physics requires that this transformation b e unitary A quan

tum may then b e regarded as the decomp osition of a unitary transformation into a pro duct of

unitary transformations each of which makes only simple lo cal changes This view is elab orated in x

Both formulations play an imp ortant role in the study of quantum computation

One imp ortant concern is whether quantum Turing Machines are really analog devices since they

involve complex transition amplitudes It is instructive to examine the analogous question for probabilistic

Turing Machines There one might worry that probabilistic machines are not discrete and therefore not

reasonable since they allow transition to b e real numbers However there is extensive

work showing that probabilistic computation can b e carried out in a such a way that it is so insensitive

to the transition probabilities that they can b e allowed to vary arbitrarily in a large range In

this pap er we show in a similar sense that quantum Turing Machines are discrete devices the transition

amplitudes need only b e accurate to O log T bits of precision to supp ort T steps of computation As

Lipton p ointed out it is crucial that the number of bits is O log T and not O T as it was in an

early version of this pap er since k bits of precision requires pinning down the transition amplitude to one

k

part in Since the transition amplitude is some physical quantity such as the angle of a p olarizer or the

length of a pulse we must not assume that we can sp ecify it to b etter than one part in some p olynomial

in T and therefore the precision must b e O log T

Another basic question one may ask is whether it is p ossible to dene the notion of a general purp ose

quantum computer In the classical case this question is answered armatively by showing that there is

an ecient In this pap er we prove that there is an ecient quantum Turing

Machine When given as input the sp ecication of an arbitrary QTM M an input x to M a time b ound

T and an accuracy the universal machine pro duces a sup erp osition whose Euclidean distance from the

time T sup erp osition of M on x is at most Moreover the simulation time is b ounded by a p olynomial

in T jxj and Deutsch gave a dierent construction of a universal quantum Turing Machine

The simulation overhead in Deutschs construction is exp onential in T the issue Deutsch was interested

in was computability not computational complexity The structure of the ecient universal quantum

Turing Machine constructed in this pap er is very simple It is just a deterministic Turing Machine with

a single type of quantum op eration a quantum coin an op eration that p erforms a rotation on a

single The existence of this simple universal quantum Turing Machine has a b earing on the physical

realizability of quantum Turing Machines in general since it establishes that it is sucient to physically

realize a simple quantum op eration on a single bit in addition to maintaining and carrying out

deterministic op erations of course Adleman et al and Solovay and Yao have further claried

this p oint by showing that quantum coin ips with amplitudes and are sucient for universal

quantum computation

Quantum computation is necessarily time reversible since quantum physics requires unitary evolution

This makes it quite complicated to correctly implement even simple primitives such as lo oping branching

and comp osition These are describ ed in x In addition we also require programming primitives such

as changing the computational basis which are purely quantum mechanical These are describ ed in x

Another imp ortant primitive is the ability to carry out any sp ecied unitary transformation of p olynomial

dimension to a sp ecied degree of accuracy In x we show how to build a quantum Turing that implements

this primitive Finally all these pieces are put together in x to construct the universal quantum Turing

Machine

We can still ask whether the quantum Turing Machine is the most general mo del for a computing device

based on quantum physics One approach to arguing armatively is to consider various other reasonable

mo dels and to show that the quantum Turing Machine can eciently simulate each of them An earlier

version of this work left op en the question of whether standard variants of a quantum Turing Machine

such as machines with multiple tap es or with mo died tap e access are more p owerful than the basic mo del

Yao showed that these mo dels are p olynomially equivalent to the basic mo del as are quantum circuits

which were introduced in The eciency of Yaos simulation has b een improved in to show that

the simulation overhead is a p olynomial with degree indep endent of the number of tap es Arguably the

full computational p ower of quantum physics for discrete systems is captured by the quantum analog of

a cellular automaton It is still an op en question whether a quantum cellular automaton might b e more

p owerful than a quantum Turing Machine there is also an issue ab out the correct denition of a quantum

cellular automaton The diculty has to do with decomp osing a unitary transformation that represents

many overlapping sites of activity into a pro duct of simple lo cal unitary transformations This problem

has b een solved in the sp ecial case of linearly b ounded quantum cellular automata

Finally several researchers have explored the computational p ower of quantum Turing Machines Early

work by Deutsch and Jozsa showed how to exploit some inherently quantum mechanical features

of QTMs Their results in conjunction with subsequent results by Berthiaume and Brassard

established the existence of oracles under which there are computational problems that QTMs can solve in

p olynomial time with certainty whereas if we require a classical probabilistic Turing machine to pro duce

the correct answer with certainty then it must take exp onential time on some inputs On the other hand

these computational problems are in BPP the class of problems that can b e solved in p olynomial time

by probabilistic Turing machines that are allowed to give the wrong answer with small probability Since

BPP is widely considered the class of eciently computable problems these results left op en the question

of whether quantum computers are more p owerful than classical computers

In this pap er we give the rst formal evidence that quantum Turing Machines violate the mo dern form

of the ChurchTuring thesis by showing that relative to an oracle there is a problem that can b e solved in

olog n

p olynomial time on a quantum Turing Machine but cannot b e solved in n time on a probabilistic

Turing Machine with any xed error probability A detailed discussion ab out the implications of

these oracle results is in the introduction to x Simon subsequently strengthened our result in the

time parameter by proving the existence of an oracle relative to which a certain problem can b e solved

n

in p olynomial time on a quantum Turing Machine but cannot b e solved in less than steps on a

probabilistic Turing Machine Simons problem is in NP coNP and therefore do es not address the

nondeterminism issue More imp ortantly Simons pap er also introduced an imp ortant new technique

which was one of the ingredients in a remarkable result proved subsequently by Shor Shor gave

p olynomial time quantum for the factoring and discrete log problems These two problems

have b een wellstudied and their presumed intractability forms the basis of much of mo dern

These results have injected a greater sense of urgency to the actual implementation of a quantum computer

The class BQP of languages that are eciently decidable with small errorprobability on a quantum

P

Turing Machine satises BPP BQP P This rules out the p ossibility of giving a mathematical

pro of that quantum Turing Machines are more p owerful than classical probabilistic Turing Machines in

the unrelativized setting unless there is a ma jor breakthrough in complexity theory

It is natural to ask whether quantum Turing Machines can solve every problem in NP in p olynomial

time Bennett Bernstein Brassard and Vazirani give evidence showing the limitations of quantum

Turing Machines They show that relative to an oracle chosen uniformly at random with probability

n

the class NP cannot b e solved on a quantum Turing Machine in time o They also show that relative

to a p ermutation oracle chosen uniformly at random with probability the class NP coNP cannot

n

b e solved on a quantum Turing Machine in time o The former b ound is tight since recent work

of Grover shows how to accept the class NP relative to any oracle on a quantum computer in time

n

O

Several designs have b een prop osed for realizing quantum computers A number of authors

have argued that there are fundamental problems in building quantum computers most notably the eects

of the decoherence of quantum sup erp ositions or the entanglement of the system with the environment

Very recently there have b een a sequence of imp ortant results showing how to implement quantum error

correcting co des and also use these co des to make quantum algorithms quite robust against the eects

of decoherence and

Quantum computation touches up on the foundations of b oth and quantum physics

The nature of quantum physics was claried by the EinsteinPodolskyRosen paradox and Bells inequalities

discussed in which demonstrate the dierence b etween its statistical prop erties and those of any

classical mo del The computational dierences b etween quantum and classical physics are if anything

more striking and can b e exp ected to oer new insights into the nature of quantum physics For example

one might naively argue that it is imp ossible to exp erimentally verify the exp onentially large size of

the Hilb ert space asso ciated with a discrete quantum system since any observation leads to a collapse

of its sup erp osition However an exp eriment demonstrating the exp onential sp eedup oered by quantum

computation over classical computation would establish that something like the exp onentially large Hilb ert

space must exist Finally it is imp ortant as Feynman p ointed out to clarify the computational

overhead required to simulate a quantum mechanical system The simple form of the universal quantum

Turing Machine constructed here the fact that it has only a single nontrivial quantum op eration dened

on a single bit suggests that even very simple quantum mechanical systems are capable of universal

quantum computation and are therefore hard to simulate on classical computers

This pap er is organized as follows Section introduces some of the mathematical machinery and

notation we will use In x we introduce the quantum Turing Machine as a natural extension of classical

probabilistic Turing Machines We also show that quantum Turing Machines need not b e sp ecied with

an unreasonable amount of precision In x and x we demonstrate the basic constructions which will

allow us to build up large complicated quantum Turing Machines in subsequent sections Many actions

which are quite easy for classical machines such as completing a partially sp ecied machine running one

machine after another or rep eating the op eration of a machine a given number of times will require non

trivial constructions for quantum Turing Machines In x we show how to build a single quantum Turing

Machine which can carry out any unitary transformation which is provided as input Then in x we use

this simulation of unitary transformations to build a universal quantum computer Finally in x we give

our results b oth p ositive and negative on the p ower of quantum Turing Machines

Preliminaries

Let C denote the eld of complex numbers For C we denote by its complex conjugate

Let V b e a vector space over C An innerpro duct over V is a complex function dened on V V

which satises

x V x x Moreover x x i x

x y z V x y z x z y z

x y V x y y x

The innerpro duct yields a norm given by kxk x x In addition to the triangle inequality

kx y k kxk ky k the norm also satises the Schwarz inequality kx y k kxkky k

An innerproduct space is a vector space V together with an innerpro duct

An innerpro duct space H over C is a Hilbert space if it is complete under the induced norm where

H is complete if every Cauchy sequence converges ie if fx g is a sequence with x H such that

n n

lim kx x k then there is an x in H with lim kx xk

nm n m n n

Given any innerpro duct space V each vector x V denes a linear functional x V C where

x y x y The set of such linear functionals is also an innerpro duct space and will b e referred to as

the vectordual of V and denoted V In the case that V is a Hilb ert space V is called the dual of V and

is the set of all continuous linear functionals on V and the dual space V is also a Hilb ert space

In Diracs notation a vector from an innerpro duct space V is identied using the ket notation j i

with some symbols placed inside to distinguish that vector from all others We denote elements of the

dual space using the bra notation h j Thus the dual of ji is hj and the inner pro duct of vectors j i

and ji which is the same as the result of applying functional h j to the vector ji is denoted by h ji

Let U b e a linear op erator on V In Diracs notation we denote the result of applying U to ji as

U ji U also acts as a linear op erator on the dual space V mapping each linear functional hj of the dual

space to the linear functional which applies U followed by hj We denote the result of applying U to hj

by hjU

For any innerpro duct space V we can consider the usual vector space basis or Hamel basis fj ig

i iI

Every vector ji V can b e expressed as a nite linear combination of basis vectors In the case that

k k and h j j i for i j we refer to the basis as an orthonormal basis With resp ect to an

i i j

P

orthonormal basis we can write each vector ji V as ji j i where h ji Similarly

i i i i

iI

P

h j where hj i Thus each element each dual vector hj V can b e written as as hj

i i i i

iI

ji V can b e thought of as a column vector of the s and each element hj V can b e thought of

i

as a row vector of the s Similarly each linear op erator U may b e represented by the set of

i

elements fh jU j ig arranged in a square matrix with rows and columns b oth indexed by I Then

i j ij I

the column of U with index i is the vector U j i and the row of U with index i is the dual vector

i

h jU

i

For a Hilb ert space H fj ig is a Hilbert space basis for H if it is a maximal set of orthonormal

i iI

vectors in H Every vector ji H can b e expressed as the limit of a sequence of vectors each of which

can b e expressed as a nite linear combination of basis vectors

Given a linear op erator U in an inner pro duct space if there is a linear op erator U which satises

hU j i hjU i for all then U is called the adjoint or Hermitian conjugate of U If a linear

op erator in an inner pro duct space has an adjoint it is unique The adjoint of a linear op erator in a

Hilb ert space or in a nite dimensional inner pro duct space always exists It is easy to see that if the

adjoints of U and U exist then U U U U and U U U U An op erator U is called

Hermitian or selfadjoint if it is its own adjoint U U The linear op erator U is called unitary if its

adjoint exists and satises U U UU I

If we represent linear op erators as square matrices indexed over an orthonormal basis then U is

represented by the conjugate transp ose of U So in Diracs notation we have the convenient identity

hjU j i h jU ji

Recall that if the innerpro duct space V is the pro duct of two innerpro duct spaces V V then

for each pair of vectors j i V j i V there is an asso ciated tensor pro duct j i j i in V In

Diracs notation we denote j i j i as j ij i

The norm of U is dened as kU k sup kU jxik A linear op erator is called bounded if kU k is

kjxik

nite We will freely use the following standard facts ab out b ounded linear op erators

If U exists then kU k kU k

kU U k kU kkU k

kU k kU k kU U k kU k kU k

Notice that a unitary op erator U must satisfy kU k We will often use the following fact which

tells us that if we approximate a series of unitary transformations with other unitary transformations the

error increases only additively

Fact If U U U U are unitary transformations on an innerproduct space then

U U U k kU U k kU U k kU

This fact follows from Statements and ab ove since

kU U U U k kU U U U k kU U U U k

kU U kkU k kU kkU U k

Miscellaneous notation

If d is a direction fL Rg then d is the opp osite of d

Given two probability distributions P and P over the same domain I the total variation distance

P

b etween P and P is equal to jP i P ij

iI

We will refer to the cardinality of a set S as cardS and the length of a string x as jxj

Quantum Turing Machines

A physicslike view of randomized computation

Before we formally dene a quantum Turing Machine QTM we introduce the necessary terminology in

the familiar setting of probabilistic computation As a b onus we will b e able to precisely lo cate the p oint

of departure in the denition of a QTM

Quantum mechanics makes a distinction b etween a systems evolution and its In the

absence of measurement the time evolution of a probabilistic TM can b e describ ed by a sequence of

probability distributions The distribution at each step gives the likelihoo d of each p ossible conguration

of the machine We can also think of the probabilistic TM as sp ecifying an innite dimensional sto chastic

matrix M whose rows and columns are indexed by congurations Each column of this matrix gives

the distribution resulting from the corresp onding conguration after a single step of the machine If we

represent the at one time step by a vector jv i then the distribution at the next

step is given by the pro duct M jv i In quantum physics terminology we call the distribution at each step a

linear sup erp osition of congurations and we call the co ecient of each conguration its probability

its amplitude The sto chastic matrix is referred to as the time evolution op erator

Three comments are in order First not every sto chastic matrix has an asso ciated probabilistic TM

Sto chastic matrices obtained from probabilistic TM are nitely sp ecied and map each conguration by

making only lo cal changes to it Second the supp ort of the sup erp osition can b e exp onential in the run

ning time of the machine Third we need to constrain the entries allowed in the transition function of our

probabilistic TM Otherwise it is p ossible to smuggle hard to compute quantities into the transition ampli

th

tudes for instance by letting the i bit indicate whether the ith deterministic TM halts on a blank tap e

g More generally we might allow A common restriction is to allow amplitudes only from the set f

any real number in the interval which can b e computed by some deterministic algorithm to within

n

any desired in time p olynomial in n It is easily shown that the rst p ossibility is computationally no

more restrictive than the second

Returning to the evolution of the probabilistic TM when we observe the machine after some number

of steps we do not see the linear sup erp osition probability distribution but just a sample from it

If we observe the entire machine then we see a conguration sampled at random according to the

sup erp osition The same holds if we observe just a part of the machine In this case the sup erp osition

collapses to one that corresp onds to the probability distribution conditioned on the value observed By

the linearity of the law of alternatives the mere act of making observations at times earlier than t do es

not change the probability for each outcome in an observation at time t So even though the unobserved

sup erp osition may have supp ort that grows exp onentially with running time we need only keep track of

a constant amount of when simulating a probabilistic TM which is observed at each step

The computational p ossibilities of quantum physics arise out of the fact that observing a quantum system

changes its later b ehavior

1

Recall that a matrix is sto chastic if it has nonnegative real entries that sum to in each column

2

The law of alternatives says exactly that the probability of an event A do esnt change if we rst check to see whether

B P B event B has happ ened P A P AjB P B P Aj

Dening a QTM

Our mo del of randomized computation is already surprisingly close to Deutschs mo del of a QTM The

ma jor change that is required is that in quantum physics the amplitudes in a systems linear sup erp osition

and the matrix elements in a systems time evolution op erator are allowed to b e complex numbers rather

than just p ositive reals When an observation is made the probability asso ciated with each conguration is

not the congurations amplitude in the sup erp osition but rather the squared magnitude of its amplitude

So instead of always having a linear sup erp osition whose entries sum to we will now always have a linear

sup erp osition whose Euclidean length is This means that QTMs must b e dened so that their time

evolution preserves the Euclidean length of sup erp ositions

Making these changes to our mo del we arrive at the following denitions

For completeness let us recall the denition of a deterministic TM There are many standard variations

to the denition of deterministic TM none of which aect their computational p ower In this pap er we will

make our choices consistent with those in Deutschs pap er we consider TMs with a twoway innite

tap e and a single tap e head which must move left or right one square on each step We also give standard

denitions for interpreting the input output and running time of a deterministic TM Note that although

we usually restrict our discussion to TMs with tap e head movements fL Rg we will sometimes consider

generalized TMs with tap e head movements fL N Rg where N means no head movement

Denition A deterministic Turing Machine is dened by a triplet Q where is a nite

alphabet with an identied blank symbol Q is a nite set of states with an identied initial state q and

nal state q q and the deterministic transition function is a function

f

Q Q fL Rg

The TM has a twoway innite tape of cells indexed by Z and a single readwrite tape head that moves

along the tape

A conguration or instantaneous description of the TM is a complete description of the the contents of

the tape the location of the tape head and the state q Q of the nite control At any time only a nite

number of tape cells may contain nonblank symbols

For any conguration c of TM M the successor conguration c is dened by applying the transition

function to the current state q and currently scanned symbol in the obvious way We write c c to

M

denote that c fol lows from c in one step

By convention we require the initial conguration of M to be satisfy the fol lowing conditions the tape

head is in cell called the start cell and the machine is in state q An initial conguration has input

x if x is written on the tape in positions and al other tape cells are blank The TM

halts on input x if it eventual ly enters the nal state q The number of steps a TM takes to halt on input

f

x is its running time on input x If a TM halts then its output is the string in consisting of those tape

contents from the leftmost nonblank symbol to the rightmost nonblank symbol or the empty string if the

entire tape is blank A TM which halts on al l inputs therefore computes a function from to

We now give a slightly mo died version of the denition of a QTM provided by Deutsch As in

the case of probabilistic TM we must limit the transition amplitudes to eciently computable numbers

Adleman et al and Solovay and Yao have separately shown that further restricting QTMs to

rational amplitudes do es not reduce their computational p ower In fact they have shown that the set

of amplitudes f g are sucient to construct a universal QTM We give a denition of the

computation of a QTM with a particular string as input but we defer discussing what it means for a QTM

to halt or give output until x Again we will usually restrict our discussion to QTMs with tap e head

movements fL Rg but will sometimes consider generalized QTMs with tap e head movements fL N Rg

As we p ointed out in the introduction unlike in the case of deterministic TMs these choices do make a

greater dierence in the case of QTMs This p oint is also discussed later in the pap er

Denition Cal l C the set consisting of C such that there is a deterministic algorithm that

n

computes the real and imaginary parts of to within in time polynomial in n

A quantum Turing Machine QTM M is dened by a triplet Q where is a nite alphabet

with an identied blank symbol Q is a nite set of states with an identied initial state q and nal

state q q and the quantum transition function is a function

f

Q fLRg

Q C

The QTM has a twoway innite tape of cells indexed by Z and a single readwrite tape head that moves

along the tape We dene congurations initial congurations and nal congurations exactly as for

deterministic TMs

Let S be the innerproduct space of nite complex linear combinations of congurations of M with the

Euclidean norm We call each element S a sup erp osition of M The QTM M denes a linear operator

U S S called the time evolution op erator of M as fol lows If M starts in conguration c with current

M

P

c state p and scanned symbol Then after one step M wil l be in superposition of congurations

i i

i

where each nonzero corresponds to a transition p q d and c is the new conguration that results

i i

from applying this transition to c Extending this map to the entire space S through linearity gives the

linear time evolution operator U

M

Note that we dened S by giving an orthonormal basis for it namely the congurations of M In terms

of this standard basis each sup erp osition S may b e represented as a vector of complex numbers indexed

by congurations The time evolution op erator U may b e represented by the countable dimensional

M

square matrix with columns and rows indexed by congurations where the matrix element from column

c and row c gives the amplitude with which conguration c leads to conguration c in a single step of M

For convenience we will overload notation and use the expression p q d to denote the amplitude

in p of j ijq ijdi

The next denition provides an extremely imp ortant condition that QTMs must satisfy to b e consistent

with quantum physics We have introduced this condition in the form stated b elow for exp ository purp oses

As we shall see later in x there are other equivalent formulations of this condition that are more familiar

to quantum physics

Denition We wil l say that M is wellformed if the its time evolution operator U preserves

M

Euclidean length

Wellformedness is a necessary condition for a QTM to b e consistent with quantum physics As we shall

see in the next subsection wellformedness is equivalent to unitary time evolution which is a fundamental

requirement of quantum physics

Next we dene the rules for observing the QTM M For those familiar with quantum mechanics we

should state that the denition b elow restricts the to b e in the computational basis of S

This is b ecause the actual basis in which the measurement is p erformed must b e eciently computable

and therefore we may without loss of generality p erform the rotation to that basis during the computation

itself

P

Denition When QTM M in superposition c is observed or measured conguration c

i i i

i

is seen with probability jj Moreover the superposition of M is updated to c

i

We may also perform a partial measurement say only on the rst cell of the tape In this case sup

P

pose that the rst cell may contain the values or and suppose the superposition was c

i i

i

P

c where the c are those congurations that have a in the rst cell and c are those cong

i i i i

i

P

urations that have a in the rst cell Measuring the rst cell results in P j j Moreover

i

i

P

p

if a is observed the new superposition is given by c ie the part of the superposition

i i

i

P r

consistent with the answer with amplitudes scaled to give a unit vector

Note that the wellformedness condition on a QTM simply says that the the time evolution op erator

of a QTM must satisfy the condition that in each successive sup erp osition the sum of the probabilities of

all p ossible congurations must b e

Notice that a QTM diers from a classical TM in that the user has decisions b eyond just choosing an

input A priori it is not clear whether multiple observations might increase the p ower of QTMs This p oint

is discussed in more detail in and there it is shown that one may assume without loss of generality

that the QTM is only observed once Therefore in this pap er we shall make simplifying assumptions

ab out the measurement of the nal result of the QTM The fact that these assumptions do not result in

any loss of generality follows from the results in

In general the output of a QTM is a sample from a probability distribution We can regard two

QTMs as functionally equivalent for practical purp oses if their output distributions are suciently close

to each other A formal denition of what it means for one QTM to simulate another is also given in

As in the case of classical TMs the formal denition is quite unwieldy In the actual constructions it will

b e easy to see in what sense they are simulations Therefore we will not replicate the formal denitions

from here We give a more informal denition b elow

Denition We say that QTM M simulates M with slowdown f with accuracy if the fol lowing

holds let D be a distribution such that observing M on input x after T steps produces a sample from D

let D be a distribution such that observing M on input x after f T steps produces a sample from D

Then we say that M simulates M with accuracy if jD D j

We will sometimes nd it convenient to measure the accuracy of a simulation by calculating the Eu

clidean distance b etween the target sup erp osition and the sup erp osition achieved by the simulation The

following shows that the variation distance b etween the resulting distributions is at most times this

Euclidean distance

Lemma Let S such that kk k k and k k Then the total variation distance

between the probability distributions resulting from measurements of and is at most

P P

jii Observing gives each jii with probability j j while jii and Pro of Let

i i i

i i

P

observing gives each jii with probability j j Let jii Then the latter

i i i

i

probability j j can b e expressed as

i

j j j j

i i i i i i i i i

i i i

Therefore the total variation distance b etween these two distributions is at most

X X

k k j j j j j j h jji hjj i kkk k

i i i i

i i

i i

Finally note that since we have unit sup erp ositions we must have 2

as a unitary transformation

In the preceding sections we introduced QTMs as an extension of the notion of probabilistic TMs We

stated there that a QTM is wellformed if it preserves the norm of the sup erp ositions In this section we

explore a dierent and extremely useful alternative view of QTMs in terms of prop erties of the time

evolution op erator We prove that a QTM is wellformed i its time evolution is unitary Indeed unitary

time evolution is a fundamental constraint imp osed by quantum mechanics and we chose to state the

wellformedness condition in the last section mainly for exp ository purp oses

Understanding unitary evolution from an intuitive p oint of view is quite imp ortant to comprehending

the computational p ossibilitie s of quantum mechanics Let us explore this in the setting of a quantum

mechanical system that consists of n parts each of which can b e in one of two states lab eled ji and ji

these could b e n particles each with a state If this were a classical system then at any given instant

it would b e in a single conguration which could b e describ ed by n bits However in quantum physics the

system is allowed to b e in a linear sup erp osition of congurations and indeed the instantaneous state of

n

the system is describ ed by a unit vector in the dimensional vector space whose basis vectors corresp ond

n

to all the congurations Therefore to describ e the instantaneous state of the system we must sp ecify

n

complex numbers The implications of this are quite extraordinary even for a small system consisting

of particles nature must keep track of complex numbers just to remember its instantaneous

state Moreover it must up date these numbers at each instant to evolve the system in time This is an

extravagant amount of eort since is larger than the standard estimates on the number of particles in

the visible universe So if nature puts in such extravagant amounts of eort to evolve even a tiny system

at the level of quantum mechanics it would make sense that we should design our computers to take

advantage of this

However unitary evolution and the rules for measurement in quantum mechanics place signicant

constraints on how these features can b e exploited for computational purp oses One of the basic primitives

that allows these features to b e exploited while resp ecting the constraints is the discrete fourier

transform this is describ ed in more detail in x Here we consider some very simple cases One

interesting phenomenon supp orted by unitary evolution is the interference of computational paths In

a probabilistic computation the probability of moving from one conguration to another is the sum of

the probabilities of each p ossible path from the former to the latter The same is true of the probability

amplitudes in quantum computation but not necessarily of the probabilities of observations Consider for

p p

example applying the transformation U twice in sequence to the same tap e cell which

p p

at rst contains the symbol If we observe the cell after the rst application of U we see either symbol

with probability If we then observe after applying U a second time the symbols are again equally

likely However since U is the identity if we only observe at the end we see a with probability

So even though there are two computational paths that lead from the initial to a nal symbol they

interfere destructively cancelling each other out The two paths leading to a interfere constructively so

that even though b oth have probability when we observe twice we have probability of reaching if

we observe only once Such a b o osting of probabilities by an exp onential factor lies at the heart of the

QTMs advantage over a probabilistic TM in solving the Fourier sampling problem

Another constraint inherent in computation using unitary transformations is reversibility We show in

R

x that for any QTM M there is a corresp onding QTM M whose time evolution op erator is the con

jugate transp ose of the time evolution op erator of M and therefore undo es the actions of M Sections

and are devoted to dening the machinery to deal with this feature of QTMs

We prove b elow in App endix A that a QTM is wellformed if and only if its time evolution op erator

is unitary This establishes that our denition which did not mention unitary evolution for exp ository

purp oses do es satisfy the fundamental constraint imp osed by quantum mechanics unitary evolution

Actually one could still ask why this is consistent with quantum mechanics since the space S of nite

linear combinations of congurations is not a Hilb ert space since it is not complete To see that this

do esnt present a problem notice that S is a dense subset of the Hilb ert space H of all not just nite

linear combinations of congurations Moreover any unitary op erator U on S has a unique extension U

to H and U is unitary and its inverse is U The pro of is quite simple Let U and U b e the continuous

extensions of U and U to H Let x y H Then there are sequences fx g fy g S such that x x

n n n

and y y Moreover for all n U x y x U y Taking limits we get that U x y x U y

n n n n n

as desired

As an aside we should briey mention that another resolution of this issue is achieved by following

Feynman who suggested that if we use a quantum mechanical system with Hamiltonian U U then

the resulting system has a lo cal time invariant Hamiltonian It is easy to probabilistically recover the

computation of the original system from the computation of the new one

It is interesting to note that the following theorem would not b e true if we dened QTMs using a

oneway innite tap e In that case the trivial QTM which always moves its tap e head right would b e

wellformed but its time evolution would not b e unitary since its start conguration could not b e reached

from any other conguration

Theorem A A QTM is wel lformed i its time evolution operator is unitary

Precision required in a QTM

One imp ortant concern is whether QTMs are really analog devices since they involve complex transition

amplitudes The issue here is how accurately these transition amplitudes must b e sp ecied to ensure that

the correctness of the computation is not compromised In an earlier version of this pap er we showed that

O

T bits of precision are sucient to correctly carry out T steps of computation to within accuracy for

any constant Lipton p ointed out that for the device to b e regarded as a discrete device we must

O

require that its transition amplitudes b e sp ecied to at most one part in T as opp osed to accurate to

O

within T bits of precision This is b ecause the transition amplitude represents some physical quantity

such as the angle of a p olarizer or the length of a pulse and we must not assume that we can sp ecify

it to b etter than one part in some p olynomial in T and therefore the number of bits of precision must b e

O log T This is exactly what we proved shortly after Liptons observation and we present that pro of in

this section

The next theorem shows that b ecause of the unitary time evolution errors in the sup erp osition made

over a sequence of steps will in the worst case only add

Theorem Let U be the time evolution operator of a QTM M and T If j i j i j i j i

T T

are superpositions of U such that

kj i j ik

i i

j i U j i

i i

T

then kj i U j ik T

T

Pro of Let j i j i j i Then we have

i i i

T T T

j i U j i U j i U j i j i

T T

The theorem follows by the triangle inequality since U is unitary and kj ik 2

i

Denition We say that QTMs M and M are close if they have the same state set and alphabet

and if the dierence between each pair of corresponding transition amplitudes has magnitude at most

Note that M and M can be close even if one or both are not wel lformed

The following theorem shows that two QTMs which are close in the ab ove sense give rise to time

evolution op erators which are close to each other even if the QTMs are not wellformed As a simple

consequence the time evolution op erator of a QTM is always b ounded even if the QTM is not well

formed

Theorem If QTMs M and M with alphabet and state set Q are close then the dierence in

their time has norm at most card cardQ Moreover this statement holds even if one or

both of the machines are not wel lformed

Pro of Let QTMs M and M with alphab et and state set Q b e given which are close Let U b e the

time evolution of M and let U b e the time evolution of M

P

Now consider any unit length sup erp osition of congurations ji jc i Then we can express

j j

j

the dierence in the machines op eration on ji as follows

X X

A

U ji U ji jc i

ij i j

ij

j

iP j

where P j is the set of i such that conguration c can lead to c in a single step of M or M and where

i j

are the amplitudes with which c leads to c in M and M and

i j ij

ij

Applying the triangle inequality and the fact that the square of the sum of n reals is at most n times

the sum of their squares we have

P P

kU ji U jik

i ij

iP j j

ij

P P

card cardQ

i ij

iP j j

ij

Then since M and M are close we have

P P

card cardQ

ij i

iP j j

ij

P P

card cardQ j j

ij i

j iP j

ij

P P

card cardQ j j

i

j iP j

Finally since for any conguration c there are at most card cardQ congurations that can lead

j

to c in a single step we have

j

P P P

card cardQ j j card cardQ j j

i i

j iP j i

card cardQ

Therefore for any unit length sup erp osition ji

kU U jik card cardQ

2

The following corollary shows that O log T bits of precision are sucient in the transition amplitudes

to simulate T steps of a QTM to within accuracy for any constant

Corollary Let M Q be a wel lformed QTM and let M be a QTM which is

card cardQT

close to M where Then M simulates M for time T with accuracy Moreover this statment holds

even if M is not wel lformed

Without loss of generality we further assume Pro of Let b

card cardQT

Consider running M and M with the same initial sup erp osition Since M is wellformed by Theo

rem A its time evolution op erator U is unitary By Theorem on page the time evolution

op erator of M U is within of U

T

Applying U can always b e expressed as applying U and then adding a p erturbation of length at most

times the length of the current sup erp osition So the length of the sup erp osition of U at time t is at

t

most Since T this length is at most e Therefore app ealing to Theorem ab ove the

dierence b etween the sup erp ositions of M and M at time T is a sup erp osition of norm at most T

Finally Lemma on page tells us that observing M at time T gives a sample from a distribution

which is within total variation distance of the distributions sampled from by observing M at time T

2

Inputoutput conventions for QTMs

Timing is of crucial imp ortance to the op eration of a QTM b ecause computational paths can only interfere

if they take the same number of time steps Equally imp ortant are the p osition of the tap e head and

alignment of the tap e contents In this subsection we introduce several inputoutput conventions on

QTMs and deterministic TMs which will help us maintain these relationships while manipulating and

combining machines

We would like to think of our QTMs as nishing their computation when they reach the nal state

q However it is unclear how we should regard a machine which reaches a sup erp osition in which some

f

congurations are in state q but others are not We try to avoid such diculties by saying that a QTM

f

halts on a particular input if it reaches a sup erp osition consisting entirely of congurations in state q

f

Denition A nal conguration of a QTM is any conguration in state q If when QTM M is

f

run with input x at time T the superposition contains only nal congurations and at any time less than

T the superposition contains no nal conguration then M halts with running time T on input x The

superposition of M at time T is called the nal sup erp osition of M run on input x A polynomialtime

QTM is a wel lformed QTM which on every input x halts in time polynomial in the length of x

We would like to dene the output of a QTM which halts as the sup erp osition of the tap e contents of

the congurations in the machines nal sup erp osition However we must b e careful to note the p osition of

the tap e head and the alignment relative to the start cell in each conguration since these details determine

whether later paths interfere Recall that the output string of a nal conguration of a TM is its tap e

contents from the leftmost nonblank symbol to the rightmost nonblank symbol This means that giving

an output string leaves unsp ecied the alignment of this string on the tap e and the lo cation of the tap e

head to b e identied When describing the inputoutput b ehavior of a QTM we will sometimes describ e

this additional information When we do not the additional information will b e clear from context For

example we will often build machines in which all nal congurations have the output string b eginning in

the start cell with the tap e head scanning its rst symbol

Denition A QTM is called wellbehaved if it halts on al l input strings in a nal superposition

where each conguration has the tape head in the same cell If this cell is always the start cell we call the

machine stationary Similarly a deterministic TM is called stationary if it halts on al l inputs with its tape

head back in the start cell

To simplify our constructions we will often build QTMs and then combine them in simple ways like

running one after the other or iterating one a varying number of times To do so we must b e able to add

new transitions into the initial state q of a machine However since there may already b e transitions

into q the resulting machine may not b e reversible But we can certainly redirect the transitions out

of the nal state q of a reversible TM or a wellbehaved QTM without aecting its b ehavior Note that

f

for a wellformed QTM if q always leads back to q then there can b e no more transitions into q In

f

that case redirecting the transitions out of q will allow us to add new ones into q without violating

f

reversibility We will say that a machine with this prop erty is in normal form Note that a wellbehaved

QTM in normal form always halts b efore using any transition out of q and therefore also b efore using

f

any transition into q This means that altering these transitions will not alter the relevant part of the

machines computation For simplicity we arbitrarily dene normal form QTMs to step right and leave

the tap e unchanged as they go from state q to q

f

Denition A QTM or deterministic TM M Q is in normal form if

q j ijq ijRi

f

We will need to consider QTMs with the sp ecial prop erty that any particular state can b e entered while

the machines tap e head steps in only one direction Though not all QTMs are unidirectional we will

show that any QTM can b e eciently simulated by one that is Unidirectionality will b e a critical concept

in reversing a QTM in completing a partially describ ed QTM and in building our universal QTM We

further describ e the advantages of unidirectional machines after Theorem in x

Denition A QTM M Q is called unidirectional if each state can be entered from only

one direction In other words if p q d and p q d are both nonzero then d d

Finally we will nd it convenient to use the common to ol of thinking of the tap e of a QTM or

deterministic TM as consisting of several tracks

Denition A multitrack TM with k tracks is a TM whose alphabet is of the form

k

with a special blank symbol in each so that the blank in is We specify the input by

i

specifying the string on each track and optional ly by specifying the alignment of the contents of the

k

is started in the superposition consisting tracks So a TM run on input x x x

i k

i

th

only of the initial conguration with the nonblank portion of the i coordinate of the tape containing

the string x starting in the start cell More generally on input x jy x jy x jy with x y the

i k k i i

i

th

nonblank portion of the i track is x y aligned so that the rst symbol of each y is in the start cell Also

i i i

input x x x with x x is abbreviated as x x x

k l k l

Programming a QTM

In this section we explore the fundamentals of building up a QTM from several simpler QTMs Im

plementing basic programming primitives such as lo oping branching and reversing a computation is

straightforward for deterministic TMs However these constructions are more dicult for QTMs b ecause

one must b e very careful to maintain reversibility In fact the same diculties arise when building re

versible deterministic TMs However building reversible TMs up out of simpler reversible TMs has never

b een necessary This is b ecause Bennett showed how to eciently simulate any deterministic TM with

one which is reversible So one can build a reversible TM by rst building the desired computation with

a nonreversible machine and then using Bennetts construction None of the constructions in this section

make any sp ecial use of the quantum nature of QTMs and in fact all techniques used are the same as

those required to make the analogous construction for reversible TMs

We will show in this section that reversible TMs are a sp ecial case of QTMs So as Deutsch noted

Bennetts result allows any desired deterministic computation to b e carried out on a QTM However

Bennetts result is not sucient to allow us to use deterministic when building up QTMs

b ecause the dierent computation paths of a QTM will only interfere prop erly provided that they take

exactly the same number of steps We will therefore carry out a mo died version of Bennetts construction

to show that any deterministic computation can b e carried out by a reversible TM whose running time

dep ends only on the length of its input Then dierent computation paths of a QTM will take the same

number of steps provided that they carry out the same deterministic computation on inputs of the same

length

Reversible Turing Machines

Denition A reversible Turing Machine is a deterministic TM for which each conguration has at

most one predecessor

Note that we have altered the denition of a reversible TM from the one used by Bennett so that

our reversible TMs are a sp ecial case of our QTMs First we have restricted our reversible TM to move

its head only left and right instead of also allowing it to stay still Second we insist that the transition

function b e a complete function rather than a partial function Finally we consider only reversible TMs

with a single tap e though Bennett worked with multitape machines

Theorem Any reversible TM is also a wel lformed QTM

Pro of The transition function of a deterministic TM maps the current state and symbol to an up date

triple If we think of it as instead giving the unit sup erp osition with amplitude for that triple and

elsewhere then is also a quantum transition function and we have a QTM The time evolution matrix

corresp onding to this QTM contains only the entries and Since Corollary B proven b elow in

App endix B tells us that each conguration of a reversible TM has exactly one predecessor this matrix

must b e a p ermutation matrix If the TM is reversible then there must b e at most one in each row

P

Therefore any sup erp osition of congurations jc i is mapp ed by this time evolution matrix to some

i i

i

P

other sup erp osition of congurations jc i So the time evolution preserves length and the QTM is

i

i i

wellformed 2

Previous work of Bennett shows that reversible machines can eciently simulate deterministic TMs

Of course if a deterministic TM computes a function which is not onetoone then no reversible machine

can simulate it exactly Bennett showed that a generalized reversible TM can do the next b est thing

which is to take any input x and compute x M x where M x is the output of M on input x He also

showed that if a deterministic TM computes a function which is onetoone then there is a generalized

reversible TM that computes the same function For b oth constructions he used a multitape TM and

also suggested how the simulation could b e carried out using only a singletap e machine Morita etal

use Bennetts ideas and some further techniques to show that any deterministic TM can b e simulated by

a generalized reversible TM with a two symbol alphab et

We will give a slightly dierent simulation of a deterministic TM with a reversible machine that

preserves an imp ortant timing prop erty

First we describ e why timing is of critical imp ortance In later sections we will build QTMs with

interesting and complex interference patterns However two computational paths can only interfere if they

reach the same conguration at the same time We will often want paths to interfere which run much of

the same computation but with dierent inputs We can only b e sure they interfere if we know that these

computations can b e carried out in exactly the same running time We therefore want to show that any

function computable in deterministic p olynomial time can b e computed by a p olynomial time reversible

TM in such a way that the running time of the latter is determined entirely by the length of its input

Then provided that all computation paths carry out the same deterministic algorithms on the inputs of

the same length they will all take exactly the same number of steps

We prove the following theorem in App endix B on page using ideas from the constructions of Bennett

and Morita etal

Theorem Synchronization Theorem If f is a function mapping strings to strings which can

be computed in deterministic polynomial time and such that the length of f x depends only on the length

of x then there is a polynomial time stationary normal form reversible TM which given input x produces

output x f x and whose running time depends only on the length of x

If f is a function from strings to strings that such that both f and f can be computed in deterministic

polynomial time and such that the length of f x depends only on the length of x then there is a polynomial

time stationary normal form reversible TM which given input x produces output f x and whose running

time depends only on the length of x

Programming primitives

We now show how to carry out several programming primitives reversibly The Branching Reversal and

Lo oping Lemmas will b e used frequently in subsequent sections

The pro ofs of the following two lemmas are straightforward and are omitted However they will b e

quite useful as we build complicated machines since they allow us to build a series of simpler machines

while ignoring the contents of tracks not currently b eing used

Lemma Given any QTM reversible TM M Q and any set there is a QTM reversible

TM M Q such that M behaves exactly as M while leaving its second track unchanged

Lemma Given any QTM reversible TM M Q and permutation k

k

k there is a QTM reversible TM M Q such that the M behaves exactly

k

as M except that its tracks are permuted according to

The following two lemmas are also straightforward but stating them separately makes Lemma

b elow easy to prove The rst deals with swapping transitions of states in a QTM We can swap the

outgoing transitions of states p and p for transition function by dening p p p

p and p p for p p p Similarly we can swap the incoming transitions of states q

and q by dening p q d p q d p q d p q d and p q d

p q d for q q q

Lemma If M is a wel lformed QTM reversible TM then swapping the incoming or outgoing

transitions between a pair of states in M gives another wel lformed QTM reversible TM

Lemma Let M Q and M Q be two wel lformed QTMs reversible TMs with

the same alphabet and disjoint state sets Then then the union of the two machines M Q Q

and with arbitrarily chosen start state q Q Q is also a wel lformed QTM reversible TM

Using the two preceding lemmas we can insert one machine in place of a state in another When

we p erform such an insertion the computations of the two machines might disturb each other However

sometimes this can easily b e seen not to b e the case For example in the insertion used by the Dovetailing

Lemma b elow we will insert one machine for the nal state of a wellbehaved QTM so that the computation

of the original machine has completed b efore the inserted machine b egins In the rest of the insertions we

carry out the two machines will op erate on dierent tracks so the only p ossible disturbance involves the

p osition of the tap e head

Lemma If M and M are normal form QTMs reversible TMs with the same alphabet and q is

a state of M then there is a normal form QTM M which acts as M except that each time it would enter

state q it instead runs machine M

Pro of Let M and M b e as stated with initial and nal states q q q q and with q a state of

f f

M

Then we can construct the desired machine M as follows First take the union of M and M according

to Lemma on page and make the start state q if q q and q otherwise and make the nal

state q if q q and q otherwise Then swap the incoming transitions of q and q and the outgoing

f f f

transitions of q and q according to Lemma on page to get the wellformed machine M

f

Since M is in normal form the nal state of M leads back to its initial state no matter whether q is

the initial state of M the nal state of M or neither 2

Next we show how to take two machines and form a third by dovetailing one onto the end of the

other Notice that when we dovetail QTMs the second QTM will b e started with the nal sup erp osition of

the rst machine as its input sup erp osition If the second machine has diering running times for various

strings in this sup erp osition then the dovetailed machine might not halt even though the two original

machines were wellbehaved Therefore a QTM built by dovetailing two wellbehaved QTMs may not

itself b e wellbehaved

Lemma Dovetailing Lemma If M and M are wel lbehaved normal form QTMs reversible

TMs with the same alphabet then there is a normal form QTM reversible TM M which carries out the

computation of M fol lowed by the computation of M

Pro of Let M and M b e wellbehaved normal form QTMs reversible TMs with the same alphab et

and with start states and nal states q q q q

f f

To construct M we simply insert M for the nal state of M using Lemma on page

To complete the pro of we need to show that M carries out the computation of M followed by that

of M

To see this rst recall that since M and M are in normal form the only transitions into q and q

are from q and q resp ectively This means that no transitions in M have b een changed except for

f f

those into or out of state q Therefore since M is wellbehaved and do es not prematurely enter state

f

q the machine M when started in state q will compute exactly as M until M would halt At that

f

p oint M will instead reach a sup erp osition with all congurations in state q Then since no transitions

in M have b een changed except for those into or out of q M will pro ceed exactly as if M had b een

f

started in the sup erp osition of outputs computed by M 2

Now we show how to build a conditional branch around two existing QTMs or reversible TMs The

branching machine will run one of the two machines on its rst track input dep ending on its second track

input Since a TM can have only one nal state we must rejoin the two branches at the end We can join

reversibly if we write back out the bit that determined which machine was used The construction will

simply build a reversible TM that accomplishes the desired branching and rejoining and then insert the

two machines for states in this branching machine

Lemma Branching Lemma If M and M are wel lbehaved normal form QTMs reversible

TMs with the same alphabet then there is a wel lbehaved normal form QTM reversible TM M such

that if the second track is empty M runs M on its rst track and leaves its second track empty and if

the second track has a in the start cell and al l other cells blank M runs M on its rst track and

leaves the where its tape head ends up In either case M takes exactly four time steps more than the

appropriate M

i

Pro of Let M and M b e wellbehaved normal form QTMs reversible TMs with the same alphab et

Then we can construct the desired QTM as follows We will show how to build a stationary normal

form reversible TM BR which always takes four time steps and leaves its input unchanged always has a

sup erp osition consisting of a single conguration and has two states q and q with the following prop erties

If BR is run with a in the start cell and blanks elsewhere then BR visits q once with a blank tap e

and with its tap e head in the start cell and do esnt visit q at all and similarly if BR is run with a blank

tap e then BR visits q once with a blank tap e and with its tap e head in the start cell and do esnt visit q

at all Then if we extend M and M to have a second track with the alphab et of BR extend BR to have

a rst track with the common alphab et of M and M and insert M for state q and M for state q in

BR we will have the desired QTM M

We complete the construction by exhibiting the reversible TM BR The machine enters state q or q

dep ending on whether the start cell contains a and steps left and enters the corresp onding q or q while

stepping back right Then it enters state q while stepping left and state q while stepping back right

f

So we let BR have alphab et f g state set fq q q q q q q g and transition function dened

f

by the following table

q q L q L

q R q

q R q

q q L

q L q

q q R

f

q R q R q

f

It can b e veried that the transition function of BR is onetoone and that it can enter each state while

moving in only one direction Therefore app ealing to Theorem B on page it can b e completed to

give a reversible TM 2

Finally we show how to take a unidirectional QTM or reversible TM and build its reverse Two

computational paths of a QTM will interfere only if they reach congurations that do not dier in any

way This means that we must b e careful when building a QTM to erase any information that might dier

along paths which we want to interfere We will therefore sometimes use this lemma when constructing a

QTM to allow us to completely erase an intermediate computation

Since the time evolution of a wellformed QTM is unitary we could reverse a QTM by applying the

unitary inverse of its time evolution However this transformation is not the time evolution of a QTM

since it acts on a conguration by changing tap e symbols to the left and right of the tap e head However

since each state in a unidirectional QTM can b e entered while moving in only one direction we can reverse

the head movements one step ahead of the reversal of the tap e and state Then the reversal will have its

tap e head in the prop er cell each time a symbol must b e changed

Denition If QTMs M and M have the same alphabet then we say that M reverses the compu

tation of M if identifying the nal state of M with the initial state of M and the initial state of M with

the nal state of M gives the fol lowing For any input x on which M halts if c and are the initial

x x

conguration and nal superposition of M on input x then M halts on initial superposition with nal

x

superposition consisting entirely of conguration c

x

Lemma Reversal Lemma If M is a normal form reversible TM or unidirectional QTM then

there is a normal form reversible TM or QTM M that reverses the computation of M while taking two

extra time steps

Pro of We will prove the lemma for normal form unidirectional QTMs but the same argument proves

the lemma for normal form reversible TMs

Let M Q b e a normal form unidirectional QTM with initial and nal states q and q and for

f

each q Q let d b e the direction which M must move while entering state q Then we dene a bijection

q

on the set of congurations of M as follows For conguration c in state q let c b e the conguration

derived from c by moving the tap e head one square in direction d the opp osite of direction d Since

q q

the set of sup erp ositions of the form jci give an orthonormal basis for the space of sup erp ositions of M

we can extend to act as a linear op erator on this space of sup erp ositions by dening jci j ci It is

easy to see that is a unitary transformation on the space of sup erp ositions on M

Our new machine M will have the same alphab et as M and state set given by Q together with new

initial and nal states q and q The following three statements suce to prove that M reverses the

f

computation of M while taking two extra time steps

If c is a nal conguration of M and c is the conguration c with state q replaced by state q then

f

a single step of M takes sup erp osition jc i to sup erp osition jci

If a single step of M takes sup erp osition j i to sup erp osition j i where j i has no supp ort on

a conguration in state q then a single step of M takes sup erp osition j i to sup erp osition

j i

If c is an initial conguration of M and c is the conguration c with state q replaced by state q

f

then a single step of M takes sup erp osition jci to sup erp osition jc i

To see this let x b e an input on which M halts and let j i j i b e the sequence of sup erp ositions

n

of M on input x so that j i jc i where c is the initial sup erp osition of M on x and j i has supp ort

x x n

only on nal congurations of M Then since the time evolution op erator of M is linear Statement

tells us that if we form the initial conguration j i of M by replacing each state q in the j i with

f n

n

state q then M takes j i to j i in a single step Since M is in normal form none of j i j i

n n

n

have supp ort on any sup erp osition in state q Therefore Statement tells us that the next n steps of M

lead to sup erp ositions j i j i Finally Statement tells us that a single step of M maps

n

sup erp osition jc i to sup erp osition jc i

x

x

We dene the transition function to give a wellformed M satisfying these three statements with

the following transition rules

i q j ijq ijd

f q

f

For each q Q q and each

X

p q d j ijpijd i q

q p

p

i ijd q j ijq

q

0

f

q j ijq ijRi

f

The rst and third rules can easily b e seen to ensure Statements and The second rule can b e

seen to ensure Statement as follows Since M is in normal form it maps a sup erp osition j i to a

sup erp osition j i with no supp ort on any conguration in state q if and only if j i has no supp ort

on any congurations in state q Therefore the time evolution of M denes a unitary transformation

f

from the space S of sup erp ositions of congurations in states from the set Q Q q to the space of

f

sup erp ositions S of congurations in states from the set Q Q q This fact also tells us that the

second rule ab ove denes a linear transformation from space S back to space S Moreover if M takes

conguration c with a state from Q leads with amplitude to conguration c with a state from Q

then M takes conguration c to conguration c with amplitude Therefore the time evolution

of M on space S is the comp osition of and its inverse around the conjugate transp ose of the time

evolution of M Since this conjugate transp ose must also b e unitary the second rule ab ove actually gives

a unitary transformation from the space S to the space S which satises Statement ab ove

Since M is clearly in normal form we complete the pro of by showing that M is wellformed To see

this just note that each of the four rules denes a unitary transformation to one of a set of four mutually

orthogonal subspaces of the spaces of sup erp ositions of M 2

The Synchronization Theorem will allow us to take an existing QTM and put it inside a lo op so that

the machine can b e run any sp ecied number of times

Building a reversible machine that lo ops indenitely is trivial However if we want to lo op some nite

number of times we need to carefully construct a reversible entrance and exit As with the Branching

Lemma ab ove the construction will pro ceed by building a reversible TM that accomplishes the desired

lo oping and then inserting the QTM for a particular state in this lo oping machine However there are

several diculties First in this construction as opp osed to the branching construction the reversible TM

leaves an intermediate computation written on its tap e while the QTM runs This means that inserting a

nonstationary QTM would destroy the prop er functioning of the reversible TM Second even if we insert a

stationary QTM the second and any subsequent time the QTM is run it may b e started in sup erp osition

on inputs of dierent lengths and hence may not halt There is therefore no general statement we are able

to make ab out the b ehavior of the machine once the insertion is carried out Instead we describ e here the

reversible lo oping TM constructed in App endix C on page and argue ab out sp ecic QTMs resulting

from this machine when they are constructed

Lemma Lo oping Lemma There is a stationary normal form reversible TM M and a constant

c with the fol lowing properties On input any positive integer k written in binary M runs for time

c

O k log k and halts with its tape unchanged Moreover M has a special state q such that on input k M

visits state q exactly k times each time with its tape head back in the start cell

Changing the basis of a QTMs computation

In this section we introduce a fundamentally quantum mechanical feature of quantum computation namely

changing the computational basis during the evolution of a QTM In particular we will nd it useful to

change to a new orthonormal basis for the transition function in the middle of the computation each

state in the new state set is a linear combination of states from the original machine

This will allow us to simulate a general QTM with one that is unidirectional It will also allow us to

prove that any partially dened quantum transition function which preserves length can b e extended to

give a wellformed QTM

We start by showing how to change the basis of the states of a QTM Then we give a set of conditions

for a quantum transition function that are necessary and sucient for a QTM to b e wellformed The last

of these conditions called separability will allow us to construct a basis of the states of a QTM which will

allow us to prove the Unidirection and Completion Lemmas b elow

The change of basis

If we take a wellformed QTM and choose a new orthonormal basis for the space of sup erp ositions of its

states then translating its transition function into this new basis will give another wellformed QTM that

evolves just as the rst under the change of basis Note that in this construction the new QTM has the

same time evolution op erator as the original machine However the states of the new machine dier from

those of the old This change of basis will allow us to prove Lemmas and b elow

Q

Lemma Given a QTM M Q and a set of vectors B from C which forms an orthonormal

Q

basis for C there is a QTM M B which evolves exactly as M under a change of basis from Q

to B

Q

Pro of Let M Q b e a QTM and B an orthonormal basis for C

Since B is an orthonormal basis this establishes a unitary transformation from the space of sup erp o

sitions of states in Q to the space of sup erp ositions of states in B Sp ecicall y for each p Q we have the

mapping

X

jpi hpjjv i jv i

v B

Similarly we have a unitary transformation from the space of sup erp ositions of congurations with states

in Q to the space of congurations with states in B In this second transformation a conguration with

state p is mapp ed to the sup erp osition of congurations where the corresp onding conguration with state

v app ears with amplitude hpjjv i

Let us see what the time evolution of M should lo ok like under this change of basis In M a conguration

in state p reading a evolves in a single time step to the sup erp osition of congurations corresp onding to

the sup erp osition p

X

p p q d j ijq ijdi

q d

With the change of basis the sup erp osition on the right hand side will instead b e

X X

hq jv i p q d j ijv ijdi

q

v d

Now since the state symbol pair jv ij i in M corresp onds to the sup erp osition

X

hv jpi jpij i

p

in M we should have in M

X X X

A

v j ijv ijdi hv jpi hq jv i p q d

p q

v d

Therefore M will b ehave exactly as M under the change of basis if we dene by saying that for

each v B

X X

hv jpi hq jv i p q d j ijv ijdi v

pq

v d

Q

Since the vectors in B are contained in C each amplitude of is contained in C

Finally note that the time evolution of M must preserve Euclidean length since it is exactly the time

evolution of the wellformed M under the change of basis 2

Lo cal conditions for QTM wellformedness

In our discussion of reversible TMs in App endix B we nd prop erties of a deterministic transition function

which are necessary and sucient for it to b e reversible Similarly our next theorem gives three prop erties

of a quantum transition function which together are necessary and sucient for it to b e wellformed The

rst prop erty insures that the time evolution op erator preserves length when applied to any particular

conguration Adding the second insures that the time evolution preserves the length of sup erp ositions

of congurations with their tap e head in the same cell The third prop erty which concerns restricted

up date sup erp ositions handles sup erp ositions of congurations with tap e heads in diering lo cations This

third prop erty will b e of critical use in the constructions of Lemmas and b elow

Denition We wil l also refer to the superposition of states

X

p q djq i

q Q

resulting from restricting p to those pieces writing symbol and moving in direction d as a direction

dgoing restricted sup erp osition denoted by p j d

Theorem A QTM M Q is wel lformed i the fol lowing conditions hold

Unit length

p Q k p k

Orthogonality

p p Q p p

Separability

p p Q p j L p j R

Pro of Let U b e the time evolution of a prop osed QTM M Q We know M is wellformed

i U exists and U U gives the identity or equivalently i the columns of U have unit length and are

mutually orthogonal Clearly the rst condition sp ecies exactly that each column has unit length In

general congurations whose tap es dier in a cell not under either of their heads or whose tap e heads

are not either in the same cell or exactly two cells apart cannot yield the same conguration in a single

step Therefore such pairs of columns are guaranteed to b e orthogonal and we need only consider pairs of

congurations for which this is not the case The second condition sp ecies the orthogonality of pairs of

columns for congurations that dier only in that one is in state p reading while the other is in state

p reading

Finally we must consider pairs of congurations with their tap e heads two cells apart Such pairs can

only interfere in a single step if they dier at most in their states and in the symbol written in these cells

The third condition sp ecies the orthogonality of pairs of columns for congurations which are identical

except that the second has its tap e head two cells to the left is in state p instead of p has a instead

of a in the cell under its tap e head and has a instead of a two cells to the left 2

Now consider again unidirectional QTMs those in which each state can b e entered while moving in

only one direction When we considered this prop erty for deterministic TMs it meant that when lo oking

at a deterministic transition function we could ignore the direction up date and think of as giving a

bijection from the current state and tap e symbol to the new symbol and state Here if is a unidirectional

quantum transition function then it certainly satises the separability condition since no leftgoing and

rightgoing restricted sup erp ositions have a state in common Moreover up date triples will always share

the same direction if they share the same state Therefore a unidirectional is wellformed i ignoring the

direction up date gives a unitary transformation from sup erp ositions of current state and tap e symbol

to sup erp ositions of new symbol and state

Unidirection and Completion Lemmas

The separability condition of Theorem allows us to simulate any QTM with a unidirectional QTM by

applying a change of basis The same change of basis will also allow us to complete any partially sp ecied

quantum transition function which preserves length

It is straightforward to simulate a deterministic TM with one which is unidirectional Simply split each

state q into two states q and q b oth of which are given the same transitions that q had and then edit

r l

the transition function so that transitions moving right into q enter q and transitions moving left into q

r

enter q The resulting machine is clearly not reversible since the transition function op erates the same on

l

each pair of states q q

r l

To simplify the unidirection construction we rst show how to interleave a series of quantum transition

functions

Lemma Given k state sets Q Q Q Q and k transition functions each mapping from

k k

one state set to the next

Q fLRg

i+1

Q C

i i

S

Q i which alternates such that each preserves length there is a wel lformed QTM M with state set

i i

i

stepping according to each of the k transition functions

Pro of Supp ose we have k state sets transition functions as stated ab ove Then we let M b e the QTM

S

with the same alphab et with state set given by the union of the individual state sets Q i and with

i

i

transition function according to the

i

X

p i p q dj ijq i ijdi

i

q d

Clearly the machine M alternates stepping according to It is also easy to see that the time

k

evolution of M preserves length If ji is a sup erp osition of congurations with squared length in the

i

subspace with congurations with states from Q then maps to a sup erp osition with squared length

i

in the subspace with congurations with states from Q 2

i i

Lemma Unidirection Lemma Any QTM M is simulated with slowdown by a factor of by

a unidirectional QTM M Furthermore if M is wel lbehaved and in normal form then so is M

Pro of The key idea is that the separability condition of a wellformed QTM allows a change of basis to

a state set in which each state can b e entered from only one direction

The separability condition says that

p p Q

p j L p j R

Q

This means that we can split C into mutually orthogonal subspaces C and C such that spanC C

L R L R

Q

C and

p Q

p j d C

d

Now as shown in Lemma ab ove under a change of basis from state set Q to state set B the new

transition function is dened by

X

hv jpihq jv i p q d v v d

pq

So choose orthonormal bases B and B for the spaces C and C and let M B B b e

L R L R L R

the QTM constructed according to Lemma which evolves exactly as M under a change of basis from

state set Q to state set B B B Then any state in M can b e entered in only one direction To see

L R

P

this rst note that since p j d B and v hv jq ijq i the separability condition implies that for

d

q

v B

d

X

p q dhv jq i

q

Therefore for any v v B B

d

X

v v d hv jpihq jv i p q d

pq

X X

hv jpi hq jv i p q d

p q

Therefore any state in B can b e entered while traveling in only one direction

Unfortunately this new QTM M might not b e able to simulate M The problem is that the start

state and nal state of M might corresp ond under the change of basis isomorphism to sup erp ositions of

states in M meaning that we would b e unable to dene the necessary start and nal states for M To x

this problem we use ve time steps to simulate each step of M and interleave the ve transition functions

using Lemma on page pagerefinterleavinglemma

Step right leaving the tap e and state unchanged

p j ijpijRi

Change basis from Q to B while stepping left

X

hpjbij ijbijLi p

bB

M carries out a step of the computation of M So is just the quantum transition function

from QTM M constructed ab ove

Change basis back from B to Q while stepping left

X

b hbjpij ijpijLi

pQ

Step right leaving the tap e and state unchanged

p j ijpijRi

If we construct QTM M with state set Q f g B f g using Lemma on page and

let M have start and nal states q and q then M simulates M with slowdown by a factor of

f

Next we must show that each of the ve transition functions ob eys the wellformedness conditions and

hence according to Lemma that the interleaved machine is wellformed

The transition function certainly ob eys the wellformedness conditions since M is a well

formed QTM Also and ob ey the three wellformedness conditions since they are deterministic and

reversible Finally the transition functions and satisfy the unit length and orthogonality conditions

since they implement a change of basis and they ob ey the separability condition since they only move in

one direction

Finally we must show that if M is wellbehaved and in normal form then we can make M wellbehaved

and in normal form

So supp ose M is wellbehaved and in normal form Then there is a T such that at time T the

sup erp osition includes only congurations in state q with the tap e head back in the start cell and at any

f

time less than T the sup erp osition contains no conguration in state q But this means that when M

f

is run on input x the sup erp osition at time T includes only congurations in state q with the tap e

f

head back in the start cell and the sup erp osition at any time less than T contains no conguration in

state q Therefore M is also wellbehaved

f

Then for any input x there is a T such that M enters a series of T sup erp ositions of congurations

all with states in Q fq q g and then enters a sup erp osition of congurations all in state q with the

f f

tap e head back in the start cell Therefore on input x M enters a series of T sup erp ositions of

congurations all with states in Q fq q g and then enters a sup erp osition of congurations all

f

in state q with the tap e head back in the start cell Therefore M is wellbehaved Also swapping the

f

outgoing transitions of q and q which puts M in normal form will not change the computation

f

of M on any input x 2

When we construct a QTM we will often only b e concerned with a subset of its transitions Luckily

any partially dened transition function that preserves length can b e extended to give a wellformed QTM

Denition A QTM M whose quantum transition function is only dened for a subset S Q

is called a partial QTM If the dened entries of satisfy the three conditions of Theorem on page

then M is called a wellformed partial QTM

Lemma Completion Lemma Suppose M is a wel lformed partial QTM with quantum transi

tion function Then there is a wel lformed QTM M with the same state set and alphabet whose quantum

transition function agrees with wherever the latter is dened

Pro of We noted ab ove that a unidirectional quantum transition function is wellformed i ignoring the

direction up date it gives a unitary transformation from sup erp ositions of current state and tap e symbol

to sup erp ositions of new symbol and state So if our partial QTM is unidirectional then we can easily ll

in the undened entries of by extending the set of up date sup erp ositions of to an orthonormal basis

for the space of sup erp ositions of new symbol and state

For a general we can use the technique of Lemma on page to change the basis of away from

Q so that each state can b e entered while moving in only one direction extend the transition function

and then rotate back to the basis Q

We can formalize this as follows

Let M Q b e a wellformed partial QTM with dened on the subset S Q Denote by

S the complement of S in Q

Q

As in the pro of of the Unidirection Lemma ab ove the separability condition allows us to partition C

Q

into mutually orthogonal subspaces C and C such that spanC C C and

L R L R

p S

p j d C

d

Then we choose orthonormal bases B and B for C and C and consider the unitary transformation

L R L R

from sup erp ositions of congurations with states in Q to the space of congurations with states in B

B B where any conguration with state p is mapp ed to the sup erp osition of congurations where the

L R

corresp onding conguration with state v app ears with amplitude hpjv i

If we call the partial function followed by this unitary change of basis then we have

X X

hq jv i p q d j ijv ijdi p

q

v d

Since preserves length and is followed by a unitary transformation also preserves length

But now can enter any state in B while moving in only one direction To see this rst note that

P

since p d B and v hv jq ijq i the separability condition implies that for v B

d

q

d

X

p q dhv jq i

q

Therefore for any p v S B

d

X

hq jv i p q p v d

q

Therefore any state in B can b e entered while traveling in only one direction

Then since the direction is implied by the new state we can think of as mapping the current state

and symbol to a sup erp osition of new symbol and state Since preserves length the set S is a set of

orthonormal vectors and we can expand this set to an orthonormal basis of the space of sup erp ositions

of new symbol and state Adding the appropriate direction up dates and assigning these new vectors arbi

trarily to S we have a completely dened that preserves length Therefore assigning S as S

followed by the inverse of the basis transformation gives a completion for that preserves length 2

An ecient QTM implementing any given unitary transformation

Supp ose that the tap e head of a QTM is conned to a region consisting of k contiguous tap e cells the tap e

is blank outside this region Then the time evolution of the QTM can b e describ ed by a d dimensional

k

unitary transformation where d k cardQcard In this section we show conversely that there is a

QTM that given any d dimensional unitary transformation as input carries out that transformation on a

region of its tap e To make this claim precise we must say how the d dimensional unitary transformation

is sp ecied We assume that an approximation to the unitary transformation is sp ecied by a d d complex

matrix whose entries are approximations to the entries of the actual unitary matrix corresp onding to the

desired transformation We show in Theorem on page that there is a QTM which on input and

p

a d dimensional transformation which is within distance of a unitary transformation carries out a

d

d

transformation which is an approximation to the desired unitary transformation Moreover the running

time of the QTM is b ounded by a p olynomial in d and

In a single step a QTM can map a single conguration into a sup erp osition of a b ounded number of

congurations Therefore in order to carry out an approximation to an arbitrary unitary transformation

on a QTM we show how to approximate it by a pro duct of simple unitary transformations each such

simple transformation acts as the identity in all but two dimensions We then show that there is a particular

simple unitary transformation such that any given simple transformation can b e expressed as a pro duct of

p ermutation matrices and p owers of this xed simple matrix Finally we put it all together and show how

to design a single QTM that carries out an arbitrary unitary transformation this QTM is deterministic

except for a single kind of quantum coinip

The decomp osition of an arbitrary unitary transformation into a pro duct of simple unitary transforma

tions is similar to work carried out by Deutsch Deutschs work although phrased in terms of quantum

computation networks can b e viewed as showing that a d dimensional unitary transformation can b e de

comp osed into a pro duct of transformations where each applies a particular unitary transformation to

dimensions and acts as the identity elsewhere We must consider here several issues of eciency not ad

dressed by Deutsch First we are concerned that the decomp osition contain a number of transformations

which is p olynomial in the dimension of the unitary transformation and in the desired accuracy Second

we desire that the decomp osition can itself b e eciently computed given the desired unitary transforma

tion as input For more recent work on the ecient simulation of a unitary transformation by a quantum

computation network see and the references therein

Measuring errors in approximated transformations

In this section we will deal with op erators linear transformations on nite dimensional Hilb ert spaces

It is often convenient to x an orthonormal basis for the Hilb ert space and describ e the op erator by a

nite matrix with resp ect to the chosen basis Let e e b e an orthonormal basis for Hilb ert space

d

d th

H C Then we can represent an op erator U on H by a d d complex matrix M whose i j entry

th T

m is U e e The i row of the matrix M is given by e M and we will denote it by M We denote

ij j i i i

th

by M the conjugate transp ose of M The j column of M is given by M e U the adjoint of U is

i i j

represented by the d d matrix M M is unitary i MM M M I It follows that if M is unitary

then the rows and columns of M are orthonormal

Recall that for a b ounded linear op erator U on a Hilb ert space H the norm of U is dened as

jU j sup jU xj

kxk

If we represent U by the matrix M then we can dene the norm of the matrix M to b e same as the norm

of U Thus since were working in a nite dimensional space

kM k max kM v k

kv k

Fact If U is unitary then kU k kU k

Pro of x H kU xk U x U x x U U x x x kxk Therefore kU k and similar

reasoning shows kU k 2

We will nd it useful to keep track of how far our approximations are from b eing unitary We will use

the following simple measure of a transformations distance from b eing unitary

Denition A bounded linear operator U is called close to unitary if there is a unitary operator U

such that kU U k If we represent U by the matrix M then we can equivalently say that M is close

to unitary if there is a unitary matrix M such that kM M k

Notice that app ealing to Statement in x if U is close to unitary then kU k However

the converse is not true For example the linear transformation has norm but is away from

unitary

Next we show that if M is close to unitary then the rows of M are close to unit length and will b e

close to orthogonal

Lemma If a d dimensional complex matrix M is close to unitary then

kM k

i

i j kM M k

i j

Pro of Let M b e the unitary matrix such that kM M k Let N M M Then we know that for

each i kM k and kN k

i i

So for any i we have M N M Therefore kM k

i i i i

M Therefore M N M N Next since M is unitary it follows that for i j M

i i i

j j j

Expanding this as a sum of four terms we get

M M M N N M N N

i i i i

j j j j

Since kM k and kN k the Schwarz inequality tells us that kM N k kN M k

i i

j j

and kN N k Using the triangle inequality we conclude that kM M k Therefore

i i

j j

kM M k 2

i j

We will also use the following standard fact that a matrix with small entries must have small norm

Lemma If M is a ddimensional square complex matrix such that jm j for al l i j then

ij

kM k d

Pro of If each entry of M has magnitude at most then clearly each row M of M must have norm at

i

p

most d So if v is a ddimensional column vector with jv j we must have

X X

kM v k kM v k d d

i

i i

where the inequality follows from the Scwarz Inequality Therefore kM k d 2

Decomp osing a unitary transformation

We now describ e a class of exceedingly simple unitary transformations which we will b e able to carry out

using a single QTM These neartrivial transformations either apply a phase shift in one dimension or

apply a rotation b etween two dimensions while acting as the identity otherwise

Denition A d d unitary matrix M is neartrivial if it satises one of the fol lowing two conditions

i

M is the identity except that one of its diagonal entries is e for some ie j m

jj

i

e k j m and k l m

k k k l

M is the identity except that the submatrix in one pair of distinct dimensions j and k is the rotation by

cos sin

some angle So as a transformation M is neartrivial if there exists

sin cos

and i j such that M e cos e sin e M e sin e cos e and k i j M e e

i i j j i j k k

We call a transformation which satises the former a neartrivial phase shift and we call a transformation

which satises the latter a neartrivial rotation

i

We will write a neartrivial matrix M in the following way If M is a phase shift of e in dimension

j then we will write down j j and if M is a rotation of angle b etween dimensions j and k we will

write down j k This convention guarantees that the matrix that we are sp ecifying is a neartrivial

matrix and therefore a unitary matrix even if for precision reasons we write down an approximation to

the matrix that we really wish to sp ecify This feature will substantially simplify our error analyses

Before we show how to use neartrivial transformations to carry out an arbitrary unitary transformation

we rst show how to use them to map any particular vector to a desired target direction

d

Lemma There is a deterministic algorithm which on input a vector v C and a bound

computes near trivial matrices U U such that

d

kU U v kv ke k

d

where e is the unit vector in the rst coordinate direction The running time of the algorithm is bounded

by a polynomial in d log and the length of the input

d

Pro of First we use d phase shifts to map v into the space IR We therefore want to apply to each

v

i

dimension i with v the phase shift So we let P b e the neartrivial matrix which applies to

i i

kv k

i

Rev

i

dimension i the phase shift by angle where if v and otherwise cos

i i i i

kv k

i

Rev

i

th

dep ending whether I mv is p ositive or negative Then P P v is the vector with i or cos

i d

kv k

i

co ordinate kv k

i

Next we use d rotations to move all of the weight of the vector into dimension So we let R b e

i

the neartrivial matrix which applies to dimensions i and i the rotation by angle where

i

kv k

i

q

cos

i

P

d

kv k

j

j i

if the sum in the denominator is not and otherwise Then

i

R R P P v kv ke

d d

Now instead of pro ducing these values exactly we can in time p olynomial in d and log and

i i

the length of the input compute values and which are within of the desired values Call

i i

dkv k

P and R the neartrivial matrices corresp onding to P and R but using these approximations Then

i i

i i

since the distance b etween p oints at angle and on the unit circle in the real plane is at most j j

kR R k

i

i

Thinking of the same inequality on the unit circle in the complex plane we have

kP P k

i

i

Finally since each matrix P P R R is unitary Fact on page gives us

i i

i i

kR R P P R R P P k d

d d

d d

and therefore

kR R P P v kv ke k d kv k

d d

2

We now show how the ability to map a particular vector to a desired target direction allows us to

approximate an arbitrary unitary transformation

Theorem There is a deterministic algorithm running in time polynomial in d and log and the

length of the input which when given as input U where and U is a d d complex matrix which is

p

close to unitary computes ddimensional neartrivial matrices U U with n polynomial in d

n

d

d

such that kU U U k

n

Pro of First we introduce notation to simplify the pro of Let U b e a d d complex matrix Then we say

U is k simple if its rst k rows and columns are the same as those of the ddimensional identity Notice

that the pro duct of two d d k simple matrices is also k simple

If U were dsimple we would have U I and the desired computation would b e trivial In general

the U which our algorithm must approximate will not even b e simple So our algorithm will pro ceed

th

through d phases such that during the i phase the remaining problem is reduced to approximating a

matrix which is i simple

Supp ose we start to approximate a k simple U with a series of neartrivial matrices with the pro duct

V Then to approximate U we would still need to pro duce a series of neartrivial matrices whose pro duct

W satises W UV To reduce the problem we must therefore compute neartrivial matrices whose

pro duct V is such that UV is close to b eing k simple We can accomplish this by using the algorithm

of Lemma ab ove

So let U b e given which is k simple and is close to unitary and let Z b e the lower right d k d k

T

submatrix of Z We invoke the pro cedure of Lemma on inputs Z the vector corresp onding to the

rst row of Z and The output is a sequence of d k dimensional near trivial matrices V V

dk

T

such that their pro duct V V V has the prop erty that kVZ kZ ke k

dk

Now supp ose that we extend V and the V back to d dimensional k simple matrices and we let

i

W UV Then clearly V is unitary and V and W are k simple In fact since V is unitary and U is

close to unitary W is also close to unitary Moreover W is close to b eing k simple as desired We

st T st

will show b elow that the k row of W satises kW e k and that the entries of the k

k

k

column of W satisfy kw k for j k

jk

So let X b e the d d k simple matrix such that

x x for j x for j x w for j l l

j j jl jl

It follows from our b ounds on the norm of the rst row of W and on the entries of the rst column of W

p p

that kW X k d Since W is close to unitary we can then conclude that X is d close

to unitary

Unfortunately we cannot compute the entries of W UV exactly Instead app ealing to Lemma

on page we compute them to within d to obtain a matrix W such that kW W k Lets use

the entries of W to dene matrix X analogous to X Using the triangle inequality it is easy to see

p p

that kW X k X is d and d close to unitary If we are willing to incur an error of

p

d then we are left with the problem of approximating the k simple X by a pro duct kW X k

of neartrivial matrices Therefore we have reduced the problem of approximating the k simple matrix

U by neartrivial matrices to the problem of approximating the k simple matrix X by neartrivial

matrices while incurring two sources of error

p

An error of kW X k d since we are approximating X instead of W

p

d close to unitary The new matrix X is only

p

Let d Clearly is an upp erb ound on b oth the sources of error cited ab ove Therefore

p p

P

d

j d

d d The last inequality follows since the total error in the approximation is just

j

p

d and therefore the sum can b e b ounded by a geometric series Therefore the total error in the

p

approximation is b ounded by since by assumption U is close to unitary for

d

d

It is easy to see that this algorithm runs in time p olynomial in d and log Our algorithm consists of

d iterations of rst calling the algorithm from Lemma on page to compute V and then computing

p

d

d

the matrix X Since the each iteration takes time p olynomial in d and log these d calls take a total

time p olynomial in d and log

st T

Finally we show as required that the k row of W satises kW e k and that the

k

k

st

entries of the k column of W satisfy kw k for j k To see this rst recall that

jk

T

the lower dimension V satises kVZ kZ ke k where Z is the rst row of the lower right k k

T

kU ke k Then since submatrix of U Therefore the higher dimension V satises kVU

k k

k

st T

e k Therefore the k row of W satises kU k it follows that kVU

k k

k

T

kW e k

k

k

st

Next we will show that this implies that the entries of the k column of W satisfy kw k

jk

for j k To see this rst notice that since V is unitary and U is delta close to unitary W is also

W W close to unitary This means that by Statement of Lemma on page Now

k

j

T

k This implies that jw j Also let us denote by let us use the condition kW e

k k k

k

W the d dimensional row vector arrived at by dropping w from W Then the condition that W

j jk j k

T

also implies that kW k Also the fact that W is close to unitary implies that is close to e

k

k

kW k Putting all this together we have W W w w W W

j k k k k j

j

jk

w w W W Therefore w w W W

k k k j k k k j

jk jk

2

Finally since we may assume that we have jw j Therefore jw j

jk jk

2

Carrying out neartrivial transformations

In this section we show how to construct a single QTM that can carry out at least approximately any

sp ecied neartrivial transformation Since a neartrivial transformation can apply an arbitrary rotation

either b etween two dimensions or in the phase of a single dimension we must rst show how a xed

rotation can b e used to eciently approximate an arbitrary rotation Note that a single copy of this xed

rotation gives the only nonclassical amplitudes those other than in the transition function of the

universal QTM constructed b elow See Adleman et al and Solovay and Yao for the constructions

of universal QTMs whose amplitudes are restricted to a small set of rationals

P

i

Lemma Let R

i

Then there is a deterministic algorithm taking time polynomial in log and the length of the input

which on input with and produces integer output k bounded by a polynomial in

such that

jk R j mod

Pro of First we describ e a pro cedure for computing such a k

Start by calculating n a p ower of such that Next approximate as a fraction with

n1

n n

denominator In other words nd an integer m such that

m

n n

n

Then we can let k m b ecause

X

i

n n

m Rmo d m mo d

i

X

i

n

A

m mo d

ilog n

X

i m

n

A

mo d m

n

ilog n

and since

X

i

n nn

m m

ilog n

nn

n

we have

m m

n n

jm R j mo d m R mo d

n n

n n

n

2

At this p oint it should b e clear that a single QTM can carry out any sequence of neartrivial trans

formations to any desired accuracy We formalize this notion b elow by showing that there is a QTM

that accepts as input the descriptions of a sequence of neartrivial transformations and an error b ound

and applies an approximation of the pro duct of these transformations on any given sup erp osition The

formalization is quite tedious and the reader is encouraged to skip the rest of the subsection if the ab ove

statement is convincing

Below we give a formal denition of what it means for a QTM to carry out a transformation

Denition Let be the alphabet of the rst track of QTM M Let V be the complex vector

space of superpositions of k length strings over Let U be a linear transformation on V and let x

U

be a string that encodes U perhaps approximately We say that x causes M to carry out the k cell

U

transformation U with accuracy in time T if for every ji V on input jijx iji M halts in exactly T

U

steps with its tape head back in the start cell and with nal superposition U jijxi where U is a unitary

transformation on V such that kU U k Moreover for a family A of transformations we say that M

carries out these transformations in polynomial time if T is bounded by a polynomial in and the length

of the input

In the case that A contains transformations that are not unitary we say that M carries out the set of

transformations A with closeness factor c if for any and any U A which is cclose to unitary

there is a unitary transformation U with kU U k such that jx iji causes M to carry out the

U

transformation U in time which is polynomial in and the length of its input

Recall that a neartrivial transformation written as x y calls for a rotation b etween dimensions x

i

and y of angle if x y and a phase shift of e to dimension x otherwise So we want to build a

stationary normal form QTM that takes as input w x y and transforms w according to the near

trivial transformation describ ed by x y with accuracy We also need this QTMs running time to

dep end only on the length of w but not its value If this is the case then the machine will also halt on an

initial sup erp osition of the form jijx y iji where ji is a sup erp osition of equallength strings w

Lemma There is a stationary normal form QTM M with rst track alphabet f g that carries

out the set of neartrivial transformations on its rst track in polynomial time

Pro of Using the enco ding x y for neartrivial transformations describ ed ab ove in x we will show

how to construct QTMs M and M with rst track alphab et f g such that M carries out the set of

neartrivial rotations on its rst track in p olynomial time and M carries out the set of neartrivial phase

shifts on its rst track in p olynomial time Using the Branching Lemma page pagerefbranchinglemma

on these two machines we can construct a QTM that b ehaves correctly provided there is an extra track

containing a when x y and we have a phase shift to p erform and containing a when x y and we

have a rotation to p erform We can then construct the desired QTM M by dovetailing b efore and after

with machines that compute and erase this extra bit based on x y The Synchronization Theorem lets us

construct two such stationary normal form QTMs whose running times dep end only on the lengths of x

and y Therefore this additional computation will not disturb the synchronization of the computation

Next we show how to construct the QTM M to carry out neartrivial rotations

It is easy to construct a QTM which on input b applies a rotation by angle b etween ji and ji while

leaving b alone if b But Lemma ab ove tells us that we can achieve any rotation by applying

the single rotation R at most a p olynomial number of times Therefore the following ve step pro cess will

allow us to apply a neartrivial rotation We must b e careful that when we apply the rotation the two

computational paths with b f g dier only in b since otherwise they will not interfere

Calculate k such that k Rmo d

Transform w x y into b x y z where b if w x b if w y and w x and b otherwise

and where z w if b and z is the empty string otherwise

Run the rotation applying machine k times on the rst bit of z

Reverse Step transforming x y w with w x y into w x y transforming x y into x x y and

transforming x y with x y into y x y

Reverse Step erasing k

We build the desired QTM M by constructing a QTM for each of these ve steps and then dovetailing

them together

First notice that the length of the desired output of Steps and can b e computed just from the

length of the input Therefore using Lemmas from page and the Synchronization Theorem from

page we can build p olynomial time stationary normal form QTMs for Steps and which run in

time which dep ends on the lengths of w x y but not their particular values

To complete the construction we must build a machine for the rotation with these same prop erties

The stationary normal form QTM R with alphab et f g state set fq q q g and transition function

f

dened by

q jijq ijLi cos Rjijq ijLi sin Rjijq ijLi

sin Rjijq ijLi cos Rjijq ijLi

q jijq ijRi

f

jijq ijRi jijq ijRi jijq ijRi q

f

runs for constant time and applies rotation R b etween start cell contents ji and ji while leaving other

inputs unchanged Inserting R for the sp ecial state in the reversible TM from the Lo oping Lemma we

can construct a normal form QTM which applies rotation k R b etween inputs j k i and j k i while leaving

input jw k i unchanged Since the machine we lo op on is stationary and takes constant time regardless

of its input the resulting lo oping machine is stationary and takes time dep ending only on k

Finally with appropriate use of Lemmas on page and on page we can dovetail these

ve stationary normal form QTMs to achieve a stationary normal form QTM M that implements the

desired computation Since the phase application machine run in time which is indep endent of w x and

y and the other four run in time which dep ends only on the length of w x and y the running time of M

dep ends on the length of w x and y but not on their particular values Therefore it halts with the prop er

output not only if run on an input with a single string w but also if run on an initial sup erp osition with

dierent strings w but with the same neartrivial transformation and

The QTM M to carry out neartrivial phase shifts is the same as M except that we replace the

transition function of the simple QTM which applies a phase shift rotation by angle R as follows giving a

iR

stationary QTM which applies phase shift e if b is a and phase shift otherwise

iR

q jijq ijLi e jijq ijLi jijq ijLi

jijq ijRi q

f

q jijq ijRi jijq ijRi jijq ijRi

f

The pro of that this gives the desired M is identical to the pro of for M and is omitted 2

Carrying out a unitary transformation on a QTM

Now that we can approximate a unitary transformation by a pro duct of neartrivial transformations and

we have a QTM to carry out the latter we can build a QTM to apply an approximation of a given unitary

transformation

Theorem Unitary Transformation Theorem There is a stationary normal form QTM M

with rst track alphabet f g that carries out the set of al l transformations on its rst track in poly

p

for transformations of dimension d nomial time with required closeness factor

d

d

k

p

close to unitary we Pro of Given an and a transformation U of dimension d which is

d

d

can carry out U to within on the rst k cells of the rst track using the following steps

Calculate and write on clean tracks and a list of neartrivial U U such that kU U U k

n n

n

k

and such that n is p olynomial in

Apply the list of transformations U U each to within

n

n

Erase U U and

n

n

We can construct a QTM to accomplish these steps as follows First using Lemma on page

and the Synchronization Theorem on page we can build p olynomial time stationary normal form

QTMs for Steps and which run in time which dep ends only on U and Finally we can build a

k

stationary normal form QTM to accomplish Step in time which is p olynomial in and as follows

We have a stationary normal form QTM constructed in Lemma on page to apply any sp ecied

neartrivial transformation to within a given b ound We dovetail this with a machine constructed using

the Synchronization Theorem on page that rotates U around to the end of the list of transformations

Since the resulting QTM is stationary and takes time which dep ends only on and the U we can insert

i

it for the sp ecial state in the machine of the Lo oping Lemma to give the desired QTM for Step

With appropriate use of Lemmas on page and on page dovetailing the QTMs for

these three steps gives the desired M Since the running times of the three QTMs are indep endent of the

contents of the rst track so is the running time of M Finally notice that when we run M we apply to

the rst k cells of the rst track we apply a unitary transformation U with

kU U k kU U U k kU U U k n

n n

n

as desired 2

Constructing a universal QTM

A universal QTM must inevitably decomp ose one step of the simulated machine using many simple steps

A step of the simulated QTM is a mapping from the computational basis to a new orthonormal basis A

single step of the universal QTM can only map some of the computational basis vectors to their desired

destinations In general this partial transformation will not b e unitary b ecause the destination vectors will

not b e orthogonal to the computational bases which have not yet b een op erated on The key construction

that enables us to achieve a unitary decomp osition is the Unidirection Lemma Applying this lemma we

get a QTM whose mapping of the computational basis has the following prop erty there is a decomp osition

of the space into subspaces of constant dimension such that each subspace gets mapp ed onto another

More sp ecically we saw in the previous section that we can construct a QTM that carries out to a

close approximation any sp ecied unitary transformation On the other hand we have also noted that

the transition function of a unidirectional QTM sp ecies a unitary transformation from sup erp ositions of

current state and tap e symbol to sup erp ositions of new symbol and state This means a unidirectional

QTM can b e simulated by rep eatedly applying this xeddimensional unitary transformation followed by

the reversible deterministic transformation that moves the simulated tap e head according to the new state

So our universal machine will rst convert its input to a unidirectional QTM using the construction of the

Unidirection Lemma and then simulate this new QTM by rep eatedly applying this unitary transformation

and reversible deterministic transformation

Since we wish to construct a single machine that can simulate every QTM we must build it in such

a way that every QTM can b e provided as input Much of the denition of a QTM is easily enco ded

We can write down the size of the alphab et with the rst symbol assumed to b e the blank symbol

and we can write down the size of the state set Q with the rst state assumed to b e the start state To

complete the sp ecication we need to describ e the transition function by giving the card cardQ

amplitudes of the form i i i i d If we had restricted the denition of a QTM to include only

machines with rational transition amplitudes then we could write down each amplitude explicitly as the

ratio of two integers However we have instead restricted the denition of a QTM to include only those

machines with amplitudes in C which means that for each amplitude there is a deterministic algorithm

n

which computes the amplitudes real and imaginary parts to within in time p olynomial in n We will

therefore sp ecify by giving a deterministic algorithm that computes each transition amplitude to within

n

in time p olynomial in n

Since the universal QTM we will construct returns its tap e head to the start cell after simulating each

step of the desired machine it will incur a slowdown which is at least linear in T We conjecture that

with more care a universal QTM can b e constructed whose slowdown is only p olylogarithmic in T

Theorem There is a normal form QTM M such that for any wel lformed QTM M any and

any T M can simulate M with accuracy for T steps with slowdown polynomial in T and

Pro of As describ ed ab ove our approach will b e rst to use the construction of the Unidirection Lemma to

build a unidirectional QTM M which simulates M with slowdown by a factor of and then to simulate M

We will rst describ e the simulation of M and then return to describ e the easily computable prepro cessing

that needs to b e carried out

So supp ose M Q is a unidirectional QTM that we wish to simulate on our universal QTM

We start by reviewing the standard technique of representing the conguration of a target TM on the

tap e of a universal TM We will use one track of the tap e of our universal QTM to simulate the current

conguration of M Since the alphab et and state set of M could have any xed size we will use a series of

log cardQ cells of our tap e referred to as a sup ercell to simulate each cell of M Each sup ercell

holds a pair of integers p where card represents the contents of the corresp onding cell of M

and p cardQ represents the state of M if its tap e head is scanning the corresp onding cell and p

otherwise Since the tap e head of M can only move distance T away from the start cell in time T we only

need sup ercells for the T cells at the center of M s tap e and we place markers to denote the ends

Now we know that if we ignore the up date direction then gives a unitary transformation U of

dimension d cardQ from sup erp ositions of current state and tap e symbol to sup erp ositions of

new state and symbol So we can prop erly up date the sup erp osition on the simulation tracks if we rst

apply U to the current state and symbol of M and then move the new state sp ecication left or right one

sup ercell according to the direction in which that state of M can b e entered

We will therefore build a QTM STEP that carries out one step of the simulation as follows In addition

to the simulation track this machine will is provided as input a desired accuracy a sp ecication of U

cardQ

p

which is guaranteed to b e close to the unitary and a string s f g which gives the

d

d

direction in which each state of M can b e entered The machine STEP op erates as follows

Transfer the current state and symbol p to empty work space near the start cell leaving a sp ecial

marker in their place

Apply U to p to within transforming p into a sup erp osition of new state and symbol q

Reverse Step transferring q back to the marked empty sup ercell and emptying the work space

th

Transfer the state sp ecication q one sup ercell to the right or left dep ending whether the q bit of

s is a or

Using the Synchronization Theorem on page we can construct stationary normal form QTMs for

Steps and which take time which is p olynomial in T and for a xed M dep ends only on T Step

can b e carried out in time p olynomial in card cardQ and with the unitary transformation applying

QTM constructed in the Unitary Transformation Theorem With appropriate use of Lemmas on

page and on page dovetailing these four normal form QTMs gives us the desired normal form

QTM STEP

Since each of the four QTMs takes time which dep ends for a xed M only on T and so do es STEP

Therefore if we insert STEP for the sp ecial state in the reversible TM constructed in the Lo oping Lemma

and provide additional input T the resulting QTM STEP will halt after time p olynomial in T and

after simulating T steps of M with accuracy T

Finally we construct the desired universal QTM M by dovetailing STEP after a QTM which carries

out the necessary prepro cessing In general the universal machine must simulate QTMs which are not

unidirectional So the prepro cessing for desired QTM M desired input x and desired simulation accuracy

consists of rst carrying out the construction of Unidirection Lemma to build a unidirectional QTM M

which simulates M with slowdown by a factor of The following inputs are then computed for STEP

The prop er T sup ercell representation of the initial conguration of M with input x

p

The ddimensional transformation U for M with each entry written to accuracy

d+2

T d

The string of directions s for M

The desired number of simulation steps T and the desired accuracy T

It can b e veried that each of these inputs to M can b e computed in deterministic time which is

p olynomial in T and the length of the input If the transformation U is computed to the sp ecied

p

accuracy the transformation actually provided to STEP will b e within of the desired unitary

d

T d

close to unitary as required for the op eration of STEP So each time STEP U and so will b e

p

d

T d

applies runs with accuracy T it will have applied a unitary transformation which is within T

of U Therefore after T runs of STEP we will have applied a unitary transformation which is within

of the T step transformation of M This means that observing the simulation track of M after

it has completed will give a sample from a distribution which is within total variation distance of the

distribution sampled from by observing M on input x at time T 2

The computational p ower of QTMs

In this section we explore the computational p ower of QTMs from a complexity theoretic p oint of view It

is natural to dene quantum analogues of classical complexity classes In classical complexity theory

BPP is regarded as the class of all languages that are eciently computable on a classical computer

The quantum analog of BPP B QP b oundederror quantum p olynomial time should similarly b e

regarded as the class of all languages that are eciently computable on a QTM

Accepting languages with QTMs

Denition Let M be a stationary normal form multitrack QTM M whose last track has alphabet

f g If we run M with string x on the rst track and the empty string elsewhere wait until M halts

and then observe the last track of the start cell we wil l see a with some probability p We wil l say that

M accepts x with probability p and rejects x with probability p

Consider any language L

We say that QTM M exactly accepts the L if M accepts every string x L with probability and

rejects every string x L with probability

We dene the class EQP exact or errorfree quantum p olynomial time as the set of languages which

are exactly accepted by some polynomial time QTM More generally we dene the class EQTime T n

3

Note that the transition function of M is again sp ecied with a deterministic algorithm which dep ends on the algorithm

for the transition function of M

4

This can b e accomplished by p erforming a measurement to check whether the machine is in the nal state q Making

f

this partial measurement do es not have any other eect on the computation of the QTM

as the set of languages which are exactly accepted by some QTM whose running time on any input of length

n is bounded by T n

A QTM accepts the language L with probability p if M accepts with probability at least

p every string x L and rejects with probability at least p every string x L We dene

the class BQP b oundederror quantum p olynomial time as the set of languages which are accepted with

probability by some polynomial time QTM More generally we dene the class BQTime T n as the

set of languages which are accepted with probability by some QTM whose running time on any input

of length n is bounded by T n

The limitation of considering only stationary normal form QTMs in these denitions is easily seen not

to limit the computational p ower by app ealing to the stationary normal form universal QTM constructed

in Theorem on page

Upp er and lower b ounds on the p ower of QTMs

Clearly EQP BQP Since reversible TMs are a sp ecial case of QTMs Bennetts results imply that

P EQP and BPP BQP We include these two simple pro ofs for completeness

Theorem P EQP

Pro of Let L b e a language in P Then there is some p olynomial time deterministic algorithm that

on input x pro duces output if x L and otherwise App ealing to the Synchronization Theorem on

page pagerefdetsynchronized there is therefore a stationary normal form QTM running in p olynomial

time which on input x pro duces output x if x L and x otherwise This is an EQP machine accepting

L 2

Theorem BPP BQP

Pro of Let L b e a language in BPP Then there must b e a p olynomial pn and a p olynomial time

deterministic TM M with output which satisfy the following For any string x of length n if we call

pn pn

S the set of bits computed by M on the inputs x y with y f g then the prop ortion of s in

x

S is at least when x L and at most otherwise We can use a QTM to decide whether a string

x

x in the language L by rst breaking into a sup erp osition split equally among all jxijy i and then running

this deterministic algorithm

pn

First we dovetail a stationary normal form QTM which takes input x to output x with a

stationary normal form QTM constructed as in Theorem b elow which applies a Fourier transform to

the contents of its second track This gives us a stationary normal form QTM which on input x pro duces

P

the sup erp osition jxijy i Dovetailing this with a synchronized normal form version of

p(n)

p(n)2

y fg

M built according to the Synchronization Theorem on page pagerefdetsynchronized gives a p olynomial

time QTM which on input x pro duces a nal sup erp osition

X

jxijy ijM x y i

pn

p(n)

y fg

Since the prop ortion of s in S is at least if x L and at most otherwise observing the bit on

x

the third track will give the prop er classication for string x with probability at least Therefore this

is a BQP machine accepting the language L 2

Clearly BQP is in exp onential time The next result gives the rst nontrivial upp er b ound on BQP

Theorem BQP PSPACE

Pro of Let M Q b e a BQP machine with running time pn

According to Theorem on page any QTM M which is

close

card cardQpn

to M will simulate M for pn steps with accuracy If we simulate M with accuracy then the

success probability will still b e at least Therefore we need only work with the QTM M where each

transition amplitude from M is computed to its rst log card cardQpn bits

Now the amplitude of any particular conguration at time T is the sum of the amplitudes of each

p ossible computational path of M of length T from the start conguration to the desired conguration

The amplitude of each such path can b e computed exactly in p olynomial time So if we maintain a stack

of at most pn intermediate congurations we can carry out a depthrst search of the computational tree

to calculate the amplitude of any particular conguration using only p olynomial space but exp onential

time

Finally we can determine whether a string x of length n is accepted by M by computing the sum of

squared magnitudes at time pn of all congurations that M can reach that have a in the start cell and

comparing this sum to Clearly the only reachable accepting congurations of M are those with a

in the start cell and blanks in all but the pn cells within distance pn of the start cell So using only

p olynomial space we can step through all of these congurations computing a running sum of the their

squared magnitudes 2

P

Following Valiants suggestion the upp er b ound can b e further improved to P This pro of

can b e simplied by using a theorem from which shows how any BQP machine can b e turned into a

clean version M that on input x pro duces a nal sup erp osition with almost all of its weight on x M x

where M x is a if M accepts x and a otherwise This means we need only estimate the amplitude of

this one conguration in the nal sup erp osition of M

Now the amplitude of a single conguration can b e broken down not only into the sum of the amplitudes

of all of the computational paths that reach it but also into the sum of p ositive real contributions the

sum of negative real contributions the sum of p ositive imaginary contributions and the sum of negative

imaginary contributions We will show that each of these four pieces can b e computed using a P machine

Recall that P is the set of functions f mapping strings to integers for which there exists a p olynomial

pn and a language L P such that for any string x the value f x is the number of strings y of length

pjxj for which xy is contained in L

Theorem If the language L is contained in the class BQTime T n with T n n with T n

timeconstructible then for any there is a QTM M which accepts L with probability and has

the fol lowing property When run on input x of length n M runs for time bounded by cT n where c is

a polynomial in log and produces a nal superposition in which jxijLxi with Lx if x L and

otherwise has squared magnitude at least

P

Theorem BQP P

Pro of Let M Q b e a BQP machine with observation time pn App ealing to Theorem

ab ove we can without loss of generality that M is a clean BQP machine ie on any input x at time

pjxj the squared magnitude of the nal conguration with output x M x is at least

Now as ab ove we will app eal to Theorem on page which tells us that if we work with the

QTM M where each amplitude of M is computed to its rst b log card cardQpn bits and

we run M on input x then the squared magnitude at time pjxj of the nal conguration with output

x M x will b e at least

We will carry out the pro of by showing how to use an oracle for the class P to eciently compute

with error magnitude less than the amplitude of the nal conguration x of M at time T Since

the true amplitude has magnitude at most the squared magnitude of this approximated amplitude must

b e within of the squared magnitude of the true amplitude To see this just note that if is the true

amplitude and k k then

k kkk k k k kk k

Since the success probability of M is at least comparing the squared magnitude of this approximated

amplitude to lets us correctly classify the string x

We will now show how to approximate the amplitude describ ed ab ove First notice that the amplitude

of a conguration at time T is the sum of the amplitudes of each computational path of length T from the

start conguration to the desired conguration The amplitude of any particular path is the pro duct of the

amplitudes in the transition function of M used in each step along the path Since each amplitude consists

T

of a real part and an imaginary part we can think of this pro duct as consisting of the sum of terms

each of which is either purely real or purely imaginary So the amplitude of the desired conguration at

T

time T is the sum of these terms over each path We will break this sum into four pieces the sum of

the p ositive real terms the sum of the negative real terms the sum of the p ositive imaginary terms and

the sum of the negative imaginary terms and we will compute each to within error magnitude less than

with the aid of a P algorithm Taking the dierence of the rst two and the last two will then give

us the amplitude of the desired conguration to with error of magnitude at most as desired

We can compute the sum of the p ositive real contributions for all paths as follows Supp ose for some

xed constant c which is p olynomial in T we are given the following three inputs all of length p olynomial

T

in T a sp ecication of a T step computational path p of M a sp ecication t of one of the terms

cT

and an integer w b etween and Then it is easy to see that we could decide in deterministic time

p olynomial in T whether p is really a path from the start conguration of M on x to the desired nal

th

conguration whether the term t is real and p ositive and whether the term t term of the amplitude for

cT

path p is greater than w If we x a path p and term t satisfying these constraints then the number

cT cT th

of w for which this algorithm accepts divided by is within of the value of the t for path p

So if we x only a path p satisfying these constraints then the number of t w for which the algorithm

cT cT

accepts divided by is within of the sum of the p ositive real terms for path p Therefore

cT cT

the number of p t w for which the algorithm accepts divided by is within N of the sum of

all of the p ositive real terms of all of the T step paths of M from the start conguration to the desired

conguration Since there are at most cardcardQ p ossible successors for any conguration in a legal

cardcardQ log T

log

cT

path of M choosing c gives N as desired Similar

T T

P

reasoning gives P algorithms for approximating each of the remaining three sums of terms 2

Oracle QTMs

In this subsection and the next we will assume without loss of generality that the TM alphab et for each

track is f g Initially all tracks are blank except that the input track contains the actual input

surrounded by blanks We will use to denote f g

In the classical setting an oracle may b e describ ed informally as a device for evaluating some Bo olean

function f on arbitrary arguments at unit cost p er evaluation This allows to formulate

questions such as if f were eciently computable by a TM which other functions or languages could

b e eciently computed by TMs In this section we dene oracle QTMs so that the equivalent question

can b e asked in the quantum setting

An oracle QTM has a sp ecial query track on which the machine will place its questions for the oracle

Oracle QTMs have two distinguished internal states a prequery state q and a p ostquery state q

q a

A query is executed whenever the machine enters the prequery state with a single nonempty blo ck of

nonblank cells on the query track Assume that the nonblank region on the query tap e is in state jx bi

when the prequery state is entered where x b and denotes concatenation Let f b e the

Bo olean function computed by the oracle The result of the oracle call is that the state of the query tap e

b ecomes jx b f xi where denotes the exclusiveor addition mo dulo after which the machines

internal control passes to the p ostquery state Except for the query tap e and internal control other parts

of the oracle QTM do not change during the query If the target bit jbi was supplied in initial state ji

then its nal state will b e jf xi just as in a classical Conversely if the target bit is

already in state jf xi calling the oracle will reset it to ji a pro cess known as uncomputing which is

essential for prop er interference to take place

The p ower of quantum computers comes from their ability to follow a coherent sup erp osition of com

putation paths Similarly oracle QTMs derive great p ower from the ability to p erform sup erp ositions of

queries For example an oracle for Bo olean function f might b e called when the query tap e is in state

P

j i jx i where are complex co ecients corresp onding to an arbitrary sup erp osition of

x x

x

queries with a constant ji in the target bit In this case after the query the query string will b e left in

P

the entangled state jx f xi

x

x

That the ab ove denition of oracle QTMs yields unitary evolutions is selfevident if we restrict ourselves

to machines that are wellformed in other resp ects in particular evolving unitarily as they enter the pre

query state and leave the p ostquery state

O

Let us dene BQTime T n as the sets of languages accepted with probability at least by some

O

oracle QTM M whose running time is b ounded by T n This b ound on the running time applies to

O

each individual input not just on the average Notice that whether or not M is a BQP machine might

O O

dep end up on the oracle O thus M might b e a BQP machine while M might not b e one

We have carefully dened oracle QTMs so that the same technique used to reverse a QTM in the

Reversal Lemma can also b e used to reverse an oracle QTM

Lemma If M is a normal form unidirectional oracle QTM then there is a normal form oracle

O O

QTM M such that for any oracle O M reverses the computation of M while taking two extra time

steps

Pro of Let M Q b e a normal form unidirectional oracle QTM with initial and nal states q

and q and with query states q q and q We construct M from M exactly as in the pro of of the

f q f a

5

Since a QTM must b e careful to avoid leaving around intermediate computations on its tap e requiring that the query

track contain only the query string adds no further diculty to the construction of oracle QTMs

Reversal Lemma We further give M the same query states q q as M but with roles reversed Since M

q a

is in normal form and q q we must have q q Recall that the transition function of M is dened

q f a

so that for q q

X

q p q d j ijpijd i

q p

p

Therefore since state q always leads to state q in M state q always leads to state q in M Therefore

q a a q

M is an oracle QTM

Next note that since the tap e head p osition is irrelevant for the functioning of the oracle the op eration

O O

of the oracle in M reverses the op eration of the oracle in M Finally the same argument used in the

O O

Reversal Lemma can b e used again here to prove that M is wellformed and that M reverses the

O

computation of M while taking two extra time steps 2

The ab ove denition of a quantum oracle for an arbitrary Bo olean function will suce for the purp oses

of the present pap er but the ability of quantum computers to p erform general unitary transformations

suggests a broader denition which may b e useful in other contexts For example oracles that p erform

more general nonBo olean unitary op erations have b een considered in computational learning theory

and used to obtain large separations b etween quantum and classical relativized complexity classes

See for a discussion of more general denitions of oracle quantum computing

Fourier Sampling and the p ower of QTMs

In this section we give evidence that QTMs are more p owerful than b oundederror probabilistic TMs We

dene the recursive Fourier sampling problem which on input the program for a b o olean function takes on

value or We show that the recursive Fourier sampling problem is in BQP On the other hand we

prove that if the b o olean function is sp ecied by an oracle then the recursive Fourier sampling problem

olog n

is not in BQTime n This result provided the rst evidence that QTMs are more p owerful than

classical probabilistic TMs with b ounded error probability

One could ask what the relevance of these oracle results is in view of the nonrelativizing results on

probabilistically checkable pro ofs Moreover Arora et al make the case that the fact that the P

versus NP question relativizes do es not imply that the question cannot b e resolved by current techniques

in complexity theory On the other hand in our oracle results and also in the subsequent results of

the key prop erty of oracles that is exploited is their backbox nature and for the reasons sketched b elow

these results did indeed provide strong evidence that BQP BPP of course the later results of

gave even stronger evidence This is b ecause if one assumes that P NP and the existence of oneway

functions b oth these hypotheses are unproven but widely b elieved by complexity theorists it is also

reasonable to assume that in general it is imp ossible to eciently gure out the function computed by

a program by just lo oking at its text ie without explicitly running it on various inputs Such a program

would have to b e treated as a blackbox Of course such assumptions cannot b e made if the question at

hand is whether P NP

n

Fourier Sampling Consider the vector space of complex valued functions f Z C There is a

natural inner pro duct on this space given by

X

f g f xg x

n

xZ

2

n

The standard orthonormal basis for the vector space is the set of delta functions Z C given by

y

y and x for x y Expressing a function in this basis is equivalent to sp ecifying its values

y y

n

at each p oint in the domain The characters of the group Z yield a dierent orthonormal basis consisting

P

sx

n

n

of the parity basis functions Z C given by x where s x s x Given any

s s i i

n2

i

P

n n

f s where f Z C is function f Z C we may write it in the new parity basis as f

s

s

given by f s f The function f is called the discrete Fourier transform or

s

of f Here the latter name refers to the fact that the linear transformation that maps a function f to its

Fourier transform f is the H Clearly this transformation is unitary since it is just

n

eecting a change of basis from one orthonormal basis the delta function basis to another the parity

P P

function basis It follows that jf xj jf sj

x s

n

Moreover the discrete Fourier transform on Z can b e written as the Kronecker pro duct of the trans

p p

This form on each of n copies of Z the transform in that case is given by the matrix

p p

fact can b e used to write a simple and ecient QTM that eects the discrete Fourier transformation in the

following sense supp ose the QTM has tap e alphab et f g and the initially only n tap e cells contain

P

nonblank symbols Then we can express the initial sup erp osition as f xjxi where f x is the

n

xfg

amplitude of the conguration with x in the nonblank cells Then there is a QTM that eects the Fourier

transformation by applying the ab ove transform on each of the n bits in the n nonblank cells This takes

P

f sjsi Theorem b elow Notice that this O n steps and results in the nal conguration

n

sfg

n

fourier transformation is taking place over a vector space of dimension On the other hand the result

of the fourier transform f resides in the amplitudes of the quantum sup erp osition and is thus not

directly accessible We can however p erform a measurement on the n nonblank tap e cells to obtain

a sample from the probability distribution P such that P s jf sj We shall refer to this op eration

as Fourier sampling As we shall see this is a very p owerful op eration The reason is that each value

f s dep ends up on all the exp onentially many values of f and it do es not seem p ossible to anticipate

which values of s will have large probability constructive interference without actually carrying out an

exp onential search

n n

Given a b o olean function g Z f g we may dene a function f Z C of norm by letting

n

f x g x Following Deutsch and Josza if g is a p olynomial time there

P

is a QTM that pro duces the sup erp osition g xjxi in time p olynomial in n Combining this

n

xfg

with the Fourier sampling op eration ab ove we get a p olynomial time QTM that samples from a certain

distribution related to the given p olynomial time computable function g Theorem b elow We shall

call this comp osite op eration Fourier sampling with resp ect to g

Theorem There is a normal form QTM which when run on an initial superposition of nbit strings

ji halts in time n with its tape head back in the start cell and produces nal superposition H ji

n

Pro of We can construct the desired machine using the alphab et f g and the set of states fq q q q q g

a b c f

The machine will op erate as follows when started with a string of length n as input In state q the ma

chine steps right and left and enters state q In state q the machine steps right along the input string

b b

until it reaches the at the end and enters state q stepping back left to the strings last symbol During

c

p p

this rightward scan the machine applies the transformation to the bit in each cell In state

p p

q the machine steps left until it reaches the to the left of the start cell at which p oint steps back right

c

and halts The following gives the quantum transition function of the desired machine

q jijq ijRi jijq ijRi

a a

jijq ijLi q

b a

p p p p

q jijq ijRi jijq ijRi jijq ijRi jijq ijRi jijq ijLi

b b b b b c

jijq ijLi jijq ijLi jijq ijLi q

f c c c

q jijq ijRi jijq ijRi jijq ijRi

f

It is can b e easily veried that the Completion Lemma can b e used to extend this machine to a wellformed

QTM and that this machine has the desired b ehavior describ ed ab ove 2

n

Theorem For every polynomial time computable function g f g f g there is a polyno

n

mial time stationary QTM where observing the nal superposition on input gives each nbit string s

n

with probability jf sj where f x g x

Pro of We build a QTM to carry out the following steps

P

n

jii Apply a Fourier transform to to pro duce

n

n2

ifg

P

Compute f to pro duce jiijf ii

n

n2

ifg

P

Apply a phaseapplying machine to pro duce f ijiijf ii

n

n2

ifg

P

Apply the reverse of the machine in Step to pro duce f ijii

n

n2

ifg

P

f sjsi as desired Apply another Fourier transform to pro duce

n

n2

ifg

We have already constructed ab ove the Fourier transform machine for Steps and Since f can b e

computed in deterministic p olynomial time the Synchronization Theorem on page lets us construct

p olynomial time QTMs for Steps and which take input jii to output jiijf ii and vice versa with

running time indep endent of the particular value of i

Finally we can apply phase according to f i in Step by extending to two tracks the stationary

normal form QTM with alphab et f g dened by

q jijq ijRi jijq ijRi jijq ijRi

q jijq ijLi jijq ijLi jijq ijLi

f f f

jijq ijRi jijq ijRi jijq ijRi q

f

Dovetailing these ve stationary normal form QTMs gives the desired machine 2

Remarkably this p erforms Fourier sampling with resp ect to f while calling the

algorithm for f only twice To see more clearly why this is remarkable consider the sp ecial case of

the sampling problem where the function f is one of the unnormalized parity functions Supp ose f

ik n

corresp onds to the parity function ie f i where i k f g Then the result of fourier

k

sampling with resp ect to f is always k Let us call this promise problem the parity problem on input

a program that computes f where f is an unnormalized parity function determine k Notice that the

QTM for fourier sampling extracts n bits of information the value of k using just two invocations of the

subroutine for computing b o olean function f It is not hard to show that if we f is sp ecied by an oracle

then in a probabilistic setting extracting n bits of information must require at least n invocations of the

b o olean function We now show how to amplify this this advantage of quantum computers over probabilistic

computers by dening a recursive version of the parity problem the recursive Fourier sampling problem

To ready this problem for recursion we rst need to turn the parity problem into a problem with range

f g This is easily done by adding a second function g and requiring the answer g k rather than k

itself

n

Now we will make the problem recursive For each problem instance of size n we will replace the

n

values of f with indep endent recursive subproblems of size n and so on stopping the recursion with

function calls at the b ottom Since a QTM needs only two calls to f to solve the parity problem it will

b e able to solve an instance of the recursive problem of size n recursively in time T n where

T n pol y n T n T n pol y n

However since a PTM needs n calls to f to solve the parity problem the straightforward recursive solution

to the recursive problem on a PTM will require time T n where

log n

T n nT n T n n

To allow us to prove a separation b etween quantum and classical machines we will replace the functions

with an oracle For any legal oracle O any oracle satisfying some sp ecial constraints to b e describ ed

b elow we will dene the language R We will show that there is a QTM which given access to any legal

O

oracle O accepts R in time O n log n with success probability but that there is a legal oracle O such

O

olog n O

that R is not contained in BPTime n

O

Our language will consist of strings from f g with length a p ower of We will call all such strings

candidates The decision whether a candidate x is contained in the language will dep end on a recursive

n

tree If candidate x has length n then it will have children in the tree and in general a no de at

l

level l counting from the b ottom with leaves at level for convenience will have children So

n

the ro ot of the tree for a candidate x of length n is identied by the string x its children are each

n

identied by a string xx where x f g and in general a descendent in the tree at level l is

l

identied by a string of the form xx x x with jxj n jx j n jx j Notice that

m m

any string of this form for some n a p ower of and l

in log n denes a no de in some tree So we will consider oracles O which map queries over the

alphab et f g to answers f g and we will use each such oracle O to dene a function V that

O

gives each no de a value f g The language R will contain exactly those candidates x for which

O

V x

O

We will dene V for leaves level no des based directly on the oracle O So if x is a leaf then we

O

let V x O x

O

We will dene V for all other no des by lo oking at the answer of O to a particular query which is

O

chosen dep ending on the values of V for its children Consider no de x at level l We will insist that

O

l

the oracle O b e such that there is some k f g such that the children of x all have values determined

x

by their parity with k

x

l

y k

x

V xy y f g

O

and we will then give V x the value O xk We will say that the oracle O is legal if this pro cess allows

O x

us to successfully dene V for all no des whose level is Any query of the form xk with x a no de at

O

l

level l and k f g or of the form x with x a leaf is called a query at node x A query which is

lo cated in the same recursive tree as no de x but not in the subtree ro oted at x is called outside of x

Notice that for any candidate x the values of V at no des in the tree ro oted at x and the decision whether

O

x is in R all dep end only on the answers of queries lo cated at no des in the tree ro oted at x

O

O

Theorem There is an oracle QTM M such that for every legal oracle O M runs in polynomial

time and accepts the language R with probability

O

Pro of We have built the language R so that it can b e accepted eciently using a recursive quantum

O

algorithm To avoid working through the details required to implement a recursive algorithm reversibly

we will instead implement the algorithm with a machine that writes down an iteration that unwraps the

desired recursion Then the Lo oping Lemma will let us build a QTM to carry out this iteration

First consider the recursive algorithm to compute V for a no de x If x is a leaf then the value V x

O O

can b e found by querying the string x If x is a no de at level l then calculate V as follows

O

l

Split into an equal sup erp osition of the children of x

Recursively compute V for these children in sup erp osition

O

Apply phase to each child given by that childs value V

O

Reverse the computation of Step to erase the value V

O

Apply the Fourier transform converting the sup erp osition of children of x into a sup erp osition con

sisting entirely of the single string k

x

Query xk to nd the value V for x

x O

Reverse Steps to erase k leaving only x and V x

x O

Notice that the number of steps required in the iteration ob eys the recursion discussed ab ove and hence

is p olynomial in the length of x So we can use the Synchronization Theorem on page to construct a

p olynomial time QTM which for any particular x writes a list of the steps which must b e carried out

Therefore we complete the pro of by constructing a p olynomial time QTM to carry out any such a list of

step

Since our algorithm requires us to recursively run b oth the algorithm and its reverse we need to see

how to handle each step and its reverse Before we start we will ll out the no de x to a description

of a leaf by adding strings of s Then Steps and at level l just require applying the Fourier

l

transform QTM to the bit string at level l in the current no de description Since the Fourier transform

is its own reverse the same machine also reverses Steps and Step is handled by the phaseapplying

machine already constructed ab ove as part of the Fourier sampling QTM in Theorem Again the

transformation in Step is its own reverse so the same machine can b e used to reverse Step Step

and its reverse can b e handled by a reversible TM which copies the relevant part of the current no de

description queries the oracle and then returns the no de description from the query tap e Notice that

each of these machines takes time which dep ends only on the length of its input

Since we have stationary normal form QTMs to handle each step at level l and its reverse in time

l

b ounded by a p olynomial in we can use the Branching Lemma to construct a stationary normal form

QTM to carry out any sp ecied step of the computation Dovetailing with a machine which rotates the

rst step in the list to the end and inserting the resulting machine into the reversible TM of the Lo oping

Lemma gives the desired QTM 2

log n

Computing the function V takes time n even for a probabilistic computer allowed a b ounded

O

probability of error We can see this with the following intuition First consider asking some set of

queries of a legal O that determine the value of V for a no de x describ ed by the string x x at

O m

level l There are two ways that the asked queries might x the value at x The rst is that the queries

outside of the subtree ro oted at x might b e enough to x V for x If this happ ens we say that V x

O O

is xed by constraint An example of this is that if we asked all of the queries in the subtrees ro oted at

all of the siblings of x then we have xed V for all of the siblings thereby xing the string k such that

O

y k

V x x y equals

O m

The only other way that the value of the no de x might b e xed is the following If the queries x the

value of V for some of the children of x then this will restrict the p ossible values for the string k such

O x

y k

x

and such that V x O xk If the query xk for each p ossible that V xy always equals

O x x O

k has b een asked and all have the same answers then this xes the value V at x If the query xk for

x O x

the correct k has b een asked then we call x a hit

x

Now notice that xing the values of a set of children of a level l no de x restricts the value of k to a set

x

l

c

of p ossibiliti es where c is the maximum size of a linearly indep endent subset of the children whose

log n

values are xed This can b e used to prove that it takes n n n

However this intuition is not yet enough since we are interested in arguing against a probabilistic TM

log n

rather than a deterministic TM So we will argue not just that it takes n queries to x the value

log n

of a candidate of length n but that if fewer than n queries are xed then choosing a random legal

oracle consistent with those queries gives to a candidate of length n the value with probability extremely

close to This will give the desired result To see this call the set of queries actually asked and the

answers given to those queries a run of the probabilistic TM We will have shown that if we take any run

log n

on a candidate of length n with fewer than n queries then the probability that a random legal oracle

agreeing with the run assigns to x the value is extremely close to This means that a probabilistic

olog n

TM whose running time is n will fail with probability to accept R for a random legal oracle O

O

Denition A run of size k is dened as a pair S f where S is a set of k query strings and f is map

from S to f g such that there is at least one legal oracle agreeing with f

Let r be a run let y be a node at level l and let O be a legal oracle at and below y which agrees

with r Then O determines the string k for which V y O y k If y k is a query in r then we say

y O y y

O makes y a hit for r Suppressing the dependency on r in the notation we dene P y as the probability

that y is a hit for r when we choose a legal oracle at and below y uniformly at random from the set of al l

such oracle at and below y which agree with r Similarly for x an ancestor of y we dene P y as the

x

probability that y is a hit when a legal oracle is chosen at and below x uniformly at random from the set of

al l oracle at and below x which agree with r

Lemma P y P y

x

Pro of Let S b e the set of legal oracles at and b elow y which agree with r We can write S as the disjoint

union of S and S where the former is the set of those oracles in S that make y a hit for r Further

h n

splitting according to the value V y we can write S as the disjoint union of four sets S S S S

O h h n n

cardS

h

Using this notation we have P y It is easy to see that since the oracles in S do

n

cardS cardS

n

h

not make y a hit for r cardS cardS cardS

n n n

Next consider the set T of all legal oracles dened at and b elow x but outside y which agree with

r Each oracle O T determines by constraint the value V y but leaves the string k completely

O y

undetermined If we again write T as the disjoint union of T and T according to the constrained value

V y we notice that the set of legal oracles at and b elow x is exactly T S T S So we have

O

cardT cardS cardT cardS

h h

P y

x

cardT cardS cardT cardS

cardT cardS cardT cardS

h h

cardT cardS cardT cardS cardT cardS

h h n

Without loss of generality let cardT cardT Then since nn c with c n increases with n

we have

cardT cardS

h

P y

x

cardT cardS cardT cardS

h n

cardT cardS

h

cardT cardS cardT cardS

h n

cardS

h

P y

cardS cardS

h n

2

log n

For a p ositive integer n we dene n nn Notice that n n

Theorem Suppose r is a run y is a node at level l with q queries from r at or below y and x

l

is an ancestor of y Then P y q n where n

x

Pro of We prove the theorem by induction on l

So x a run r and a no de y at level with q queries from r at or b elow y If q y can never b e a

hit So certainly the probability that y is a hit is at most q as desired

Next we p erform the inductive step So assume the theorem holds true for any r and y at level less

than l with l Then x a run r and a no de y at level l with q queries from r at or b elow y Let

q

l

n We will show that P y and then the theorem will follow from Lemma So for the

n

remainder of the pro of all probabilities are taken over the choice of a legal oracle at and b elow y uniformly

at random from the set of all those legal oracles at and b elow y which agree with r

Now supp ose that q of the q queries are actually at y Clearly if we condition on there b eing no

hits among the children of y then k will b e chosen uniformly among all nbit strings and hence the

y

n n

probability y is a hit would b e q If we instead condition on there b eing exactly c hits among the

nc

children of y then the probability that y is a hit must b e at most q Therefore the probability y is

n

a hit is b ounded ab ove by the sum of q and the probability that at least n of the children of y are

hits

Now consider any child z of y Applying the inductive hypothesis with y and z taking the roles of x

and y we know that if r has q queries at and b elow z then P z q n Therefore the expected

z y z

number of hits among the children of y is at most q q n This means that the probability that

at least n of the children of y are hits is at most

q q q q

nn n

Therefore

q q q q

P y

n

n n

n

since n for n 2

olog n

Corollary For any T n which is n relative to a random legal oracle O with probability

R is not contained in BPTime T n

O

olog n

Pro of Fix T n which is n

We will show that for any probabilistic TM M when we pick a random legal oracle O with probability

O olog n

M either fails to run in time cn or it fails to accept R with error probability b ounded by

O

Then since there are a countable number of probabilistic TMs and the intersection of a countable number

of probability events still has probability we conclude that with probability R is not contained in

O

olog n

BPTime n

O

We prove the corollary by showing that for large enough n the probability that M runs in time

n

greater than T n or has error greater than on input is at least for every way of xing the

n

oracle answers for trees other than the tree ro oted at The probability is taken over the random choices

n

of the oracle for the tree ro oted at

n

Fix arbitrarily a legal b ehavior for O on all trees other than the one ro oted at Then consider

n O n

picking a legal b ehavior for O for the tree ro oted at uniformly at random and run M on input We

O n

can classify runs of M on input based on the run r that lists the queries the machines asks and the

answers it receives If we take all probabilities over b oth the randomness in M and the choice of oracle O

O n

then the probability M correctly classies in time T n is

X

P r r P r cor r ect j r

r

where P r r is the probability of run r where P r cor r ect j r is the probability the answer is correct given

run r and where r ranges over all runs with at most T n queries Theorem tells us that if we

n

condition on any run r with fewer than n queries then the probability is a hit is less than

n

This means that the probability the algorithm correctly classies conditioned on any particular run r

with fewer than n queries is at most Therefore for n large enough that T n is less than

O n

n the probability M correctly classies in time T n is at most So for suciently large n

O

when we choose O then with probability at least M either fails to run in time T n or has success

n

probability less than on input 2

A A QTM is wellformed i its time evolution is unitary

First we note that the time evolution op erator of a QTM always exists Note that this is true even if the

QTM is not wellformed

Lemma A If M is a QTM with time evolution operator U then U has an adjoint operator U in the

innerproduct space of superpositions of the machine M

Pro of Let M b e a QTM with time evolution op erator U Then the adjoint of U is the op erator U is

the op erator whose matrix element in any pair of dimensions i j is the complex conjugate of the matrix

element of U in dimensions j i The op erator U dened in this fashion still maps all sup erp ositions to

other sup erp ositions nite linear combinations of congurations since any particular conguration of

M can b e reached with nonzero weight from only a nite number of other congurations It is also easy

to see that for any sup erp ositions

hU j i hjU i

as desired 2

We include the pro ofs of the following standard facts for completeness We will use them in the pro of

of the theorem b elow

Fact A If U is a linear operator on an innerproduct space V and U exists then U preserves norm

i U U I

Pro of For any x V the square of the norm of U x is U x U x x U U x It clearly follows that if

U U I then U preserves norm For the converse let B U U I Since U preserves norm for every

x V x U U x x x Therefore for every x V x B x It follows that B and therefore

U U I 2

This further implies the following useful fact

Fact A Suppose U is an linear operator in an innerproduct space V and U exists Then

x V kU xk kxk x y V U x U y x y

Pro of Since kU xk kxk U x U x x x one direction follows by substituting x y For the other

direction if U preserves norm then by fact A U U I Therefore U x U y x U U y x y

2

We need to establish one one additional fact ab out norm preserving op erators b efore we can prove our

theorem

Fact A Let V be a countable innerproduct space and let fjiig be an orthonormal basis for V

iI

If U is a norm preserving linear operator on V and U exists then i I kU jiik Moreover if

i I kU jiik then U is unitary

Pro of Since U preserves norm kUU jiik kU jiik But the pro jection of UU jii on jii has norm

jhijUU jiij kU jiik Therefore kU jiik kU jiik and therefore kU jiik

Moreover if kU jiik then since U is norm preserving kUU jiik On the other hand the

pro jection of UU jii on jii has norm kU jiik It follows that for j i the pro jection of UU jii on

jj i must have norm Thus jhj jUU jiij It follows that UU I 2

If V is nite dimensional then U U I implies UU I and therefore an op erator is norm preserving

if and only if it is unitary However if H is innite dimensional then U U I do es not imply UU

I Nevertheless the time evolution op erators of QTMs have a sp ecial structure and in fact these two

conditions are equivalent for the time evolution op erator of a QTM

Theorem A A QTM is wel lformed i its time evolution operator is unitary

Pro of Let U b e the norm preserving time evolution op erator of a wellformed QTM M Q

Consider the standard orthonormal basis for the sup erp ositions of M given by the set of vectors jci where

c ranges over all congurations of M as always jci is the sup erp osition with amplitude for conguration

c and elsewhere We may express the action of U with resp ect to this standard basis by a countable

th

hc jU jci This matrix has some sp ecial prop erties First each dimensional matrix whose c c entry u

cc

row and column of the matrix has only a nite number of nonzero entries Secondly there are only nitely

many dierent types of rows where two rows are of the same type if their entries are just p ermutations

of each other We shall show that each row of the matrix has norm and therefore by the Fact A

ab ove U is unitary To do so we will identify a set of n columns of the matrix for arbitrarily large n

and restrict attention to the nite matrix consisting of all the chosen rows and all columns with nonzero

entries in these rows Let this matrix b e the m n matrix B By construction B satises two prop erties

it is almost square mn for arbitrarily small There is a constant a such that each distinct

row type of the innite matrix o ccurs at least ma times among the rows of B

Now the sum of the squared norms of the rows of B is equal to the sum of the squared norms of

the columns The latter quantity is just n since the columns of the innite matrix are orthonormal by

Fact A ab ove If we assume that some row of the innite matrix has norm for then we can

choose n suciently large and suciently small so that the sum of the squared norms of the rows is at

most m a ma m m a n n n a n This gives the required contradiction and

therefore all rows of the innite matrix have norm and therefore by the Fact A ab ove U is unitary

To construct the nite matrix B let k and x some contiguous set of k cells on the tap e Consider

the set of all congurations S such that the tap e head is lo cated within these k cells and such that the

tap e is blank outside of these k cells It is easy to see that the number of such congurations n

k

k card cardQ The columns indexed by congurations in S are used to dene the nite matrix B

referred to ab ove The nonzero entries in these columns are restricted to rows indexed by congurations

in S together with rows indexed by congurations where the tap e head is in the cell immediately to the

left or right of the k sp ecial cells and such that the tap e is blank outside of these k cells The

k

number of these additional congurations over and ab ove S is at most card cardQ Therefore

m n k card For any we can choose k large enough such that m n

Recall that a row of the innite matrix corresp onding to the op erator U is indexed by congurations

We say that a conguration c is of type q if c is in state q Q and the three adjacent tap e cells

centered ab out the tap e head contain the three symbols The entries of a row indexed by

c must b e a p ermutation of the entries of a row indexed by any conguration c of the same type as c

This is b ecause a transition of the QTM M dep ends only on the state of M and the symbol under the tap e

head and since the tap e head moves to an adjacent cell during a transition Moreover any conguration

d that yields conguration c with nonzero amplitude as a result of a single step must have tap e contents

identical to those of c in all but these three cells It follows that there are only a nite number of such

congurations d and the row indexed by c can have only a nite number of nonzero entries A similar

argument shows that each column has only a nite number of nonzero entries

Now for given q consider the rows of the nite matrix B indexed by congurations of

type q and such that the tap e head is lo cated at one of the k nonb order cells Then

6

Consider for example the space of nite complex linear combinations of p ositive integers and the linear op erator which

maps jii to ji i

k

jT j k card Each row of B indexed by a conguration c T has the prop erty that if d is any

conguration that yields c with nonzero amplitude in a single step then d S Therefore the row indexed

by c in the nite matrix B has the same nonzero entries as the row indexed by c in the innite matrix

Therefore it makes sense to say that row c of B is of the same type as row c of the innite matrix Finally

the rows of each type constitute a fraction at least jT jm of all rows of B Substituting the b ounds from

k 3

k card

ab ove we get that this fraction is at least Since k this is at least

k

a

k card cardQk card

for constant a card cardQ card This establishes all the prop erties of the matrix B

used in the pro of ab ove 2

B Reversible TMs are as p owerful as deterministic TMs

In this app endix we prove the Synchronization Theorem of x

We b egin with a few simple facts ab out reversible TMs We give necessary and sucient conditions

for a deterministic TM to b e reversible and we show that just as for QTMs a partially dened reversible

TM can always b e completed to give a wellformed reversible TM We also give as an aside an easy pro of

that reversible TMs can eciently simulate reversible generalized TMs

Theorem B A TM or generalized TM M is reversible i the fol lowing two conditions both hold

Each state of M can be entered while moving in only one direction In other words if p

q d and p q d then d d

The transition function is onetoone when direction is ignored

Pro of First we show that these two conditions imply reversibility

Supp ose M Q is a TM or generalized TM satisfying these two conditions Then the following

pro cedure lets us take any conguration of M and compute its predecessor if it has one First since each

state can b e entered while moving in only one direction the state of the conguration tells us in which cell

the tap e head must have b een in the previous conguration Lo oking at this cell we can see what tap e

symbol was written in the last step Then since is onetoone we know the up date rule if any that was

used on the previous step allowing us to reconstruct the previous conguration

Next we show that the rst prop erty is necessary for reversibility So for example consider a TM

or generalized TM M Q such that p q L and p q R Then we can

easily construct two congurations which lead to the same next conguration Let c b e any conguration

1

where the machine is in state p reading a and where the symbol two cells to the left of the tap e head

is a and let c b e identical to c except that the and are changed to and the machine

2 1

is in state p and the tap e head is two cells further left Therefore M is not reversible Since similar

arguments apply for each pair of distinct directions the rst condition in the theorem must b e necessary

for reversibility

Finally we show that the second condition is also necessary for reversibility Supp ose that M Q

is a TM or generalized TM with p p Then any pair of congurations which dier only in

the state and symbol under the tap e head where one has p and the other p lead to the same

next conguration and again M is not reversible 2

Corollary B If M is a reversible TM then every conguration of M has exactly one predecessor

Pro of Let M Q b e a reversible TM By the denition of reversibility each conguration of M

has at most one predecessor

So let c b e a conguration of M in state q Theorem B tells us that M can enter state q while

moving its tap e head in only one direction d Since Theorem B tells us that ignoring direction is

q

onetoone taking the inverse of on the state q and the symbol in direction d tells us how to transform

q

c into its predecessor 2

Corollary B If is a partial function from Q to Q fL Rg satisfying the two conditions

of Theorem B then can be extended to a total function that stil l satises Theorem B

Pro of Supp ose is a partial function from Q to Q fL Rg that satises the prop erties of

Theorem B Then for each q Q let d b e the one direction if any in which q can b e entered and

q

let d b e arbitrarily L otherwise Then we can ll in undened values of with as yet unused triples of

q

the form q d so as to maintain the conditions of Theorem B Since there are card cardQ

q

such triples there will b e exactly enough to fully dene 2

Theorem B If M is a generalized reversible TM then there is a reversible TM M that simulates

M with slowdown at most

Pro of The idea is to replace any transition that has the tap e head stand still with two transitions The

rst up dates the tap e and moves to the right remembering which state it should enter The second steps

back to the left and enters the desired state

So if M Q is a generalized reversible TM then we let M b e identical to M except that for

each state q with a transition of the form p q N we add a new state q and we also add a new

transition rule q q L for each Finally we replace each transition p q N with

the transition p q R Clearly M simulates M with slowdown by a factor of at most

To complete the pro of we need to show that M is also reversible

So consider a conguration c of M We need to show that c has at most one predecessor If c is in

state q Q and M enters q moving left or right then the transitions into q in M are identical to those

in M and therefore since M is reversible c has at most one predecessor in M Similarly if c is in one of

the new states q then the transitions into q in M are exactly the same as those into q in M except that

the tap e head moves right instead of staying still So again the reversibility of M implies that c has at

most one predecessor Finally supp ose c is in state q Q where M enters q while standing still Then

Theorem B tells us that all transitions in M that enter q have direction N Therefore all of them have

b een removed and the only transitions entering q in M are the new ones of the form q q L

Again this means that c can have only one predecessor 2

We will prove the Synchronization Theorem in the following way Using ideas from the constructions

of Bennett and Morita etal we will show that given any deterministic TM M there is a reversible

multitrack TM which on input x pro duces output x M x and whose running time dep ends only on the

sequence of head movements of M on input x Then since any deterministic computation can b e simulated

eciently by an oblivious machine whose head movements dep end only on the length of its input we

will b e able to construct the desired synchronized reversible TM

The idea of Bennetts simulation is to run the target machine keeping a history to maintain reversibility

Then the output can b e copied and the simulation run backwards so that the history is exactly erased

while the input is recovered Since the target tap e head moves back and forth while the history steadily

grows Bennett uses a multitape TM for the simulation

The idea of Morita etals simulation is to use a simulation tap e with several tracks some of which are

used to simulate the tap e of the desired machine and some of which are used to keep the history Provided

that the machine can move reversibly b etween the current head p osition of the target machine and the end

of the history it can carry out Bennetts simulation with a quadratic slowdown Morita etal work with

TMs with oneway innite tap es so that the simulating machine can move b etween the simulation and the

history by moving left to the end of the tap e and then searching back towards the right In our simulation

we write down history for every step the target machine takes rather than just the nonreversible steps

This means that the end of the history will always b e further right than the simulation allowing us to work

with twoway innite tap es Also we use reversible TMs that can only move their head in the directions

fL Rg rather than the generalized reversible TMs used by Bennett and Morita etal

Denition B A deterministic TM is oblivious if its running time and the position of its tape head

at each time step depend only on the length of its input

In carrying out our single tap e Bennett constructions we will nd it useful to rst build simple reversible

TMs to copy a string from one track to another and to exchange the strings on two tracks We will copy

strings delimited by blanks in the single tap e Bennett construction but will copy strings with other

delimiters in a later section

Lemma B For any alphabet there is a normal form reversible TM M with alphabet with

the fol lowing property When run on input x y M runs for maxjxj jy j steps returns the tape head

to the start cell and outputs y x

Pro of We let M have alphab et state set fq q q q q g and transition function dened by

f

other

q q L q L

q q R

q L q R q

q R q L q

f

q q R q R

f

Since each state in M can b e entered in only one direction and its transition function is onetoone

M is reversible Also it can b e veried that M p erforms the desired computation in the stated number of

steps 2

Lemma B For any alphabet there is a normal form reversible TM M with alphabet with

the fol lowing property When run on input x M outputs x x and when run on input x x it outputs x In

either case M runs for jxj steps and leaves the tape head back in the start cell

Pro of We let M have alphab et state set fq q q q q g and transition function dened by the

f

following where each transition is duplicated for each nonblank

q q L q L q L

q q R

q L q R q R q

q q R q L q L

f

q R q R q R q

f

Since each state in M can b e entered in only one direction and its transition function is onetoone

M can b e extended to a reversible TM Also it can b e veried that M p erforms the desired computation

in the stated number of steps 2

Theorem B Let M be an oblivious deterministic TM which on any input x produces output M x

with no embedded blanks with its tape head back in the start cell and with M x beginning in the start

cell Then there is a reversible TM M which on input x produces output x M x and on input x M x

produces output x In both cases M halts with its tape head back in the start cell and takes time which

depends only on the lengths of x and M x and which is bounded by a quadratic polynomial in the running

time of M on input x

Pro of Let M Q b e an oblivious deterministic TM as stated in the theorem and let q q b e the

f

initial and nal states of M

The simulation will run in three stages

M will simulate M maintaining a history to make the simulation reversible

M will copy its rst track as shown in Lemma B

M runs the reverse of the simulation of M erasing the history while restoring the input

We will construct a normal form reversible TM for each of the three stages and then dovetail them

together

Each of our machines will b e a fourtrack TM with the same alphab et The rst track with alphab et

will b e used to simulate the tap e of M The second track with alphab et f g will b e used

to store a single lo cating the tap e head of M The third track with alphab et f g Q

will b e used to write down a list of the transitions taken by M starting with the marker This will

help us nd the start cell when we enter and leave the copying phase The fourth track with alphab et

will b e used to write the output of M

In describing the rst machine we will give a partial list of transitions ob eying the conditions of

Theorem B and then app eal to Corollary B Our machines will usually only b e reading and

writing one track at a time So for convenience we will list a transition with one or more o ccurrences of

the symbols of the form v and v to stand for all p ossible transitions with v replaced by a symbol from

i i

i

replaced by a symbol from other than the appropriate other than the sp ecial marker and with v

i i

i

and

The rst phase of the simulation will b e handled by the machine M with state set given by the union

of sets Q Q Q Q and fq q g Its start state will b e q and the nal state q

a b a f

The transitions of M are dened as follows First we mark the p osition of the tap e head of M in the

start cell mark the start of the history in cell and enter state q

q v v v v q R

a b

q v v v v q R

b

Then for each pair p with p q and with transition p q d in M we include transitions

f

to go from state p to state q up dating the simulated tap e of M while adding p to the end of the history

We rst carry out the up date of the simulated tap e remembering the transition taken and then move to

the end of the history to dep osit the information on the transition If we are in the middle of the history

we reach the end of the history by walking right until we hit a blank However if we are to the left of the

history then we must rst walk right over blanks until we reach the start of the history

p v v v v q p d

q p v v v v q p R

q p v v v v v v q p R

q p v v v v q p R

q p v v v v q p R

q p v v v v q p R

v q p R v v v q p v v

q p v v v p v q R

When the machine reaches state q it is standing on the rst blank after the end of the history So

for each state q Q we include transitions to move from the end of the history back left to the head

p osition of M We enter our walk left state q while writing a on the history tap e So to maintain

reversibility we must enter a second leftwalking state q to lo ok for the tap e head marker past the left

end of the history When we reach the tap e head p osition we step left and right entering state q

q v v v v q L

q v v v v v v q L

q v v v v q L

q v v v v v v q L

q v v v v q L

q v v v v q L

q v v v v q L

q v v v v v v v v q R

Finally we put M in normal form by including the transition

q q R

f a

for each in the simulation alphab et

It can b e veried that each state can b e entered in only one direction using the ab ove transitions and

relying on the fact that M is in normal form and we dont simulate its transitions from q back to q it

f

can also b e veried that the partial transition function describ ed is onetoone Therefore Corollary B

says that we can extend these transitions to give a reversible TM M Notice also that the op eration of

M is indep endent of the contents of the fourth track and that it leaves these contents unaltered

For the second and third machines we simply use the copying machine constructed in Lemma B

ab ove and the reverse of M constructed using Lemma on page Since M op erated indep endently

of the fourth track so will its reversal Therefore dovetailing these three TMs gives a reversible TM M

which on input x pro duces output x M x with its tap e head back in the start cell and on input

x M x pro duces output x

Notice that the time required by M to simulate a step of M is b ounded by a p olynomial in the running

time of M and dep ends only on the current head p osition of M the direction M moves in the step and

how many steps have already b een carried out Therefore the running time of the rst phase of M de

p ends only on the series of head movements of M In fact since M is oblivious this running time dep ends

only the length of x The same is true of the third phase of M since the reversal of M takes exactly two

extra time steps Finally the running time of the copying machine dep ends only on the length of M x

Therefore the running time of M on input x dep ends only on the lengths of x and M x and is b ounded

by a quadratic p olynomial in the running time of M on x 2

Theorem B Let M be an oblivious deterministic TM which on any input x produces output M x

with no embedded blanks with its tape head back in the start cell with M x beginning in the start cell

and such that the length of M x depends only on the length of x Let M be an oblivious deterministic

TM with the same alphabet as M which on any input M x produces output x with its tape head back in

the start cell and with x beginning in the start cell Then there is a reversible TM M which on input x

produces output M x Moreover M on input x halts with its tape head back in the start cell and takes

time which depends only on the length of x and which is bounded by a polynomial in the running time of

M on input x and the running time of M on M x

Pro of Let M and M b e as stated in the theorem with the common alphab et

Then the idea to construct the desired M is rst to run M to compute x M x then to run an

exchange routine to pro duce M x x and nally to run M to erase the string x where each of the three

phases starts and ends with the tap e head in the start cell Using the construction in Theorem B we

build normal form reversible TMs to accomplish the rst and third phases in times which dep end only on

the lengths of x and M x and b ounded by a p olynomial in the running times of M on input x and M

on input M x In Lemma B on page we have already constructed a reversible TM that p erforms

the exchange in time dep ending only on the lengths of the two strings Dovetailing these three machines

gives the desired M 2

Since any function computable in deterministic p olynomial time can b e computed in p olynomial time

by an oblivious generalized deterministic TM Theorems B and B together with Theorem

give us the following

Theorem Synchronization Theorem If f is a function mapping strings to strings which

can be computed in deterministic polynomial time and such that the length of f x depends only on the

length of x then there is a polynomial time stationary normal form QTM which given input x produces

output x f x and whose running time depends only on the length of x

If f is a function from strings to strings that such that both f and f can be computed in deterministic

polynomial time and such that the length of f x depends only on the length of x then there is a polynomial

time stationary normal form QTM which given input x produces output f x and whose running time

depends only on the length of x

C A reversible lo oping TM

We prove here the Lo oping Lemma from x

Lemma Lo oping Lemma There is a stationary normal form reversible TM M and a

constant c with the fol lowing properties On input any positive integer k written in binary M runs for

c

time O k log k and halts with its tape unchanged Moreover M has a special state q such that on input

k M visits state q exactly k times each time with its tape head back in the start cell

Pro of As mentioned ab ove in x the diculty is to construct a lo op with a reversible entrance and exit

We accomplish this as follows Using the Synchronization Theorem we can build threetrack stationary

normal form reversible TM M Q running in time p olynomial in log k that on input b x k where

b f g outputs b x k where b is the opp osite of b if x or k but not b oth and b b

otherwise Calling the initial and nal states of this machine q q we construct a reversible M that

f

lo ops on machine M as follows We will give M new initial and nal states q q and ensure that it has

a z

the following three prop erties

Started in state q with a on the rst track M steps left and back right changing the to a

a

and entering state q

When in state q with a on the rst track M steps left and back right into state q

f

When in state q with a on the rst track M steps left and back right changing the to a and

f

halts

So on input k M will step left and right into state q changing the tap e contents to k Then

machine M will run for the rst time changing k to k and halting in state q Whenever M is

f

in state q with a on the rst track it reenters q to run M again So machine M will run k more

f

times until it nally pro duces k k At that p oint M changes the tap e contents to k k and halts So

on input k M visits state q exactly k times each time with its tap e head back in the start cell This

f

means we can construct the desired M by identifying q as q and dovetailing M b efore and after with

f

reversible TMs constructed using the Synchronization Theorem to transform k to k and k k back

to k

We complete the pro of by constructing a normal form reversible M that satises the three prop erties

ab ove We give M the same alphab et as M and additional states q q q q The transition function

a b y z

for M is the same as that of M for states in Q q and otherwise dep ends only on the rst track leaving

f

the others unchanged and is given by the following table

q q L

a b

q q R

b

q L q L q

b y f

q q R

y z

q R q R q R q

a a a z

It is easy to see that M is is normal form and satises the three prop erties stated ab ove Moreover since

M is reversible and ob eys the two conditions of Theorem B it can b e veried that the transition

function of M also ob eys the two conditions of Theorem B Therefore according to Theorem B

the transition function of M can b e completed giving a reversible TM 2

Acknowledgements

This pap er has greatly b enetted from the careful reading and many useful comments of Richard Jozsa

and Bob Solovay We wish to thank them as well as Charles Bennett Noam Nisan and

Dan Simon

References

Adleman L DeMarrais J and Huang M Quantum computability manuscript

Arora S Impagliazzo R Vazirani U On the Role of the CookLevin Theorem in Complexity

Theory manuscript

Arora S Lund C Motwani R Sudan M and Szegedy M Proof verication and intractabil

ity of approximation problems Pro ceedings of the rd Annual IEEE Symp osium on Foundations of

Computer Science

Babai L and Moran S ArthurMerlin games a randomized proof system and a hierarchy of

complexity classes Journal of Computer and System Sciences

Barenco A Bennett C Cleve R DiVincenzo D Margolus N Shor P

Sleator T Smolin J and Weinfurter H Elementary gates for quantum computation

manuscript

Benioff P Quantum Hamiltonian models of Turing machines Journal of Statistical Physics

pp

Bennett C H Logical reversibility of computation IBM J Res Develop pp

Bennett C H Timespace tradeos for reversible computation SIAM J Comput

pp

Bennett C H Bernstein E Brassard G and Vazirani U Strengths and weaknesses of

quantum computing SIAM J Comput to app ear

Bernstein E Quantum complexity theory PhD dissertation UC Berkeley to app ear

Bernstein E and Vazirani U Quantum complexity theory Pro ceedings of the th Annual

ACM Symp osium on Theory of Computing pp

Berthiaume A and Brassard G The quantum chal lenge to structural complexity theory Pro

ceedings of th IEEE Conference on Structure in Complexity Theory pt

Berthiaume A and Brassard G Oracle quantum computing Journal of Mo dern Optics

pp

Berthiaume A Deutsch D and Jozsa R The stabilisation of quantum computation Pro

ceedings of the Workshop on Physics and Computation p

Bshouty N and Jackson J Learning DNF over uniform distribution using a quantum example

oracle Pro ceedings of th Annual ACM Conference on Computational Learning Theory pp

Calderbank AR and Shor P Good quantum error correcting codes exist Phys Rev A to

app ear

Chirac and Zoller Quantum computation using trapped cold ions manuscript

Chuang I LaFlamme R Shor P and Zurek W Quantum computers factoring and

decoherence manuscript

CohenTannoudji C Diu B LaLoe F Quantum mechanics pp

Deutsch D Quantum theory the ChurchTuring principle and the universal quantum computer

Pro c R So c Lond A pp

Deutsch D Quantum computational networks Pro c R So c Lond A pp

Deutsch D and Jozsa R Rapid solution of problems by quantum computation Pro c R So c

Lond A pp

DiVincenzo D Twobit gates are universal for quantum computation Phys Rev A

pp

Durr C Santha M Thanh A decision procedure for wel lformed linear quantum cellular au

tomata RAC workshop Berkeley

Feynman R Simulating physics with computers International Journal of

pp

Feynman R Quantum mechanical computers Foundations of Physics pp Orig

inally app eared in Optics News February

Fredkin E and Toffoli T Conservative Logic Internat J Theoret Phys p

Grover L Searching for a needle in a haystack a fast quantum mechanical algorithm manuscript

Landauer R Is quantum mechanics useful Pro c R So c Lond to app ear

Lipton R Personal communication

Lloyd S A potentially realizable quantum computer Science pp

Machta J Phase information in quantum oracle computing Physics Department University of

Massachusetts at Amherst manuscript

Morita K Shirasaki A and Gono Y A tape symbol reversible Turing Machine IEEE

Transactions of the IEICE E pp

von Neumann J Various Techniques Used in Connection with Random Digits Notes by G E

Forsythe National Bureau of Standards Applied Math Series pp Reprinted in von

Neumanns Collected Works Pergamon Press pp

Palma G Suominen K and Ekert A Quantum computers and dissipation manuscript

A Shamir IPPSPACE Pro ceedings of the nd ACM Symp osium on the Theory of Computing

pp

Shor P Algorithms for quantum computation Discrete log and factoring Pro ceedings of the th

Annual IEEE Symp osium on Foundations of Computer Science

Shor P Faulttolerant quantum computation Pro ceedings of the th Annual IEEE Symp osium on

the Foundations of Computer Science

Simon D On the power of quantum computation Pro ceedings of the th Annual IEEE Symp osium

on Foundations of Computer Science

Solovay R and Yao A manuscript

Toffoli T Bicontinuous extensions of invertible combinatorial functions Mathematical Systems

Theory pp

Unruh W Maintaining coherence in quantum computers Phys Rev A p

Valiant L Personal communication

Vazirani U and Vazirani V Random polynomial time is equal to semirandom polynomial time

Pro ceedings of the th Annual IEEE Symp osium on Foundations of Computer Science

Watrous J On one dimensional quantum cellular automata Pro ceedings of the th Annual IEEE

Symp osium on Foundations of Computer Science

Yao A complexity Pro ceedings of the th Annual IEEE Symp osium on Founda

tions of Computer Science pp

Zuckerman D Weak Random Sources PhD dissertation UC Berkeley