Transcript | Just the Math You Need to Know for Quantum Computing – with Author Leonard Woody

Mathematics is one of the most intimidating barriers for those looking to get into quantum coding. Mention linear algebra the next time you want to grind a conversation to a halt. What if there was a resource to learn the necessary mathematics to best prepare for such a career? Join host Konstantinos Karagiannis for a chat with Leonard Woody, the author of an excellent new book, Essential Mathematics for Quantum Computing, and learn precisely the math chops you need to code quantum applications effectively. 

Guest Speaker: Leonard Woody— Author of Essential Mathematics for Quantum Computing

Konstantinos Karagiannis:

Mathematics is one of the most intimidating barriers for those looking to get into quantum coding. Mention linear algebra at a party next time you want to grind conversation to a halt.

We talked to the author of an excellent new book that gives you precisely the math chops you need to code quantum applications effectively in this episode of The Post-Quantum World. I’m your host, Konstantinos Karagiannis. I lead Quantum Computing Services at Protiviti, where we’re helping companies prepare for the benefits and threats of this exploding field. I hope you’ll join each episode as we explore the technology and business impacts of this post-quantum era.

Our guest today is the senior product manager and quantum at scale lead at Microsoft. Leonard Woody, welcome to the show.

 

Leonard Woody:

Thanks. I actually go by my last name, Woody, so feel free to call me with it.

 

Konstantinos Karagiannis:

Great. You’re here partly to discuss this great new book you wrote, but before we get to that, it’s always interesting to see how our guests got to the world of quantum. Because of where you work, I wanted to dig into what you do by day that qualifies you to write this book by night, or whenever you wrote it. What got you into quantum?

 

Leonard Woody:

Well, I did my undergraduate at the University of Virginia 20 years ago in physics and computer science. I loved physics. I wanted to do a PhD in that, but then I got engaged to my wife. Computers were much more commercially viable at that point, and I needed to support a family, so I went into computers. I’ve loved computers all my life. I wouldn’t say I forgot about physics, but it went on the back burner. I did software development — C#, Java, all that good stuff.

Then, when I joined Microsoft about four years ago, they had just released Q#, our quantum programming language. I asked my manager — I was onboarding, and I didn’t have any clients at the time — and I said, “With this free time I’ve got, can I study quantum computing? Can I look into Q#?” and I expected him to say, “No, we have no customers doing that. Why would you even look into that?” but he was nice enough to say, “Go for it. Why not?” So, I started looking into it.

We have an internal conference here at Microsoft called Ready. and I wanted to go. My manager said, “No, we don’t have the budget,” that kind of thing. I knew the only way to go for me was to speak. I had two options: I could do one on Team Foundation Server, which was my major technology, but I figured there’d be tons of applicants on that. I said, “Or I could just do this totally-out-there session on quantum computing,” because I figured there’s not going to be much competition on that one. I did, and then I got accepted. Then I was, like, “I got to know this stuff. I can’t just get up there in front of hundreds of people and talk about something that I don’t know well.” So that forced me to start to look at it and study it.

The first thing that I came across when I got into quantum computing was math. There was so much linear algebra. I remember looking at the vectors, and I was, like, “Yes, got that. Remember that from linear algebra. Matrices, eh, it’s been a little while. But then it got into tensor products, and I was just, like, “No, I don’t remember any of that.” It had been at least 20 years since I’ve taken linear algebra and calculus and stuff like that.

So, I did my presentation. It went well. Of course, one of the best ways to learn something is to try to teach other people about it. I just kept on studying the math and going through that, and had an experience where eventually, over time, I went back to community college and retook some of the math classes.

It’s funny: The second time around, you’re not going for the grade — you’re going for understanding, so it’s been interesting doing that. I got the offer — I started blog posting about quantum computing, and then the publisher saw some of my blog posts and asked me to write the book, which was awesome. That then generated a job here at Microsoft at quantum computing. It felt like a career change, going from strictly software development and IT to quantum computing.

