Lecture Notes on Quantum Computing, Lecture notes of Algorithms and Programming

A set of lecture notes on quantum computing. It covers topics such as quantum mechanics, qubits and quantum memory, elementary gates, quantum circuits, quantum parallelism, and various quantum algorithms including the Deutsch-Jozsa algorithm, Simon's algorithm, the Fourier transform, and Shor's factoring algorithm. The notes also touch on the hidden subgroup problem and its efficient quantum algorithm if G is Abelian. dedicated to the memory of the author's father.

Typology: Lecture notes

2022/2023

Uploaded on 05/11/2023

seshadrinathan_hin
seshadrinathan_hin 🇺🇸

4.6

(17)

231 documents

1 / 218

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Quantum Computing:
Lecture Notes
Ronald de Wolf
QuSoft, CWI and University of Amsterdam
arXiv:1907.09415v5 [quant-ph] 16 Jan 2023
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Lecture Notes on Quantum Computing and more Lecture notes Algorithms and Programming in PDF only on Docsity!

Quantum Computing:

Lecture Notes

Ronald de Wolf

QuSoft, CWI and University of Amsterdam

arXiv:1907.09415v5 [quant-ph] 16 Jan 2023

Dedicated to the memory of my father

Abraham de Wolf (1942–2019)

ii

Problem (Chapter 6; the above-mentioned chapter numbers are for the earlier version of the notes), and moved the hints about exercises to an Appendix for students who want to try the exercises first without hints. Thanks to Joran van Apeldoorn, Srinivasan Arunachalam, Rens Baardman, Alexander Belov, Koen de Boer, Daniel Chernowitz, Andr´as Gily´en, Ronald de Haan, Leon Ingelse, Stacey Jeffery, Rafael Kiesel, Jens Klooster, Sam Kuypers, Christian Nesenberend, and Christian Schaffner for useful comments.

January’19 : More corrections, clarifications and exercises, and new chapters about Hamiltonian simulation (Chapter 9) and the HHL algorithm (Chapter 10). These two chapters can be taught together in two lectures, with the longer Chapter 9 spilling over into the second lecture if necessary. I marked by ‘(H)’ the exercises having a hint in Appendix C, and removed citations from exer- cises to prevent students looking up the original papers when doing the exercises (which is neither necessary nor helpful). Those references are [49, 96, 103, 67, 102, 115, 75, 37, 50, 35, 118, 86, 19]. Thanks to Arjan Cornelissen, Sven Cornets de Groot, Gerrit Vos, and Harm de Vries for useful comments, and to Andr´as Gily´en for much help with Chapters 9 and 10. Thanks to my father and Mieke Beer for hosting me for two months while I was recovering from an ankle fracture in a wheelchair, from which much of these two chapters was written.

July’19 : More corrections, clarifications and exercises. Thanks to Joran van Apeldoorn, Andr´as Gily´en, Stephanie Gonzalez, Sander Gribling, Jaco ter Hoeve, Arnold Kole, Lotte Mertens, Stefano Pironio, Merel Schalkers, Jim Skulte, Iris Smit, Manuel Van, and Sebastian Zur for useful com- ments. Thanks to Barbara Terhal for suggesting the possibility of dedicating these notes.

January’21 : More corrections, clarifications and exercises, and a new chapter about QMA and the local Hamiltonian problem (Chapter 14). Thanks to Dorit Aharonov, Tomas Ehrencron, Alex Grilo, Joris Kattem¨olle, Stan de Lange, Noah Linden, Tessel Majtlis, Nikhil Mande, Andrea Mazzocco, Robert Modderman, Thomas Preu, Philip Verduyn Lunel, Baer Ververgaert, and Carel Wagenaar for useful comments.

January’22 : More corrections, clarifications and exercises. Thanks to Simon Apers, Christiaan van Asperen, Yanlin Chen, Lynn Engelberts, Sevag Gharibian, Andr´as Gily´en, Diego Gonz´alez- S´anchez, Bruno Jedynak, Joris Kattem¨olle, Julius Krebbekx, Zeph Landau, Noah Linden, Fr´ed´eric Magniez, Ryan Mann, and Yanelle Stolwijk for useful comments.

