Introduction to Quantum Computing

Lecture 2

The rules and math of quantum mechanics

Enter the Qubit

First we start out with the basic block of quantum computing. Analogous to the bit in classical computing, there is a quantum bit in quantum computing. A classical bit is a 2 state system, with the states denoted 0 and 1. A classical bit is always in one of those states or the other, and measuring the state return a 0 or 1 with certainty. n bits can be in exactly one of 2^{n} different ordered states, usually denoted 000 … 00, 000 … 01,…,111 … 11.^{a} Quantum bits (which we shall call qubits) similarly can exist in two states, which we call |0⟩ and |1⟩. However, they behave as if existing in many “in between” states. A quantum bit can be physically represented by any two state (or more) system, such as electron spin up and down, photon energy states, atomic energy levels, molecular vibrational freedom, and many others. For our purposes we assume physical representations are available (they are). To make the concept of a qubit precise, we define Definition 1 (Qubit). A qubit (or quantum-bit) is a unit vector in ℂ^{2}. Definition 2 (State vector). The state of a quantum system is a (column) vector in some

Copyright Chris Lomont 2003. Email corrections or questions to clomont@math.purdue.edu. a“There are only 10 kinds of people in the world. Those who understand binary and those who don’t.”

1

vector space, written |ψ⟩.

With this definition, we fix an orthonormal basis of (column) vectors, labelled |0⟩ = \binom{1}{0} and |1⟩ = \binom{0}{1}. It will turn out that physically, we can only distinguish orthogonal quantum states, thus the orthogonal requirement. And considerations of probability will make the normality convenient, thus we fix an orthonormal basis. Any such basis of ℂ^{2} will work, but we choose the above representations since they are good to work with. Finally, we make a qubit a unit vector because, again, it makes calculations cleaner, and has some physical significance. Now for the differences from classical bits. A qubit can be any unit vector, not just those corresponding to |0⟩ and |1⟩. A qubit can be in the state

α|0⟩ + β|1⟩  (1)

where α and β are complex numbers, with |α|^{2} + |β|^{2} = 1. While it only takes one “bit” to fully describe the state of a classical bit, it takes two complex numbers to completely describe the state of one qubit, which intuitively is infinitely more information! However we will see there are practical limitations to the amount of “information” one can store in a single qubit. This gives us the first of four postulates of quantum mechanics: Quantum Mechanics Postulate 1: State Space Associated to an isolated physical system is a complex vector space with inner product (a Hilbert space) known as the state space of the system. The system is completely described by its state vector, which is a unit vector in the system’s state space^{b}. Thus a n qubit system is a unit vector in ℂ^{2^{n}}. We will explain the inner product below (we can use the Euclidean one).

bPostulate taken verbatim from Neilsen and Chuang. The rest is Lomont-ized

How to “Measure” a Qubit

In principle you could store the knowledge in the Library of Congress on one qubit, but you could never retrieve it. When you read out the value in a qubit in the state in equation 1, it returns |0⟩ with probability |α|^{2}, or it returns |1⟩ with probability |β|^{2}, and then the qubit assumes the state just returned. For example, suppose we have a qubit in the state

|ψ⟩ = \frac{1}{\sqrt{2}}|0⟩ + \frac{1}{\sqrt{2}}|1⟩  (2)

What are the odds that it returns a |1⟩ when measured? A |0⟩? This generalizes to multiple qubits as we soon see. One last point is worth mentioning - there is a useful way to visualize operations on a single qubit, using the Bloch sphere. It will turn out that under obervation, states |ψ⟩ and e^{iθ}|ψ⟩ have the same behavior, so we can modify a state up to the phase iθ, where i = \sqrt{−1}. So given a single qubit state α|0⟩ + β|1⟩, we can remove a phase to write

α|0⟩ + β|1⟩ = e^{iγ} (cos \frac{θ}{2}|0⟩ + e^{iφ} sin \frac{θ}{2}|1⟩)  (3)

Since the phase out front has no effect on measurements, we can use θ and φ for spherical

3

coordinates

x = cos φ sin θ  (4)
y = sin φ sin θ  (5)
z =  cos θ  (6)

This allows us to picture a qubit as a point on a three dimensional sphere, and visualize operations upon a qubit. Unfortunately, this has no known generalization to multiple qubits

Qubits Galore

Similar to concatenating classical bit to get n-bit “bitstrings”, we concatenate qubits to get larger systems. Two qubits form a space spanned by four vectors

|0⟩ ⊗ |0⟩, |0⟩ ⊗ |1⟩, |1⟩ ⊗ |0⟩, and |1⟩ ⊗ |1⟩  (7)

