Charlee Stefanski and Constantin Gonciulea, co-authors of Building Quantum Software, are interviewed by Yuval Boger. Charlee, a software engineer, and Constantin, an expert in math and quantum computing, discuss their new book aimed at developers and readers with a basic background in math and programming, emphasizing a deeper understanding of quantum algorithms like Grover’s algorithm and the quantum Fourier transform. They also cover the importance of hybrid quantum-classical algorithms and the development of their own high-performance quantum simulator. The conversation touches on the current state of quantum software tools, the challenges of scaling quantum algorithms, and the potential business impact of quantum computing, particularly in optimization and finance, and much more.
Use code SPG45 for a 45% discount on this book or others at manning.com
Full transcript
Yuval Boger: Hello, Charlee. Hello, Constantin. Thank you so much for joining me today.
Charlee Stefanski: Hey Yuval, thanks for having us.
Constantin Gonciulea: Thank you for having us.
Yuval: Great. So Charlee, who are you and what do you do?
Charlee: I am a software engineer. I have been working in the quantum computing space for just three years now. Under or with Constantin and so writing this book has been sort of a reflection of that experience coming into the quantum computing space.
Yuval: Wonderful. And Constantin, who are you and what do you do?
Constantin: Well, so I do a mix of math and computers if you want in my career, typically for large financial institutions. This is my second one. And among other things, I’ve been doing quantum computing for six years. And Charlee joined out of school. She joined my team and she can relate probably to a lot of people who are starting to learn quantum computing.
Yuval: So I think you published a new book. So tell me a little bit about that. What is the book called? Who is it for? And if I read it cover to cover, what will I learn?
Charlee: The book is called Building Quantum Software: A developer’s guide. And it is for sort of, as I mentioned previously, it’s for developers, but really a broad audience. We want it to be approachable for anyone with a high school, maybe freshman year of college. Background in math, a little bit of programming, and you will be able to read the book. Constantin, if you want to add anything about it.
Constantin: Yeah, I would say that our book fills a gap in the literature. If you look at the current books or tutorials or instructional materials, they fall into two main categories. One is you need to know high level math like Hilbert spaces. And a lot of people think you have to go through that first. And the other extreme is you just learn the syntax for building a circuit using Qiskit, let’s say, and then you are good to go.
The reality is, so in our team, we have both developers and researchers. The scientists, the researchers create algorithms and then developers help with them in production. It’s not enough to know the syntax though. You need to understand what’s behind the algorithms, what’s behind every gate pretty much. So that’s the gap that we are filling. If you know how to program and if you know some elementary math, which means the level of, let’s say, SAT subject math, which Charlee took and she got a perfect score.
I had the same experience with my kids when they were in high school. I asked my daughter, so we had a Python simulator, a very simple one, and I asked her to convert it to Julia. And she did it and my son did the same for Google Sheets. We also have a student, Naren Satishkumar, who just graduated high school. He’s going to UCLA and he’s helping us with the book code, the more advanced parts. And this is the audience. We’re seeing people who know how to program, they know a little bit of math, like complex numbers, and then they want to learn quantum computing.
Yuval: So Charlee, would it be correct to say that this is the book you wish you had three years ago when you got into quantum?
Charlee: Most definitely. There are a lot of great learning materials out there, but this one takes you step by step and is very much for someone who’s coming from a developer background.
Yuval: If I remember correctly, in the book, other than the introduction, you cover Grover’s algorithm, you cover the quantum Fourier transform, and then I think quantum phase estimation. What about the others? I mean, there’s VQE and QAOA and there are several other algorithms. Is there a sequel coming or is there a particular reason that you left them out of this book?
Constantin: Yeah, I’ll take that. So Manning Publications has a great process. And part of it is you cannot let the reader fall through. So whatever you explain has to be completely explained. And we had plans for more, but because we had to expand and put complete explanations, complete details, so we are covering up to Grover Optimizer, which is an optimization algorithm, obviously. It’s one that I helped create in my previous job. Stefan Werner is also an author and Austin Gillam. That’s one of the five optimizers in Qiskit.
So it’s not by any means falling short. Some people say, “Oh, this is research because we include something that’s published in the Quantum Journal, a research paper.” So I would say it’s focused on what you need to know in order to do optimization, but it’s not leaving out too much. In the last chapter we talk a little bit about other algorithms but since we don’t go into depth we are not advertising them.
Yuval: I would like to dive a little bit into the process of software development covered in the book and even beyond the book. So first, what do you think of the state of today’s software tools? Do you think that they will be sufficient to develop the types of algorithms that you work on in your day job in a financial services organization? Or do you think there needs to be a big change or even a revolution in the way one writes quantum software?
Constantin: We can speak from experience and this is something unique about us. We are practitioners in both research and development. And I don’t think you’ll find too many authors doing both or even sometimes people write, but they’re not practitioners even in one of these areas.
So what we’re finding out is it’s beneficial to have your own simulator. So what we did in the book, we implemented a simple simulator from scratch. And this is in line with learning neural networks. If you take Andrew Eng’s class, you start with implementing a neural network from scratch and then you start using Torch and so on. So our simulator, which is like 200 lines of code, the basic implementation, follows Qiskit’s interface. So we have compatibility to the point where the same code runs with both our simulator and Qiskit’s.
Our simulator is much faster and the implementation much simpler. It’s more flexible because we can change it anytime and so on. Now, Qiskit has transpilation and optimization, so it’s not that Qiskit couldn’t do it. But it’s a more general tool for everyone. We can customize ours to whatever we want. And the same design we applied to a Rust simulator, which is called Spinoza. It’s open source. According to the benchmarks, we beat pretty much everyone else. I mean, any benchmark, you’ll be better in some areas and worse in other areas. But the design is also high performance.
So what we found out is that it’s better to have your own simulator and be ready to adapt whenever something new comes. The answer is that what’s out there is sort of average. And you can build on those tools or complement with your own.
Yuval: Do you think that these tools would be sufficient to create algorithms that use a large number of qubits? I’m guessing that without getting into the details of what you do at work, you’re probably running programs that could still be solved classically, sort of learning the ropes, developing algorithms, and hoping that one day soon computers will be large enough and error-free enough so you could actually run them on a larger scale. First, is that true? And two, do you think that the existing tools would allow you to do that, to run on very many qubits?
Constantin: Yeah, so I would say that whatever we do, we implement solutions that work on a small scale, but we know that they will work on a large scale when we’ll have the large scale production level computers. But we’re not going to pursue solutions that don’t scale.
Also, the simulator I mentioned can be distributed. You cannot go to too many qubits in a simulator, though. So Charlee is also running our experiments on our partner’s computers. So what was the highest number of qubits, Charlee, that you ran on?
Charlee: 127 qubits.
Constantin: Yeah, so that’s the largest. And frankly, whenever we include the results in a paper, it has to be a smaller number in order to really convey that the algorithm works.
Yuval: How about hybrid algorithms? Are the algorithms that you develop typically purely classical, or are they hybrid? And is hybrid classical quantum covered in the book?
Constantin: So they have to be hybrid. So we have a whole area of research that is related to… this is public information, to the limit order book. In order to benefit from quantum computing, you have to use mid-circuit measurement. So mid-circuit measurement, something non-linear, if it’s only linear. So it’s almost like every useful algorithm has to be hybrid, including the Grover optimizer, where you adjust the function. So you find, let’s say, a value that’s higher than the previous one, then you adjust your function and find something higher.
So pretty much every algorithm that we’re talking about is hybrid. And also we’re looking at quantum-inspired algorithms. For example, we found out that using Hidden Markov models, you need fewer states in the quantum implementation. This doesn’t necessarily mean that overall it’s better, but it means that it’s a simpler model. So then we’re saying, why shouldn’t we try it classically? So basically using complex probabilities instead of just real probabilities.
Previously you asked about how do you compare with the classical implementations. In the market algorithms, I think businesses use like 20-30,000 servers distributed. It’s very hard to beat that, even if you get 1,000,000 qubits. But the benefit is, if you get a new model that sees something that the classical models don’t see, you can add it to the ensemble. So you get from a percentage, whatever it is, like I don’t know, I’m making this up like 95%, if you go to 95.2%, that’s important in those algorithms. So that’s where we’re seeing the value, not necessarily beating any classical counterpart.
Yuval: People talk about three classes of problems that quantum computers could solve. Optimization, machine learning, and simulation. As you think about business utility, something that’s truly useful to the business, which category do you think will be first in that business utility range and in what timeframe? Maybe Charlee first and then Constantin?
Charlee: Sure. So we are heavily focused in the optimization category. But in addition to that, some early applications that we think will be first to be utilized are things like random sampling, random number generation, which of course is a component for developing other solutions. So random number generation is used in building AI products and in machine learning applications and then of course in security and encryption.
Constantin: In the book, we have a higher level description of three classes of problems. One is sampling from probability distributions that are intractable classically. And I think this falls into the simulation category that you mentioned. Then we have problems where the answer is found in the outcome of the computation, like the zeros and ones. And the other one is when the answers are found in the amplitude or probability.
Initially we were very hopeful about the derivative pricing where you need amplitude estimation. But less and less we believe the main category is the one where you can increase the probability of the answer, which is binary. And there you have the classification process of QML and optimization. Both of these are on our radar, but we believe that optimization will be the main one, especially in financial services. And we are also part of the IBM working group for optimization. There was a paper recently. So optimization would be the one. And our book happens to focus on optimization as well.
But there is a very important aspect of our book, which is that we point out what types of problems will benefit from a quantum approach that a lot of people ignore. And this is the butterfly pattern. So basically when you apply a quantum gate to a quantum state, you change the probabilities and the amplitudes in pairs. It’s not global or you preserve the probability in pairs. And this is called the butterfly pattern. If you look at Shor’s algorithm, it benefits from that, both the building of the function and then finding its period with Grover. And Grover optimizer also follows that pattern. That’s why we favor it in the book. So we emphasize the butterfly pattern over and over again. And recently in neural networks, for the Hazy Research group at Stanford, they also… So basically people are saying we need structured matrices, not general unitaries. And then you leave the homework to the reader. I have a solution with a big unitary, but it’s up to you to break it into small gates. So we’re looking for those problems that benefit from this structure.
Yuval: And I meant to ask about timeframe. When do you think quantum computers will be useful for your company or a company like yours?
Constantin: Well, so when I started, which is six years ago, a lot of people were hopeful that in five years at that point in time, would have quantum computers. I was in meetings with providers who thought they would have a million qubits in five years, you know, photonics. None of that happened. Now IBM has a roadmap that includes 100,000 qubits in 2034. Right? So they don’t promise more than that. Maybe you can go to production with a thousand qubits, reliable qubits. So instead of giving a year, I would say when we have a thousand reliable qubits, we’ll be in production in an experimental mode. How is that for your answer?
Yuval: I wanted to ask both of you. Constantin, I think you mentioned six years of working in quantum and Charlee, I think you mentioned three years. What have you learned in the last six months that you didn’t know before about quantum computing or quantum computing programming? What’s new in the field in your opinion?
Constantin: So I’ll say, and then Charlee can chime in. We see news, for example, there was something about logical qubits versus, you know, with 1000 qubits, you get one good logical qubit. Some people are very excited and say, oh, this is a great day for quantum computing, but then you see the competition saying something different. This is not a big deal and you have to read the details. So this is a little bit discouraging. So I would say there is good news. I think all of these are, for example, this is one of the examples I would mention, this one, the logical qubits. There is a lot of hope. But at the same time, when you see that other people are not as hopeful, you don’t know what to think. IBM’s announcement on the Ising model was also promising. Now in hardware, we don’t follow as much because it will take a lot of time. So I’m not very familiar with those. I know you work for a hardware company pretty much. But yeah, for me, those two stand out.
Charlee: I would say we’ve seen some preliminarily good results using Q-CTRL’s Fire Opal. So that is a potentially exciting tool, but we’re still experimenting.
Yuval: I think one of the unique things about publishing a book on Manning is that it’s online and it’s interactive and you could probably change it. I actually saw books that are published chapter by chapter. What kind of feedback are you getting from readers? Do they say, “Oh, I found a bug in your code. It doesn’t work for me.” Or could you explain that better? What are you hearing and does the book change as a result sometimes?
Charlee: Manning has a lot of built-in mechanisms for getting feedback along the way, which is really helpful. We have, in addition to the chapters that are live that anyone can read and leave comments on, we have three scheduled reviews that Manning leads with reviewers that they find. So we get very comprehensive feedback on in-line comments and then overall chapter feedback and all of that. So we go through all the feedback and we make adjustments accordingly, some large and some small. So I think it’s leading to a better book.
Constantin: You can be more specific, Charlee. I’ll give some examples from the reviewers and the readers. In general, we got very good ratings in the last review, but typically you see a number of people who are in the category of physicists. They already know quantum mechanics or some quantum computing and then they criticize even something like, “Oh, this is not an amplitude because an amplitude is only the height of the wave.” Or things like that. And then you see some developers who don’t know enough math and they say, if they don’t know complex numbers, I think they cannot learn quantum computing. And they say, “Oh, you are saying it’s elementary, but look, you need complex numbers.” Pun intended. Complex numbers are really taught in high school.
So this is the kind of feedback that teaches us, for example, that we need to set expectations. And there is a lot of great feedback where people say they find bugs, of course, and they make suggestions and we address every single one of them because we know that for every reader who makes such a comment, there will be many more. But in general, I would say, compared to other publishers, from what I’m hearing, Manning’s process is actually one of the best from this point of view of getting feedback and working with beta readers.
Yuval: And one of the other nice things about Manning, your publisher has shared the discount code with me, SPG45, and anyone can use it to get 45% off all Manning products. So you’re welcome to use it as well.
Yuval: As we get to the end of our conversation, I wanted to ask you a hypothetical. If you could have dinner with one of the quantum greats, dead or alive, who would that person be? Maybe Charlee first and then Constantin.
Charlee: That’s a great question. I think I would probably say maybe Peter Shor, just because I’d be curious, just because it was a different time than when I’m living in, so I’d just be curious to ask questions about what it was like back in the day.
Constantin: Then I’ll pick someone who, one of the originals, let’s say, it would be between Feynman and Heisenberg, let’s say. So Heisenberg realized that linear algebra is basically matrix multiplication. The evolution of quantum state is pretty much matrix multiplication. That’s great, but that also created problems from my point of view, where when you go to qubits, you have these pairs that are more important. A lot of people go with Heisenberg’s approach. They only talk about big matrices, so I’m curious, what’s the physical interpretation of pairing these amplitudes? Would it play a role, let’s say, if this was known 100 years ago? They didn’t talk about qubits at that point, I guess. And for Feynman, again, he talked about negative probabilities, which we use probabilities with direction in our book. I like a lot of his approaches, especially in naming, that helped us. Someone criticized, on LinkedIn, I posted something, and some people said, “What are these probabilities with direction?” I think these two, for me, would be interesting to talk about.
Yuval: Very good. So the book is called Building Quantum Software. It’s available on manning.com. Use code SPG45 to get your discount. Charlee and Constantin, thank you very much for joining me today.
Constantin: Sure, thank you. I would mention, the easiest way to get to the book can be learnqc.com. We created a site, and we’ll put the discounts there, whatever is valid, we can put them there.
Yuval: Very good. Thank you again.
Constantin: Thank you. Bye.
Charlee: Thank you. Bye.