August’22 : More corrections, clarifications and exercises, and a new chapter about some aspects of quantum machine learning (Chapter 19). Thanks to Danish Alvi, Srinivasan Arunachalam, Nikolaos Chatzis, Li Chen, Yanlin Chen, Iordanis Kerenidis, Mikhail Kudinov, Casper Loman, Fr´ed´eric Magniez, Galina Pass, Benjamin Shaffrey, Mario Szegedy, and Michael Walter for useful comments.

January’23 : More corrections and clarifications, and a new chapter about the generalized ad- versary bound (Chapter 12). Thanks to Srinivasan Arunachalam, Martijn Brehm, Yanlin Chen, Lynn Engelberts, Noah Linden, Fr´ed´eric Magniez, Mehrdad Tahmasbi, Quinten Tupker, and Jordi Weggemans for useful comments.

© Ronald de Wolf, January 2023, Amsterdam

iv

Contents

  • 1 Quantum Computing
    • 1.1 Introduction
    • 1.2 Quantum mechanics
      • 1.2.1 Superposition
      • 1.2.2 Measurement
      • 1.2.3 Unitary evolution
    • 1.3 Qubits and quantum memory
    • 1.4 Elementary gates
    • 1.5 Example: quantum teleportation
  • 2 The Circuit Model and the Deutsch-Jozsa Algorithm
    • 2.1 Quantum computation
      • 2.1.1 Classical circuits
      • 2.1.2 Quantum circuits
    • 2.2 Universality of various sets of elementary gates
    • 2.3 Quantum parallelism
    • 2.4 The early algorithms
      • 2.4.1 Deutsch-Jozsa
      • 2.4.2 Bernstein-Vazirani
  • 3 Simon’s Algorithm
    • 3.1 The problem
    • 3.2 The quantum algorithm
    • 3.3 Classical algorithms for Simon’s problem
      • 3.3.1 Upper bound
      • 3.3.2 Lower bound
  • 4 The Fourier Transform
    • 4.1 The classical discrete Fourier transform
    • 4.2 The Fast Fourier Transform
    • 4.3 Application: multiplying two polynomials
    • 4.4 The quantum Fourier transform
    • 4.5 An efficient quantum circuit
    • 4.6 Application: phase estimation
  • 5 Shor’s Factoring Algorithm
    • 5.1 Factoring
    • 5.2 Reduction from factoring to period-finding
    • 5.3 Shor’s period-finding algorithm
    • 5.4 Continued fractions
  • 6 Hidden Subgroup Problem
    • 6.1 Hidden Subgroup Problem
      • 6.1.1 Group theory reminder
      • 6.1.2 Definition and some instances of the HSP
    • 6.2 An efficient quantum algorithm if G is Abelian
      • 6.2.1 Representation theory and the quantum Fourier transform
      • 6.2.2 A general algorithm for Abelian HSP
    • 6.3 General non-Abelian HSP
      • 6.3.1 The symmetric group and the graph isomorphism problem
      • 6.3.2 Non-Abelian QFT on coset states
      • 6.3.3 Query-efficient algorithm
  • 7 Grover’s Search Algorithm
    • 7.1 The problem
    • 7.2 Grover’s algorithm
    • 7.3 Amplitude amplification
    • 7.4 Application: satisfiability
  • 8 Quantum Walk Algorithms
    • 8.1 Classical random walks
    • 8.2 Quantum walks
    • 8.3 Applications
      • 8.3.1 Grover search
      • 8.3.2 Collision problem
      • 8.3.3 Finding a triangle in a graph
  • 9 Hamiltonian Simulation
    • 9.1 Hamiltonians
    • 9.2 Method 1: Lie-Suzuki-Trotter methods
    • 9.3 Method 2: Linear combination of unitaries (LCU)
      • 9.3.1 Hamiltonian simulation via LCU
    • 9.4 Method 3: Transforming block-encoded matrices
      • 9.4.1 Hamiltonian simulation via transforming block-encoded matrices
  • 10 The HHL Algorithm
    • 10.1 The linear-system problem
    • 10.2 The basic HHL algorithm for linear systems
    • 10.3 Improving the efficiency of the HHL algorithm
  • 11 Quantum Query Lower Bounds
    • 11.1 Introduction
    • 11.2 The polynomial method
    • 11.3 The quantum adversary method
  • 12 Quantum Algorithms from the Generalized Adversary Bound
    • 12.1 The generalized adversary bound
    • 12.2 The dual of the generalized adversary bound
    • 12.3 ADV± is an upper bound on quantum query complexity
    • 12.4 Applications
    • 12.5 Perfect composition and AND-OR trees
  • 13 Quantum Complexity Theory
    • 13.1 Most functions need exponentially many gates
    • 13.2 Classical and quantum complexity classes
    • 13.3 Classically simulating quantum computers in polynomial space
  • 14 QMA and the Local Hamiltonian Problem
    • 14.1 Quantum Merlin-Arthur (QMA)
    • 14.2 The local Hamiltonian problem
    • 14.3 Local Hamiltonian is QMA-complete
      • 14.3.1 Completeness and soundness
      • 14.3.2 Reducing the locality
    • 14.4 Other interesting problems in QMA
    • 14.5 Quantum interactive proofs
  • 15 Quantum Encodings, with a Non-Quantum Application
    • 15.1 Mixed states and general measurements
    • 15.2 Quantum encodings and their limits
    • 15.3 Lower bounds on locally decodable codes
  • 16 Quantum Communication Complexity
    • 16.1 Classical communication complexity
    • 16.2 The quantum question
    • 16.3 Example 1: Distributed Deutsch-Jozsa
    • 16.4 Example 2: The Intersection problem
    • 16.5 Example 3: The vector-in-subspace problem
    • 16.6 Example 4: Quantum fingerprinting
  • 17 Entanglement and Non-Locality
    • 17.1 Quantum non-locality
    • 17.2 CHSH: Clauser-Horne-Shimony-Holt
    • 17.3 Magic square game
    • 17.4 A non-local version of distributed Deutsch-Jozsa
  • 18 Quantum Cryptography
    • 18.1 Saving cryptography from Shor
    • 18.2 Quantum key distribution
    • 18.3 Reduced density matrices and the Schmidt decomposition
    • 18.4 The impossibility of perfect bit commitment
    • 18.5 More quantum cryptography
  • 19 Quantum Machine Learning
    • 19.1 Introduction
    • 19.2 Supervised learning from quantum data
      • 19.2.1 The PAC model of learning
      • 19.2.2 Learning from quantum examples under the uniform distribution
      • 19.2.3 Learning from quantum examples under all distributions
      • 19.2.4 Learning quantum states from classical data
    • 19.3 Unsupervised learning from quantum data
    • 19.4 Optimization
      • 19.4.1 Variational quantum algorithms
      • 19.4.2 Some provable quantum speed-ups for optimization
  • 20 Error-Correction and Fault-Tolerance
    • 20.1 Introduction
    • 20.2 Classical error-correction
    • 20.3 Quantum errors
    • 20.4 Quantum error-correcting codes
    • 20.5 Fault-tolerant quantum computation
    • 20.6 Concatenated codes and the threshold theorem
  • A Some Useful Linear Algebra
    • A.1 Vector spaces
    • A.2 Matrices
    • A.3 Inner product
    • A.4 Unitary matrices
    • A.5 Diagonalization and singular values
    • A.6 Tensor products
    • A.7 Trace
    • A.8 Rank
    • A.9 The Pauli matrices
    • A.10 Dirac notation
  • B Some other Useful Math and CS
    • B.1 Some notation, equalities and inequalities
    • B.2 Algorithms and probabilities
  • C Hints for Exercises