where we will define the “tensor product” ⊗ in a moment. Shorthand for the above expressions is

|00⟩, |01⟩, |10⟩, and |11⟩  (8)

Definition 3. The tensor product of two vectors x = (x_{1}, x_{2}, …, x_{n})^{T} and y = (y_{1}, y_{2}, …, y_{m})^{T} as the vector in nm dimensional space given by

x ⊗ y = (\begin{matrix}x_{1}y \\ x_{2}y \\ … \\ x_{n}y \end{matrix}) = (\begin{matrix}x_{1}y_{1} \\ x_{1}y_{2} \\ … \\ x_{1}y_{m} \\ x_{2}y_{1} \\ … \\ x_{n}y_{m} \end{matrix})  (9)

Homework 1. Check this definition does not depend on a choice of basis.

5

Now we can check the second basis element (dictionary ordering)

|01⟩ = |0⟩ ⊗ |1⟩  (10)
= \binom{1}{0} ⊗ \binom{0}{1}  (11)

= (\begin{matrix}1\binom{0}{1} \\ 0\binom{0}{1} \end{matrix}) = (\begin{matrix}0 \\ 1 \\ 0 \\ 0 \end{matrix})  (12)

and we get the second usual basis element of ℂ^{4}. This works in general; that is, the vector corresponding to the state |n⟩ where n is a binary number, is the (n + 1)^{th} standard basis element. We also use the decimal shorthand sometimes: |32⟩ is the 33rd standard basis vector in some space which would be clear from context. Back to the inner product from postulate 1: We write it using the “braket” notation, where the symbol |k⟩ is called a ket, and the dual ⟨j| is a bra. Given a state (ket) |ψ⟩ = ∑ α_{j}|j⟩, we define the dual (bra) as the conjugate transpose, that is,

⟨ψ| = |ψ⟩^{†} = ∑ α_{j}^{∗}⟨j|  (13)

Together we write ⟨j|k⟩, which is the “braket” of states |j⟩ and |k⟩. Since the states are orthonormal, ⟨j|k⟩ is 1 if and only if j = k, otherwise it is zero. We extend this inner product ⟨−, −⟩ to general states via linearity. Thus states |ψ_{1}⟩ = ∑ α_{j}|j⟩ and |ψ_{2}⟩ = ∑ β_{k}|k⟩ give

⟨ψ_{1}|ψ_{2}⟩ = ∑_{j} α_{j}^{∗}⟨j| ∑_{k} β_{k}|k⟩
= ∑_{j,k} α_{j}^{∗}β_{k}⟨j|k⟩ = ∑_{m} α_{m}^{∗}β_{m}

So we have the equivalent notations for a 5 qubit state:

|1⟩ ⊗ |0⟩ ⊗ |0⟩ ⊗ |1⟩ ⊗ |0⟩ = |10010⟩
= |18⟩

It is worth noting that not all composite states are simple tensor products of single states. One of the simplest is one of the 2 qubit Bell states, β_{00} = \frac{|00⟩+|11⟩}{\sqrt{2}}. This is an example of an entangled state which turns out to be a very useful computational resource later. Homework 2. Prove β_{00} is not of the form |ψ⟩ ⊗ |φ⟩.

When appropriate, we may drop the normalization factor to clean up calculations. Then we could write β_{00} = |00⟩ + |11⟩, with the understanding this needs to be normalized.

7

Measuring revisited

Now - how about measuring these states? An arbitrary 2 qubit state is

|ψ⟩ = α_{00}|00⟩ + α_{01}|01⟩ + α_{10}|10⟩ + α_{11}|11⟩

with complex valued α_{ij}. Requiring ∑_{ij} |α_{ij}|^{2} = 1 is called the “normalization requirement”, and we assume all states are normalized. Sometimes to avoid clutter we will drop the coefficients. Suppose we only the first qubit of |ψ⟩. We will obtain |0⟩ with probability |α_{00}|^{2} + |α_{01}|^{2}, that is, we obtain a state with probability equal to the sum of the magnitudes of all states that contribute. After measuring, we know the first qubit is |0⟩, so only those type of states are left, causing the new state to be

|ψ^{∗}⟩ = \frac{α_{00}|00⟩ + α_{01}|01⟩}{\sqrt{|α_{00}|^{2} + |α_{01}|^{2}}}

Notice the new normalization factor in the denominator. Again, this idea generalizes to arbitrary (finite) dimension. Thus we have a way to denote arbitrary quantum states on n qubits:

