Lecture 24: Quantum Computing (12/15/2005) : Bit and Qubit
Lecture 24: Quantum Computing (12/15/2005) : Bit and Qubit
Classical computers operate with classical information, e.g. bits encoded in the voltage of a capacitor.
5 = 00000101. Their working should be deterministic.
Additional reading if you wish: recent books such as The Physics of Quantum Information by Bouwmeester, Ekert, Zeilinger
Richard Feynman was the first one to propose that there could also be computers that follow the
laws of quantum mechanics instead of classical physics. A practical construction of a useful quantum
computer remains a dream for the future, nevertheless a lot has been learned about the theory and the
algorithms and some preliminary steps to overcome the technical difficulties and realize the idea have
been made.
The states |0i and |1i may be represented by spin-up and spin-down or any other two-level system that
we have discussed or we have not discussed.
Instead of one bit, we seem to have two complex numbers. They cant be directly measured; these
numbers only determine the probabilities. If you consider N qubits, there are 2N different states, and
each of them is associated with a complex number. For example, for N = 2 we have a state
|i = 00 |00i + 01 |01i + 10 |10i + 11 |11i
where |10i is the same thing as |1i|0i and so on. The classical computer only allows the states where
all the constants in the standard basis are essentially equal to zero except for one that is equal to
one, and this property must be preserved by all the operations. What are these operations in the case
of the classical computer? For example, the n-th bit can change to the logical sum of the p-th bit and
the q-th bit.
Quantum computers are not constrained by these classical constraint, and all coefficients may be
nonzero. This allows much more general operations. Consider the operations that only act on one bit.
In classical physics, you can either do nothing; or change the bit to 0 regardless of its value; or change
it to one; or negate it.
In quantum physics, there are many more operations that you can do with a single bit. Any unitary
2 2 transformation will do the job. It is very useful to consider a very special transformation, the
so-called Hadamard transformation:
!
1
1
1
1
1
UH =
In some algorithms we will sketch later, this operation is particularly useful if it acts (in the same way)
on many bits simultaneously. For example,
1
1
1
UH |00i = [(|0i + |1i)(|0i + |1i)] = (|00i + |01i + |10i + |11i) = (|0i + |1i + |2i + |3i)
2
2
2
1
which is a maximally non-classical state that is often envisioned to be the initial condition of the
quantum computer for many calculations.
As we mentioned, classical computers can change the value i = 0 . . . 255 of a register to an arbitrary
function f (i). In quantum computing, all the operations done with the state must be unitary
because any evolution operator in pure quantum mechanics is unitary. This feature does not allow us
to use functions i 7 f (i) to change the register directly if the function f (i) is not one-to-one. Its
because functions that are not one-to-one are not invertible i.e. the process would not be reversible
but as we have said, all operations with the quantum computer must be reversible because they are
unitary (U 1 = U ). The constraint of reversibility usually forces us to preserve the input |iin :
|iin |0im 7 |iin |f (i)im
Of course, the information about the second register is only preserved if f (i) is a unitary action on the
second register for every i. In our case, we only consider the action on |0im .
For example, start with |0in |0im , and apply UH to the first register to obtain
n 1
1 2X
|iin |0im
(UH |0in ) |0im = n
2 i=0
Now apply f :
n 1
n 1
1 2X
1 2X
1
7
|ii
|f
(i)i
=
n
m
n
m
2n i=0
2n i=0
2n
Note that the state has simultaneously evaluated the values f (i) for all possible configurations of the
first register. In other words, we have simultaneously calculated 2n values of the function f (i) in one
step. Indeed, this is what quantum computers could do in one operation. Such observations are behind
the statement that quantum computers could be exponentially faster than the classical computers.
However, you should notice that most of the information is inaccessible because the wavefunction
cant be directly measured. For example, try to measure the first register. You will obtain, with equal
probability, any number |ki between 0 and 2n 1. Because of the measurement, the wavefunction
collapses to |ki|f (k)i. This allows you to learn the value of f (k) for one value k no improvement
over the classical computer moreover a random value of k which you may not have cared about in
the first place.
exponentially long time. A quantum computer would only require a polynomial time, O(np ) for some
power p. In computer science, they discuss the NP-completeness issues and it is widely believed that
a classical computer cannot solve certain problems in a polynomial time. Quantum computers could
break the limitations.
How do they find the period? Consider the last state we mentioned
n 1
1 2X
|iin |f (i)im
2n i=0
and start with measuring the second register. You find a value f (k). This collapses the wavefunction
of the first register to
|in = A [ |ki + |k + ri + |k + 2ri + . . .]
If we now measured the first register, we would obtain just one example of |k + nri that gives the f (k).
But one example is not enough, and if you try to repeat the measurement to get another example of
an k + nr to figure out the period, you will fail: next time, you will get a different value of f . Again,
you need to repeat the experiment O(2n ) times to obtain the same f (k) again, and no improvement
over the classical computer is found.
In the limit 2n , the variables x, y behave just like the canonical coordinate and the momentum.
It is important to notice that UDF T is a unitary transformation on the Hilbert space: the norm of the
vectors is preserved because you know that the norm of a wavefunction and the norm of its Fourier
transform are equal if a proper normalization is chosen. The DFT can be realized in a pretty small
number of operations of a quantum computer.
How does it help us to find the period r? Assume, for a while, that 2n is a multiple of r. This is a
very strong condition because it implies that r = 2 itself. Indeed, we wont strictly need this condition
at the end but it makes our reasoning more clear.
If r divides 2n , then the state of the first register, after we measured f (k) on the second register,
will be
n /r1
r
r 2X
|k + jri
|in =
2n j=0
which we normalized to the identity. What is the Fourier transformation of this state?
UDF T |in =
/r1
1 2 X
r 2X
2n
y=0
j=0
X
1 r1
2n l
exp(2i(k + jr)y/2 )|yi = . . . =
e2ikl/r | i
r l=0
r
n
The dots indicate that we have summed up the phases over j to find out that the sum is only nonzero
for y being a multiple of 2n /r, i.e. y = 2n l/r, which replaced the summation over y by a sum over l.
You see that only some basis vectors contribute to the state of the first register the states |2n l/ri
and by repeating the calculation and the measurement several times, we can determine r.
3
If r does not divide 2n exactly, the resonances wont be sharp; instead, they will have a nonzero
width. In other words, |c(y)|2 will be nonzero in a vicinity of the fractional values of y = 2n l/r. But
we can still determine r by a few measurements.
Draw graphs: |c(x)|2 is nonzero for x = l, l + r, l + 2r, . . . after the measurement of the second
register, and the Fourier transforms |c(y)|2 is nonzero for y = 2n l/r where l is integer and is
nonzero but small if 2n is not a multiple of r.
which means that at least one of the numbers , = (ar/2 1) must fail to be co-prime with n. Thats
pretty clear: if both and were co-prime with n, their product could not be a multiple of n. Theyre
co-prime but theyre not multiples of n. For example, if = (ar/2 1) were a multiple of n, then the
periodicity would be r/2 instead of r.
In other words, not being co-prime means that you may look for the greatest common divisor of n
and , or the greatest common divisor of n and , you are guaranteed to find a nontrivial factor of n.
The greatest common divisor can be found using the recursive (classical) algorithm due to Euclid. The
greatest common divisor of n, , assuming n < , is the same number as the greatest common divisor
of n and n. Substitute these numbers to the previous sentence instead of n, (and order them)
and repeat the same step until the new values of n, are equal. Once theyre equal, both of them
are equal to the greatest common divisor of all pairs you encountered.
Example: Factors of 21
The quantum computers, if ever constructed, would be able to factorize huge numbers, but for our
understanding, it is better to start with a small example such as n = 21. Choose a random value of a
comparable to n/2, for example a = 11. About one half of the choices will give you a helpful result.
Calculate the powers of a = 11 modulo 21. You will get:
110 = 1,
111 = 11,
112 = 16,
113 = 8,
4
114 = 4,
115 = 2,
116 = 1
This step can be done efficiently, for large a, n, by a quantum computer. Without the computer, we
see that r = 6 because the sixth power agrees with the zeroth power.
Now define
ar/2 1 = 113 1 = 1330,
1332
21
9
3
=
=
=
=
63 21 + 9
29+3
33
gcd(1332, 21)
This was probably not the simplest way to figure out that 3 and 7 divide 21, but for large numbers, be
sure that this would be a faster method than other methods you may imagine.
Grovers algorithm
The second most famous algorithm and I dont know any third algorithm in which the quantum
computer would surpass the classical computer was discovered by Lov K. Grover in 1996. He figured
out how one can find a correct entry in an unordered database with n items very quickly. Classically,
you need O(n) steps: such a computer would have to ask: Is this the right entry?
roughly n times.
Quantum computers with Grovers algorithm could do the same job in O( n) steps. Each step is a
form of the Hadamard transformation discussed previously, and it systematically rotates the initial
P
state 2n/2 |ii into the right state.
Unfortunately there is not enough room here to explain it in detail; Grovers algorithm at
Wikipedia may be a simple starting point for you to learn it. The practical importance of such an
algorithm, even if the large quantum computers are ever constructed, is uncertain. Modern classical
algorithms such as Googles software are based on the idea that databases should be ordered (and
indexed) after all, and an unordered database may always look like a flawed starting point.
Feynman was also proposing to use quantum computers for simulations of quantum objects and
wavefunctions themselves which seems a natural thing to do but as far as I know, not much research
in this direction has been done.
We have qubits. What about the operations? One uses lasers at the resonant frequency 01 directed
at each ion. Such radiation can induce the transitions
|0i
|1i
and we have discussed the two-level systems earlier in the course. Recall that if the pulse lasts for
t=
2R
where R is the Rabi frequency, it will change |0i to |1i and |1i to |0i. A pulse that lasts for /4R ,
one half of the previous time, will act much like the Hadamard transformation. One can also change
the phase of the state if the laser frequency is detuned away from 01 . These two operations cover all
manipulations with individual qubits.
Vibrational modes and coupled qubits
In order to create a useful quantum computer, we also need operations where the fate of the qubits
depend on each other where the qubits are coupled. This can be achieved by vibrational modes.
Consider a pair of ions. They can vibrate in two energy eigenstates
();
()
The first one is the center-of-mass vibrational mode and it is the vibrational mode with the lowest
energy. Recall that the vibrational modes contribute much less energy than h
01 . By exciting the
modes, however, we can entangle the qubits.
We have qubits and methods how to evolve them depending on their state. Actually people have
designed a system of ideas and tricks showing that these basic operations are sufficient to combine into
the nontrivial algorithms discussed previously. The final thing we need is to be able to measure the
state. This can be done by stimulating the qubits by the frequency 0m between |0i and a short-lived
state |mi. Such a frequency will drive |0i into |mi but it wont affect |1i. When we see a photon, it
proves a decay of |mi |0i + which means that the qubit was in the state |0i to start with. Dont
forget that once we emit and see the photon, the wavefunction is collapsed and the quantum calculation
must be finished. The decay is irreversible.