to behave classically, but instead one might also try to work with them, enabling further miniaturization.

  1. Making use of quantum effects allows one to speed up certain computations enormously (sometimes exponentially), and even enables some things that are impossible for classical computers. The main purpose of these lecture notes is to explain these advantages of quantum computing (algorithms, crypto, etc.) in detail.
  2. Finally, one might say that the main goal of theoretical computer science is to “study the power and limitations of the strongest-possible computational devices that Nature allows us.” Since our current understanding of Nature is quantum mechanical, theoretical computer science should arguably be studying the power of quantum computers, not classical ones.

Before limiting ourselves to theory, let us say a few words about practice: to what extent will quantum computers ever be built? At this point in time, it is just too early to tell. The first small 2-qubit quantum computer was built in 1997 and in 2001 a 5-qubit quantum computer was used to successfully factor the number 15 [240]. Since then, experimental progress on a number of different technologies has been steady but slow. The most advanced implementations currently use superconducting qubits and ion-trap qubits. The largest quantum computation done at the time of writing is Google’s “quantum supremacy” experiment on 53 qubits [30], which performs a complicated (but rather useless) sampling task that appears to be no longer simulatable in a reasonable amount of the time on even the largest existing classical supercomputer. The practical problems facing physical realizations of quantum computers seem formidable. The problems of noise and decoherence have to some extent been solved in theory by the discovery of quantum error-correcting codes and fault-tolerant computing (see, e.g., Chapter 20 in these notes), but these problems are by no means solved in practice. On the other hand, we should realize that the field of physical realization of quantum computing is still in its infancy and that classical computing had to face and solve many formidable technical problems as well—interestingly, often these problems were even of the same nature as those now faced by quantum computing (e.g., noise-reduction and error-correction). Moreover, while the difficulties facing the implementation of a full quantum computer may seem daunting, more limited applications involving quantum communication have already been implemented with some success, for example teleportation (which is the process of sending qubits using entanglement and classical communication), and versions of BB84 quantum key distribution are nowadays even commercially available. Even if the theory of quantum computing never materializes to a real large-scale physical com- puter, quantum-mechanical computers are still an extremely interesting idea which will bear fruit in other areas than practical fast computing. On the physics side, it may improve our understand- ing of quantum mechanics. The emerging theories of entanglement and of Hamiltonian complexity have already done this to some extent. On the computer science side, the theory of quantum computation generalizes and enriches classical complexity theory and may help resolve some of its problems (see Section 15.3 for an example).