|ψ⟩ = ∑_{j=0}^{2^{n}−1} α_{j}|j⟩  (14)

where the α_{i} are complex numbers satisfying the normalization requirement. Measuring |ψ⟩ returns state |j⟩ with probability |α_{j}|^{2}, and then becomes state |j⟩

Qubit evolution

We would like our quantum computers to work similar to classical computers. Classically, a very basic operation at the bit level is the NOT gate, which flips bits, that is 0 becomes 1 and 1 becomes 0. So the quantum version would take the state α|0⟩ + β|1⟩ ⟶^{NOT} β|0⟩ + α|1⟩. It is east to check the matrix

X = ( \begin{matrix}0 & 1 \\ 1 & 0 \end{matrix} )  (15)

performs the desired operation, by multiplying X on the left of the state. The name X is historical, and we will see the exponential of X rotates qubits around the x-axis on the Bloch sphere. Since X acts like a NOT gate on a qubit, it is often called the NOT operator. For fun, we compute “the square root of NOT.” We want an operator \sqrt{NOT} that when applied twice to a qubit, has the effect of NOT. This procedure will be useful when we need to construct quantum circuits and when we explain exponentials. In general, given a function f(t) of one complex variable, we extend this definition to diagonalizable matrices M = diag(m_{1}, m_{2}, … m_{n}) via:

f(M) = diag(f(m_{1}), f(m_{2}), …, f(m_{n}))  (16)

Since we want \sqrt{X}, we need to diagonalize X. Note the eigenvectors of X are \binom{1}{1} and \binom{1}{−1}. Setting a matrix P with these as column vectors, we have under this basis change the diagonal

9

matrix

P XP^{−1} = ( \begin{matrix}1 & 1 \\ 1 & −1 \end{matrix} ) ( \begin{matrix}0 & 1 \\ 1 & 0 \end{matrix} ) ( \frac{1}{2} −\frac{1}{2}^{\frac{1}{2}  \frac{1}{2}} )

=  ( \begin{matrix}1 & 0 \\ 0 & −1 \end{matrix} )

Applying f(t) = \sqrt{t}, and changing the basis back gives

P^{−1}f ( \begin{matrix}1 & 0 \\ 0 & −1 \end{matrix} ) P = ( \frac{1}{2} −\frac{1}{2}^{\frac{1}{2}  \frac{1}{2}} ) ( \begin{matrix}1 & 0 \\ 0 & i \end{matrix} ) ( \begin{matrix}1 & 1 \\ 1 & −1 \end{matrix} )

=  \frac{1}{2} ( \begin{matrix}1 + i & 1 − i \\ 1 − i & 1 + i \end{matrix} )
=  \sqrt{NOT}

It is an easy check to see that \sqrt{NOT}^{2} = X. This process of diagonalizing an operator, applying a function, and restoring the basis will be invaluable later. Homework 3. What is the effect of e^{−iθX/2} on the Bloch sphere, where θ is a real number?

A universal quantum gate?

It is a basic result in computer science that any circuit can be built with NAND gates, which performs the following operation on two bits a and b:

\begin{matrix}a \ b & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 0 \end{matrix}

Any function on n bits can be built up from NAND gates. However the general function requires exponentially many gates, so in practice we are restricted in the functions we utilize. So is there a similar “gate” for quantum computing? Yes, and no. It will take a while to answer this precisely, but there are finite (and small) sets of gates sufficient to approximate any desired quantum operation to any degree of accuracy in an efficient manner.^{a} To understand what operations we can physcially apply to a qubi (or set of qubits), we are led to study rules from quantum mechanics. It has become clear that abstract models of computation and information theory should be derived from physical law, rather than as standalone mathematical structures, since it is ultimately physical law that determines computability and information. Observation has led researchers to believe that at the quantum level, the following two facts hold:

aThe Solovay-Kitaev theorem says that for any gate U on a single qubit, and given any ϵ > 0, it is possible to approximate U to a precision ϵ using Θ(log^{c}(1/ϵ)) gates from a fixed, finite set, where 1 ≤ c ≤ 2. Detemining c is an open problem.

11

• All quantum evolution is reversible. That is very unlike the classical case, where for example NAND is not reversible.^{b} This is illustrated by the fact that an electron in orbit does not emit radiation and spiral into the nucleus.

• Quantum evolution is linear. That is, if an experiment is done on the state |0⟩ and on the state |1⟩, then when performed on mixed states the resulting state is the same state as if the initial two answers were added.^{c}

