Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

CS3222 Transition Systems

Quantum Computing A state space is just a set S.


An initial state is just a fixed element sI S.
Course Outline A current state is just a variable element s S.
An action is an element of a set Act of actions.
Intro [1] A transition is a triple (s,act,s), where s, s are
Linear Algebra [3] states and act is an action.
Quantum Mechanics [3] A (labelled) transition system S on (S,Act) is just
Entanglement [1] a set of transitions built from (S,Act).
Reading Week [2 Ex]
Simple quantum algorithms [3 + Ex] Picture:
Quantum Search [5 + Ex]
Quantum Factoring [3 + Ex]
c
Book: Nielsen M., Chuang I. (2000) Quantum a
Computation and Quantum Information. CUP. a
Additional Reading: See Syllabus / Web Page. b x
Notes: These notes plus Abbas Edalats Quantum

Computing course notes from Imperial College q
(used with permission). q
Syllabus Web Page > Additional Info:
1. Downloadable Material, eg. the course notes
and exercises. The initial state is usually indicated in some way in
2. Other relevant material, eg. pointers to even a picture, eg. . A current state may or may not be
more reading, etc. (and subject to updating). indicated.
Action names may be used to represent external
control by the user over what the TS does next (i.e.
to express initiative).

R. Banach, Computer Science Department, University of Manchester, UK 1 of 78 R. Banach, Computer Science Department, University of Manchester, UK 2 of 78

Example 1 (Computing): A 32-bit register. Issues for Transition Systems


The state space is the set of values that can be Nondeterministic TS: If for some state s, and
held in the register. The initial state is the value at action a, we have two states s s such that both
power-on (usually 0). The current state is the value (s,a,s) and (s,a,s) are transitions, then the TS is
held in the register at the current time as the com- nondeterministic. Otherwise it is deterministic.
putation progresses. The actions are the individual
machine instructions that may be invoked. The Examples 1 and 3 are deterministic. Example 2 is
transitions are the possible computation steps. nondeterministic if the particle is stationary on a
local maximum of the potential, otherwise it is
Example 2 (Physics): A classical particle in a deterministic.
potential well.
Assume only one action from now on.
The state space is the set of position/velocity pairs
of the particle. The initial state is the position and Stochastic TS: If each transition (s,s) has an
velocity at the start of the dynamics. The current associated probability p(s,s), then the TS is
state is the position/velocity at the current time t. stochastic.
There is only one action, which corresponds to the
law of motion. The transitions correlate (x(t),v(t)) Since when starting from any state, there must,
with (x(t),v(t)) where t < t, if these are consistent with certainty, be some outcome, we must have for
with the dynamics. all s:
(Cf. phase space.) s p(s,s) = 1
Example 3 (Mathematics): Group actions. Picture:
Let G be a group. Regard G as both a state space
and a set of actions. The initial state is e, the iden- p = 1/4
tity. The transitions are triples (a,g,ag) where a,g
G; i.e. the group elements act by right multiplica- p = 1/4
tion. (N.B. The current state is not a concept much
used in this sort of treatment.)
p = 1/2

R. Banach, Computer Science Department, University of Manchester, UK 3 of 78 R. Banach, Computer Science Department, University of Manchester, UK 4 of 78
Quantum TS: If each transition (s,s) has an asso- Probabilities vs. Amplitudes
ciated
Sequential composition
probability amplitude (s,s)
Suppose s,s,s are states visited in order by the
then the TS is a quantum TS. TS. Then:
Probability amplitudes are complex numbers; they Stochastic: p(s,s,s) = p(s,s) p(s,s)
generate probabilities by squaring the modulus. Quantum: (s,s,s) = (s,s) (s,s)
Since when starting from any state, there must, The quantum case leads to the same behaviour for
with certainty, be some outcome, we must have for the derived probabilities for sequences of transi-
all s: tions.
s |(s,s)|2 = 1
Picture:

Composition of alternatives
= 1/2
Suppose a TS can move from state s to state s via
= 1/2 either u1 or u2.
Then for a stochastic TS we have:
= 1/2 p(s,u1,s) = p(s,u1)p(u1,s) and
p(s,u2,s) = p(s,u2)p(u2,s)
Altogether:
Why bother with probability amplitudes if all you p(s,s) = p(s,u1)p(u1,s) + p(s,u2)p(u2,s)
do is square them to get probabilities?

R. Banach, Computer Science Department, University of Manchester, UK 5 of 78 R. Banach, Computer Science Department, University of Manchester, UK 6 of 78

For a quantum TS Stochastic:


(s,u1,s) = (s,u1)(u1,s) and 1/2
(s,u2,s) = (s,u2)(u2,s) p = 1/4+1/4 = 1/2
1/2 1/2
Altogether:

(s,s) = (s,u1)(u1,s) + (s,u2)(u2,s) 1/2
1/2
p = 1/4+1/4 = 1/2
However is not a probability. To get the probabil- 1/2
ity of going from s to s via either u1 or u2 we need
the modulus squared:
Quantum:
pQ(s,s) = |(s,u1)(u1,s) +
(s, u2)(u2, s)|2 1/2
p = |1/21/2| = 0
2
1/2

1/2
= | (s,u1)(u1,s) |2 + | (s,u2)(u2,s) |2 +
(s,u1)(u1,s)*(s,u2)*(u2,s) +
*(s,u1)*(u1,s)(s,u2)(u2,s) 1/2
1/2
p = |1/2+1/2| = 1
2

This can lead to possibilities different from the 1/2
stochastic case, because the interference terms
need not be positive.
The interference terms can indeed be negative,
leading to destructive interference, which is
Features of Quantum Computing
impossible in stochastic TS. exponential stochasticity
superposition and destructive interference
measurement
entanglement

R. Banach, Computer Science Department, University of Manchester, UK 7 of 78 R. Banach, Computer Science Department, University of Manchester, UK 8 of 78
Linear Algebra We also write || x || = x | x, where || x || is the norm
of | x. The norm is like a length, in that: || x || 0,
|| x || = | |.|| x ||, and || x || is only zero for | x = 0.
A complex inner product space H is a set H
which carries a complex vector space structure: In arbitrary inner product spaces, the inner product
is the analogue of the dot product for conventional
(1) | x, | y H | x + | y = | x + y = | y + | x H
vectors in 3D space.
(2) | x, | y, | z H (| x+ | y)+ | z = | x+(| y+ | z) If y | x = 0 then | x and | y are orthogonal.
(3) 0 H and 0+ | x = | x H
(4) | x H , C
I | x = | x H Examples
(5) | x H , , C
I | x = | x = | x H Example 1: Vectors in 3-space. (N.B. This is not an
example in the strict sense since the scalars used
(6) | x, | y H , C
I (| x+ | y) = | x+ | y H are the reals).
(7) | x H , , C
I (+) | x = | x + | x H A typical vector in 3-space a = axex + ayey + azez,
where ex, ey, ez are the three orthogonal unit vec-
together with an inner product y | x, i.e.:
tors along the coordinate axes.
(8) | x, | y H y | x CI Then a = axex + ayey + azez (with R).
I
(9) x | y = y | x* If b = bxex + byey + bzez, then
(10) z | (| x+ | y) = z | x + z | y a + b = (ax + bx)ex + (ay + by)ey + (az + bz)ez.
The inner product is the usual dot product
I y | x = y | x = * y | x
(11) C
a.b = ax bx + ay by + az bz.
(12) x | x 0 and x | x = 0 | x = 0 The norm is given by the length:
N.B. |... is called a ket, and is standard Dirac || a || = | a | = (ax2 + ay2 + az2) = (a.a), giving rise to
notation, used in quantum physics. the definition of the angle between a and b via
a.b = | a || b | cos().

R. Banach, Computer Science Department, University of Manchester, UK 9 of 78 R. Banach, Computer Science Department, University of Manchester, UK 10 of 78

Example 2: L2(K). Here K is any space upon which Consequently the norm is given by:
I n, [0,1][1,3], etc., etc.
integration is defined, eg. R
|| x || = (| x0 |2 + | x1 |2 + + | xn1 |2)
Then L2(K) consists of all the complex valued
functions f such that K | f |2 is well defined. If f and g These vectors give a good account of quantum
are two such functions then f+g is also in L2(K) systems with a small (finite) number of degrees of
since K | f+g |2 K || f | + | g ||2 K (2max(| f | , | g |))2 freedom; such systems exclusively will concern us
K (4| f |2 + 4| g |2) which is finite. Similarly for f. I 2 will be called Q.
in this course. In future C

Addition and scalar multiplication are just addition


and scalar multiplication of functions, and the inner Basic Properties
product is given by f | g = K f*g.
The Parallelogram Identity:
The norm is thus || f || = (K | f |2)1/2.
|| x+y ||2 + || xy ||2 = 2(|| x ||2 + || y ||2)
The elements of L2(K) are used in quantum theory
for wave functions of particles in a region K. Proof. LHS is x+y | x+y+xy | xy. Simplify.
Example In
3: C
(Complex Column Vectors). This The Polarisation Identity:
example will be used extensively in the rest of the
course. A typical vector is: 4x | y = || x+y ||2 || xy ||2 i || x+ i y ||2 +i || x i y ||2
x0 Proof. Expand RHS.
x
| x = 1 The Cauchy-Schwartz inequality:
xn1 | x | y |2 x | xy | y = || x ||2|| y ||2
We will often write this as [x0, x1 xn1]T to save Proof. If | x = 0 or | y = 0 its easy. Otherwise let
space. Addition and scalar multiplication are just = y | x/y | y. Then:
addition and scalar multiplication of vectors. The
inner product is given by: 0 x+y | x+y = x | x+x | y+* y | x+ | |2y | y