1.2 Quantum mechanics

Here we give a brief and abstract introduction to quantum mechanics. In short: a quantum state is a superposition of classical states, written as a vector of amplitudes, to which we can apply either a measurement or a unitary operation. For the required linear algebra we refer to Appendix A.

2

1.2.1 Superposition

Consider some physical system that can be in N different, mutually exclusive classical states. Because we will typically start counting from 0 in these notes, we call these states | 0 〉, | 1 〉,... , |N − 1 〉. Roughly, by a “classical” state we mean a state in which the system can be found if we observe it. A pure quantum state (usually just called state) |φ〉 is a superposition of classical states, written

|φ〉 = α 0 | 0 〉 + α 1 | 1 〉 + · · · + αN − 1 |N − 1 〉.

Here αi is a complex number that is called the amplitude of |i〉 in |φ〉. Intuitively, a system in quantum state |φ〉 is “in all classical states at the same time,” each state having a certain amplitude. It is in state | 0 〉 with amplitude α 0 , in state | 1 〉 with amplitude α 1 , and so on. Mathematically, the states | 0 〉,... , |N − 1 〉 form an orthonormal basis of an N -dimensional Hilbert space (i.e., an N -dimensional vector space equipped with an inner product). A quantum state |φ〉 is a vector in this space, usually written as an N -dimensional column vector of its amplitudes:

|φ〉 =

α 0 .. . αN − 1

Such a vector is sometimes called a “ket.” It conjugate transpose is the following row vector, sometimes called a “bra”: 〈φ| =

α∗ 0 ,... , α∗ N − 1

The reason for this terminology (often called “Dirac notation” after Paul Dirac) is that an inner product 〈φ|ψ〉 between two states corresponds to the dot product between a bra and a ket vector (“bracket”): 〈φ|ψ〉 = 〈φ| · |ψ〉. We can combine different Hilbert spaces using tensor product: if | 0 〉,... , |N − 1 〉 are an or- thonormal basis of space HA and | 0 〉,... , |M − 1 〉 are an orthonormal basis of space HB , then the tensor product space H = HA ⊗ HB is an N M -dimensional space spanned by the set of states {|∑i〉 ⊗ |j〉 | i ∈ { 0 ,... , N − 1 }, j ∈ { 0 ,... , M − 1 }}. An arbitrary state in H is of the form N − 1 i=

∑M − 1

j=0 αij^ |i〉 ⊗ |j〉.^ Such a state is called^ bipartite.^ Similarly we can have^ tripartite^ states that “live” in a Hilbert space that is the tensor product of three smaller Hilbert spaces, etc. There are two things we can do with a quantum state: measure it or let it evolve unitarily without measuring it. We will deal with measurement first.

1.2.2 Measurement

Measurement in the computational basis