So we are left with “reversible” linear operators on the states, that is, matrices! Since the resulting state should satisfy the normalization requirement also, it turns out that any unitary operation is allowed. Recall U unitary means UU^{†} = I. We now have : Quantum Mechanics Postulate 2: State Evolution The evolution of a closed quantum system is described by a unitary transformation. That is, the state of a system |ψ⟩ at time t_{1} is related to the state |ψ′⟩ at time t_{2} by a unitary operator U which depends only on the times t_{1} and t_{2},

|ψ⟩ = U|ψ′⟩  (17)

Now we know how to specify quantum states and what is legal for manipulating the state.

Intermission - Linear algebra review

bCharles Bennett of IBM research showed in the 1970’s that energy is used in computations to destroy information.

Lossless computation can theoretically be done with no energy usage whatsoever!

cSeth Lloyd of MIT has shown that any nonlinearity at the quantum level allows the building of computers that can solve NP hard problems in polynomial time. Some researchers, most notably Stephen Weingram, try to construct nonlinear quantum mechanics theories, but so far they fail.

We will need several facts, terms, and theorems from linear algebra. It will be easiest to just fire them off: (we also combine some previous facts here for the heck of it) Definition 4. Let H, A, B, U be linear operators on a vector space V.

1. H^{†} is the conjugate transpose of H.

2. H is Hermitian or self-adjoint if H = H^{†}.

3. |ψ⟩ is a column vector.

4. ⟨ψ| is the dual to |ψ⟩, defined ⟨v| ≡ |v⟩^{†}.

5. |ψϕ⟩ = |ψ⟩|ϕ⟩ = |ψ⟩ ⊗ |ϕ⟩.

6. [A, B] = AB − BA.

7. {A, B} = AB + BA.

8. A is normal if A^{†}A = AA^{†}.

9. U is unitary if U^{†}U = I.

10. A is positive if ⟨ψ|A|ψ⟩ ≥ 0 for all ψ.

11. ⟨ψ|A|ϕ⟩ is the inner product of ψ and A|ϕ⟩.

13

12. We define specific matrices (the first 4 are the Pauli matrices)

σ_{0} = I,

σ_{1} = σ_{x} = X = ( \begin{matrix}0 & 1 \\ 1 & 0 \end{matrix} ),

σ_{2} = σ_{y} = Y = ( \begin{matrix}0 & −i \\ i & 0 \end{matrix} ),

σ_{3} = σ_{z} = Z = ( \begin{matrix}1 & 0 \\ 0 & −1 \end{matrix} ),

H = \frac{1}{\sqrt{2}} ( \begin{matrix}1 & 1 \\ 1 & −1 \end{matrix} ), S = ( \begin{matrix}1 & 0 \\ 0 & i \end{matrix} ), T = ( \begin{matrix}1 & 0 \\ 0 & e^{\frac{iπ}{4}} \end{matrix} )

13. For a unit vector n⃗ = (n_{x}, n_{y}, n_{z}) ∈ ℝ^{3}, define n⃗.σ⃗ ≡ n_{x}σ_{x} + n_{y}σ_{y} + n_{z}σ_{z}.

14. Bloch Sphere Given a state a|0⟩ + b|1⟩ we may assume a is real by phase rotation. Then define for ϕ ∈ [0, 2π] and θ ∈ [0, π]

cos (\frac{θ}{2}) = a  (18)
e^{iϕ} sin (\frac{θ}{2}) = b  (19)

Then the point on the Bloch Sphere is (cos ϕ sin θ, sin ϕ sin θ, cos θ).

15. Define the three rotation matrices:

R_{x}(θ) = e^{−θXi/2} = cos \frac{θ}{2}I − i sin \frac{θ}{2}X = ( \begin{matrix}cos(θ/2) & −i sin(θ/2) \\ −i sin(θ/2) & cos(θ/2) \end{matrix} )

R_{y}(θ) = e^{−θY i/2} = cos \frac{θ}{2}I − i sin \frac{θ}{2}Y = ( \begin{matrix}cos(θ/2) & − sin(θ/2) \\ sin(θ/2) & cos(θ/2) \end{matrix} )

R_{z}(θ) = e^{−θZi/2} = cos \frac{θ}{2}I − i sin \frac{θ}{2}Z = ( \begin{matrix}e^{−iθ/2} & 0 \\ 0 & e^{iθ/2} \end{matrix} )

16. For a composite quantum system AB, the partial trace is an operator from density operators on AB to density operators on A defined for tr_{B}(|a_{1}⟩⟨a_{2}| ⊗ |b_{1}⟩⟨b_{2}|) = ⟨b_{2}|b_{1}⟩|a_{1}⟩⟨a_{2}|, and extended by linearity. On matrices: let dim A = n, dim B = m, then it takes a mn by mn matrix, and replaces each m by m sub-block with its trace to give a n by n matrix.

