�

�
6.080/6.089
GITCS
May
13,
2008
Lecture
24
Lecturer:
Scott
Aaronson
Scribe:
Chris
Granade
1
Quantum
Algorithms
Of
course
the
real
question
is:
can
quantum
computers
actually
do
something
more
eﬃciently
than
classical
computers?
In
this
lecture,
we’ll
see
why
the
modern
consensus
is
that
they
can.
1.1
Computing
the
XOR
of
Two
Bits
We’ll
first
see
an
algorithm
due
to
Deutsch
and
Jozsa.
Even
though
this
algorithm
is
trivial
by
modern
standards,
it
gave
the
first
example
where
a
quantum
algorithm
could
provably
solve
a
problem
using
fewer
resources
than
a
classical
algorithm.
Suppose
we’re
given
access
to
a
Boolean
function
f
:
{
0
,
1
} → {
0
,
1
}
.
And
suupose
we
want
to
compute
f
(0)
⊕
f
(1),
the
XOR
of
f
(0)
and
f
(1).
Classically,
how
many
times
would
we
need
to
evaluate
f
?
It’s
clear
that
the
answer
is
twice:
knowing
only
f
(0)
or
f
(1)
tells
us
exactly
nothing
about
their
XOR.
So
what
about
in
the
quantum
case?
Well,
first
we
need
to
say
what
it
even
means
to
evaluate
f
.
Since
this
is
a
quantum
algorithm
we’re
talking
about,
we
should
be
able
to
evaluate
both
inputs,
f
(0)
and
f
(1)
in
quantum
superposition.
But
we
have
to
do
so
in
a
reversible
way.
For
example,
we
can’t
map
the
state

x,
b
�
to

x,
f
(
x
)
�
(overwriting
b
),
since
that
wouldn’t
be
unitary.
The
standard
solution
is
that
querying
f
means
applying
a
unitary
transformation
that
maps

x,
y
� → 
x,
y
⊕
f
(
x
)
�
.
Is
it
reversible?
Yeah.
Applying
it
twice
gets
you
back
to
where
you
started.
I
claim
we
can
compute
f
(0)
⊕
f
(1)
using
just
a
single
one
of
these
operations.
How?

0
�
H
U
f
H

0
�
X
H
Figure
1
:
Finding
f
(0)
⊕
f
(1)
in
one
query.
In
the
circuit
above,
the
effect
of
the
gates
before
U
f
is
to
prepare
an
initial
state

ψ
0
�
:
1

ψ
0
�
=

+
�
−�
=
2
[

0
�
+

1
�
] [

0
� −

1
�
]
If
you
think
of
the
effect
of
U
f
on
the
first
qubit
in
this
state,
it’s
just
to
negate
the
amplitude
if
f
(0)
=
f
(1)!
Thus,
U
f
produces
+
�
−�
if
f
(0)
=
f
(1)
and
−�
−�
otherwise.
The
final
Hadamard
gate
transforms
the
first
qubit
back
into
the
computational
basis,
so
that
we
measure
1
if
and
only
if
f
(0)
=
f
(1).
In
particular,
this
means
that
if
you
want
to
compute
the
XOR
of
N
bits
with
a
quantum
computer,
you
can
do
so
using
N/
2
queries,
as
follows:
first
divide
the
bits
into
N/
2
pairs
of
bits,
241
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
then
run
the
above
algorithm
on
each
pair,
and
finally
output
the
XOR
of
the
results.
Of
course,
this
is
only
a
constantfactor
speedup,
but
it’s
a
harbinger
of
much
more
impressive
speedups
to
come.
1.2
Simon’s
Algorithm
Say
you’re
given
a
Boolean
function
f
:
{
0
,
1
}
n
→ {
0
,
1
}
n
.
You’re
promised
there
exists
a
“secret
string”
s
such
that
f
(
x
) =
f
(
y
)
if
and
only
if
y
=
x
⊕
s
,
where
⊕
denotes
a
sum
mod
2.
The
problem
is
to
find
s
by
querying
f
as
few
times
as
possible.
How
many
queries
would
a
classical
randomized
algorithm
need
to
solve
this
problem?
Some
thing
very
similar
was
on
your
problem
set!
Right,
2
n/
2
.
This
is
basically
just
the
birthday
paradox.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '11
 Prof.ScottAaronson
 Algorithms, Quantum, Integer factorization, Shor's algorithm

Click to edit the document details