Suppose we measure state |φ〉. We cannot “see” a superposition itself, but only classical states. Accordingly, if we measure state |φ〉 we will see one and only one classical state |j〉. Which specific |j〉 will we see? This is not determined in advance; the only thing we can say is that we will see state |j〉 with probability |αj |^2 , which is the squared norm of the corresponding amplitude αj. This is known as “Born’s rule.” Accordingly, observing a quantum state induces a probability distribution on the classical states, given by the squared norms of the amplitudes.∑ This implies N − 1 j=0 |αj^ |

(^2) = 1, so the vector of amplitudes has (Euclidean) norm 1. If we measure |φ〉 and get

outcome j as a result^1 , then |φ〉 itself has “disappeared,” and all that is left is |j〉. In other words, (^1) Don’t use the ambiguous phrase “we measure j” in this case, since it’s not clear in that phrasing whether |j〉 is the state you’re applying the measurement to, or the outcome of the measurement.

3

with j < N/2 and |j〉 with j ≥ N/2 corresponds to the two projectors P 1 =

j<N/ 2 |j〉〈j|^ and P 2 =

j≥N/ 2 |j〉〈j|, each of rank^ N/2 (assume^ N^ is even). Applying this measurement to the state

|φ〉 = √^13 | 1 〉 +

2 3 |N^ 〉^ gives outcome 1 with probability^ ‖P^1 |φ〉‖

(^2) = 1/3, in which case the state

collapses to | 1 〉. It gives outcome 2 with probability ‖P 2 |φ〉‖^2 = 2/3, the state then collapses to |N 〉.

Observables

A projective measurement with projectors P 1 ,... , Pm and associated distinct outcomes λ 1 ,... , λm ∈ R, can be written as one matrix M =

∑m i=1 λiPi, which is called an^ observable. This is a succinct way of writing down the projective measurement in one matrix, and has the added advantage that the expected value of the outcome can be easily calculated: if we are measuring a state |φ〉, then the probability of outcome∑ λi is ‖Pi|φ〉‖^2 = Tr(Pi|φ〉〈φ|), so the expected value of the outcome is m i=1 λiTr(Pi|φ〉〈φ|) = Tr(

∑m i=1 λiPi|φ〉〈φ|) = Tr(M^ |φ〉〈φ|). Note that^ M^ is Hermitian:^ M^ =^ M^

Conversely, since every Hermitian M has a spectral decomposition M =

∑m i=1 λiPi, there is a direct correspondence between observables and Hermitian matrices. The Pauli matrices I, X, Y, Z (see Appendix A.9) are examples of 2-dimensional observables, with eigenvalues ±1. For example, Z = | 0 〉〈 0 | − | 1 〉〈 1 | corresponds to measurement in the compu- tational basis (with measurement outcomes +1 and −1 for | 0 〉 and | 1 〉, respectively). Suppose we have a bipartite state. An observable A on the first part of the state corresponds to an observable A ⊗ I on the bipartite state. Similarly, an observable B on the second part of the state corresponds to an observable I ⊗ B on the bipartite state. Separately measuring observables A and B on the two parts of a bipartite state is different from measuring the joint observable A ⊗ B: the separate measurements give one outcome each, while the joint measurement gives only one outcome, and the distribution on the post-measurement state may be different. What is true, however, is that the measurement statistics of the product of outcomes is the same as the measurement statistics of the outcome of the joint measurement. For example consider the case when A = B = Z (these correspond to measurement in the computational basis), and the bipartite state is |φ〉 = √^12 (| 0 〉 ⊗ | 0 〉 + | 1 〉 ⊗ | 1 〉). With the separate measurements, the outcomes will be ++ or −− (note that in both cases the product of the two outcomes is +1) and the state |φ〉 will collapse to either | 0 〉 ⊗ | 0 〉 or | 1 〉 ⊗ | 1 〉. Yet |φ〉 remains undisturbed by a joint measurement with ±1-valued observable Z ⊗ Z, because |φ〉 is a +1-eigenstate of Z ⊗ Z.

POVM measurement