y | x = y0*.x 0 + y 1*.x 1 + + y n1*.x n1 which when simplified, gives the result.

R. Banach, Computer Science Department, University of Manchester, UK 11 of 78 R. Banach, Computer Science Department, University of Manchester, UK 12 of 78
The Triangle inequalities: Here are some bases for Q:
|| x || || y || || x+y || || x || + || y || {[1, 0]T, [0, 1]T}, {[1, 0]T, [1, 1]T},
|| x || || y || || xy || || x || + || y || {[1, i]T, [1, i]T}, {[2+3i, 274i]T, [578+675i, 2]T}.
Proof. || x+y ||2 = x+y | x+y = || x ||2 +x | y+y | x+ || y ||2 A basis is orthogonal iff xj | xk = 0 for any two dis-
= || x ||2 +2Rex | y+ || y ||2 || x ||2 +2 | x | y | + || y ||2 tinct elements | xj, | xk. Above, {[1, 0]T, [0, 1]T} and
|| x ||2 +2 || x |||| y || + || y ||2 = (|| x || + || y ||)2; now take the {[1, i]T, [1, i]T} are orthogonal bases.
square root. For the other part, (|| x || || y ||)2 =
|| x ||2 2 || x |||| y || + || y ||2 || x ||2 2 | x | y | + || y ||2 A basis is orthonormal iff it is orthogonal and all
|| x ||2 +2Rex | y+ || y ||2 = || x+y ||2. The second line is its elements have norm 1. Above, {[1, 0]T, [0, 1]T} is
similar. orthonormal; {[1, i]T, [1, i]T} can be normalised to
give { 21 [1, i]T, 21 [1, i]T} which is orthonormal.
Any maximal finite orthonormal set is a basis.
Independence, Bases, (Finite) Dimensionality (Exercise.)
A finite collection | x0, | x1 | xd is independent iff
0 | x0+1 | x1 +d | xd = 0 0 = 1 = d = 0 Henceforth we restrict attention to orthonormal
bases. Let | x0, | x1 | xd be an orthonormal basis.
A maximal (finite) set of independent vectors is a Then the expansion of | y is:
basis. Given a basis | x0, | x1 | xd, every | y has
an expansion of the form: | y = 0 | x0+1 | x1 +d | xd
| y = 0 | x0+1 | x1 +d | xd where for each k:
(or else | x0, | x1 | xd, | y would be a bigger inde- k = xk | y
pendent set, contradicting maximality). Also, the
expansion is unique. (Exercise.) We say the basis so that:
spans the whole space. | y = k xk | y | xk = k | xkxk | y
Moreover, any two bases have the same number of
Proof. For any k, xk | y = xk | j j xj = k.
elements, the dimension of H, dim(H). (Exercise.)

R. Banach, Computer Science Department, University of Manchester, UK 13 of 78 R. Banach, Computer Science Department, University of Manchester, UK 14 of 78

Linear Operators the examples are rather dishonest: there is no


reason why for arbitrary f L2(R),
I that x.f should
A linear operator A from H1 to H2 is a mapping be (finitely) square integrable, still less that f itself
such that for all | x, | y H1, , C:
I should be differentiable. This shows the problems
that arise in the infinite dimensional case.
A( | x+ | y) = A| x+A| y
I n, operators are matrices.
Example 6: On C
where A| x, A| y H2. Most often, H1 = H2.
x0 a00 a01 a0n1 x0
Clearly A0 = 0, and linear operators can be added x1 a a11 a1n1 x1
and scaled (A+B)| x = A| x+B| x. | x = A| x = 10
xn1 an10 an11 an1n1 xn1

Examples
Example 7: The Pauli Spin Matrices on Q.
Example 1: The null operator 0; for all | x, 0| x = 0.
Example 2: The identity operator I; I| x = | x. x = 0 1 y = 0 i z = 1 0 I= 1 0
1 0 i 0 0 1 0 1
Example 3: The operator on 3-space that maps a =
axex + ayey + azez to a = 5azex + (12ay +6ax)ey + azez. The Pauli Spin Matrices are of enormous practical
importance in quantum theory, as we will shortly
Example 4: On L2(R), I the operator x that sends f(x)
see. They satisfy a number of useful properties:
to x.f(x), i.e. it is the operation multiply by x.
xy = iz = yx
Example 5: On L2(R), I the operator p that sends f(x)
yz = ix = zy
to idf/dx, i.e. it is the operation differentiate by x
and multiply the result by i. zx = iy = xz (N.B. noncommutativity)

Examples 4 and 5 are fundamental to the wave x2 = y2 = z2 = I


function description of quantum systems in one x = x ; y = y ; z = z
- x and p are the
dimension. Up to factors of h,
position and momentum operators. Unfortunately where A = (AT)* is the adjoint (i.e. the conjugate
transpose) of the matrix A.

R. Banach, Computer Science Department, University of Manchester, UK 15 of 78 R. Banach, Computer Science Department, University of Manchester, UK 16 of 78
Operators A,B:HH can be composed. Thus Matrix Elements
AB:H H is the operator defined by:
Suppose in C I n, we have the standard orthonormal
AB | x = A(B | x) basis {[1, 0, 0 0]T, [0, 1, 0 0]T, [0, 0, 1 0]T, ,
[0, 0, 0 1]T}. We write this for short as {| 0, | 1,
This defines powers of A, eg. A2 = AA, A5 = AAAAA, | 2, , | n1}. Suppose we have an operator A
etc. Furthermore any function defined by a power given by a matrix (ajk). Then:
series that converges, extends to operators (at
least in the finite dimensional case). Examples: j | A | k = ajk
eA = I+A+ 2!1 2A2 + 3!1 3A3 + 4!1 4A4 + Thus ajk is what you get when you apply A to the
sin(A) = A 3!1 3A3 + 5!1 5A5 kth basis vector and extract the jth component of
etc. the result. Since A is given by the totality of such
facts, we can write:
Example 8: Functions of the Pauli Spin Matrices.
A = jk | jajkk | = jk | jj | A | kk |
exp(iz)
= I+(iz)+ 2!1 (iz)2 + 3!1 (iz)3 + 4!1 (iz)4 + Here k | is a bra vector (k | - | k, bra-ket, geddit?).
= I+iz 2!1 2I 3!1 i3z + 4!1 4I+ (Strictly speaking a bra is an element of the dual
= cos()I+isin()z space, i.e. an operation to linearly map each vector
(ket) to a complex number. The inner product y | x
Similarly for exp(ix), exp(iy) ... and so on. can be seen as the application of the bra y | to the
exp(in) = exp(i(nxx +nyy +nzz)) ket | x. For a ket | x given by a column matrix x, the
= I+(i(nxx +nyy +nzz))+ corresponding bra x |, is given by the adjoint x .)
2! (i(nxx +nyy +nzz)) +
1 2
A notable special case is the identity operator:
3! (i(nxx +nyy +nzz)) +
1 3
I = k | kk |
4! (i(nxx +nyy +nzz)) +
1 4
= I+ in 2! I 3! i n+ 4!1 4I+
1 2 1 3
Suppose we have a subspace spanned by basis
= cos()I+isin()n {| l}l=0...t . Then the projection operator P = l | ll |
Above, n = (nx, ny, nz) is a unit vector. takes a vector and yields the component.

R. Banach, Computer Science Department, University of Manchester, UK 17 of 78 R. Banach, Computer Science Department, University of Manchester, UK 18 of 78

Special Kinds of Operator We can assume that the converse holds too. For
every unitary U, there is a hermitian A (called the
The adjoint A of an operator A is defined by: generator of U) and a , such that U = eiA.
y | Ax = Ay | x N.B. The Pauli Spin Matrices are both hermitian
If A is | jk |, then it is easy to see that is | kj |, A and unitary.
and so our earlier notation is consistent with the Unitary operators U are invertible, in that they are
new definition. The matrix elements of the adjoint operators having an inverse U 1 such that UU 1 =
of an operator, are given by the adjoint matrix. I = U 1U. For an invertible U, U | v 0 unless | v =
0. For unitary U, the inverse is the adjoint. Note
Note that (A+B) = * A +* B.
that (U1U2) 1 = U2 1U1 1.
An operator A is normal iff:
AA = AA
Diagonalisation
Two kinds of normal operator are noteworthy. An Let A be an operator. A nonzero vector | v such
operator A is unitary iff:
that A | v = v | v where v is a complex number is
AA = I = AA called an eigenvector of A with eigenvalue v. For
an eigenvalue v, (AvI) | v = 0, so all eigenvalues
An operator A is hermitian iff: are contained in {v | (AvI) is not invertible}.
A = A For normal matrices A the eigenvalues can be
found by solving:
det(AvI) = 0
If A is hermitian then for real , eiA is unitary.
which is called the characteristic equation of A.
Proof. First (eiA) = (I+(iA)+ 2!1 (iA)2 + ) = I+ Once the eigenvalues v are found, finding the
(i*A)+ 2!1 (i*A)2 + = I+(iA)+ 2!1 (iA)2 + eigenvectors reduces to solving (AvI) | v = 0.
= eiA. Now eiAeiA = (I+(iA)+ 2!1 (iA)2 + )
(I+(iA)+ 2!1 (iA)2 + ) = = I = = eiAeiA.

