Quantum Algorithms Via Linear Algebra
Announcing publication of our textbook with MIT Press
By permission of Nataly Meerson, artist : source 
Richard Feynman had a knack for new ways of seeing. His Feynman diagrams not only enabled visualizing subatomic processes, they also rigorously encapsulated an alternative formalism that crossvalidated the equations and procedures of quantum field theory. His 1948 pathintegral formulation sprang out of work by Paul Dirac that reinterpreted a continuous Lagrangian operator as a matrix multiplication. Fast forward to his 1985 article “Quantum Mechanical Computers” (a followup to his 1981/82 keynote speech “Simulating Physics With Computers”) and there are only matrices and circuit diagrams to be seen.
Today, December 5 as Dick and I write, is the US publication day of our textbook with MIT Press, titled Quantum Algorithms Via Linear Algebra: A Primer. It is also available from Amazon. Both places offer it for less than two adult IMAX tickets to see “Interstellar.” Publication abroad is on 1/1/15.
Quantum computing has captured the imagination of scientists and entrepreneurs from all walks of research and business. Whether any computers that operate in the quantum regime exist in the world today, however, remains a puzzle. Hence what has really been driving the surge are quantum algorithms, which by our expectant understanding of Nature promise to accomplish tasks beyond the feasibility of our abundant classical computers. The algorithms have stunning beauty yet can be taught with minimal prior involvement of either ‘quantum’ or ‘computing’ as they are made of matrices. Our text builds on elementary linear algebra and discrete mathematics to tell their story at an undergraduate level.
We first intended to make it a short story, growing out of a pair of posts by Dick four years ago. With a few shortcuts on arguing the feasibility of certain quantum states we could have dispensed with quantum circuits and held to a “Brief” format under 100 pages. Desire for completeness and the visual appeal of circuits led us to enlarge the fundamentals. Then we realized we could support some advanced topics, including what we believe is the first coverage in any general text of quantum walks and quantum walk search algorithms. Interaction with the quantum group at IBM Thomas Watson Labs, including Charles Bennett whose inspiration shows on the first page of Feynman’s 1985 paper, led me to include an expanded treatment of quantum gates, framed in the exercises of five chapters to minimize interference with the main flow. We still kept it under 200 pages.
An Invitation to Quantum
Here is the table of contents, including page numbers and a few section titles:
 Introduction — 1
 Numbers and Strings — 9

Basic Linear Algebra — 15
 3.5 Matrices, Graphs, and Sums Over Paths — 20
 Boolean Functions, Quantum Bits, and Feasibility — 27
 Special Matrices — 41
 Tricks — 51

Phil’s Algorithm — 63
 7.6 Quantum Mazes versus Circuits versus Matrices — 69
 Deutsch’s Algorithm — 77
 8.3 Superdense Coding and Teleportation — 82
 The DeutschJozsa Algorithm — 89
 Simon’s Algorithm — 93
 Shor’s Algorithm — 97
 Factoring Integers — 109

Grover’s Algorithm — 115
 13.4 The General Case, with k Unknown — 118
 13.5 Grover Approximate Counting — 119
 Quantum Walks — 129
 Quantum Walk Search Algorithms — 143

Quantum Computation and BQP — 159
 16.4 SumOverPaths and Polynomial Roots — 165
 Beyond — 175
 Bibliography — 183
 Index — 189