If we only care about the final probability distribution on the m outcomes, not about the result- ing post-measurement state, then the most general type of measurement we can do is a so-called positive-operator-valued measure (POVM). This is specified by m positive semidefinite (psd) ma- trices E 1 ,... , Em that sum to identity. When measuring a state |φ〉, the probability of outcome i is given by Tr(Ei|φ〉〈φ|). A projective measurement is the special case of a POVM where the measurement elements Ei are projectors.^4 There are situations where a POVM can do things a projective measurement cannot do.^5 For (^4) Note that if Ei is a projector, then Tr(Ei|φ〉〈φ|) = Tr(E i (^2) |φ〉〈φ|) = Tr(Ei|φ〉〈φ|Ei) = ‖Ei|φ〉‖ (^2) , using the fact that Ei = E^2 i and the cyclic property of the trace. These inequalities can fail if Ei is psd but not a projector. (^5) Even though POVMs strictly generalize projective measurements, one can show that every POVM can be “sim- ulated” by a projective measurement on a slightly larger space that yields the exact same probability distribution over measurement outcomes (this follows from Neumark’s theorem).

5

example, suppose you have a state in a 2-dimensional space, and you know it is either in state | 0 〉 or in state |+〉 = √^12 (| 0 〉 + | 1 〉). These two states are not orthogonal, so there is no measurement that distinguishes them perfectly. However, there is a POVM measurement that never makes a mistake, but sometimes gives another outcome 2, meaning “I don’t know.” That is, you would like to do a measurement with three possible outcome: 0, 1, and 2, such that:

  • If the state is | 0 〉, then you get correct outcome 0 with probability 1/4, and outcome 2 with probability 3/4, but never get incorrect outcome 1.
  • If the state is |+〉, then you get correct outcome 1 with probability 1/4, and outcome 2 with probability 3/4, but never get incorrect outcome 0.

You cannot achieve this with a projective measurement on the qubit, but the following 3-outcome POVM does the job:

E 0 = 12 |−〉〈−| (where |−〉 = √^12 (| 0 〉 − | 1 〉), which is orthogonal to the |+〉 state); E 1 = 12 | 1 〉〈 1 | (note that this is orthogonal to the | 0 〉 state); E 2 = I − E 0 − E 1.

You can check that E 0 , E 1 , E 2 are psd and add up to identity, so they form a valid POVM. None of the 3 matrices is a projector. The success probability 1/4 can be improved further, see Exercise 9.

1.2.3 Unitary evolution

Instead of measuring |φ〉, we can also apply some operation to it, i.e., change the state to some

|ψ〉 = β 0 | 0 〉 + β 1 | 1 〉 + · · · + βN − 1 |N − 1 〉.

Quantum mechanics only allows linear operations to be applied to quantum states. What this means is: if we view a state like |φ〉 as an N -dimensional vector (α 0 ,... , αN − 1 )T^ , then applying an operation that changes |φ〉 to |ψ〉 corresponds to multiplying |φ〉 with an N × N complex-valued matrix U :

U

α 0 .. . αN − 1

β 0 .. . βN − 1

Note that by linearity we have |ψ〉 = U |φ〉 = U (

i αi|i〉) =^

i αiU^ |i〉.

∑Because measuring^ |ψ〉^ should also give a probability distribution, we have the constraint N − 1 j=0 |βj^ | (^2) = 1 on the new state. This implies that the operation U must preserve the norm

of vectors, and hence must be a unitary transformation (often just called “a unitary”). A matrix U is unitary if its inverse U −^1 equals its conjugate transpose U ∗. This is equivalent to saying that U always maps a vector of norm 1 to a vector of norm 1. Because a unitary transformation always has an inverse, it follows that any (non-measuring) operation on quantum states must be reversible: by applying U −^1 we can always “undo” the action of U , and nothing is lost in the process. On the other hand, a measurement is clearly non-reversible, because we cannot reconstruct |φ〉 from the observed classical state |j〉.

6