17. The Bell States are the 2-qubit basis states

|β_{00}⟩ = \frac{|00⟩ + |11⟩}{\sqrt{2}}  (20)
|β_{01}⟩ = \frac{|01⟩ + |10⟩}{\sqrt{2}}  (21)
|β_{10}⟩ = \frac{|00⟩ − |11⟩}{\sqrt{2}}  (22)
|β_{11}⟩ = \frac{|01⟩ − |10⟩}{\sqrt{2}}  (23)

15

Note: The four Pauli matrices (I, X, Y, and Z) have significance, since they form a basis of all linear operators on one qubit, and correspond to similarly named actions on the Bloch sphere. We can write operators like X in an equivalent operator notation, which is often convienent to use in calculations. Noting that ⟨0| is a row vector, then |0⟩⟨0| is a 2 × 2 matrix. We can write X as:

X =  |0⟩⟨1| + |1⟩⟨0|  (24)
=  \binom{1}{0}(0 1) + \binom{0}{1}(1 0)  (25)
= ( \begin{matrix}0 & 1 \\ 0 & 0 \end{matrix} ) + ( \begin{matrix}0 & 0 \\ 1 & 0 \end{matrix} ) = ( \begin{matrix}0 & 1 \\ 1 & 0 \end{matrix} )  (26)

This is interpreted quickly: X sends state 0 to 1, and vice versa. Example: As an example calculation, we compute ⟨β_{00}|I_{2} ⊗ X|β_{10}⟩ two different ways. The first way is matrix multiplication: Noting that |00⟩ = (1, 0, 0, 0)^{T} and |11⟩ = (0, 0, 0, 1)^{T}, we have

⟨β_{00}|I ⊗ X|β_{10}⟩ = (\frac{|00⟩+|11⟩}{\sqrt{2}})^{†} ( \begin{matrix}1 & 0 \\ 0 & 1 \end{matrix} ) ⊗ ( \begin{matrix}0 & 1 \\ 1 & 0 \end{matrix} ) (\frac{|00⟩−|11⟩}{\sqrt{2}})  (27)

= (\frac{1}{\sqrt{2}})^{2} ( 1 0 0 1 ) ( \begin{matrix}0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{matrix} ) ( \begin{matrix}1 \\ 0 \\ 0 \\ −1 \end{matrix} )  (28)

=  0  (29)

For the other method, note as operators we can write I = |0⟩⟨0| + |1⟩⟨1|, and X swaps basis vectors, giving X = |0⟩⟨1| + |1⟩⟨0|. Then we have

I ⊗ X =  (|0⟩⟨0| + |1⟩⟨1|) ⊗ (|0⟩⟨1| + |1⟩⟨0|)  (30)
= |00⟩⟨01| + |01⟩⟨00| + |10⟩⟨11| + |11⟩⟨10|  (31)

where we used the fact |a⟩⟨b| ⊗ |c⟩⟨d| = |ac⟩⟨bd|. Apply this and use orthonormality,

⟨β_{00}|I ⊗ X|β_{10}⟩ = (\frac{⟨00|+⟨11|}{\sqrt{2}}) (|00⟩⟨01| + |01⟩⟨00| + |10⟩⟨11| + |11⟩⟨10|) (\frac{|00⟩−|11⟩}{\sqrt{2}}) (32)
=  (\frac{1}{\sqrt{2}})^{2} (0 + 0 + 0 + ⋯ + 0)  (33)
=  0  (34)

where we get terms like ⟨00|00⟩⟨01|00⟩ = 1 · 0 = 0. Homework 4. Write the matrices above in operator form for practice. Homework 5. Compute the eigen-values and eigen-vectors for the matrices defined above. They will be useful. Homework 6. Understand the behavior of each matrix above on the Bloch sphere representation of a qubit.

17

Useful linear algebra theorems

Theorem 5 (Cauchy Schwartz Inequality). |⟨v|w⟩|^{2} ≤ ⟨v|v⟩⟨w|w⟩ Theorem 6 (Spectral Decomposition). Any normal operator M on a vector space V is diagonal with respect to some orthonormal basis for V. Conversely, any diagonalizable operator is normal.

Proof. Sketch: Induct on d = dim V. d = 1 is trivial. Let λ be an eigenvalue of M, P the projector onto the λ eigenspace, and Q the projector onto the orthogonal complement. M = P MP + QMQ is diagonal with respect to some basis (strip off an eigenvalue one at a time...)