R. Banach, Computer Science Department, University of Manchester, UK 19 of 78 R. Banach, Computer Science Department, University of Manchester, UK 20 of 78
A normal matrix has a complete eigenvector Change of Basis
decomposition in that a normal A can be written:
In general eigenvectors will not coincide with basis
A = i vi | vivi | vectors in the particular orthonormal basis you
happen to be working with. So let {| ul}l=0..n1 and
where the | vi are eigenvectors with eigenvalues vi, {| vi}i=0..n1 be two orthonormal bases. Then each
and the collection of the | vi forms an orthonormal | vi will be a linear combination of the | ul:
basis for the whole space. (This is not true for arbi-
trary operators.) | vi = l ul | vi | ul = l | ulul | vi
Moreover uj | ui = vj | vi = ij (1 if i = j, else 0); i.e.:
For unitary and hermitian matrices the eigenvector vj | vi = lm um | um | vj* ul | vi | ul
decompositions have specific forms. = lm lmum | vj* ul | vi = l vj | ulul | vi = ij
For unitary U = i vi | vivi |, we have | vi | = 1 for all i. So the ul | vi are the matrix elements of a unitary
operator U since the last equality is just UU = I.
For hermitian A = i vi | vivi |, vi is real for all i.
Under a change of basis (rotation) described by a
This is consistent with remarks above. Consider a
unitary U, vectors and operators transform by:
hermitian A. Then:
eiA
| x U | x and A UAU
= I+(iA)+ 2!1 (iA)2 + 3!1 (iA)3 + 4!1 (iA)4 + respectively, since then:
= ( i | vivi |)+(i)( i vi | vivi |)+
(A | x) UAUU | x = U(A | x)
2! (i) ( i vi | vivi |) + 3! (i) ( i vi | vivi |) +
1 2 2 1 3 3

= ( i 1 | vivi |)+( i (ivi) | vivi |)+


( i 2!1 (ivi)2 | vivi |)+( i 3!1 (ivi)3 | vivi |)+
= i (1+(ivi)+ 2!1 (ivi)2 + 3!1 (ivi)3 +) | vivi |) Example 1: Rotation by unitary operator x. This is:
= i exp(ivi) | vivi |
x = 0 1
If and the vi are real then | exp(ivi) | = 1 for all i as 1 0
required.

R. Banach, Computer Science Department, University of Manchester, UK 21 of 78 R. Banach, Computer Science Department, University of Manchester, UK 22 of 78

It looks like it just swaps components round. The Constructions on Spaces


standard basis, {| 0, | 1} = {[1, 0]T, [0, 1]T}, i.e.
It is important to be able to make bigger spaces
| 0 = 1 | 1 = 0 and operators out of smaller ones. The most
0 1 important constructions for this are the direct sum
and the tensor product.
goes to {| 0, | 1} = {x | 0, x | 1} = {[0, 1]T, [1, 0]T}.
An operator eg. y, goes to xyx = xyx =
izx = iiy = y, which is indeed consistent with Direct Sums
the view that x just swaps components round. Let H1 and H2 be spaces. We define the direct
Example 2: Rotation by unitary operator H. This is: sum H1 H2 as the space whose vectors are pairs
(| u, | v) where | u and | v are vectors in H1 and H2
respectively. In essence H1 and H2 are orthogonal
H= 1 1 1 components of H1 H2 just as the X and Y axes
2 1 1
are orthogonal components in the plane.
The standard basis, {| 0, | 1} = {[1, 0]T, [0, 1]T}, The linear operations are defined as follows:
goes to {| 0H, | 1H} = {H | 0, H | 1} which is
(1) (| u1, | v1), (| u2, | v2) H1 H2
| 0H = 1 1 = 1 (| 0 + | 1) (| u1, | v1) + (| u2, | v2) =
2 1 2 (| u1+ | u2, | v1+ | v2) H1 H2
(2) (| u, | v) H1 H2 , C I
| 1H = 1 1 = 2
1 (| 0 | 1)
2 1 (| u, | v) = ( | u, | v) H1 H2

H is called the Hadamard rotation, {| 0H, | 1H} = An obvious consequence is that (0, 0) is the zero
{H | 0, H | 1} = { 21 [1, 1]T, 21 [1, 1]T} is called the vector in H1 H2. For the inner product:
Hadamard basis. We will meet these frequently
(3) (| u1, | v1), (| u2, | v2) H1 H2
below.
(| u1, | v1) | (| u2, | v2) = u1 | u2+v1 | v2 CI

R. Banach, Computer Science Department, University of Manchester, UK 23 of 78 R. Banach, Computer Science Department, University of Manchester, UK 24 of 78
Operators go as follows. Let A1 be an operator on these are orthogonal, so dim(H1 H2) = dim(H1) +
H1 and A2 be an operator on H2. Then A1 A2 is dim(H2). N.B. For every H and every basis {| uj}j of
the operator on H1 H2 defined as follows: H, H is the direct sum of all the subspaces Hj cor-
responding to the individual basis vectors | uj.
(4) (| u, | v) H1 H2
A1 A2 (| u, | v) = (A1 | u, A2 | v) H1 H2
Note that you dont get an operator on H1 H2 from Tensor Products for Dummies
just A1 alone. If theres no obvious A2 around, a
An enormous amount can be said about tensor
couple of default choices for A2 are I and 0 (the lat-
products, and from the point of view of quantum
ter giving a projection effect).
theory tensor products are far more important than
Note also that operators of the form A1 A2 are just direct sums. We will keep it as simple as we can.
a small portion of all operators on H1 H2 as they
Let H1 with basis {| uj}j=0..m1, and H2 with basis
do not mix the H1 part with the H2 part.
{| vk}k=0..n1 be spaces. Then the tensor product
Consider eigenvalues and eigenvectors, let A1 | u = H1 H2 has as one possible basis the collection
u | u, and A2 | v = v | v. Then: {| uj | vk}j=0..m1,k=0..n1 (and thus dim(H1 H2) =
dim(H1) dim(H2)). This means that a vector in
A1 A2 (| u, 0) = u(| u, 0) H1 H2 has the general form:
so (| u, 0) is an eigenvector of A1 A2 with eigen- jk ajk | uj | vk
value u, and:
The tensor product extends by linearity to all of
A1 A2 (0, | v) = v(0, | v) H1 and H2. Thus if:
so (0, | v) is an eigenvector of A1 A2 with eigen- | u = j aj | uj ; | v = k bk | vk
value v. This covers all the possibilities.
then:
Let {| uj}j=0..m1 be a basis of H1, and {| vk}k=0..n1
be a basis of H2. Each | uj can be identified with | u | v = jk aj.bk | uj | vk
the H1 H2 vector (| uj, 0); likewise each | vk can
be identified with the H1 H2 vector (0, | vk). All of The best way to think of an object like | u | v is as
a pair of siamese twins. Inextricably tied together

R. Banach, Computer Science Department, University of Manchester, UK 25 of 78 R. Banach, Computer Science Department, University of Manchester, UK 26 of 78

into an indivisible entity, but nevertheless retaining just A1 alone. If theres no obvious A2 around, the
some individuality as vectors in their own right. default for A2 is I (N.B. Choosing 0 reduces A1 A2
to the 0 operator by linearity arguments as above).
The linear operations are defined as follows: Also operators of the form A1 A2 are just a small
(1) jk ajk | uj | vk, jk bjk | uj | vk H1 H2 portion of all operators on H1 H2.
jk ajk | uj | vk + jk bjk | uj | vk = Consider eigenvalues and eigenvectors, let A1 | u =
jk (ajk + bjk) | uj | vk H1 H2 u | u, and A2 | v = v | v. Then:
(2) jk ajk | uj | vk H1 H2 , C I A1 A2 | u | v = u.v | u | v
jk ajk | uj | vk = jk ajk | uj | vk H1 H2
so that | u | v is an eigenvector of A1 A2 with
An obvious consequence is that 00 is the zero eigenvalue u.v. This covers all the possibilities.
vector in H1 H2. But that isnt the only way of
writing it, since by linearity, for any | u or | v we Notes
have | u0 = 00 = 0 | v. The tensor product is a bit like a multiplication that
For the inner product: doesnt go all the way. Tensor products are quite a
bit trickier than direct sums. In a direct sum, once
(3) (| u | v), (| u | v) H1 H2 you have an element of H1 H2 in the form (| u, | v)
(| u | v) | (| u | v) = u | uv | v CI thats it. That form is canonical: essentially, you
cannot rewrite (| u, | v) = (| u, 0) + (0, | v) in any dif-
so ( jk ajk | uj | vk) | ( jk bjk | uj | vk) = jk ajk* bjk. ferent way, while still retaining the (| -, | -) shape.
Operators go as follows. Let A1 be an operator on Tensor products are different. Writing an element
H1 and A2 be an operator on H2. Then A1 A2 is of H1 H2 in the canonical way with respect to a
the operator on H1 H2 defined as follows: basis {| uj | vk}j=0..m1,k=0..n1, i.e. in the form:
(4) jk ajk | uj | vk H1 H2 | = jk ajk | uj | vk
A1 A2 jk ajk | uj | vk =
jk ajk (A1 | uj)(A2 | vk) H1 H2 gives no clue about whether | can be written in
the form | u | v, or in the form q q | uq | vq with
Note that you dont get an operator on H1 H2 from q ranging over fewer than m.n elements, and if it

R. Banach, Computer Science Department, University of Manchester, UK 27 of 78 R. Banach, Computer Science Department, University of Manchester, UK 28 of 78
can, whether the representation is unique or not. H n | 00 = H | 0H | 0 H | 0
= [ 21 (| 0+ | 1)][ 21 (| 0+ | 1)] [ 21 (| 0+ | 1)]
Example: Consider the standard and Hadamard
= 21 n(| 0000+ | 0001+ | 0010+)
bases, {| 0, | 1} and {| 0H, | 1H} = { 21 (| 0 + | 1),
= 21 n z | z
2 (| 0 | 1)}. It is easy to check directly that:
1

(| 0 | 0 + | 1 | 1) = (| 0H | 0H + | 1H | 1H) where the sum over z is over all binary strings of


