Qiskit Performance with Dr. Blake Johnson | Quantum Crosstalk
1.87k views5580 WordsCopy TextShare
Qiskit
Why is Qiskit the most performant quantum SDK? In this episode of Crosstalk, Olivia and Abby sit dow...
Video Transcript:
[Music] welcome back to another episode of cross talk I'm Olivia Lanes I'm Abby and today we are going to be interviewing Blake Johnson who is our Quantum capabilities architect at IBM Quantum we have a great discussion ahead for you we're going to be discussing what is performance software like Kiss kit and what our strategy is going forward for not only benchmarking performance software but also how kiss kit compares to other sdks in the quantum ecosystem let's dive into it Blake thank you so much for being here with us today in the YouTube Studio we are going to be talking all about kiss kit performance today so just to dive straight into it what do we mean when we say software performance or we talk about performance software all right so software performance I mean in general terms is about efficient use of space and time right so things that are either fast or that they uh use very little memory for some kinds of software right like the solution quality isn't there isn't like an answer uh your's there's a range of answers there's a sort of uh some sort of scale about sort of quality of answer and so when you have that kind of scenario um then you're going to be maybe looking at tradeoffs between space time and solution quality uh which is certainly the case uh when we're talking about uh compiling or transpiling Quantum circuits so if I was going to maybe anchor this in a real world metaphor for those that aren't very knowledgeable about the software space is this like when your laptop gets really hot and the fan starts woring is that a performance issue normally the software is just taking too much time and and resources to Crunch the numbers it needs to Crunch and do the things uh sure there scenarios where your your fans shouldn't be worrying because someone wrote some uh lousy software or something's gone wrong um I mean there are some like heavy duty computational tasks right like when we use our laptops to do sort of uh major computations which most of us are not doing on a day-to-day basis uh the fans are going to work and I guess in scientific Computing and Quantum Computing specifically um you have to do a lot of these really sort of intensive computations and performance becomes I guess very important in this space yeah for sure I mean obviously like our attention has been for a long time on on the performance of the hardware we need really high performance uh we need really low error rates we need we need lots of things out of our Quantum Hardware in order to get Quantum Computing into an era of eventual Advantage right compared to classical Computing but there's uh a lot of work you have to do in terms of being prepared to use that quantum computer in terms of representing your problem compiling your circuits post-processing the results and all those things can can involve uh uh expensive computations as well and so like suddenly now uh when we think about putting Quantum Computing uh together in terms of applications workflows and so on suddenly we like now we actually have to care about the performance outside of the quantum machine itself so my question is again just talking about the software what are the types of metrics that we need to keep track of which ones are the most important sure I mean so like like any piece of soft we're going to measure time like how long it takes to do certain tasks but particularly in the quantum space uh for a piece of software that's preparing a workload to execute on a Quantum work Quantum uh Quantum system quantum computer we care about the the quality of the circuit It prepares right Quantum circuits particularly you know Quantum Hardware is more is much more error prone than classical Hardware errors are prevalent we need to uh condense the size of circuits as much as possible in order to have the most uh the highest probability that the outcome will be will be fix faithful will be useful to us right and so we're asking our Quantum software to produce circuits that are that are small right that use the fewest number of cubits use the Fus number Gates that have the shortest depth right and so we're going to look uh for whenever we're measuring like the performance of our Quantum software we're going to look not just at how fast it runs but sort of what what are the qualities or characteristics of the circuit It produced and and does that give me the best chance for Success when I U move onto the execution phase with the quantum the quantum computer and a lot of that sort of reducing the depth of the circuit um type of stuff and and um it's all sort of wrapped up in the transpilation step of your um Quantum Computing workflow right right so I mean I think we think of different phases as as you go through right we've talked uh we've seen this pattern emerge over and over again looking at applications algorithm development where you you have to map a problem from a classical description to a Quantum to a Quantum one you're going to optimize that to execute and then you finally go to execute on the on the quantum computer um and in those first phases uh we have several different tasks that any SDK Quantum SDK uh is going to participate in right so we're going to be looking at how efficiently can it construct uh and manipulate circuits how efficiently can it construct and manipulate uh observables or operators representing the the the characteristics I'm going to measure the outcome of my circuit um uh and then there's going to be often synthesis tasks where I go from some sort of abstract mathematical description of a transformation to a a concrete uh instantiation or you know actual sequence of operations are going to implement it um and then I then finally I have to actually like conform my circuit to the constraints of the hardware so it has to only use the operations that it allows has to use only the connectivity that that it that's present and so we have kind of these different phases of building manipulating synthesizing and optimizing and all of those um steps the the main way a user would sort of interact with that is through the kiss kit SDK correct and now that kiss kit went to version 1. 0 earlier this year um and we know performance has been a major theme for just the last the last few releases of kis kit um and why is it sort of the SDK in particular that has such a focus on uh performance right now and and what does it mean when we talk about a high performance Quantum SDK right so I mean uh kind of I think we've transitioned in terms of uh the eras of quantum Computing right like there was an earlier era where we were using our Quantum software maybe to learn about Quantum quantum mechanics to learn about Quantum Computing uh to kind of probe the properties of quantum Computing systems but the our attention has has turned because the systems have gotten more powerful and suddenly people are now in sort of earnest search for like finding uh different modes of utility and potentially eventually advantage with with Quantum systems and so like they want to sort of uh uh now they suddenly actually care about like how does this whole workflow compared to the classical workflow that I'm maybe trying to displace or improve upon right and I guess the you know the kis SDK of three years ago when people were building like two Cubit Bell States like that SDK is not kind of cut it I guess with the type of workflows that people are trying to execute today with hundreds of cubits yeah I mean we may even been kind of unaware of how it performed right because like if the only things we were building were sort of two to 5 Cubit circuits like uh you know how performs like how long do it to take to transpile a 100 Cubit circuit we didn't have the Q times that we you know is maybe not as important right but so the SDK is like is is is is I mean it exists within a broader set of tools now but it it is your touch Point your your first touch point to sort of everything right so and it's kind of involved in every one of those steps so like it has to be high it has to be highly performant in order to sort of not become the bottleneck anywhere in that workflow mhm what is the overall strategy that IBM is pursuing now and in the future to improve kiss kit performance right so kit started out as a pure python library right that was a choice that we made both because like python was popular and accessible to our target audience but also python has this wonderful like Flavor that kind of everything can be uh kind of torn up and and and sort of you you can you can change everything about about a piece piece of python code uh so you know adaptability flexibility was sort of like one of the prize criteria in sort of the the the initial versions um uh but uh python for all of its benefits is not a particularly fast uh programming language right like it's not that the tool you pick up if you if if you want to take speed and efficiency to to to the Max uh so we've started an effort actually two years ago now to replace the kind of internals of kcit with a high performance rust core yes I'm so excited about this I find it okay my coating nud side is showing now but I find it so I didn't know what rust was until basically tldr python slow but easy to use rust very fast but difficult to use no I knew that well that's all that's basically what you need to know well I think there are a lot of people who have been asking actually recently um I going to need to know rust in order to program with kiss kit in the future but that's not Cas that's that's the cool thing and I'm sure Blake can say more on this but the interface to kiss kit is still python yeah but just under the hood it's all rust so it's like you get the best of both worlds you get all the performance from the rust side but as an end user you still get the nice easy interface of python okay correct me if I that's exactly it right so we've started to oxidize uh kcit so the internals are becoming sort of more and more this this R library and that project's not done right like we started it two years ago uh the aim is for it to be complete by the time we get to kiss SDK 2. 0 which will be released uh about March of 2025 um but sort of in in the interim sort of each SDK release has sort of another tranch of that work that is completed and so uh you know it started out with uh you know Kit's kind of fundamental data structure for represent desing circuits when it manipulates them is something known as a directed dayc graph uh and Matthew Trish one of the first things in this project was to replace uh the the the graph Library called Network X that that Kisco is using with a rust imple re-implementation of the same that's actually called rust works it's a drop in replacement you can sort of use it it kind of feels looks and feels like networkx but it's it's much much faster right so that was the beginning of that Journey but sort of over time sort of everything has been uh has being converted and I would say we're a little over the halfway point now U but sort of with each sort of new piece that gets converted you get sort of new performance benefits and and and as Abby was just saying one of the beautiful things about that is like we're doing this in the in the way that's like you have this high performance rust core and then a python interface to it so your code can stay the same it still looks and feels to you like a python package but what you're uh but what you're getting out of it is that higher performance uh Library underneath mhm and it sounds like there's more performance improvements to come if there still if it's still in in work in progress yeah for sure I mean like one of the things that's uh a bit challenging is you do this conversion right it's like you're trying to change the wheels on the car while it's driving um but like uh the team has been really successful in doing it but uh you end up with these kind of awkward transition points where uh because some of the code is still Python and some of it's rust uh you can actually can take some piece of code and make it a faster implementation rust but because you're like calling it from python more often like you actually lose some of the benefit because of that sort of language barrier Crossing so there's actually some things that are kind of latent and waiting in uh in kis SDK 1.
2 for instance where like there's performance still to to to come but we have to like now convert the the python colar as well and so like uh most of that will be uh most of the sort of user facing parts that will be present by the time we get to 1. 3 but then by 2. 0 you'll really have this kind of Standalone rust library and that also lets us even contemplate maybe in the future like putting other shells around it like it doesn't just have to be python right you could put a C++ shell or whatever right so you could think think about uh other popular languages for different uh computational science communities and and how they could also take advantage of the same uh High Performance Tool great I'm excited everyone mark your calendars for kiss Kit 2.