I’ve been on my current job almost three months, and I enjoyed working with the Azure Quantum Team and learning about our products and all the different hardware devices, from superconnecting qubits to ion traps. We support Qiskit and SRQ and Q#. It’s been a great job right now, and it’s been a great journey. It’s funny — I’ve always waited for the passion to turn off, and say, “I’m not willing to do all this math homework” and stuff like that, but it hasn’t. As long as the passion is still there for me, I’m going to keep on going.

 

Konstantinos Karagiannis:

The book is called Essential Mathematics for Quantum Computing, and we’re going to dive into that in a moment. I wanted to hear more about what you do day-to-day at Microsoft right now — also, your background. It’s the kind of thing that a lot of people are hearing about — physics and computer science mixed together — and it’s what we recommend until tracks are created for quantum developers. How you made the switch, it’s great. It’s going to be inspirational to a lot of people. What did all this hard work and shifting get you to now? What do you do day-to-day?

 

Leonard Woody:

I work a lot with our Azure Quantum team on, how are we going to message our strategy going forward? How do we do thought leadership within the quantum world? I recently got to go to IEEE Quantum Week. A lot of it is also looking at the market: What are our competitors doing? How are they doing things better or worse, and how can we differentiate ourselves in the quantum computing market? Where is the market going?

Quantum, ultimately, is an emerging technology in the organisation I’m in, within Microsoft. It has a lot of the emerging technologies that are coming up — 5G, Azure Space, those types of things. As these technologies mature, how do we create them as real businesses? How do we create the next $10 billion business for Microsoft? How does that happen? It’s a tricky thing to do. You’ve already got established things like Azure and, of course, Office and stuff like that, but we’re taking this incubation of quantum computing, and we need to turn it into commercialised business and how we’re going to do that with the field and things like that. A lot of my work is trying to think how we’re going to position Azure Quantum going forward.

 

Konstantinos Karagiannis: 

We had on Microsoft recently to talk about the topological-gap work that was done. One day soon, you might be positioning a very impressive machine — who knows?

 

Leonard Woody:

Yes, we’re always working on stuff, and definitely keep your ears open.

 

Konstantinos Karagiannis: 

That could be exciting. You wanted to make quantum computing development easier for folks when you wrote this book. Let’s talk about the prerequisites for being a quantum coder. Obviously, math is one of them. What would you consider them to be? You could include what aspects of math too.

 

Leonard Woody:

There are basically three big languages out there for quantum computing at this point if you want to be a quantum coder: There’s Qiskit. There’s SRQ, and Q#, which we’ve developed. Most people that come into quantum computing are either coming from a software development background — they’ve got the programming chops but possibly not the physics chops to understand all the different physics concepts that need to be understood to do the quantum programming — or they’re coming from a physics background, and so they’ve got all that stuff, and they just need to learn how to programme.

It’s probably easier to come from the physics background, because I find that there’s a lot of stuff to know, and concepts, and physicists dominate the field at this point, but my track was coming from a software development, so I know how to write code. I’ve done that most of my career. I actually got my master’s in software engineering. What I needed to learn was the physics, and I’ve now read a number of books on quantum computing. The first thing that, almost always, they start with is some sort of linear algebra. It just has to be taught.

When Packt came and asked me to write the book, they said, “We were thinking about the mathematics of quantum computing,” and that seemed like something I wanted to get into, because I felt like the books and the courses gloss over linear algebra in the beginning. It’s understandable — they have to teach a lot of stuff within, say, 300 pages or, let’s say, a five-hour class. You could spend that much time on just linear algebra, which I did in my books. They’re, like, “These are vectors. These are matrices. This is matrix multiplication. This is a tensor product. Let’s go.”

If you’ve never come across those concepts before, and a lot of software developers haven’t, it’s like, “Whoa!” and then you’re just off to the races with superposition and all the other concepts and things we love in quantum computing. You didn’t get the fundamentals, most likely, good, and then you’re talking about these far-out concepts of entanglement and superposition and things within physics using this math that you just learned about an hour ago.

That was where I wanted my book to concentrate on. There are good books out there, but one that Jack Hidary did on quantum computing, he had a whole appendix on linear algebra, and I liked what he did, but I wanted to expand it, and I wanted to meet the software developer where they were. Either they’ve taken the math a long time ago, like me, or, possibly, they just have never taken it at university or something like that. I start at high school math and then go from there through everything you need to know to get started.

 