length n. So just by a simultaneous change of
(I tend to call such surprising but true equalities basis in each of the factors of the n-fold tensor
between terms of the form q q | uq | vq tensor product, we have a uniformly weighted sum of
product sleight of hand; we will see more of this in vectors representing all binary strings of length n.
due course.) This just gets worse with multiple ten-
sor products, i.e. H1 H2 Hn. Some more: Apply the Hadamard rotation to an
arbitrary standard basis vector | w = | 0110 say.
We will often write | u | v as | uv or as | u | v or
as | u, v or just as | uv when the tensor product H n | w = H n | 0110
structure can be infered. = H | 0H | 1H | 1 H | 0
= [ 21 (| 0+ | 1)] (+ for | 0 factors)
[ 21 (| 0 | 1)] ( for | 1 factors)
We will need tensor powers of Q, i.e. Qn. [ 21 (| 0 | 1)] ( for | 1 factors)

Starting with the standard basis {| 0, | 1}, for the [ 21 (| 0+ | 1)] (+ for | 0 factors)
tensor square we get a basis {| 00, | 01, | 10, | 11}. = 21 n z ()w.z | z
For the tensor cube we get {| 000, | 001, | 010,
| 011, | 100, | 101, | 110, | 111}. Etc. Here w.z is the scalar product between the two bit
vectors w = 011...0 and z = (whatever), and is the
In general the standard basis vectors of the nth total number of bit positions in which both w and z
tensor power of Q can be labelled by the binary have a 1. Thus:
strings of length n.
Now apply the Hadamard rotation to the basis vec- H n | w = 1n
2 z ()w.z | z
tor | 0 in each factor of an n-fold tensor power of Q.
Learn to love this formula.

R. Banach, Computer Science Department, University of Manchester, UK 29 of 78 R. Banach, Computer Science Department, University of Manchester, UK 30 of 78

Quantum Theory Principles of Quantum Mechanics


Anybody who is not shocked by quantum theory has not understood it.
Different accounts give the principles in different
Niels Bohr ways. However it all amounts to the same thing.
It requires a certain degree of sophistication ... to grasp the existence of quantum mechanics,
I would say theres much more difference from this point of view, between a human being who
Heres one way of doing it.
knows quantum mechanics and one who doesnt, than between one that doesnt and the other
great apes. The big divide is between people who know quantum mechanics and people who I The (pure) states of a quantum system are
dont. The ones who dont, for this purpose, are goldfish.
Murray Gell-Mann described by the unit vectors up to phase
Quantum theory as we now understand it endured (rays) of a Hilbert Space.
a long, painful and erratic birth process, from the So the phase of a state doesnt matter. The vectors
oversimplified attempts of the old quantum theory, | and ei | describe the same physical state.
via subtle adaptations of the most sophisticated Note that every unit vector in the state space is a
formulations of classical mechanics and classical potential configuration of the system.
electrodynamics ever conceived1, to the enduring
framework of today. A framework that moreover II The state space of a composite system (of
continues to disdainfully rebut all experimental distinguishable components) is the tensor
challenges, and the understanding of which is still product of the component state spaces.
maturing.
So the state space of an electron and a proton is
Sadly, we dont have time to cover any of this the tensor product of the electron state space and
fascinating stuff in any detail. the proton state space.
We just present quantum theory as an axiomatic III The time evolution from time t0 to time t1 of the
system in linear algebra. This together with the state of a (closed) quantum system is given by
rules for relating the linear algebra to observable
a unitary operator U(t0,t1).
phenomena is enough to get quantum theory to do
the job that we want. So if the state at time t0 is | (t0) then the state at
time t1 > t0 is | (t1) = U(t0,t1) | (t0).
1. In physics, it is palpably the case that the search for abstraction in physical theory
has led to some of the most profound advances, a fact that even the most recalcitrant
experimentalist would find hard to deny. In computer science it is palpably not the
[Aside: The unitary U(t0,t1) can be written U(t0,t1) =
case that the search for abstraction in computation theory has led to deep advances; eitH, where t = t1 t0 is real, and H is a hermitian
increasing elegance often leads to increasing irrelevance; vede Churchs Thesis.

R. Banach, Computer Science Department, University of Manchester, UK 31 of 78 R. Banach, Computer Science Department, University of Manchester, UK 32 of 78
operator, as we know. Up to a factor of h, - this H is Vb Performing a measurement MB on a state |
the Hamiltonian, the generator of time evolution in nondeterministically sends | to one of the
quantum theory. For physics, knowing the correct following outcomes:
H for any given system is the crucial question. The
dynamics, (given eg. by the Schrdinger equation) N11 P1 | = N11 l1 | l1l1 | where
relates the time derivative of the state to H. For us, N1 = || P1 | ||, with probability || P1 | ||2
H is of no concern.]
Nm1 Pm | = Nm1 lm | lmlm | where
IV Every physical observable A corresponds to a
Nm = || Pm | ||, with probability || Pm | || 2
hermitian operator A on the state space. The
eigenvalues of A are the only values that can Each outcome is a projection and renormalization
be obtained for A by experiment. of | by one of the Pj with probability || Pj | || 2.
[This is often called the projection postulate.]
This is radically different to the classical idea of a
physical observable. Vc Performing an observation of an observable A
(experiment to measure A), means performing
For a composite system, whose state space is
H1 H2, observable A1 of system H1 becomes the the measurement MB, where B is a basis of
observable A1 I2 of H1 H2 and observable A2 of eigenvectors of A partitioned according to the
system H2 becomes the observable I1 A2 of eigenspaces of A. For each possible outcome
H1 H2. These are both different from observable of the measurement, Nj1 Pj | , the value
A1 A2 which is also an observable of H1 H2. obtained for A is the eigenvalue vj, where j is
the eigenspace of eigenvectors for vj.
Va A measurement MB is a set of projections
M = {P1 = l1 | l1l1 |, , Pm = lm | lmlm |} Since the eigenvectors of A form a basis of the
corresponding to a partition of a basis state space {| l1,0 | l1,n11, | l2,0 | l2,n21, ,
B = {{| l1}l1, , {| lm}lm} = | lm,0 | lm,nm1}, the total probability for obtaining
{{| l1,0 | l1,n11}, , {| lm,0 | lm,nm1}} some outcome is:
of the state space. || P1 | ||2 + + || Pm | || 2 = k | k | | 2
Thus P1 ++Pm = I = k | kk | (the identity). = | | | 2 = 1

R. Banach, Computer Science Department, University of Manchester, UK 33 of 78 R. Banach, Computer Science Department, University of Manchester, UK 34 of 78

