Scale By The Bay 2021 : Karl Wehden The intersection of Quantum Computing and Distributed Systems...
[Music] thanks joseph so today as joseph mentioned we're going to talk a little bit about quant about quantum computing but not really totally focus on it we'll talk about uh how what it means what the computing paradigm looks like and how things are gonna flow um so i'm excited to be here and let's get right into it so just a a quick uh you know interpretation of quantum computing from a simple perspective you know quantum computing is new and interesting and fun and represents a whole host of spooky uki uh different interpretations of the world during this talk you'll never hear me talk about shore's algorithm or encryption cracking or anything like that this is for the most part makes for good clickbait but not good science so we're going to leave that alone for a while in many cases quantum computing is using math and in some cases technology that was developed over 20 to 30 years ago when the the field of quantum informatics far outstripped actual quantum hardware development so when you talk about tracking um you know uh encryption by detecting primes and other unique values that's a something way for the future meaning the hardware has to continue to grow on leaps and bounds it is but the reality is it's not something we need to worry about at this point in time um so what is quantum computing quantum computing is fundamentally probability of calculus um it's the idea that you're evaluating the likelihood of something happening over a a very wide and and you know rich space of of options in that case and it's much more than just uh the superposition of one and zero and duality and schrodinger's cat it's the idea that um in any situation you have a lot of influence over the overall interpretation of the quantum state of a cubit as part of that story it is definitely complex and we're not here to explain it all today but it's also um you know very useful and uh this is i think the shocking part at this point in time um just a little note we're uh written what we think of as the noisy intermediate stage of quantum systems or the nisk era where when you run a quantum system it's subject to a lot of interference an interference for a quantum system can be something as simple as light or heat or any sort of radiation so in many cases in order to get a statistically significant value for quantum operation you're going to run it many many times so it does take a lot more effort to get you know in some cases similar results uh to a regular what we call a classical computer as part of the story um there are many quantum computing architectures that you can use as well uh joseph's injunction or would you think of as superconducting uh super cold qubits are the one we use um this in each of them has a different level of advantage or disadvantage overall joseph's injunction jenkins are very compatible with normal electronic architectures at this point because they're based on essentially taking two electrons and smudging them together and getting them close and then creating a superposition between the two as part of that story um but they're very susceptible to radiation which is why you have to keep them at a very low temperature at the bottom of something called a distillation refrigerator at close to 15 millikelvin not just kelvin milo kelvin which is significantly cooler than space itself overall so that's interesting uh there's ion trap which is the process of inducing an ion to to enter a superposition between two atoms and it is really reliable and uh connects very well with other ion trap qubits and maintains its state or we think of coherence for a long time in fact much longer than just joseph's injunctions but its downside is it is slow it takes a while to perform an operation and even though your coherence coherence state is much longer ion trap even with its connectivity advantages has trouble with things there with certain types of algorithms that are what we think of as variational uh photonic qubits are amazingly fast but they also have some of the lowest coherence times possible so you have to build a quantum state perform an operation and get a result and read it at the speed of light which uh is a pretty serious uh bar to bar to hit so it's great for things like quantum communication so um being able to do things like do quantum key sharing a really interesting subject i'm not going to touch on today but it's definitely part of that story and it can it can be used today for very interesting applications in their areas there's also what i would think of as a little bit more um exotic uh types of uh qubits so nitrogen vacancy so actually little gaps in diamond that contain nitrogen bubbles are a place where you can absolutely you can actually create a superposition and operate at things on that level um sorry two seconds oh my god apologize i'm going to be right back i have an emergency here so sorry that was a problematic uh apologies so yeah these nitrogen uh vacant uh qubits are really good for sensing applications because they're by far some of the slowest qubits if possible so they're very sensitive and they're used for things like operations that relates to relate to squids and other you know obvious sensing scenarios uh mayuranas and topological qubits are pretty interesting um but they are also um not completely proven out yet uh there's many cases where uh this is a scenario where um you're using a different form of vacancy to create a superposition to operate on in this case so we're seeing a good bit of overall flow in this situation and then just for reference uh on the on the right of the screen there you're seeing a an x gate in something called a block sphere this block fear um is a way to represent the complexities of quantum space this x-gate is what we call just uh putting a cubit into what's called a coin flip state where you're you're taking the the overall spin up spin down on the z-axis and just flipping it over as an example but there's a lot of other axes and operations that go into that package as part of that story um and in many cases a lot of other operations will operate in other axis as part of that story so all of them potentially affect this overall map of probability that's part of the story when we're looking at it so that's the fastest version of quantum computing i think you're probably going to get let's talk a little bit about use cases overall there's really um what i would think of as three main focal areas of application today in quantum systems we're talking about optimization simulation and the beginnings of applications and machine learning is part of the story as well so what does that mean in optimization whenever you have a closed system and you're looking for a local minimum there's lots of opportunities to use things like eigen eigenvalue driven optimizers quadratic undone binary optimization max cut and routing think traveling salesman for example in this case and that gives you a tremendous amount of flexibility in these pieces now one of the things to note about quantum computation is we don't have that many qubits and it's very hard to encode classical information in these qubits so you're always looking for a statistical representation of your data more than you are looking to load your data the same way you would with a classical machine learning stack as part of that story so your optimization goals are typically centered around that sort of flow um simulation when i'm talking about simulation i'm typically talking about molecular simulation um the the wonderful thing about uh representation of a qubit is it is usually represented by something called a hamiltonian which is a combined equation that describes the energy state both potential and kinetic if you will of a system without loss and that is also how we generally describe the energy state of an atom overall as well so that analog and that facility by no mistake gives us a good capability to look at different properties overall of molecular systems so we can look at things like electronic structure ground state potential energy thermodynamic observables and in many cases these can be applied to things like docking sites for protein folding not just simulating protein folding in terms of outcome but actually being able to predict new details in those cases which is interesting on the machine learning side in many cases you have a good opportunities to apply things like classifiers simple you know one pass neural networks are pretty well uh in hand on the quantum side although again we're faced with the same type of problem um in terms of total capacity for input so you're usually looking at a representative solve at this point not a total volume um and usually this is accomplished by um you know doing using the kernel trick so just for a quick refresher on the bottom right you're seeing a distribution of data that if you were to draw a line or even potentially um another curve through it um at the in in a two-dimensional space you would have a whole lot of trouble uh separating the data and coming up with an appropriate classification by moving into a higher dimensional space and in the right side you're seeing that there's a clear differentiator uh and an ability to bound in appropriate space uh using that kernel trick um in classical machine learning you're using higher dimensional feature space to represent this um which you know is it an age-old method to define things uh in that case what we're doing when we're doing a quantum kernel is we're actually plotting that into quantum space um in in hilbert's base actually uh and that's uh a probabilistic feature space if you will more than it is necessarily an actual higher dimensional feature space um in an undimensional model so same type of application but very different interpretation of how things work as part of that story um it's important to note that in many situations the types of algorithms that you run on the quantum system start with an initial guess or uh what's called an onsots which is a a scenario where your you're not just looking for an appropriate match or solved as you might in an optimization problem but you're actually iterating or varying the inputs to a convergent a value and this creates a pretty serious loop in terms of the amount of work that has to be done in order to solve some of these problems that combined with the fact that we need those iterations to differentiate between noise you know depending on the depth or capability of error correction you have available means that this is a highly cyclical flow um for any sort of problems that you're planning to solve with a quantum system overall from that perspective so there's lots of you know operations to essentially achieve a single result um there are things like oracles which we'll talk briefly about as well that don't actually need many many operations to converge on a value they need some to you know essentially get the statistical significance but that's a different story and they're quite neat in their own right that's part of that but we'll talk with you about that as well so does an interface between a quantum and classical system look like overall uh it looks a bit like um a notebook rebel connecting to an execution kernel and uh calling out to a remote uh piece of quantum hardware um on in a typical user environment which is in many cases things like a jupiter notebook you're loading at the local runtime you are um you know building a circuit and gate based state that represents the problem and the data you're encoding because if i didn't mention it before quantum systems have no qram they rely on classical systems or traditional computers for any sort of persistent persistence outside of execution itself and that is then prepared and the circuits are sent to an execution kernel that may do things like transpile them or convert them to a lower gate primitives and there's a lot of work that goes on in that category to be able to do that and we get into a place where that operation is performed we get a response back and because i mentioned things are noisy and difficult to work with at this point it's really important to note that you may do you know a thousand two thousand eight ten thousand we call shots which are round trips to essentially get a statistical significant value for a specific operation combine that with what we were talking about earlier in terms of variational algorithms and you may be running 10 thousand times ten thousand operations um you know so for example to um essentially simulate something like lithium hydride um from a from a battery you would probably need to do well over a billion circuit operations to be able to do that so the distance and flow between this classical user environment where you're preparing a python in a notebook and where it's getting executed is one of the biggest problems in terms of overall latency and distribution of the compute that you're working with in any situation at this point and it's really uh it's been a headache in many cases so uh lithium hydride uh from an operations perspective and an execution perspective when we were doing some of this work in 2019 was taking days to be able to return values and then we thought what can we do to improve this and looked at some of the lessons from distributed compute and a few other places and started to move from what we think of as gate pace quantum execution to something called runtime based quantum execution so the idea here is pretty simple and it may seem astoundingly simple to a lot of you is rather than preparing a set of gates and looping that from say a local machine that might be far away in terms of overall latency let's prepare an entire program that's fun that's turning complete and push it to a runtime that may be better co-located to the hardware so the latency is lower and potentially you can introduce different things like operations that can potentially adjust based on the feedback you get interpreting some of the output in that case but fundamentally you move from a model where you prepare a gate set to be executed to where you prepare a program there are many different interpretations of runtime today i'm not here to push mine or anybody else's so we're just gonna keep this at a nice abstract level to give you a sense of where this is because spoiler alert i'm really interested to see if anyone has any initial thoughts or good ideas on uh approaches or other targets to help alleviate some of the problems we'll highlight as we go through this so great we're at the runtime state sounds amazing this runtime program is typically running in a containerized environment it's preparing the circuits and sending them potentially reacting to some of the results that come back before it's shipping the results all the way to the consumer and i think people are pretty happy except we now have a whole other set of constraints which are what do we have locally in this distributed runtime that we can use in terms of resources am i capped at a certain cpu consumption rate or a memory rate um what kind of libraries can i involve in this you know because anytime you you load a a free containerized environment like this everyone you know looks at it as a great opportunity to mine some bitcoin so life is interesting uh these days so great we have this runtime based quantum execution pattern let's go a little farther and say um uh i might want to be able to use more than one system at the same time or schedule multiple jobs against this as well so adding the option to be able to do some scheduling on top of this might be a next step to you know start deriving some better value overall quantum hardware is scarce so the idea of having two systems to work with together sounds ideal until you realize that you really can't send to send the same workload over and over uh to different systems because i mentioned these things are noisy there's lots of error that also means that calibration is really important to the outcome that people are going to the outcome of the of the execution that you got in play today so that means that in many cases if i sent job a to one piece of quantum hardware and job a again to another piece of hardware i would get somewhat varied responses from both those cases and would have to to essentially build a model of statistical delta between those two calibration regimes in order to be able to combine the results which in many cases can be more computationally intense than just doing it on one system at this point so we're still working that out here's the short version of it um so that makes sense and we're kind of flown forward in terms of what that looks like um let's go to the next level you know whenever you're working with a quantum system today you typically don't immediately go and run it on quantum hardware you might start with a very simple state vector simulator for a quantum system that's based on you know uh at the core of it ordinary differential equation based modeling of quantum waveforms and use that to get a noise-free interpretation of your your uh your program or your circuit set as part of that story and you at least have a read that says i know this thing is going to potentially work and i can move forward you might then run it again on a noise based simulator that actually adds noise to the equation to see if they're if they're it's feasible in a scenario where you have to get to a statistically significant value and for the noise or you have to do some optimization you can continue flowing on that result and uh keep going um at which point you might want to say great i have um quantum hardware so the next thing i'm going to do is go pick that up and ship that same job over and execute there or you know depending on where you are in your in your overall requirements you can relax it and continue running on the simulator so cost based scheduling starts to introduce some nice upside in terms of what that looks like too this is again kind of the next level of where we want to go with stuff today you would be doing this manually um but you know the algorithmic workflow options here are pretty boundless so another way to look at this is to talk about cost-based scheduling and optimization of classical resources so in these cases you may not be bound especially if you're on something like superconducting hardware um of the quantum circuit speed you might be bound potentially by the distributed compute that's available in this case so you may want to offer an opportunity to run some of the classical operations in your distributed runtime on say a captive hpc cluster if you have a lot of money if not you know potentially cloud cpu or gpu resources is part of that story as well as in that case so yet another option in terms of growth in the optimization of the overall scheduling targets that you're working with in this case that's available you may do that again through a balance of cost-based scheduling on different types of quantum hardware you may go for a higher qubit volume or a longer coherence time or a faster system depending on what's available to you or you may you know you may use free tier or whatever the case may be depending on your you know frankly your schedule so again another level of potential optimization overall and you know that cost-based analysis is not different than potentially what you might do today running um you know a machine learning model and choosing between cpu and gpu depending on your overall priority and you know essential value of the computation that you're running in that case so you know think of this quant if quantum as yet another schedule or optimizable method of completing work you know in many cases this is in fact how we present quantum uh for things like quantum machine learning uh as potentially a pi torch accelerator that you can submit work to as part of that story and now it's a and it's really kind of moving in that direction so to go a little further you know what if you're in a situation where you want to potentially optimize not just between a single types of quantum hardware but you may introduce the idea of scheduling across multiple or heterogeneous systems in this case so if you're running variational algorithms maybe it would make sense to run on superconducting hardware if you're running oracles or other operations that are local in that context scheduling them on ion-based systems is absolutely reasonable as well as part of that story so there's again another whole host of options in terms of overall scheduling and execution we're doing a lot of work with some pretty familiar characters uh overall in terms of looking at this uh this workflow in general some of the early approaches have been using you know straight off the shelf uh ml based tool sets and more recently we're doing a lot of work with ray and as well a lot of our compatriots are too and looking at cases where we really want to start looking taking in hpc quantum cpu and gpu as an overall scheduling problem to be solved in a single dag that can be executed at any given time which gives us a lot of strong options to you know start to look at really taking advantage of the parts of quantum and and the other parts of different specialized uh execution contexts that um that make sense uh at the given time in a in a computing pipeline so i think it's important to note now that we've talked about where we're going with this in terms of its total integration that this is similar but very different you know i i hear often that everyone is expecting you know moore's law type growth pattern to quantum adoption and technology but it's really not um it's not a great analog um this really isn't a repeat of 1940 for some pretty obvious reasons one is uh you know the qubits uh hold significantly more information they're much more information dense than classical classical bits so you're doing different operations with different goals uh fundamentally and that really changes how we're approaching things and where we're going so it makes sense um we were not connecting uh transistors to analog internet in the last century when we were working on this we have a lot of amazing advances in terms of cloud technology and overall um informatics that we can draw on as we combine these novel technologies together and you know it's also important to note that the math we're using the in the quantum informatics that was developed was developed over i think it's 30 to 40 years ago really when it comes down to it so the theory fire out stripped the practicality and was thought of and worked on for a very long time that's part of that um and you know hardware and software trajectories can be both similar and completely orthogonal one of the things for example you can do with a quantum computer very early on in its life cycle is parallelism on the chip itself either through partitioning or scheduling which is not something you could ever think about intellect in an electronic context overall so it's really been interesting and then there's fascinating uh you know key uh differences so the circuit you're seeing below is actually something called a deutsche joseph oracle that you can use to reveal uh key facts about um about functions by not just putting in and the inputs but using that and silicubit at the bottom to change to look for change state through the the entangled qubits that people are operating on in this case there's lots of flow in terms of what that looks like and how it works and it really looks like a positive spin overall but there's lots there's a there's lots going on there um the other novel approach that i think is interesting is um you doing what i i've started to call quantum mapreduce which is the idea that you could take maybe not a two different quantum systems but potentially uh two quantum systems of smaller size to operate on larger uh data space to do things like perform opera simulations operations and a few others that gives you a clear view of what that looks like and you can use what you would think of as like a traditional distributed or classical virtual register of qubits that you can use to decompose complex simulation problems into smaller problems that could eventually run in parallel but not yet um and can also be used to pipeline things like error mitigation approaches and like so long story short you know we can simulate larger things faster with these and you know it's it's very interesting to see some of these things being developed in parallel or in adjacent to some of the techniques like we take for granted every day like fan and fan out from that perspective um the other thing that's happening right now is we've talked a lot about gates and run times we're just starting to think clearly about the idea of um a fundamental abstraction on top of this to get to the point where it starts to look like a more traditional um complex object-based uh api and in the right here you see a quick example of that so we might have an abstract estimator that gets used by a variational quantum eigen solver and then potentially those facilities are inherited by a ground state or excited state simulator which gets wrapped into an api it looks like a chemistry simulation overall as part of that story um we're not there yet primarily because of those differences i've talked about already these qubits and these capabilities are wild and varied so you're going to need to be able to support the application of user config at almost each of these levels for a good bit of time till we start to stabilize the error corrected in nature that run the noise if you will overall but once you have that abstraction gives you lots of options to do things like apply optimization for heterogeneous or hybrid hardware look at that single dag scheduling of classical and other resources and really you know pull together a pretty interesting view of a combined quantum plus classical regime for computation so in summary there is a ton of interesting and yet unsolved problems in quantum and i'm not talking about just hardware and talking about how the software is to work and where it's to go um and it's really a you know a fun area to play with overall at least in my opinion and really there's a lot of capability to exploit even today especially when it comes to scientific simulations from materials discovery or drug discovery the molecular simulations for protein folding and the like so we're really seeing some interesting opportunities there and it's in many cases it's about some engineering that that needs to be done to set it free and again it's not all as it seems um you know it is simultaneously not as useful as uh something like an encryption cracking toolkit based on shore's algorithm but there's a lot of very fun stuff going on in the space and i thought i'd share with you today [Music] you