Check: There is a matrix P, with unit eigenvectors as columns, so that P MP^{†} is diagonal, with entries the eigenvalues. Theorem 7 (Simultaneous diagonalization). Suppose A and B are Hermitian operators on a vector space V. Then [A, B] = 0 ⇔ there exists an orthonormal basis such that both A and B are diagonal with respect to that basis. Theorem 8 (Polar decomposition). Let A be a linear operator on a vector space V. Then there exists a unitary U and positive operators J and K such that

A = UJ = KU

where the unique J and K are given by J ≡ \sqrt{A^{†}A} and K ≡ \sqrt{AA^{†}}. Moreover, A invertible implies U is unique.

Proof. J ≡ \sqrt{A^{†}A} is positive, so spectral gives J = ∑_{i} λ_{i}|i⟩⟨i|, (λ_{i} ≥ 0). Let |ϕ_{i}⟩ = A|i⟩. For λ_{i} ≠ 0, let |e_{i}⟩ = |ϕ_{i}⟩/λ_{i}. Extend to orthogonal basis |e_{i}⟩, and define unitary U ≡ ∑_{i} |e_{i}⟩⟨i|. This satisfies A = UJ. Multiply on left by adjoint A^{†} = JU^{†} giving J^{2} = A^{†}A, so J = \sqrt{A^{†}A}. Then A = UJ = UJU^{†}U = KU with K = UJU^{†}. This K = \sqrt{AA^{†}}.

Theorem 9 (Singular value decomposition). Let A be a square matrix. Then there exists unitary U and V, and diagonal D, such that

A = UDV

The diagonal elements of D are called singular values of A.

Proof. By polar decomposition, A = SJ for S unitary and J positive. By spectral J = T DT^{†}, T unitary, D diagonal with nonnegative entries. U ≡ ST and V ≡ T^{†} completes the proof.

Theorem 10. Every unitary 2 × 2 matrix can be expressed as

(\begin{matrix}e^{iα} & 0 \\ 0 & e^{iα} \end{matrix}) · (\begin{matrix}e^{\frac{iβ}{2}} & 0 \\ 0 & e^{− \frac{iβ}{2}} \end{matrix} ) · (\begin{matrix}cos \frac{γ}{2} & − sin \frac{γ}{2} \\ sin \frac{γ}{2} & cos \frac{γ}{2} \end{matrix} ) · (\begin{matrix}e^{\frac{iδ}{2}} & 0 \\ 0 & e^{− \frac{iδ}{2}} \end{matrix} )  (35)

Note: Notice the third matrix is a usual rotation in the plane. The 2nd and 4th matrices are Z-axis rotation on the Bloch sphere, and the first matrix is merely a phase shift of the entire state. This decomposition gives some intuition of how a single qubit operator acts.

19

Theorem 11 (Z-Y decomposition for a single qubit). U is a unitary operation on a single qubit. Then there are real numbers α, β, δ, γ such that

U = e^{iα}R_{z}(β)R_{y}(γ)R_{z}(δ)

Note: Similarly there are X-Y, Z-X, etc. decomposition theorems. Theorem 12 (ABC corollary). Suppose U is a unitary gate on a single qubit. Then there are unitary operators A, B, and C, such that ABC = I, and U = e^{iα}AXBXC, where α is some overall phase factor.

Proof. Apply theorem 11 with A ≡ R_{z}(β)R_{y}(γ/2), B ≡ R_{y}(−γ/2)R_{z}(−(δ + β)/2), and C ≡ R_{z}((δ − β)/2).

This weird looking theorem becomes very useful when trying to construct quantum circuts. It allows one to use a Controlled NOT gate (a circut that flips a qubit based on the state of another qubit) to contruct arbitrary controlled U gates.

Useful linear algebra facts!

Here are some facts that help in computations and proofs when dealing with quantum computing.

1. Any complex n × n matrix A can be written as a sum of 4 positive Hermitian matrices: A = B + iC with B, C Hermitian B = \frac{1}{2} (A^{∗} + A), and C accordingly. Then any Hermitian B can be written as the sum of 2 positive Hermitian matrices B = (B + λI) − λI where −λ is the most negative eigenvalue of B.

2. Every positive A is of the form BB^{∗}.

3. |a_{1}⟩⟨a_{2}| ⊗ |b_{1}⟩⟨b_{2}| = |a_{1}b_{1}⟩⟨a_{2}b_{2}| (useful in partial trace operations).