(because | is a unit vector). Thus the probabili- tioned basis {{| 4}, {| 5a, | 5b}}. The eigenvalue 5
ties add up to 1, as they should. [Moreover, the fact is degenerate. In state | = 31 | 4+ 32 | 5a+ 32 | 5b, the
that all observable probabilities look like || Pj | || 2, probabilities of observing the various outcomes is:
explains why the the phase of a state does not | 4: 91 , 21 | 5a+ 21 | 5b: 98 ; while the expectation value
matter.] of A in state | is 91 4+ 98 5 = 449 . N.B. Unless the
ratio between the | 5a and | 5b components in |
When a large number of observations of A on state is known to be 1:1 precisely, if 5 is observed, then it
| are performed, the average (or expectation will not be known that the resulting state is pre-
value (of A in state | ) that is obtained is: cisely 21 | 5a+ 21 | 5b.
j vj || Pj | || 2 Example 3: The measurement corresponding to
= ( l1 | l1l1 |)v1 ( l1 | l1l1 | ) the basis partition {{| 0}, {| 1}} (on the space Q).
+ The projections are {P0 = | 00 |, P1 = | 11 |}.
+ ( lm | lmlm |)vm ( lm | lmlm | )
= | ( lj | ljvj lj |) | Example 4: The measurement corresponding to
= | A | the basis partition {{| 0, | 1}} (on the space Q). The
projection is I = | 00 | + | 11 |, i.e. the identity. This
[N.B. For any projection operator Pj, Pj2 = Pj.] is the null measurement, since every state on Q
remains unchanged under the projection I.
Example 1: An observable A corresponding to her-
mitian operator A = | 444 | + | 555 | + | 666 |. The Note the differences between Examples 1 and 2,
collection of projections for this is {P4 = | 44 |, P5 = and between Examples 3 and 4, even though each
| 55 |, P6 = | 66 |}, corresponding to the partitioned pair is constructed from (effectively) the same
basis {{| 4}, {| 5}, {| 6}}. In state | = 31 | 4+ 232 | 6, basis. The granularity of the partition of the basis
the probabilities of observing the various outcomes is what reveals the information yielded by a meas-
is: | 4: 91 , | 5: 0, | 6: 98 ; while the expectation value of urement. Note the difference in terminology:
A in state | is 91 4+ 98 6 = 529 .
A measurement projects the state (via
Example 2: An observable A corresponding to her- the projections for a partition of the basis).
mitian operator A = | 444 | + | 5a55a | + | 5b55b |. An observation associates numbers
The collection of projections for this is {P4 = | 44 |, with the projections.
P5 = | 5a5a | + | 5b5b |}, corresponding to the parti-

R. Banach, Computer Science Department, University of Manchester, UK 35 of 78 R. Banach, Computer Science Department, University of Manchester, UK 36 of 78
N.B. A projection (i.e. an operator of the form P = Those were the principles ...
l | ll | where the summation is over some subset
of a basis) is itself a hermitian operator. So it yields The principles however dont tell you anything at all
an observable, with eigenvalues 1 and 0 (or just 1 if about what state space corresponds to what physi-
the projection is I, or just 0 if the projection is 0). cal system, what hermitian operator corresponds
The associated projections are P = l | ll | (for to what physical observable, etc. That remains an
eigenvalue 1), and P = I P (for eigenvalue 0). issue for patient exploration in the lab.
Note the dual role of projections.

Conventional presentations of quantum theory


So quantum systems either evolve smoothly, via a invariably discuss issues like:
continuous unitary U(t0,t1), or discontinuously, Schrdingers equation and wave functions.
via a measurement, when the state jumps to an
eigenstate of a suitable projection. The Canonical Commutation Relations.

The balance between unitary evolution and meas- Heisenbergs Uncertainty Principle.
urement projections in the dynamics of a physical Bohr Complementarity.
system, determines the extent to which the system
behaves either like a quantum transition system The nature of measurement.
(unitary evolution) or a stochastic transition system The classical limit of quantum theory.
(unitary evolution followed by a measurement).
Contemporary theoretical and experimental work
shows that most of these things are at the very
least, quite a bit more subtle than was assumed in
the early days. We will not discuss them beyond
what has been said already.

R. Banach, Computer Science Department, University of Manchester, UK 37 of 78 R. Banach, Computer Science Department, University of Manchester, UK 38 of 78

Basic Stuff The fundamental observables for spin- 21 particles


are the spin polarisations, which we take to be
Electrons for Dummies - by:
given (up to factors of h)
Electrons are the spin- 21 particles of choice. There n = (nxx +nyy+nzz)
are of course many others. They all enjoy a wealth
of fascinating properties. We will take a drastically where n = (nx, ny, nz) is a unit vector (in 3-D space),
oversimplified view: for us the state of an electron and = (x, y, z) is the spin operator vector.
can be described using a unit vector in Q. [Aside: In fact, more fundamental physically, is the
This is indeed a drastic oversimplification; we cant operator vector S = (Sx, Sy, Sz) = 21 . Why the factor
1
even speak about where the electron might be; we 2 in particular? Because Sx, Sy, Sz, must satisfy the
can only discuss the electrons internal state, i.e. angular momentum commutation relations. These
its spin.2 (Such vectors in Q are called spinors.) are basic physical requirements for any system
that carries a representation of 3-D space rotation
A unit vector is | = [a, b]T where | a | 2 + | b | 2 = 1. So (as does spin), and are given (again up to factors
there is a such that | a | = cos(/2), | b | = sin(/2). So - by:
of h)
a = ei cos(/2), b = ei(+) sin(/2). Removing the
overall (and irrelevant) phase factor ei, we get: [Sx, Sy] = Sx Sy Sy Sx = iSz
[Sy, Sz] = Sy Sz Sz Sy = iSx
| = [cos(/2), ei sin(/2)]T [Sz, Sx] = Sz Sx Sx Sz = iSy
The total range of possibilities is given by letting Only the factor of 1
makes this come out right.]
2
0 , 0 2. This parameterisation of the
unit vectors (with the first components phase fac-
tor fixed at 1), neatly corresponds to the surface of
a sphere, with as a latitude parameter, and as Recall that the only values of spin that an experi-
longitude. This is the Bloch sphere. ment on an individual electron can observe are the
eigenvalues of the spin polarisation observable.
On the other hand, given an ensemble of spins
prepared in the same state, the ensemble average
2. Even this is not strictly true. The representation given only works for nonrelativistic
electrons. You cant handle Lorenz boosts, even if you were to include configuration
is given by the expectation value of the spin polari-
space information in the description; space inversion would screw up. sation observable.

R. Banach, Computer Science Department, University of Manchester, UK 39 of 78 R. Banach, Computer Science Department, University of Manchester, UK 40 of 78
To start with we look at the special cases where n Suppose we start with a | +z eigenvector of z, and
is a unit vector parallel to the coordinate axes, i.e. now we consider various scenarios.
at x, y, z. The eigenvalues and eigenvectors of
these are easy enough to find. It is enough to look (I) A measurement of z is made: +1 is obtained
at z: with certainty. The state remains as [1,0]T. Next x
is measured. Then outcomes +1 and 1 are equally
probable, because:
z = 1 0
0 1 | 21 [1,1]T | [1,0]T | 2 = 21 = | 21 [1,1]T | [1,0]T | 2
It is easy to check that this has two (normalised) So the state ends up as either 21 [1,1]T or 21 [1,1]T.
eigenvectors. These are | 0 = [1,0]T with eigen-
value +1, or spin up; and | 1 = [0,1]T with eigen- (II) First x is measured. Outcomes +1 and 1 are
value 1 or spin down. We will often refer to these equally probable as before, and the state becomes
as | +z and | z. (Why?) either 21 [1,1]T or 21 [1,1]T. Focus on +1 and 21 [1,1]T.
Next z is measured, then outcomes +1 and 1 are
By rotational symmetry (or by explicit calculation) equally probable, by a similar calculation. Also the
the eigenvalues of x and y are also +1 and 1. It 1 and 21 [1,1]T case is similar. In any event the
is easy to find the relevant eigenvectors, so: state ends up as either [1,0]T or [0,1]T with equal
probability. (Cf. the stochastic TS of lecture 1.)
x: for +1, 21 [1,1]T = | +x ; for 1, 21 [1,1]T = | x
y: for +1, 21 [1,i]T = | +y ; for 1, 21 [1,i]T = | y (III) First the state is allowed to evolve according
z: for +1, [1,0]T = | +z ; for 1, [0,1]T = | z to the unitary x. No measurement is made. Since
the evolution is unitary, the state becomes x | +z =
Note that n is not only hermitian, but unitary | z = 21 ( 21 [1,1]T 21 [1,1]T). Note that there is no
(because the x,y,z, are). So n can generate ambiguity. Now the state is allowed to evolve
both smooth evolution (i.e. no measurement, and according to the unitary z. No measurement is
the state evolves according to the unitary n), and made. The state becomes:
also discontinuous evolution (i.e. a measurement
is made of the hermitian observable n). z 21 ( 21 [1,1]T 21 [1,1]T)
= 21 ( 21 [1,1]T 21 [1,1]T)
= | z

R. Banach, Computer Science Department, University of Manchester, UK 41 of 78 R. Banach, Computer Science Department, University of Manchester, UK 42 of 78

(or more simply z [0,1]T = [0,1]T). Note there is no Now we return to the general case.
ambiguity; the state is [0,1]T without doubt. Now
z is measured. The outcome 1 is certain. (Cf. the What is the expectation value of n in state | =
quantum TS of lecture 1.) [cos(/2), ei sin(/2)]T ? Well:

These sequences of events are quite different, and n = nz nx iny


show two important things which it is vital to appre- nx +iny nz
ciate:
and so:
The order in which you do things makes a
very big difference in quantum mechanics | n | =
(regardless of whether the things are peri-
ods of unitary evolution, or measurements). [cos(/2), ei sin(/2)] nz nx iny cos(/2)
nx +iny nz e i sin(/2)
The points at which you perform measure-
ments and the measurements you perform After a bit of simplification this gives:
make a big difference in quantum mechan-
ics. | n | = (nxsin()cos() +
nysin()sin() +
nzcos())
Now (sin()cos(), sin()sin(), cos()) are the x, y, z,
components in spherical polar coordinates of a unit
vector built from | , = (x,y,z), in 3-D space
(just check x2 +y2 +z2), so we get finally:

| n | = n = cos((n,))

where (n,) denotes the angle between n and


(in 3-D space).

R. Banach, Computer Science Department, University of Manchester, UK 43 of 78 R. Banach, Computer Science Department, University of Manchester, UK 44 of 78
N.B.1. An easier way of obtaining this is to assume More than one Electron
that the coordinate axes are such that the z axis is
aligned with n. Then nx = ny = 0, and nz = 1, so we We use the same techniques to get probability
get just cos() = cos((n,)). The generalisation fol- amplitudes involving more than one electron.
lows from the rotational symmetry of the shape Consider a two-electron system with state space
n; it is an inner product, and rotations are defined Q1 Q2. Let us calculate the expectation value of
to preserve inner products.3 the observable:

N.B.2. Do not confuse the various unit vectors (n11)(n22)


here. | is a unit vector in Q; while n and are in the so-called singlet state:
unit vectors in real 3-D space. Moreover is more
than just a vector in 3-D space, it is a vector opera- |sing = 1 (| + | +)
tor acting in Q. 2
This can be done simply enough.
In general the eigenvectors of n are:
sing | (n11)(n22) |sing
For +1, 1/ 2(1+nz) [1+nz, nx +iny]T = | +n = 21 (+ | + |)(n11)(n22)(| + | +)
For 1, 1/ 2(1nz) [nz 1, nx +iny]T = | n = 21 (+ | (n11)(n22) | +
+ | (n11)(n22) | +
For a general state | , the probability that an + | (n11)(n22) | +
observation of n will detect +1 is: + + | (n11)(n22) | +)
= 21 (+ | n11 | + | n22 |
| +n | | 2 = 21 (1 + cos((n,)))
+ | n11 | | n22 | +
and for 1 it is: | n11 | ++ | n22 |
+ | n11 | + | n22 | +)
| n | | 2 = 21 (1 cos((n,)))
This is built up out of expectation values calculated
This agrees with | n | since: above, + | n | + = nz and | n | = nz; together
| n | = + | +n+n | | nn | with other things which are easily calculated, viz.
+ | n | = nx iny and | n | + = nx +iny. We get:
3. N.B. This is the tip of a huge group theoretic iceberg.

R. Banach, Computer Science Department, University of Manchester, UK 45 of 78 R. Banach, Computer Science Department, University of Manchester, UK 46 of 78

sing| (n11)(n22) |sing Qubits


= (n1,xn2,x + n1,yn2,y + n1,zn2,z)
Given the prevalence of quantum systems with an
= n1n2
internal state space Q, with two basis vectors | 0
= cos((n1,n2)) and | 1, and the convention in computation theory
This is a nice simple result. It corresponds to the of coding things using the two symbols 0 and 1,
value observed when the spin polarisations of both being the two possible values of a single bit of
electrons are measured simultaneously at various information, we can regard an abstract quantum
angles, and thus represents the average correla- system with state space Q, as a qubit, a quantum
tion observed between the two spins (in the singlet analogue of the classical bit, a carrier of quantum
state, and at those angles). It is along the lines of information.
what we expect, because in each summand of A classical bit can only be in one of the two states,
|sing, the spins are oppositely aligned, and so 0 or 1. A qubit can be in a continuum of states
when n1 = n2, we get perfect anticorrelation. given by | 0+ | 1, where | | 2 + | | 2 = 1. This
might imply that one can embed an arbitrary
amount of classical information in a single qubit
(eg. by encoding it in the infinite string of decimal
places of the decimal representation of or ).
However this is misleading. You cannot extract this
level of detail using a quantum measurement since
measurement causes a discontinuous jump in the
state. In practice you can only hope to get one bit
of information out of a qubit. Whats the point of
using qubits then?
Ans: You can manipulate qubits in a different way
from classical bits. Thus a classical bit evolves in
a discrete step, flipping between 0 and 1, or not,
according to an instruction whose outcome may
be conditional on the values of some neighbouring
bits. A qubit evolves according to quantum theory;

R. Banach, Computer Science Department, University of Manchester, UK 47 of 78 R. Banach, Computer Science Department, University of Manchester, UK 48 of 78
either smoothly during unitary evolution, or discon- The No-Cloning Theorem
tinuously via a quantum measurement. The trick is
to exploit these novel mechanisms to try and gain In conventional computing there is no obstacle to
an edge computationally. making a copy of some information all systems
offer various kinds of Copy command and you just
use them as required. In the quantum computing
world, information is held in the quantum state, and
the analogue of copying would be a unitary oper-
ator U that could achieve for an arbitrary | :
U | | s = | |
where | s is some standard state. However this is
impossible: U | , s = | , and U | , s = | , ; now
[Aside: Theres an issue to do with qubits which we point out taking inner products of LHSs and RHSs gives:
now and then immediately ignore for the rest of this course. If
you wish to perform computations on collections of qubits that
encode binary information, then you have to make the qubits | = , s | UU | , s = , | , = | 2
individually identifiable. The equivalent problem doesnt exist
classically, you can always tell things apart you just look! so that | must be either 0 or 1, which is untrue
In the quantum regime its not so easy. If you use a collection in general.
of identical systems for the qubits (eg. a collection of electrons),
then the quantum statistics of collections of indistinguishable
physical systems comes into play, which forces all physical
states of the whole system to be either completely symmetric or
completely antisymmetric under permutations of the identical The no-cloning theorem colludes with quantum
subsystems. (Actually we have been surreptitiously exposed to measurement to conceal information, so you cant:
this already. The singlet state |sing we saw above, and will
revisit below, is antisymmetric under interchange of the two 1. do some quantum processing to get some
electrons.) This issue can potentially cause some problems :
processing binary information where you cant tell the bits apart
unknown state | ,
isnt a lot of use really. The way this is overcome is either to use 2. replicate it many times, ...
distinguishable systems for different bits, or if using identical
systems, to couple them to the environment sufficiently strongly and then make various measurements on distinct
that the degeneracy due to the symmetry of interchange is copies to pin down the precise details of what the
lifted. Below we will just assume that the problem has been
overcome in one way or another.] state | was.

R. Banach, Computer Science Department, University of Manchester, UK 49 of 78 R. Banach, Computer Science Department, University of Manchester, UK 50 of 78

Basis Copying vs. Cloning Entanglement


Although cloning of arbitrary states is impossible, Consider a 2-qubit system on QQ which contains
copying quantum encoded classical bit strings is the state:
OK. A classical n-bit string eg. 100...111 will corre-
spond to a basis vector eg. |100...111 in Qn. | = 1 (| 00+ | 11)
2
Copying these basis vectors to eg. the |0...0 basis This state cannot be written as a tensor product of
vector corresponds to a unitary operator U that two individual qubits such as | 1 | 2 in any way
acts as: whatsoever (i.e. it is not separable). Suppose on
the contrary that it was, then:
U | 0...00| 0...00 = | 0...00| 0...00
U | 0...01| 0...00 = | 0...01| 0...01 | 1 = a1 | 0+b1 | 1 and | 2 = a2 | 0+b2 | 1
U | 0...10| 0...00 = | 0...10| 0...10
... ... ... and therefore
U | 1...11| 0...00 = |1...11| 1...11 | = a1a2 | 00+a1b2 | 01+b1a2 | 10+b1b2 | 11
This partially specifies U as a partial permutation So a1b2 = b1a2 = 0. It is now becomes impossible to
of the basis vectors of Q2n. This can always be have a1a2 = b1b2 0.
extended to a complete permutation of the basis
vectors of Q2n, and therefore to a valid unitary U States that cannot thus be decomposed as tensor
by linearity. However the action of U will not agree products are called entangled.
with that of cloning for non-basis states.
Consider a similar construction in a larger system
The copying instead of cloning trick is used a lot in QHBIG, where Q is a 1-qubit atomic system, and
quantum computing. HBIG is a macroscopic system, eg. the state space
of Schrdingers cat. There is now a state:
| = 1 (| 0 | alive+ | 1 | dead)
2
in which the cat is in a superposition of alive and
dead states (such a state can arise by coupling the

R. Banach, Computer Science Department, University of Manchester, UK 51 of 78 R. Banach, Computer Science Department, University of Manchester, UK 52 of 78
cat to an unstable atomic particle; if the particle Bell and CHSH Inequalities
decays, it sets off a device that kills the cat).
Consider local realistic theories of physics. In
Now we make a measurement on the atomic sys- these, physical phenomena separated by large dis-
tem, forcing it into state | 0 or | 1. The whole entan- tances have no effect on one another; they have
gled state now jumps discontinuously into either independent existence. Facts about the world are
| 0 | alive or | 1 | dead. The cat moves from a half true or not independent of whether we choose to
alive and half dead superposition to one or the observe them at any particular point. This is a
other. This appears bizzare to say the least. basic tenet of everyday existence.
Insofar as macroscopic systems can be prepared Suppose we have four physical systems A, B, C, D
in superposed states at all, experiments confirm that are (a) widely separated, (b) can only produce
the prediction of quantum mechanics. values 1 when measured. Let the values obtained
when A, B, C, D are measured be A, B, C, D. Con-
Note that the subsystems in an entangled state sider:
need not be spatially coincident. When they are
widely separated, measurement can give rise to M = (A+C)B + (CA)D
action at a distance. Einstein, Podolsky and
Rosen were the first to point out this troublesome Now either A and C both have the same sign and
possibility, and so entangled states are also called so CA = 0 and M = (A+C)B = 2, or A and C have
EPR states. Entangled states with spatially sepa- opposite signs so A+C = 0 and M = (CA)D = 2.
rated components illustrate dramatically the differ- Either way:
ence between classical and quantum phenomena.
M = (A+C)B + (CA)D = 2
so that if we take the average over many identically
In Quantum Computing, entanglement is seen prepared systems we get:
not as a problem but as a resource.
| M | = | AB + BC + CD DA | 2
This is the Clauser-Horne-Shimony-Holt inequality
(Bell effectively considered the case B = C).

R. Banach, Computer Science Department, University of Manchester, UK 53 of 78 R. Banach, Computer Science Department, University of Manchester, UK 54 of 78

Now consider an atomic species that decays and Inserting this in the CHSH inequality, and choosing
produces a pair of electrons the spin part of whose the directions to be in the plane perpendicular to
state is the singlet state: the direction of flight of the electrons, gives:
|sing = 1 (| + | +) | cos((A,B)) + cos((B,C)) +
2
cos((C,D)) cos((D,A)) | 2
where the + and refer (as usual) to the z axis, and
which fly apart in opposite directions: Choosing (A,B) = (B,C) = (C,D) = (A,D)/3 =
/4, the positive coss each give 1/2 and the nega-
A,C B,D tive cos gives 1/2. So we derive:
22 2
Let A and C be two different measurements of the
spin polarisation (transverse to the direction of which is absurd.
flight) on the leftgoing electron, and B and D be
two different measurements on the rightgoing elec- Quantum mechanics denies local reality.
tron. In such a scheme the four sample averages
AB, BC, CD, DA can be experimentally
obtained. Note that four sample measurements Experiments by the Aspect group (on polarised
cannot be obtained simultaneously in any individ- photons4) have confirmed the quantum mechani-
ual experiment, but local reality says that the cal predictions in situations where the A vs C and
measurements not performed in any particular B vs D choices are made at spacelike separations,
case do not conflict with the value that would have confirming that quantum mechanics can act nonlo-
been obtained if it had been (i.e. we depend here cally.
on counterfactual reasoning).
Now quantum mechanics (via our previous calcula-
tions) says that measurements of the correlation of
the polarisations of the two electrons in the singlet
state in directions A and B yield: 4. The only difference between photons and electrons in these circumstances is that
the correlation AB = cos((A,B)) for electrons becomes AB = cos(2(A,B)) for
AB = cos((A,B)) photons. Armed with this fact, the analogous calculations are easy, though we will
not go into details here. Of course, nothing in these notes explains why the only dif-
ference is the one stated.

R. Banach, Computer Science Department, University of Manchester, UK 55 of 78 R. Banach, Computer Science Department, University of Manchester, UK 56 of 78
The GHZ Argument so that:
Greenberger Horne Zeilinger and later Mermin, O1 | GHZ = 21 1x2y3y(| + | + | + | | | )
considered the decay of some atomic species that = 21 (1x| +2y| +3y| + 1x| 2y| 3y| )
produces 3 spin- 21 particles5 for which the spin part = 21 (| i | i | | +i | +i | +)
of the state is: = 21 (| + | + | + | | | )
| GHZ = 1 (| +++ | )
2 Similarly, defining:
where the + and refer (for definiteness) to the z X = 1x 2x 3x
axis, and which fly apart at 120 to each other.
we have:
X | GHZ = | GHZ

and remembering that x y = iz (and cyclically),
and that spin operators belonging to different spins
commute, we easily get:
Now consider the three operators:
O1 O2 O3 = X
O1 = 1x 2y 3y ;
O2 = 1y 2x 3y ; Now, given that the three components 1...3 are
O3 = 1y 2y 3x spatially far apart, we can measure say the 1x and
2y values of | GHZ , and knowing that | GHZ is an
These satisfy for i = 1...3: eigenstate of O1, determines the value of a meas-
urement of 3y on the resulting state. This works
Oi | GHZ = | GHZ
for all the observables O1, O2, O3, X, and all possi-
Proof: We can check that: ble choices of two spin variables to measure first;
and can lead us to suspect that all the values
x | + = | ; y | + = i | ; z | + = | + ; obtained for these various spin measurements, say
x | = | + ; y | = i | + ; z | = | m1x, m1y, m2x, m2y, m3x, m3y, have an independent
existence.
5. Little white lie here ...

R. Banach, Computer Science Department, University of Manchester, UK 57 of 78 R. Banach, Computer Science Department, University of Manchester, UK 58 of 78

Now since Oi | GHZ = | GHZ : Quantum Computing Basics


m1x .m2y.m3y = 1 Now we start processing qubits quantum mechani-
m1y.m2x .m3y = 1 cally, to see what computations can be done. The
m1y.m2y.m3x = 1 model of computation is the quantum circuit model:
and since X | GHZ = | GHZ :
unitary
m1x .m2x .m3x = 1 qubits evolution qubits
in and out
whereupon multiplying all four LHSs we get: measurements
m1x2 .m1y2 .m2x2 .m2y2 .m3x2 .m3y2 = 1
Basic facts:
whereas multiplying all four RHSs we get: No. of qubits in = No. of qubits out.6
1.1.1.1 = 1 Classical binary input information is coded in
the state of the input qubits by:
So local reality leads to 1 = 1. Note that this is a
sharper contradiction than CHSH since it applies 011...0 | 0110
to an individual experiment, not just statistically.
Classical output information must be extracted
As for the CHSH inequalities, GHZ type situations by measurement.
have been observed experimentally (in particular
by Zeilinger himself, though as ever, he was using Of particular note is this:
photons).
Since measurement destroys the state, if the
computation is to be useful, the answer sought
must be present in the output qubits state vector
with (at least) high probability amplitude.

The series of qubits is called a quantum register.


6. Neither unitary evolution nor measurement can alter the shape of the state space.

R. Banach, Computer Science Department, University of Manchester, UK 59 of 78 R. Banach, Computer Science Department, University of Manchester, UK 60 of 78
Quantum Gate Basics H the Hadamard transformation.
As in classical hardware design, quantum circuits the transformation that maps
are built out of a relatively small selection of basic | 0 to | 0, and | 1 to ei | 1 in Q.
gates.7 There are two basic kinds of gate:
Here is a reminder of their matrices:
Unitary gates: these are reversible, because all
8
unitary operators U have inverses U .
X= 0 1 Y = 0 i Z= 1 0
Measurement gates: these are irreversible, 1 0 i 0 0 1
(because of projection) and have to be specified
statically; the measurement cannot depend H= 1 1 1 = 1 0i I= 1 0
dynamically on the state to be measured. 2 1 1 0 e 0 1

Here are the most important gates we work with: Note that I = 0 and Z = .
One Qubit Gates Now consider the circuit:
Unitary gates:
H H +/2
I the IDENTITY, not normally mentioned, but
a valid unitary transformation just the same. It maps | 0 to 21 [1,1]T, then to 21 [1,ei]T, then to
2 2 [1+e , 1e ] = e
1 1 i i T i/2[cos(/2), isin(/2)]T, and
X the NOT transformation (swaps basis vectors finally to e [cos(/2), ei sin(/2)]T.
i/2
| 0 and | 1 in Q); the transformation formerly
known as Pauli spin matrix x. Up to the irrelevant ei/2, this is the most general
qubit state | , = [cos(/2), ei sin(/2)]T. Since Q is
Y the transformation formerly known as two dimensional, | , has an orthogonal comple-
Pauli spin matrix y. ment, | ,, unique up to an arbitrary phase, thus:
[sin(/2), ei cos(/2)]T. And so the transformation
Z the transformation formerly known as +/2HH (note the order of factors) rotates the
Pauli spin matrix z. basis {| 0, | 1} to the basis {| ,, | ,} in effect.
7. Its no coincidence that qubits are drawn as wires in quantum circuit designs.
This is the most general basis rotation since | ,
8. There are classical models of reversible computation, but we will ignore them.

R. Banach, Computer Science Department, University of Manchester, UK 61 of 78 R. Banach, Computer Science Department, University of Manchester, UK 62 of 78

is arbitrary and | , is determined up to phase by Two Qubit Gates


| ,. So the H and gates are sufficient to imple-
ment the most general unitary 1-qubit gate (all up Unitary gates; besides the identity gate there are:
to phases). For the record: CNOT the CONTROLLED NOT gate;
cos(/2) i sin(/2) the transformation that maps
+/2HH = ei/2
eisin(/2) i eicos(/2) | 00 | 00, | 01 | 01, (identity)
| 10 | 11, | 11 | 10. (swap)
If a and b are two classical bits, corresponding to
Measurement gates: qubit basis vectors | a and | b, then CNOT maps
MB projection onto basis B; the state vector jumps | a,b | a,ab where is EXCLUSIVE OR on a
and b. To see its matrix representation we have to
to one or other element of B with the usual
choose a specific order to list the basis vectors of
probabilities. Normally B is {| 0, | 1}. QQ. Predictably we choose | 00, | 01, | 10, | 11,
There is nothing special about the standard basis i.e. the lexicographical order on the corresponding
B of Q, though it is the most commonly used one. bit strings.9 As a matrix and as a circuit:
Equally good is the Hadamard basis {| 0H, | 1H}
which we have seen: CNOT = 1 0
0 1
0 qubit 0
| 0H = 1 1 = 1 (| 0 + | 1) 0 1 qubit 1
2 1 2 0 1 0

| 1H = 1 1 = 2
1 (| 0 | 1) In the circuit, the represents the EXCLUSIVE
2 1 OR whose result is in qubit 1, while the repre-
sents the controlling effect of qubit 0, with a full

One qubit is unfortunately rather limited most blob meaning switch on the XOR when this bit is 1
interesting computational problems require more
than one bit to code their instances! So we need
two or more qubit gates so that the qubits can be
(and there is an analogous empty blob possibil-

9. Thus far we have largely been able to avoid such choices of ordering of basis ele-
ments by splitting calculations involving tensor products into smaller ones on the fac-
coupled together. tors, because the operators we have dealt with (eg. (n11)(n22)) have been sep-
arable. Now that ceases to be the case and we must list all the component explicitly.

R. Banach, Computer Science Department, University of Manchester, UK 63 of 78 R. Banach, Computer Science Department, University of Manchester, UK 64 of 78
ity meaning switch on the XOR when this bit is 0 C-U the CONTROLLED-U gate, where U is a
and drawn as follows:) 1-qubit unitary gate; the transformation
that maps
qubit 0
| 00 | 00, | 01 | 01, (identity)
qubit 1 | 1 | | 1U | . (apply U)

CNOT is a very important gate. Heres another


C-U =
gate that you can implement with the CNOT gate. U

SWAP the SWAPPING gate; C-U has various useful special cases: CNOT is just
the transformation that maps C-X, and another special case of some importance
is C-, the controlled phase gate. The controlling
| 00 | 00, | 01 | 10, idea is a significant one, as we will see.
| 10 | 01, | 11 | 11.
Measurement gates:
SWAP = qb 0 =
MB projection onto basis B of subspace S.
qb 1
Taking the standard basis {| 00, | 01, | 10, | 11} of
QQ, the subspace S may be the whole of QQ;
[Aside: Why on earth do you need an actual circuit to swap two so if the state is a00 | 00+a01 | 01+a10 | 10+a11 | 11,
qubits around? Why not just swap the wires over? Well, the then any basis vector | 00, | 01, | 10, | 11, is a
lines in our circuits are time lines rather than physical wires.
In reality, insofar as qubits can be implemented at all, individual possible outcome, with probabilities | a00 |2, | a01 |2,
qubits are either implemented as distinguishable systems and | a10 |2, | a11 |2, respectively.
dispersed everywhere, or implemented as indistinguishable
systems and sufficiently nailed down within the environment to Alternatively S is the subspace corresponding to
enable them to be told apart; i.e. they cant move. So you need
a circuit. Maybe one day someone will invent a technology in one of the qubits, say qubit 0, in which case the
which qubits are restrained by purposely engineered conduits, relevant projections are:
along which they travel to be brought together to interact as
required. But for now thats just a pipe dream.]

R. Banach, Computer Science Department, University of Manchester, UK 65 of 78 R. Banach, Computer Science Department, University of Manchester, UK 66 of 78

P0 = | 0000 | + | 0101 | for obtaining answer 0, N.B. To go from the standard basis {| 00, | 01, | 10,
with probability | a00 |2 + | a01 |2, and if this is non- | 11} to the Bell basis {| 00B, | 01B, | 10B, | 11B}
zero, yielding the state: (both listed in the order given), you need the uni-
a00 | 00+a01 | 01 tary matrix:
| a00 |2 + | a01 |2 1 0 0 1
USB =
1 1 0 0 1
P1 = | 1010 | + | 1111 | for obtaining answer 1, 2 0 1 1 0
with probability | a10 |2 + | a11 |2, and if this is non- 0 1 1 0
zero, yielding the state:
a10 | 10+a11 | 11
| a10 |2 + | a11 |2

There is nothing special about the standard basis


of QQ, though it is the most commonly used one.
Equally good is the Bell basis which consists
exclusively of entangled states:
| 00B = 1 (| 00+ | 11)
2
| 01B = 1 (| 00 | 11)
2
| 10B = 1 (| 01+ | 10)
2
| 11B = 1 (| 01 | 10)
2
This is just as good as any other basis of QQ. In
particular, measurements can be done using the
Bell basis or any other basis. The mechanics of
these is just the same ... eg. just add subscript B.

R. Banach, Computer Science Department, University of Manchester, UK 67 of 78 R. Banach, Computer Science Department, University of Manchester, UK 68 of 78
Superdense Coding Note that these outcomes are orthogonal.
With 1-qubit gates and entanglement we can send Alice now puts qubit 0 on the Shuttle to Bob. When
two classical bits using one qubit as a channel. Bob receives it, he has both qubits of the pair and
can perform a maximal measurement (on QQ)
Alice wants to send two bits of classical information corresponding to the Bell basis partition {{| 00B},
to Bob, but can only pay the shipping costs of one {| 01B}, {| 10B}, {| 11B}}. Because he is measur-
qubit on the Space Shuttle. Luckily, Alice and Bob ing one of four basis states in the basis which they
share an entangled state 21 (| 00+ | 11) = | 00B that constitute, he is certain to discover which basis
they prepared earlier; Alice has qubit 0 of this and state it is. Hence he is certain to discover the two
Bob has qubit 1. Fortunately they are also both classical bits Alice had in mind.
pretty good at quantum theory.
Alice does one of four things to qubit 0 of the
entangled pair, according to the value of the two Using photons, quantum superdense coding has
classical bits she wants to send: been observed experimentally (by Zeilinger).
To send 00, Alice applies I to qubit 0; the total
state remains:
2 (| 00+ | 11) = | 00B
1

To send 01, Alice applies Z to qubit 0; the total


state becomes:
ZI 21 (| 00+ | 11) = 21 (| 00 | 11) = | 01B
To send 10, Alice applies X to qubit 0; the total
state becomes:
XI 21 (| 00+ | 11) = 21 (| 10+ | 01) = | 10B
To send 11, Alice applies iY to qubit 0; the total
state becomes:
iYI 21 (| 00+ | 11) = 21 ( | 10+ | 01) = | 11B

R. Banach, Computer Science Department, University of Manchester, UK 69 of 78 R. Banach, Computer Science Department, University of Manchester, UK 70 of 78

Quantum Teleportation
With 2-qubit gates and entanglement we can do
| 00B : 00
| 01B : 01
| 10B : 10
| 11B : 11

something fairly startling, namely teleportation.


Alice wants to send a qubit | = a | 0+b | 1 to Bob
who is far away. She doesnt know what the state
| is (i.e. what a and b are), and cant copy it to
experiment on it to find out, without destroying it
Quantum Superdense Coding

(by no-cloning). Luckily, Alice and Bob share an


entangled state 21 (| 00+ | 11) that they prepared
earlier; Alice has qubit 0 of this and Bob has qubit
1. The total state is the tensor product of | and
the entangled state (remember Alice has the first
two qubits of this and Bob the last qubit):
1 [a | 0(| 00+ | 11) + b | 1(| 00+ | 11)]
2
Alice applies CNOT to her two qubits, amounting to
applying CNOTI to the whole state:
11: iY
10: X
01: Z
00: I

1 [a | 0(| 00+ | 11) + b | 1(| 10+ | 01)]


2
Alice next applies H to her first qubit, i.e. HII to
1 (| 00+ | 11)

the whole state:


1
2 [a(| 0+ | 1)(| 00+ | 11) + b(| 0 | 1)(| 10+ | 01)]
Now comes the tensor product sleight of hand. The
2

above is the same as:


1
2 [ | 00(a | 0+b | 1) + | 01(a | 1+b | 0) +
| 10(a | 0b | 1) + | 11(a | 1b | 0) ]

R. Banach, Computer Science Department, University of Manchester, UK 71 of 78 R. Banach, Computer Science Department, University of Manchester, UK 72 of 78
Now Alice measures both her qubits, projecting

a | 0+b | 1
onto the basis {| 00, | 01, | 10, | 11}. The linear

| =
superposition of Bobs qubit states collapses to
one of four possibilities:
Alice got | 00, then Bobs qubit is (a | 0+b | 1)

11: X;Z
Alice got | 01, then Bobs qubit is (a | 1+b | 0)

01: X
10: Z
00: I
Alice got | 10, then Bobs qubit is (a | 0b | 1)
Alice got | 11, then Bobs qubit is (a | 1b | 0)
Bob doesnt yet know which of these happened, so

Quantum Teleportation
Alice has to tell him using classical communication
(no signalling faster than light then). However once
he knows the classical value Alice obtained, i.e.
00, 01, 10, 11, he knows what to do to recover an
exact replica of the original | :

00
01
10
11
Alice got 00, Bob applies I to recover |
Alice got 01, Bob applies X to recover |
Alice got 10, Bob applies Z to recover |
Alice got 11, Bob applies ZX to recover |

H
Note that Alices original qubit got projected away,

1 (| 00+ | 11)
destroying its value, so teleportation is not a way



around no-cloning. [Bob must have needed the
qubit more than she did.]

a | 0+b | 1
| =

2
Using (inevitably) photons, quantum teleportation
has been observed experimentally (by Zeilinger).

R. Banach, Computer Science Department, University of Manchester, UK 73 of 78 R. Banach, Computer Science Department, University of Manchester, UK 74 of 78

Gates with more than Two Qubits Toffoli or C 2-; in pictures:


| a | a
The more qubits in a gate, the harder it is to imag-
ine how to implement it. However some n-qubit Toffoli =
gates are conceptually useful. | b
| c
| b
| (ab)c

Cn-U the (multi) CONTROLLED-U gate, where
U is an m-qubit unitary gate; writing the Toffoli is useful because, acting on basis vectors, it
state in the form | where | is the can simulate classical nand and fanout as follows.
n-qubit control part and | is the m-qubit Note the basis copying (not cloning) in fanout.
target, Cn-U acts by:
| a | a
| a basis vector of Qn other than | 1n : nand =
| | ,
| 1n | | 1nU | .
(identity) | b
| 1
| b
| (ab)1 = | (ab)
(apply U)

Cn-U =
| 1 | 1
fanout =
| a
| 0
| a
| (1a)0 = | a


m U In turn nand and fanout are sufficient to implement
any classical circuit computation, a well known fact
from digital logic design. As a result we con-
As for C-U, Cn-U has variants where the control is
clude:10
concentrated on some other basis vector of Qn
than | 1n; diagramatically the 0 qubits are repre-
In principle, quantum computation is
sented by open circles as previously.
able to subsume classical computation.
As for C-U, Cn-U has various useful special cases.
The most useful of these is the Toffoli gate, C 2-. 10.To properly quantify this statement, we have to clarify how the size of the circuit
varies with the size of the inputs etc etc. This is beyond the scope of this course.

R. Banach, Computer Science Department, University of Manchester, UK 75 of 78 R. Banach, Computer Science Department, University of Manchester, UK 76 of 78
In detail, suppose we want to quantum compute a With Toffoli and a C-U we can emulate a Cn-U:
function f with several binary inputs and one binary
output whose classical circuit implementation we Cn-U =
n control
know. We construct a quantum circuit that corre-
sponds to our classical circuit by replacing each
qubits

nand and each binary fanout with a suitably tuned | 0


Toffoli. This produces a quantum circuit with more | 0
n1 ancilla
qubits
qubits than just the input and output qubits; we | 0
have ancilla qubits, and in general the computation
will produce some garbage qubits too. The circuit
U
so far implements the transformation:
Vf | 0,x, 0 = | gar(x),x, f(x) Note the use of ancilla (workspace) qubits again,
each initially in state | 0, for storing intermediate
where the garbage qubits are written first. To get results of the (((q0q1)q2)q3) calculation.
this into a standard form, we want to eliminate the
garbage by getting it back to | 0. We add an extra The Toffoli gate itself may be built from 1- and 2-
qubit | y and follow the application of Vf with a qubit gates. The solution is not unique. A simple
CNOT, controlling the flip of | y with the | f(x) qubit. solution follows as a special case of a special pur-
Finally we apply Vf to undo both the computation pose C 2-U design, which depends on the availabil-
of | f(x) and the garbage, getting the standard ity of a unitary operator V such that V 2 = U.
quantum implementation of f, Uf :
Uf | 0,x, 0, y = (Vf I)(IICNOT )(Vf I) C 2-U = =
| 0,x, 0, y | 0,x, 0,yf(x)


| gar(x) U V V V
( | 0 | 0 )
| x
Uf =
| x Vf Vf | x Setting V = (1 i)(I + iX )/2 gives Toffoli. In general
| f(x)
| 0
| y
| 0
| yf(x)
quite a bit is now known about building larger gates
out of smaller ones.

R. Banach, Computer Science Department, University of Manchester, UK 77 of 78 R. Banach, Computer Science Department, University of Manchester, UK 78 of 78

You might also like