Such 2-qubit states are sometimes called EPR-pairs in honor of Einstein, Podolsky, and Rosen [106], who examined such states and their seemingly paradoxical properties. Initially neither of the two qubits has a classical value | 0 〉 or | 1 〉. However, if we measure the first qubit and observe, say, a | 0 〉, then the whole state collapses to | 00 〉. Thus observing the first qubit immediately fixes also the second, unobserved qubit to a classical value. Since the two qubits that make up the register may be far apart, this example illustrates some of the non-local effects that quantum systems can exhibit. In general, a bipartite state |φ〉 is called entangled if it cannot be written as a tensor product |φA〉 ⊗ |φB 〉 where |φA〉 lives in the first space and |φB 〉 lives in the second.^7 At this point, a comparison with classical probability distributions may be helpful. Suppose we have two probability spaces, A and B, the first with 2n^ possible outcomes, the second with 2m possible outcomes. A probability distribution on the first space can be described by 2n^ numbers (nonnegative reals summing to 1; actually there are only 2n^ − 1 degrees of freedom here) and a distribution on the second by 2m^ numbers. Accordingly, a product distribution on the joint space can be described by 2n^ + 2m^ numbers. However, an arbitrary (non-product) distribution on the joint space takes 2n+m^ real numbers, since there are 2n+m^ possible outcomes in total. Analogously, an n-qubit state |φA〉 can be described by 2n^ numbers (complex numbers whose squared moduli sum to 1), an m-qubit state |φB 〉 by 2m^ numbers, and their tensor product |φA〉 ⊗ |φB 〉 by 2n^ + 2m numbers. However, an arbitrary (possibly entangled) state in the joint space takes 2n+m^ numbers, since it lives in a 2n+m-dimensional space. We see that the number of parameters required to describe quantum states is the same as the number of parameters needed to describe probability distributions. Also note the analogy between statistical independence^8 of two random variables A and B and non-entanglement of the product state |φA〉 ⊗ |φB 〉. However, despite the similarities between probabilities and amplitudes, quantum states are much more powerful than distributions, because amplitudes may have negative (or even complex) parts which can lead to interference effects. Amplitudes only become probabilities when we square them. The art of quantum computing is to use these special properties for interesting computational purposes.

1.4 Elementary gates

A unitary that acts on a small number of qubits (say, at most 3) is often called a gate, in analogy to classical logic gates like AND, OR, and NOT; more about that in the next chapter. The Pauli matrices I, X, Y, Z (Appendix A.9) are examples of 1-qubit gates. For example, the bitflip gate X (a.k.a. NOT-gate) negates the bit in the computational basis, i.e., it swaps | 0 〉 and | 1 〉. The phaseflip gate Z puts a − in front of | 1 〉. Represented as 2 × 2 unitary matrices, these are

X =

, Z =

(^7) We often omit the tensor product symbol for such unentangled states, abbreviating |φA〉 ⊗ |φB 〉 to |φA〉|φB 〉 (you shouldn’t abbreviate this further to |φAφB 〉 though, unless both |φA〉 and |φB 〉 are computational basis states). Note that there cannot be ambiguity between tensor product and the usual matrix product in this abbreviation, because both |φA〉 and |φB 〉 are column vectors and hence their matrix product wouldn’t even be well-defined (the dimensions “don’t fit”). (^8) Two random variables A and B are independent if their joint probability distribution can be written as a product of individual distributions for A and for B: Pr[A = a ∧ B = b] = Pr[A = a] · Pr[B = b] for all possible values a, b.

8

Another important 1-qubit gate is the phase gate Rφ, which merely rotates the phase of the | 1 〉-state by an angle φ: Rφ| 0 〉 = | 0 〉 Rφ| 1 〉 = eiφ| 1 〉

This corresponds to the unitary matrix

Rφ =

0 eiφ

Note that Z is a special case of this: Z = Rπ, because eiπ^ = −1. The Rπ/ 4 -gate is often just called the T -gate. Possibly the most important 1-qubit gate is the Hadamard transform, specified by:

H| 0 〉 =

H| 1 〉 =

As a unitary matrix, this is represented as

H =

If we apply H to initial state | 0 〉 and then measure, we have equal probability of observing | 0 〉 or | 1 〉. Similarly, applying H to | 1 〉 and observing gives equal probability of | 0 〉 or | 1 〉. However, if we apply H to the superposition √^12 | 0 〉 + √^12 | 1 〉 then we obtain