4. Trace of kets: |ψ⟩ = ∑_{i,j} a_{ij}|ij⟩, when converted to a density matrix ρ = |ψ⟩⟨ψ|, and then trace is taken over the j, gives tr_{B}(p) = ∑_{i} (∑_{j} |a_{i,j}|^{2}) |i⟩⟨i|, so it seems tr_{B}(|ψ⟩) should be something like ∑_{i} \sqrt{∑_{j} |a_{i,j}|^{2}} |i⟩. In particular, tracing out some columns in |011010⟩ removes those columns, but the new kets are not a simple sum of the previous ones... It may be ok to sum probabilities, then sqrt when collapsing, but I am not clear.

5. Unitary also satisfies UU^{†} = I, so U is normal and has spectral decomposition (all QC ops unitary!).

6. Unitary preserves inner products.

7. Positive ⇒ Hermitian ⇒ normal.

8. A^{†}A is positive for any linear operator A.

9. Tensor of unitary (resp Hermitian, positive, projector) is unitary (resp,...).

21

10. If P = ( \begin{matrix}a & b \\ c & d \end{matrix} ) is invertible, then P^{−1} = \frac{1}{ad−bc} ( \begin{matrix}d & −b \\ −c & a \end{matrix} ).

11. Given eigenvectors v_{1} and v_{2} of B, with eigenvalues λ_{1} and λ_{2}, let P = ( v_{1} v_{2} ). Then the diagonal D is

D = ( \begin{matrix}λ_{1} & 0 \\ 0 & λ_{2} \end{matrix} ) = P^{−1}BP

12. W is a subspace of V with basis |i⟩. Projection to W is P = ∑_{i} |i⟩⟨i|. Q = I − P is the orthogonal complement.

13. Eigenvectors with distinct eigenvalues of a Hermitian operator are orthogonal.

14. n⃗.σ⃗ has eigenvalues ±1 with corresponding eigenvectors ( \begin{matrix}n_{z} ± 1 \\ n_{x} + in_{y} \end{matrix} ).

15. U unitary ⇒ U has a spectral decomposition ⇒ U is diagonal in some orthonormal basis ⇒ U = diag(e^{iα_{1}}, e^{iα_{2}}, …, e^{iα_{n}}) ⇒ U has a unitary n^{th} root V, V^{n} = U.

16. tr (|ψ⟩⟨ϕ|) = ⟨ϕ|ψ⟩.

17. For unit vectors r⃗ and s⃗, (r⃗.σ⃗) · (s⃗.σ⃗) = r⃗ · s⃗I + (r⃗ × s⃗).σ⃗.

Some basic identities

There are lots of identities between the operators we have above which will be useful in reducing circuits later on. This is a good place to list some.

[X, Y] = 2iZ [Y, Z] = 2iX [Z, X] = 2iY

{σ_{i}, σ_{j}} = 2δij if i, j ≠ 0 σ_{i}^{2} = I

R_{z}(\frac{π}{2} )R_{x}(\frac{π}{2} )R_{z}(\frac{π}{2} ) = e^{−iπ/2}H

XY X = −Y ⇒ XR_{y}(θ)X = R_{y}(−θ)

HXH = Z HY H = −Y HZH = X

HT H = phase ∗ R_{x}(\frac{π}{4} )

C is CNOT, X_{j} is X acting on qubit j, etc.

\begin{aligned}CX_{1}X & = & X_{1}X_{2} & CY_{1}C & = & Y_{1}X_{2} \\ CZ_{1}C & = & Z_{1} & CX_{2}C & = & X_{2} \\ CY_{2}C & = & Z_{1}Y_{2} & CZ_{2}C & = & Z_{1}Z_{2} \\ R_{z,1}(θ)C & = & CR_{z,1}(θ) & R_{x,2}(θ)C & = & CR_{x,2}(θ) \end{aligned}

For i, j = 1, 2, 3, σ_{j}σ_{k} = δ_{jk}I + i ∑_{l=1}^{3} ϵ_{jkl}σ_{l} where ϵ_{jkl} is the antisymmetric tensor on 3 indices.^{a} Homework 7. Check these identities using the matrix form and the operator form to gain mastery of these calculations.

aExercise 2.43 in Neilsen and Chuang. All of these identites appear in the book, as exercises or in the text.

23

Measuring the qubits

The final operation we need to understand about qubits is, how can we get information back out of them? The process is called measurement, and there are several equivalent ways to think about it. We will cover the easiest to understand, intuitively and mathematically. However, to gain the precise control over measurements, we will have to resort later to an equivalent, yet more complicated, measurement framework. Quantum Mechanics Postulate 3: State Measurement^{a} Quantum measurements are described by a collection {M_{m}} of measurement operators. These are operators acting on the state space of a system being measured. The index m refers to the measurement outcomes that may occur in the experiment. If the state of the system is |ψ⟩ immediately before the measurement, then the probability that result m occurs is given by