Our idea of a 10to12week undergraduate course runs up through section 13.4, possibly including chapter 14. A longer or advanced course or graduate seminar may include some of the later advanced topics.
The last main chapter 16 is notable for what we didn’t do in the earlier chapters: talk about complexity classes and the theory of quantum circuits. No complexity class names appear before that chapter. We limit “machine” models to an informal presence in chapter 4, and we describe “polynomial time” as meaning that whenever the problem size doubles, the time can increase by a constant factor c that might be greater than 2. Hence there is no prescribed dependence on computer theory, beyond Boolean logic networks as often included in a discrete mathematics course.
Nor is any physics required—even the sumoverpaths idea is introduced by showing how matrix multiplication counts paths in graphs. Then it is visualized via “maze diagrams” introduced in chapter 7, whose title plays on how the subsequent algorithms are named after people and also plays on Feynman’s middle name. (There are no Feynman diagrams.)
We are both chess fans, and we close chapter 15 with the result that quantum computers can speed up evaluating formulas and playing chess. My favorite childhood chess book was An Invitation to Chess: A Picture Guide to the Royal Game by Irving Chernev and Kenneth Harkness. It assumes nothing and begins with how the pieces move, but unlike any other chess guide I know, it progresses smoothly and with pictures up through some fairly advanced strategy. It ends with a chess endgame composition by Leonid Kubbel as an ode to beauty, which inspired me to compose endgames of my own. We hope that our book will provide the same smoothness and encouragement.
Notation and Nature
One thing important to us is that the book should look and feel like a linear algebra text. This entailed keeping to an ordinary columnvector (or transposed row vector) representation of quantum pure states, and avoiding the customary physics notation of Paul Dirac. We followed recent ISO/IEC standards of bold lowercase italic for vectors and bold uppercase italic for matrices, in heavier, lessserifed fonts. We did include some examples of Dirac notation that especially show its advantages, so as not to obstruct its usage when desired.
We skirted famous philosophical issues of quantum mechanics, but instead tried to promote the issue of scale between natural processes and the notation. I knew Oxford physicist James Binney as a Fellow of Merton College in the 1980s, and I’m delighted to find a similar emphasis in his recent textbook with David Skinner used for undergraduate physics at Oxford. They begin their section 6.2 on “Quantum computing” with the famous old story of the creation of the game of chess, whose agreed royal reward was one grain of rice for the first square, two grains for the second square, four grains for the third square, and (unwittingly to the king) doubling to a mammoth total of grains after the last square. They continue (their emphasis):
What is the relevance of this old story for quantum mechanics? … By the time we have built a system from 64 twostate systems, our composite system will have basis states. …[It is] physically miniscule, [but] to calculate the dynamics of this miniscule system we would have to integrate the equations of motion of amplitudes! This is seriously bad news for physics.
The idea behind quantum computing is to turn this disappointment for physics into a boon for mathematics. We may not be able to solve equations of motion, but Nature can evolve the physical system, and appropriate measurements made on the system should enable us to discover what the results of our computations would have been if we had the time to carry them out. If this approach to computation can be made to work in practice, calculations will become possible that could never be completed on a conventional computer.
Our saving grace is that although the linear algebraic objects—that is, the vectors and matrices—are so huge as to make “our computations” with them unscalable, the linear algebraic formulas do scale when put in succinct functional form. The question is how and whether Nature has a way to treat those functions in turn as some kind of object whose form may be ineffable to us. It may be necessarily ineffable if factoring and some other quantumfeasible tasks require exponential time in the classical regime. But how could Nature do it? Feynman famously advised:
Do not keep saying to yourself, if you can possibly avoid it, “But how can it be like that?” because you will get “down the drain,” into a blind alley from which nobody has yet escaped. Nobody knows how it can be like that.
We certainly have no idea. However, we have an idea of what might jar new ideas loose, and accordingly our book promotes the view from combinatorics. That is why we blend numbers and strings early on, why graphs come in chapter 3 (where they also help for reading circuits in the next chapter), why we have a whole chapter on handy “tricks,” and why we include a chapter on the number theory used to make periodfinding solve factoring though it has no quantum content. It is why we incorporate the “coin space” of a quantum walk on a graph into a “doubledup” graph and then phrase the interference analysis in terms of counting heads/tails subsequences in the coinflips. Finally, Chapter 16 includes my quasioriginal extension of the proof of upper bounds for in this paper, whose authors expressly reference Feynman’s sumoverpaths formulation, with lighter theorem statements and proofs than in my post and “cookbook” draft paper on this subject two years ago.
Open Problems
Our final submitted typescript included everything in new LaTeX macros commissioned by MIT Press, even the exact frontmatter, and came to 206 pages (192 numbered). Yet the published version, with no other content besides the cover, has 208 pages. The reason is a law of quantization that limits one’s ability to “save trees” by improving pagebreaks and linebreaks. Can you explain this quantum principle?
[fixed 1984>1948]
This looks so interesting! I am fighting the urge to just buy it immediately now, poor gradstudent or not. I loved the posts about this subject two years ago, and I’ve kept them in mind ever since. I believe a whole textbook about this subject seems like something that could plant the seeds of a revolution.
A simple explanation of pagequantization is that offsetpresses don’t print books as individual pages, but rather as signatures that are foldedandcut into pages.
Particularly when some signatures are printed (expensively) incolor, while other signatures are printed (cheaply) in black, the resulting quantization patters can be rich indeed!
More richly, we can appreciate pagequantization as a metaphor for dynamicalquantization.
Ideality The creed of the Church of the Larger Hilbert Space regards basisvectors as the independent “pages” of the Book of Nature. This independentpage description is adequate for most purposes, and is particularly congenial to students and to theoremprovers.
Reality For reasons of efficiency, Gaia’s Press prints the Book of Nature not on exponentially many separate pages, but upon polynomially many algebraic signatures. The associated signaturebundle description of the Book of Nature is particularly congenial to algebraic geometers and to simulationists.
Synthesis The independent basispages of the Church’s creed arise as a simplifying illusion that Gaia’s Press induces by the foldandcut process that is commonly called “experimental measurement”.
Readings The lecture “Accelerating DrugDiscovery: The Accurate Prediction of Potency” (available on YouTube), by Mark Murcko (who is the senior vice president of strategy at the quantumsimulation company Schrödinger), is a terrific introduction to burgeoning power of realworld quantumsignature dynamics.
Summary It is well for quantumdynamics students to respect *both* the elegant creed of the Church and the burgeoning power of the Press.
Dick and Ken’s Quantum Algorithms Via Linear Algebra is a terrific introduction to the beauty of the Church … we can hope that Dick and Ken will someday gift students with a comparably lucid introduction to the power of the Press!
@inproceedings{Murcko:2014aa, Author =
{Mark Murcko}, Booktitle = {Advances in
Drug Discovery and Development},
DateAdded = {20141123 04:18:41 +0000},
DateModified = {20141123 04:18:41
+0000}, Month = {24 September}, Year = {2014}}
Accelerating Drug Discovery: The Accurate
Prediction of Potency
Gosh the above videolink is both annoying and even (on my browser) broken outright. Dick and Ken, please feel free to substitute this (hopefully working) direct link to Mark Murcko’s lecture “Accelerating Drug Discovery: The Accurate Prediction of Potency.”
For young quantum researchers especially, this realm is rich in familysupporting jobs, open problems both deep and natural, and burgeoning enterprise opportunities.
See The Thorn and the Blossom by Theodora Goss for a novel case of pagecomplementarity.
See also Mark Z. Danielewski’s Only Revolutions.
I suppose there’s a pun about binding energy in here somewhere.
Reblogged this on Pink Iguana.
congratulations!
Can’t argue with that. Congratulations!
You had me at:
“This entailed keeping to an ordinary columnvector (or transposed row vector) representation of quantum pure states, and avoiding the customary physics notation of Paul Dirac.”
but… the Dirac notation is just row and column vectors 🙂 this is a . The idea is just to help keep track of when we have really taken an inner product , and also when we have an outer product like I find this much easier than using the superscript (or and trying to remember whether things are rows or columns!
oops, funny markup language. This is a \langle row , and this is a  column \rangle. An inner product is \langle u  v \rangle, and an outer product is  u \rangle \langle v .
Use $latex … $ without the hyphen. E.g.
nice nice probably the best readable book on quantum algorithms available.
Why don’t any quantum algorithms texts cover algorithms for simulating physics? That seems like the most practically useful application of QCs we know.
We pay “lip service” to that in chapter 7—since “Phillips” was Feynman’s middle name, ultimately we say “Phil’s Algorithm” refers to simulating nature. It did not seem thematic to go into further physics details now; that and something else might pick up on things mentioned briefly in chapter 17 for a later edition. (–Ken)
We read your ellipsis …
Congratulations!
The book is out of stock on Amazon. Do you know any other retailer that carries it other than MIT press?
Knowing nothing about QC but a lot of linear algebra, I’ve read the previous two posts. it seems like a very interesting approach, but there’s one very important aspect i don’t understand: what determines the set of “allowed” unitary computations?
Obviously there’s always a unitary matrix that will take us directly from an initial state to the desired state – why can’t we just apply it? Why can we use the matrix diag(1_R) in Grover’s algorithm? Doesnt it assume knowing R, which is what we’re looking for in the first place?
We address the allowed unitaries in chapters 4 and 5, while the treatment of gates in the exercises of chapters 3–7 builds a concrete characterization, which is finally included in a theorem statement in chapter 16. The detail about the feasibility of the Grover matrix is the most particular “shortcut” referred to in the post’s intro (4th paragraph). We added sections to chapters 5 and 6, the latter with a reversible “How many … light bulb?” metaphor, in order to fully justify it. We introduce the term “functional superposition” for states of the form (this is one of our examples of Dirac notation), and in fact there seem to be some interesting notyetfullytreated theoretical questions about them.
Congrats ! Great News! I really like your style of exposition. I would be very happy to get your perspective on topics like algebraic and combinatorial methods in circuit complexity in the form of a book.
beyond Boolean logic networks as often included in a discrete mathematics course .. respect .. although I hate mathematical calculations and related stuff !
Out of stock on Amazon. Hope the press is cranking more before Christmas!
interesting title, but what is the difference between linear algebra and quantum mechanics?
interesting title, but what is the difference between linear algebra and quantum mechanics?
ADC, Since this blog post is partly an homage to Feynman, and since Richard Lipton loves a good quote, I can’t resist quoting Feynman’s answer to almost the same question:
“Math (Linear Algebra) is to Physics (Quantum Mechanics) what masturbation is to sex.”
Hi rrtucci,
Do you believe in faulttolerant quantum computing? If so, QM = sex and LA = masturbation.
I do not believe that quantum computing is feasible in a noisy (physical) system. For me, QM=LA
Which begs for the obvious question about your gut feeling. Do you believe QC is even remotely possible? And would answering this question affect book sales? :0)
Reblogged this on All about Nils.
On page 103, should it really be 0.4*r*r? 0.4/(r*r) makes more sense for me.
I was unable to figure out how to create the functional superposition of a noninvertible function – as suggested in the description of Simon’s and Shor’s algorithm. See http://cs.stackexchange.com/questions/43805/howisquantumfunctionfxaxmodnconstructedinshorsalgorithm/49198
I found a solution for the functional superposition using ancillary qubits and edited my response on stackexchange accordingly.
What about my problem with page 103? Am I missing something or is there a mistake?
Yes, there is a mistake on page 103, and it’s already on the book’s errata page http://www.cse.buffalo.edu/~regan/LRQbook.html
Yes and thanks, you were one of several to point it out this month; we still wish to find a smoother presentation in pages 101–103.
Please please tell me there will be a solutions manual for this book. I will gladly pay for one as many impelmentation tricks are left for the reader and I don’t know if my answers are correct or rigorous enough. This is all new to me, I’m an undergrad in computer engineering.