Konstantinos Karagiannis: 

The first thing I noticed when I got the book was, like, “I thought it would be thicker.” When I saw the topics you were trying to tackle, I was, like, “This is 10 major areas that I can’t believe he’s going to accomplish with this.” It was clear and concise, and no real extraneous matter. I thought it was well done.

When people read this and they don’t have the background, one of the things first they might be surprised by is how early on in this learning process all this directly relates to quantum computing. You make a point in the book about how you shouldn’t read this and then go and do quantum. You should maybe be reading while you’re doing quantum and while you’re experimenting. It’s right there at the earliest. We’re not going to dive into every little bit of math in the podcast, but one great example is, if you just want to explain to listeners how vectors and matrices directly correlate in the real world to their quantum counterparts.

 

Leonard Woody:

I tried to do that from the get-go, like you talked about, because I didn’t want it to just be a dry, straightforward math book. There are plenty of those out there that you can purchase, but I wanted readers to see how the math correlates directly to quantum computing and the concepts. For the first chapter, where we talk about superposition with Euclidian vectors, I take simple vectors. They may not be simple to new people in quantum computing, but it’s just two-dimensional things you probably have done in high school, and I define, mathematically, superposition by the end of the chapter. It’s only about 20 pages.

That’s great, because any pop article you usually read on quantum computing tells something about qubits and says, “They can be in the zero state and the one state at the same time, or they’re a combination.” That just goes on and on, and it’s not the actual definition. Quantum mechanics and quantum computing is very math-based. One reason is that math is the language of physics, but even more so, it’s that we don’t totally understand what’s going on at that level, at that nanometer scale, and so we don’t have the language in our vernacular today where we talk about apples falling and baseballs going 90 miles per hour and stuff like that to explain what’s going on. The only thing we can fall back on is our math. So, knowing what superposition is from a mathematical perspective within 20 pages is huge.

Then, the next chapter, talking about matrices, again, I don’t want to be dry about matrix multiplication. There’s plenty of stuff out there about matrix multiplication, but I want to connect it to quantum computing and how we do gates and how we do operators and stuff like that. You’re right — most people don’t come to quantum computing to learn math. That’s not what attracted me to quantum computing. It was, “It’s this cool technology. It seems like it might be the next thing in computing. It also seems just from another planet — it’s a totally different thing.” You don’t want to lose that enthusiasm, just slogging through math or just slogging through learning a particular language, or stuff like that. You want to keep that coolness, if you will, that you saw in the beginning.

Like you said, do some math. Get stuck. Say, frankly, “I’m going to go do some cool quantum computing stuff. I’m going to go programme in Qiskit, or whatever, or Q# — run some of my code on the actual quantum computer, on Azure Quantum or the other platforms that are out there, and have some fun,” and then get stuck with that. Then, entanglement, you’re, like, “I know what superposition is, but entanglement, that’s a whole other beast.” Come back to the book, learn some more math. That’s how I did it. You don’t want to just study math all day.

 

Konstantinos Karagiannis: 

Linear algebra, I think of it as the great face dropper — when people come to me in the company and they’re, like, “I want to join your team. What do I do to learn?” The minute the L and the A come out — “linear algebra” — you see that expression just nosedive and it’s, like, “Oh, OK.”

 

Leonard Woody:

Yes. Also, when I talk to my friends, they’re, like, “You’re writing a book?” I was, like, “Yes,” and I’m, like, “It’s Essential Math—” and I don’t even get past the rest of the title. You see their eyes go boom.

 

Konstantinos Karagiannis: 

Kudos, because it didn’t feel like just math. It was, “Here’s a vector,” and in some ways, you’re learning about a qubit. Here’s a matrix, and you’re learning about a gate. Then, later on, some other concepts come up — like you mentioned before, like in articles, you always hear “zero-one, zero-one,” and no one gets what that means. I like what you did with the Bloch sphere. People see that diagram, and they don’t understand how it works.

Then there are also all these concepts associated with doing encodings. There’s a lot of granularity to coding with a quantum computer that people don’t get. It’s not just, “Drag the little cute composer things in Qiskit” — there’s a whole lot going on.