H(

H| 0 〉 +

H| 1 〉 =

The positive and negative amplitudes for | 1 〉 have canceled each other out! This effect is called interference, and is analogous to interference patterns between light or sound waves. An example of a 2-qubit gate is the controlled-not gate CNOT. It negates the second bit of its input if the first bit is 1, and does nothing if the first bit is 0:

CNOT| 0 〉|b〉 = | 0 〉|b〉 CNOT| 1 〉|b〉 = | 1 〉| 1 − b〉

The first qubit is called the control qubit, the second the target qubit. In matrix form, this is

CNOT =

More generally, if U is some n-qubit unitary matrix, then the controlled-U operation corresponds to the following 2n+1^ × 2 n+1^ unitary matrix: ( I 0 0 U

where I is the 2n-dimensional identity matrix and the two 0s denote 2n^ × 2 n^ all-0 matrices.

9

  1. Show that surrounding a CNOT gate with Hadamard gates switches the role of the control-bit and target-bit of the CNOT: (H ⊗ H)CNOT(H ⊗ H) is the 2-qubit gate where the second bit controls whether the first bit is negated (i.e., flipped).
  2. Simplify the following: (〈 0 | ⊗ I)(α 00 | 00 〉 + α 01 | 01 〉 + α 10 | 10 〉 + α 11 | 11 〉).
  3. Prove that an EPR-pair √^12 (| 00 〉 + | 11 〉) is an entangled state, i.e., that it cannot be written as the tensor product of two separate qubits.
  4. Suppose we have the state √^12 (| 0 〉|φ〉 + | 1 〉|ψ〉), where |φ〉 and |ψ〉 are unknown normalized quantum states with the same number of qubits. Suppose we apply a Hadamard gate to the first qubit and then measure that first qubit in the computational basis. Give the probability of measurement outcome 1, as a function of the states |φ〉 and |ψ〉.
  5. Give the 2-outcome projective measurement on a 2-qubit space that measures the parity (i.e., sum modulo 2) of 2-bit basis states. Also give the corresponding observable.
  6. (H) Show that the success probability of the POVM at the end of Section 1.2.2 can be increased from 1/4 to 1/(2 +
  1. (H) Prove the quantum no-cloning theorem: there does not exist a 2-qubit unitary U that maps |φ〉| 0 〉 7 → |φ〉|φ〉 for every qubit |φ〉.
  2. Show that unitaries cannot “delete” information: there is no 1-qubit unitary U that maps |φ〉 7 → | 0 〉 for every 1-qubit state |φ〉.
  3. Suppose Alice and Bob are not entangled. If Alice sends a qubit to Bob, then this can give Bob at most one bit of information about Alice.^9 However, if they share an EPR-pair, |ψ〉 = √^12 (| 00 〉 + | 11 〉), then they can transmit two classical bits by sending one qubit over the channel; this is called superdense coding. This exercise will show how this works.

(a) They start with a shared EPR-pair, √^12 (| 00 〉 + | 11 〉). Alice has classical bits a and b. Suppose she does an X-gate on her half of the EPR-pair if a = 1, followed by a Z-gate if b = 1 (she does both if ab = 11, and neither if ab = 00). Write the resulting 2-qubit state for the four different cases that ab could take. (b) Suppose Alice sends her half of the state to Bob, who now has two qubits. Show that Bob can determine both a and b from his state, using Hadamard and CNOT gates, followed by a measurement in the computational basis.

  1. Alice and Bob share an EPR-pair, |ψ〉 = √^12 (| 00 〉 + | 11 〉).

(a) Let C be a 2 × 2 matrix. Show that Tr((C ⊗ I)|ψ〉〈ψ|) = 12 Tr(C). (b) (H) Alice could apply one of the 4 Pauli matrices (I, X, Y, Z) to her qubit. Use part (a) to show that the 4 resulting 2-qubit states form an orthonormal set. (^9) This is actually a deep statement, a special case of Holevo’s theorem. More about this may be found in Chapter 15.

(c) Suppose Alice applies one of the 4 Pauli matrices to her qubit and then sends that qubit to Bob. Give the 4 projectors of a 4-outcome projective measurement that Bob could do on his 2 qubits to find out which Pauli matrix Alice actually applied.

  1. Let θ ∈ [0, 2 π), Uθ =

cos θ − sin θ sin θ cos θ

, |φ〉 = Uθ| 0 〉 and |φ⊥〉 = Uθ| 1 〉.

(a) Show that ZX|φ⊥〉 = |φ〉. (b) Show that an EPR-pair, √^12 (| 00 〉 + | 11 〉), can also be written as √^12 (|φ〉|φ〉 + |φ⊥〉|φ⊥〉). (c) Suppose Alice and Bob start with an EPR-pair. Alice applies U (^) θ− 1 to her qubit and then measures it in the computational basis. What pure state does Bob have if her outcome was 0, and what pure state does he have if her outcome was 1? (d) Suppose Alice knows the number θ but Bob does not. Give a protocol that uses one EPR-pair and 1 classical bit of communication where Bob ends up with the qubit |φ〉 (in contrast to general teleportation of an unknown qubit, which uses 1 EPR-pair and 2 bits of communication).