Valorem Reply's QuBites video series breaks down Quantum Computing concepts and use cases to help business leaders learn more about the next wave of technology disruption in quick and easy to consume episodes. In the 7th episode of QuBites Season 5, Rene talks about quantum intermediate representation- QIR, with our special guest, Cassandra Granade from Microsoft.
Transcript
Rene – Hi! Welcome to QuBites, your bite-sized pieces of quantum computing. My name is Rene from Valorem Reply and today we're going to talk about the quantum intermediate representation- QIR and for this I’m honored to have a special expert guest today, Cassandra Granade. Hi Cassandra and welcome to the show. How are you today?
Cassandra - I'm doing well. Thanks for having me.
Rene – Well, thanks for coming back for recording another episode. This is very much appreciated, but for the folks that have might have missed your previous episodes, where you have been a guest, can you tell us a little bit about yourself and your background as relates to quantum computing, computer science, you know all the related things?
Cassandra – Absolutely! Yeah so I did my undergraduate in Physics, CS, Mathematics, couldn't really make up my mind, heard about this new exciting quantum computing thing, went on from there to do a PhD and then joined Microsoft. Working on the quantum team, a little under five years ago now and I've been working on Q# in the quantum development kit since and really happy with all the amazing things we're able to do there. And I see you have a copy of the book that recently put out, available from manning publications on learning quantum computing with Python and Q#.
Rene - Exactly, this is the book folks. If you did not get a copy, get a copy. It's with Cassandra and as well as Sarah Kaiser, the authors of the book and it's really nice because it's written in such an approachable manner and so you don't need to have a PhD in physics and so that's me for example, I'm a computer scientist, right, so like this is perfect. But yeah, thank you Cassandra for the introduction and we, in the previous episode, like I said, we actually talked about your work on the Azure quantum team or the quantum development kit and so one specially on a noisy quantum systems right and that so important that we're also able to well simulate good noise right? Noise that is realistic to what an actual quantum computer would produce. Is there any news since we talked regarding that of course the noisy quantum system but also the broader level, you know, the QDK and Q# and maybe you can actually just again for being inclusive here for making sure everyone's on the same page, just explain us a little bit all about it?
Cassandra – Absolutely! Do let me take that last piece first then you know because I think you really touched on something really important there which is if I go and run a quantum program on hardware today, noise is a part of reality. I have to understand the impact that noise has on how I run those programs and what outputs I get from them and you know, if I look at what's happened over the past few years and especially over the past few months that noise has gotten impressively good you know, the lower levels of noise we see new and exciting announcements about that but it's still where we're at today and so being able to simulate the impact of that noise has on quantum programs that we run, that's really an important part of that kind of quantum development workflow to be able to understand. Here's how that will impact what answers I get out, how I can go use them as part of a broader application that uses quantum computing, you know? So to that extent, as you say, you know, we talked about on the last episode that I joined about the open system simulator, that's, you know, or noisy simulator that was released as part of the quantum development kit recently, and you know, I think it's been really exciting to see the feedback about that, to hear how that's really enabling people to do new and interesting things and really address that kind of workflow. I think there's also some really other kind of exciting things in terms of community that have happened around that as well. You know, one that surprised me a little bit but it's been really neat to see we chose to implement that simulator in rust and you know that's turned out to be a really neat choice for us and something that we've gone on and you know developed other components and rust and things like that as well and I think there's it, you know, it's that's something that has been really neat to see, kind of, people engage with that and respond to and kind of, watching the growth of that community as well.
Rene - So let's talk about Q# which is another interesting languages because developers can actually write and implement quantum logic in Q# directly and this will also be like in Q# you can also leverage an SDK called the QDK, the quantum development kit, right, and so this can run on simulators but this, of course, in the end you want to run it on real hardware, on real quantum computers. And every quantum computer is, of course, a little bit different and even from the same vendor it might have the kind of different instruction sets, right? If it's a new updated model or so there's constant changes because we're on this rapid growing kind of field at the moment and so there is definitely a need for having this kind of more stable intermediate layer where you can basically translate your high-level language. Like you saw python rust whatever and then put this into an intermediate representation which is then, you know, basically more generic but anyhow let's talk about this kind of QIR the quantum intermediate representation. Is it similar to a .Net, you know, for all the dot-net developers that know net and the CIL, the Common Intermediate language which is also a similar kind of model. So is the quantum intermediate representation QIR, is it similar, is it comparable?
Cassandra - I mean, I think that's a good comparison to make, I think. You know, what I'd really highlight there is the QIR, the quantum intermediate representation is similar to dot net but it's based on LLVM OR and so really, kind of, comes out of that history fairly strongly and there you know, if I kind of look at some of the history of classical compilers, I might have a high level language and then I might write some optimization passes for it but then if somebody thinks of a new pass or they think of a new way, that they want to generate code or target some other device with, then I have to now go back and kind of couple that all the way up through the high-level language but where LLVMs really changed that landscape classically, has been if I have a new high-level language or if I have a new optimization pass or a new kind of device, you know, or even not a device at all something like we see llvm output targeting web assembly or things like that which are, you know, fairly outside of kind of the execution model of where a lot of high-level languages, kind of, started right, you know, so llvm really supports that by allowing communication between different parts of the stack even when they weren't necessarily explicitly designed with each other in mind. Andi t's that kind of decoupling and modularity that really enables that interoperability and I think those are the lessons we've really tried to learn in the quantum community more generally and why I'm really excited to see the QIR alliance take off and some of the amazing things that they've been able to do. I absolutely agree with what you're saying about you know there are some of those challenges. There isn't exactly a single instruction set like even something like x86 or arm where we know that's going to be pretty much the instruction set moving forward. But it's even more than that like capabilities like having classical control flow and intermediate measurements and things like that. We need a way to be able to represent those in an interoperable way and that's where we get into needing it, you know. We could try and do a lot of that or we could go look at the history of how that's done in classical computing and I think it's really that latter approach that we see taken by the QIR alliance with quantum intermediate representation and reusing a lot of the infrastructure offered by LLVM.
Rene - The good part is basically, also well this is not only the good part but, what I'm trying to say is basically since it's part based on LLVM, it's actually also part of an open source kind of framework, right, so this is actually, really nice and you mentioned like already the QIR alliance, right, so this is what is it actually? Tell us a little bit about this and what is the goal actually of the QIR alliance, what are they trying to achieve here with of course, like, we understood, like you know, we need this kind of intermediate representation and so is the QIR alliance trying to kind of lobby for it with multiple vendors or what is the QR alliance actually going to do?
Cassandra - So first and foremost, I definitely recommend checking out the website qir-alliance.org, you know, that will take you to kind of an outline and more detail as well as some of the ongoing opensource projects at QIR alliances but I think what I'd really, you know, highlight here is, it's a joint effort. It you know that an intermediate representation that's supported by, you know, one tool or one product or one service isn't that that's not going to get us to where we need to that fully interoperable role that you know we just talked about. So it's really, I think, neat to see efforts, see the joint effort out of the QIR alliance including Microsoft, including different hardware vendors, QCI, Quantinuum, Rigetti and research groups Oakridge national labs, you know. So, we see a lot of really kind of joint investment and effort there in getting us to that fully interoperable world that's really necessary to deliver on I think really a lot of the exciting potential of quantum computing.
Rene – Gotcha! And so the QIR alliance is this kind of joint effort to develop this forward-looking quantum intermediate representation with a bunch of powers and you mentioned rust before so I guess also rust is part of that somehow?
Cassandra - Well yeah, So I mean one of the projects out of the QIR alliances that I am personally really excited to see is a Pyqir. So that's a python package or rather set of python packages for loading and parsing QIR in your python project for working emitting QIR from your python project and started, you know, to try and help bridge from, kind of, you know, it's there's a lot of investment and infrastructure in the python ecosystem and that's part of why we chose to highlight python in our book. It's why there's python interoperability as part of the quantum development kit and it's why we see a lot of other tools written in python. So being able to reach out to that is really important and the PyQir packages really make it possible to work with at least some parts of QIR and in some ways from where that ecosystem is, where that one, you know, where why I mentioned rust in that is trying to work directly with LLVM from python is, kind of, a pain you know. But on the other hand, there's this really neat project called Pi03, that is a Rust library to help you write python libraries in Rust and that's what the QIR alliance used to go write Pi QIR and you can go check out the GitHub repository for it and see how really that's been an incredibly useful tool for making QIR available to the python world using Rust. I mean as a user of that package, you may not know or you know, it's not something you immediately need to care about that it's written in rust. But kind of underneath, that sort of API, if you go, you know look into the repository, that's one of the things that really has enabled that. And I think it comes full circle in that, that's you know Rust is itself built on LLVM, you know so it's one of those that allows for this kind of surprising retargeting, and I think is really kind of part of that story as well.
Rene - Nice and actually, you know, this is how you truly engineer things, right, you use the right tools for the right job and basically why not use it if it makes your life easier and you get a more cleaner and nicer maintainable code base and what not, right? There's a lot of benefits here, building on top of existing stuff right, I mean this is the right way to go. So totally makes sense. Thanks for explaining it.
Cassandra - No, thank you for the question.
Rene – Well, we're already at the end of the show here. We could talk for much more hours about the QIR and the QIR alliance and all the amazing stuff with all the different programming languages and you definitely notice, I think like, this is the beginning, we're still in the beginning of, like, you know, broad adoption of quantum computing so I thank you so much, Cassandra for being here with us again and sharing your insights that is very much appreciated.
Cassandra - Absolutely and thank you for having me. It's really great to have the opportunity to talk with you and share some of the exciting things that have been happening.
Rene – Awesome. Well and thanks everyone for joining us for yet another episode of QuBites, your bite-sized piece of quantum computing. Watch our blog, follow our social media channels. Everywhere basically where you can hear about all the upcoming episodes and of course on our website you can find all the previous episodes from season one till season five now and this also includes Cassandra and a few of her colleagues from the QDK team like Bettina and a few other folks. Of course, I'm not mentioning all of them because you got to watch these episodes to learn all of it. Well, thanks everyone take care, stay safe and see you soon, bye!