I want to be able to give a few abstract concepts, some description time here. You want to talk a little bit about the Bloch sphere? I know people see it, and they could visualise it as it comes up.

 

Leonard Woody:

Yes, definitely. I struggled with the Bloch sphere when I studied. That was one of my biggest struggles. I didn’t understand it, but it seemed to be a central concept in quantum computing. I tried different courses and books to learn quantum computing. I was taking Peter Shor’s class at MIT. He immediately brought up the Bloch sphere. I knew that it was important, but I couldn’t wrap my head around it. To be frank, I put it on a shelf. I was, like, “I’m going to sit here all day and for days on end and not understand this Bloch sphere. I’m going to put it on a shelf and keep learning other things that makes sense to me.”

Lo and behold, as I got more and more into the mathematics, it started to slowly make sense to me, and I understood why they did what they did with the Bloch sphere. A lot of it revolves around complex numbers, which I covered in high school and university math, but it had been a long time. Basically, I knew about complex numbers, and the square root of negative 1 was i. That’s about it.

And the other thing is that physicists kept taking about phases. When I was on Quantum Computing Stack Exchange, I said, “What exactly is a phase?” I’ve heard of phase, but it’s never been used in computers. I just don’t understand, and the more I got into it, understanding the physicist’s language, since they dominate the quantum computing industry and marketplace, helps you understand why they say things the way they say them.

In that chapter that involves the Bloch sphere and complex numbers, I go through, exactly what is a phase? Mathematically, it’s angle within the number e to a certain power. What is a global phase? What is a relative phase? What I wanted to do was build from simply what I knew, which was the square root of negative 1 was i, all the way to, “Let’s understand how the Bloch sphere came to be, and let’s derive it mathematically,” so by the end of the chapter, you understand why they use this as a model.

The reason, ultimately, that it becomes important is because you have these rotation x operators and rotation y operators and rotation z operators. The reason they’re named that way is because of the Bloch sphere. Do you have to know the Bloch sphere to go into quantum computing? Maybe not, but when you’re talking to other people, and they say “rotation on the x angle,” you’ve got to get back to the Bloch sphere. There’s just no way around it, because that’s what they’re referring to.

That was something I wanted to do — demystify the Bloch sphere, the thing that had given me so much trouble over so much time in quantum computing. That’s why I wrote the book — I had someone like myself in mind that had gone through these trials and tribulations, and retook a lot of my math courses. When I retook linear algebra, it was interesting that they didn’t cover all the linear algebra that I needed in that semester course. On the flip side, they covered a lot of stuff that I didn’t need. I didn’t want to force people to go back. Not everybody wants to go back to university to take linear algebra. That’s not a fun thing.

I wanted to take what I had learned and just take the parts that you need. You don’t need a full semester course of linear algebra. If you want to, I don’t want to hold you back, but you don’t have to. There are only parts of those different courses that you need, so I tried to pick them out, put them in one book. The other thing that you referred to was that it was a whole lot thinner than you thought it would be — by design: If I sent you a 500-page book, it might become a paperweight very quickly. Like, “Holy cow.”

 

Konstantinos Karagiannis: 

It was a compliment.

 

Leonard Woody:

I took it that way too. I was at a IBM Quantum summer camp thing, and the guy was going through different books. He came across one — it might have been Mike and Ike, or whatever, one of the books — and it was 400, 500 pages. He was, like, “You could try with this, but I don’t know.” Then he had this one that only had 100 or 200 pages. He’s, like, “This is much more manageable.” If I get a book like this, I’m like, “I might be able to read that whole thing.”

That was something I was going for too — you get it, and you’re, like, “This I can do.” I just wanted to meet people where they were at, especially software developers, but also other technically minded people that are gifted, they’re smart, they know technical subjects — they’ve conquered other technical subjects in engineering or what’s in software development — but they just haven’t done the math they need for quantum computing, and that’s usually the biggest stumbling hurdle for people getting into the field.

 

Konstantinos Karagiannis: 

Yes, objectively, it reads as if you have compassion for the reader at times. It’s, like, “This was tough for me, so I hope you have a better experience with it.”

 

