Professional Documents
Culture Documents
Mark Przepiora
University of Calgary
July 9, 2009
Say our computer has exactly one bit of storage, so the state
of our machine is always simply either 0 or 1.
We want to compute the NOT function, i.e. NOT(0) = 1
and NOT(1) = 0.
Let’s identify states in our machine with basis vectors:
1 0
0∼ 1∼
0 1
√1
1 1
Consider the unitary transformation H = (the
2 1 −1
Hadamard matrix.)
Easy to see it is unitary.
|0i+|1i |0i−|1i
H |0i = √
2
and H |1i = √
2
“Generates a qubit that’s half 0 and half 1.”
Measuring such a qubit would result in either a 0 or 1 being
observed, each with 50% probability.
This transformation is a fundamental part of many quantum
algorithms.
basis NM
, which measures that qubit in the computational
(according to the laws given earlier.)
NM
For example, the circuit |0i H
b
implements a random number generator.
We will use this model later to discuss a quantum algorithm.
|a, bi 7→ |a, a ⊕ bi
or “leave the first bit alone, and flip the second bit if the first
bit is a 1.”
(In which the first qubit is the input, and we place the output
in the second qubit.) However, it is clear that this mapping is
not invertible.
We can use a generalization of the CNOT operator instead.
Let Uf denote the two-qubit operator that performs the
following map:
|a, bi 7→ |a, f (a) ⊕ bi
An operator of this form is called the quantum oracle of f ,
and we can think of it as a black box.
Mark Przepiora CUMC 2009
Learning a boolean function
Forget about the quantum world, and say we have a black box
that computes some unknown f : {0, 1} → {0, 1} classically.
f could be one of four functions. Say we’d like to learn which
it is, without being allowed to look inside the black box. How
many queries are required?
It’s easy to prove that we need two queries classically.
In the quantum case, what if we’re given f as a bit oracle Uf ?
Here, the answer is still two queries! So we see that quantum
computation doesn’t allow us to speed up all computational
tasks, only some.
NM
|0i H H
b
Uf
|1i H
The result is b = f (0) ⊕ f (1).