p(m) = ⟨ψ|M_{m}^{†}M_{m}|ψ⟩  (36)

and the state of the system after the measurement is

\frac{M_{m}|ψ⟩}{\sqrt{p(m)}}  (37)

The measurement operators satisfy the completeness equation

∑_{m} M_{m}^{†}M_{m} = I  (38)

Cascaded measurements are single measurements Distinguishing states TODO:

aVerbatim from Neilsen and Chuang.

25

Combining states and partial states

Quantum Mechanics Postulate 4: State Combining^{a} The state space of a composite physical system is the tensor product of the state spaces of the component systems. Moreover, if we have systems numbered 1 through n, and system number j is prepared in the state |ψ_{j}⟩, then the joint state of the total system is |ψ_{1}⟩ ⊗ |ψ_{2}⟩ ⊗ … |ψ_{n}⟩. TODO: partial trace And that is all there is to quantum mechanics (as far as we are concerned). These four postulates form the basis of all that is known about qantum mechanics, a physical theory that has stood for over seven decades, and is used to explain phenomena at many scales. However, quantum mechanics does not mesh well with the other main intellectual achievement in theoretical physics in the 20th century, relativity. Combining these two theories into a unified framework has occupied the best minds for over 50 years, and good no solution is TODO: clean. Using the above postulates gives us an important theorem:

aVerbatim from Neilsen and Chuang.

The No Cloning Theorem

Theorem 13. The No Cloning Theorem.It is impossible to build a machine that can clone any given quantum state. This is in stark ccontrast to the classical case, where we copy information all the time. Proof. Suppose we have a machine with two slots: A for the quantum state |ψ⟩ to be cloned, and B in some fixed initial state |s⟩, and the machine makes a copy of the quantum state A. By the rules of quantum mechanics, the evolution U is unitary, so we have

|ψ⟩ ⊗ |s⟩ ⟶^{U} |ψ⟩ ⊗ |ψ⟩  (39)

Now suppose we have two states we wish to clone, |ψ⟩ and |φ⟩, giving

U (|ψ⟩ ⊗ |s⟩) = |ψ⟩ ⊗ |ψ⟩
U (|φ⟩ ⊗ |s⟩) = |φ⟩ ⊗ |φ⟩

Taking the inner product of these two equations, and using U^{†}U+ =:

(⟨φ| ⊗ ⟨s|) U^{†}U (|ψ⟩ ⊗ |s⟩) = (⟨φ| ⊗ ⟨φ|) (|ψ⟩ ⊗ |ψ⟩)
⟨φ|ψ⟩⟨s|s⟩ =  ⟨φ|ψ⟩⟨φ|ψ⟩
⟨φ|ψ⟩ =  (⟨φ|ψ⟩)^{2}

This has solutions if and only if ⟨φ|ψ⟩ is 0 or 1, so cloning cannot be done for general states.^{a}

aThere is a lot of research on what can be cloned, how much information can be cloned, etc.

27

Reasons, Part 1

The reasons we define a qubit and multiple qubits as above is ... TODO: TODO: evolution via Schrodinger... TODO: density operator, bell inequality, mixed, pure, reduced state, partial trace, Schmidt decomposition TODO: explain other measurements TODO: projective measurements TODO: add operator form of matrices, and how to compute TODO: give some formula, etc, and explain decomposition of single qubit formula, and X-Y decomp, etc TODO: need partial trace operation, etc, density matrix formulation TODO: problems - and work out some calculations TODO: next time - classical computing TODO: Heisenberg - p.89 TODO: then - quantum circuits

Next time

• Definition of Turing machine, computability, Halting problem

• Circut construction - AND, OR, NAND, XOR, FANOUT, half adder, arbitrary function computation.

• Universality of NAND.

• Uniform circuit families.

• Complexity classes: P, NP, coNP, PSPACE, EXP, L, BPP.

• Problems: 3SAT, 2SAT, sorting, and more.

• Energy and computation.

• Fractran (how to get all primes from the “program”

\frac{17}{91}; \frac{78}{85}; \frac{19}{51}; \frac{23}{38}; \frac{29}{33}; \frac{77}{29}; \frac{95}{23}; \frac{77}{19}; \frac{1}{17}; \frac{11}{13}; \frac{13}{11}; \frac{15}{2}; \frac{1}{7}; \frac{55}{1}).

• Fun fun fun.