Leonard Woody:

That’s why I wrote the book. I frankly wish the book had been there when I started to get into it, because I struggled. I watched YouTube videos on things. I read different articles. There’s a plethora of books out there in quantum computing, and I didn’t know which ones where the best, so I tried one and then I tried another. Lo and behold, there just wasn’t one that was just, like, “Here’s the math that you need.” There’s a lot more in quantum computing beyond the math, but foundationally, if you don’t have this stuff, you’re not going to get a whole lot further in quantum computing. Having a good foundation as you start your career or your study into the field is very important, because the rest of the subjects come much more easily once you have that great foundation.

 

Konstantinos Karagiannis: 

Yes. It becomes more and more practical along the way. Then, when you get to bra-ket notation, I mean, it’s right there. You’re going to see that literally every single day on the job if you’re doing this in quantum coding.

I don’t know if you want to talk a little bit about bra-ket and how that translates in the Q# world, just to give one more concrete example.

 

Leonard Woody:

Yes. That was an intentional decision by me in the beginning. There are different notations for vectors. Some of them just have a letter with an arrow on top. I said, “If we’re writing about quantum computing, you have to use bra-ket notation” — or Dirac notation, as it’s sometimes called — “I might as well just introduce it from the get-go and just get the reader used to it.”

That was another thing — I was used to vectors being written a different way. I’d never seen this bra-ket notation before. Even with the math that I already knew going in, I almost took a step back when I saw the bra-ket notation, because it didn’t make sense to me. I knew what a dot product was, but I’d never seen it written the way that it was within bra-ket. That was an essential thing.

I have a whole appendix on bra-ket notation that gets into it more, but I wanted to introduce it from the get-go. I wanted you to get used to it and learn the mathematical concepts through bra-ket notation. I don’t know of any linear algebra books that use bra-ket notation to teach linear algebra. Most of the time, it’s using the letters with the arrow on top and stuff like that.

That’s the other thing: Physicists — especially quantum physicists — have their own language, as we’ve been taking about with phases and interference and stuff like that. The other language they like to use is bra-ket notation. I read a lot of different books as I was writing mine. The mathematicians are very rigorous. They have to prove everything out to themselves, and stuff like that. The physicists are, like, “The math is great, but we’re going to fudge it a little bit. If we can’t prove it out, I don’t care. If it works, it works.” That was interesting to me too. You don’t often think about it, but just the way that the physicists use the math and the way that mathematicians were, like, “It has to be this way — it has to be rigorous,” and things like that.

Like you said, I also tried to throw in humor — I don’t know if it came through — every so often in the book, because reading a dry math book can be hard sometimes. I definitely, like you talked about, told people to go take a break with the book. To be quite truthful, when I was writing it, I had to take a break. I’m, like, “I got that half of the chapter done. I need to take a break for a few days before I get back to it.”

As regards bra-ket notation with Q#, the notation itself is not within Q#, but again, when you go to the documentation on Q#, we start with bra-ket notation. A lot of our documentation — frankly, I know I’m biased, but our documentation on the math of quantum computing is where I started when I started to learn quantum computing. It’s very terse. It’s very compact, but it’s all there, within about eight web pages. I found that helpful as well. Sometimes, when I was doing Google searchers on different types of notation, our stuff was at the top in terms of how to understand that.

 

Konstantinos Karagiannis: 

That makes sense. I encourage people to read this book, for sure, because I have a feeling that it’s going to fill some gaps. I’d be shocked if you didn’t have some of these gaps if you’re trying to make your way into this space. We’ve done episodes before on how hard it is to break into this field, and the preparation, so I’m glad this new tool is out there. I hope people pick it up.

 

Leonard Woody:

I want to remember what it was like for me when I started my journey, that I wanted to get into quantum computing. When I first started to get into it, I learned new programming languages, new technologies. If I’ve got to go learn Python, I could learn that pretty quickly. Quantum computing was nothing like any of the other technologies that I’ve ever tried to get into. Even after four years, I don’t understand everything, and I tend to take it with a grain of salt if somebody says they do understand everything in quantum computing.

Getting into the field, a lot of the people have PhDs. It’s just the way it is. It’s something I come across in the work all the time. I’m surrounded by PhD physicists. So, it’s hard to get noticed. It’s hard to apply for some of these different jobs if you don’t have that PhD in physics, but I also wasn’t going to spend 10 years of my life getting a physics PhD. It just wasn’t what I wanted to do at that point. I wanted to get into the field.

The best way to do it is, I was lucky at Microsoft that we have a vibrant community within quantum computing, so I would find that community within your company or within your community. Start the community if it’s not there already, and take leadership positions within that community. Get noticed by the quantum computing part of your organisation. Go out and do presentations, podcasts, whatever you can, because ultimately, when you come up and you don’t have the PhD, you want to be able to refer to things that you’ve done that are — I don’t want to say equivalent, because PhDs aren’t like that, but demonstrate that you understand things like that. Because it’s very hard in an interview to test someone on physics concepts. I don’t know a way of doing that.

Getting a track record around physics and quantum computing as you apply for these different jobs is important. You can’t fake enthusiasm and passion. You just can’t fake that. if you’ve got that for quantum computing, make sure it shows through in all the different work that you do and that you start to have your reputation within your company and possibly outside your company: “That person is very passionate and enthusiastic about quantum computing. They’re doing a podcast, hosting a podcast” — as you do — or “Their blog posts are just out of this world.”

The cool thing about people who start to get into quantum computing is that — and I may be farther removed — you still remember what it’s like in those first three months. You know some of the things that you didn’t know then, and you can explain it better to the new person than someone that’s been in it four, five, six years. That’s a vital thing. We need people to be able to explain those concepts. They’re very difficult to new people coming into the field. That’s where you can make a contribution. So, don’t just learn it. Contribute to the community. There are plenty of ways to do that both at Microsoft and at other companies. Just follow your passion, is the best advice.

 

Konstantinos Karagiannis: 

That’s great. I feel like we just appendix six to the book.

 

Leonard Woody:

Or a second edition.

 

Konstantinos Karagiannis: 

Thank you for that extra wisdom there. I’ll be linking information about the book in the show notes. I hope everyone picks it up, because it’s great. I enjoyed it.

 

Leonard Woody:

I appreciate you having me on.

 

Konstantinos Karagiannis: 

Yes, thanks so much for coming.

 

Leonard Woody:

Take care, Konstantinos.

 

Konstantinos Karagiannis: 

Now it’s time for Coherence, the quantum executive summary, where I take a moment to highlight some of the business impacts we discussed today in case things got too nerdy at times. Let’s recap. Leonard Woody found his way to quantum computing after years in classical software development. When he realised that he needed to brush up on specific math skills to make the shift to quantum at Microsoft, he not only went back to take courses for a refresher but also decided to teach what he most needed to learn. He wrote Essential Mathematics for Quantum Computing.

Like most great books, it’s a work the author wished he had access to. The book is surprisingly thin for all the information it contains. As its title suggests, it’s distilled to only include the math you need for the hands-on coding of quantum computers. What can often seem to be esoteric, abstract concepts are taught in the context of quantum computing. For example, vectors introduce qubits, and matrices introduce gates. It’s an easy-to-follow approach and brings terms to life that readers might have only vaguely understood before.

You should take a look at the link in the show notes for a taste of the book’s contents and style. In a couple of days, you’ll understand the Bloch sphere like never before and will be comfortable with bra-ket notation like a pro in the field. I’m already recommending it to those in Protiviti interested in migrating to my team.

That does it for this episode. Thanks to Leonard Woody for joining us to discuss his book on the essential math you need to understand quantum computing. Thank you for listening. If you enjoyed the show, please subscribe to Protiviti’s The Post-Quantum World and leave a review to help others find it. Be sure to follow me on Twitter and Instagram @KonstantHacker. You’ll find links there to what we’re doing in Quantum Computing Services at Protiviti. You can also DM me questions or suggestions for what you’d like to hear on the show. For more information on our quantum services, check out Protiviti.com, or follow ProtivitiTech on Twitter and LinkedIn. Until next time, be kind, and stay quantum curious.

Loading...