Introduction to Quantum Computing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
mekka get a all and welcome to another video in today's video we're going to explore quantum computing so first of all we're going to have a bit of an introduction as to the difference between a classical computer and a quantum computer and then at the end we're going to have a bit of an example of how to program these things using both a simulator and a real quantum computer ok so before we get started I just want to say a big big thank you to all of my patreon if you'd like to support the channel and become a patron head over to patreon or you could purchase some merchandise from the store below alright so first of all in order to understand what a quantum computer is and how it's different from a classical computer we have to define what a classical computer is all of the computing devices that we use day-to-day this is our laptop computers or our smart phones our tablets even things like our microwave ovens they're all classical computers and they all run on bits so a bit or a binary digit can be any one of two states now it can either be 0 or off or it can be 1 or on in other words so there's not a great deal that you can do with a single bit you can either set it to 0 or 1 and then you can read it later on but interesting things start to happen when we get a couple of these bits together so if we've got 2 bits and each of them can be set to 0 or 1 then it's actually 4 different possibilities so we could set the bits to either 0 0 0 1 1 0 or 1 1 and if you're familiar with programming and computing you probably be aware that this is kind of our computers count and in shorts the more bits that you add then the more different possible states that you could set your bits to so what the CPU actually does it has some very basic logic which allows it to do simple arithmetic things like adding 2 bytes together or subtracting 2 bytes multiplying bytes or dividing bytes anyway the important thing about the way that a classical computer works is if you set a byte in your classical computer say 2 5 which in binary is 1 0 1 then if you read that byte later on it's just gonna say five there's no ambiguity at all yeah you set the bits in a byte or you set a byte to a number it's always going to be that every one of those trillions of bits in the hard drives and in the memory and even in the CPU itself every single one of those bits is set to either 0 or 1 and there is no ambiguity at all yeah so that's a classical computer but wouldn't it be fun wouldn't it be fun if instead of setting a bit to 0 or 1 with no ambiguity wouldn't it be fun if we could say something like there's a 50% chance of zero and there's a 50% chance of one so instead of saying our bet is definitely zero or our bet is definitely one we could just say it's 50/50 yeah and then when we run our program our program could choose so if we ran our program three times using this strange little random bit then it might come out with 1 1 0 0 0 or it might have 0 0 1 1 0 yeah or 1 1 1 1 1 something like that yeah but every time we run our program there's a 50% chance that when we read our bit it will be 0 and there's a 50% chance that when we read our strange little bit it will be 1 ok well we know that normal bits don't work like that normal bits are just 0 or 1 there's no ambiguity you just set them to 0 or 1 so instead of calling this strange little random bit a bit let's call it a Q bit shall we so our qubit is like a normal bit except instead of setting it to 0 or 1 with certainty we can set it kind of in between we can say there's a 50/50 probability that it's going to come up either 0 or 1 so it's pretty much just the same as flipping a coin the way that we've defined our little qubit at the moment yeah so if you flip a coin you can get heads or you can get tails and one of the important things about it to note is that there's 100% probability that you'll get one of the two so whenever you flip a coin you're not going to get in between heads or tails you're going to get one or the other likewise for our little qubit when we read the qubit it's always going to say that's selected zero or it's selected one okay so that's kind of interesting idea a cubit that can be 0 or 1 with 50/50 probability but it would be more interesting I think if instead of 50/50 probability what if we could play around with those probabilities just a little bit so something like a biased coin yeah if you've if you've got a biased coin maybe it comes up heads 25 percent of the time and maybe it's biased towards tails and it comes up tails 75 percent of the time so maybe our qubit could do the same maybe we could make our qubit biased towards 1 yeah so that 75% of the time it comes out with a 1 and the remaining 25% of the time it comes out with a 0 so that way if we ran our program 100 times we'd start to see the pattern emerge we'd start to see approximately 75% of the runs we would have a 1 returned from our program when we read our qubit and approximately 25% of the time our qubit would say it's 0 maybe we could just set these probabilities to anything we like being careful that the probabilities do add up to 100% since our qubit has to be either 0 or 1 when we come to read it so we'll take our coin analogy a little bit further and if you flip two coins then there's four possibilities you could get tails tails tails heads heads tails or heads heads so if our program returns two of these little random qubits that were both selecting whether they're 0 or 1 if they were fair if they were unbiased then we would have a 25% chance of our program returning 0-0 from our two qubits we would have a 25% chance of our program returning 0 1 25% chance of our program returning 1 0 and a 25% chance of our program returning 1 1 now that's if our qubits are fair but it would be very interesting as we said before if we could bias our qubits what if we could buy us each of these 4 probabilities we could say there's a 16 percent chance that the qubits will return 0 0 we could say there's a 42 percent chance that the qubits will return 0 what we could assign a 31% chance that they'll return 1 0 and we could assign an 11% chance that they'll return 1 1 so we could actually set pretty much any probability that we want really any of the all probabilities to any of these little states so long as it sums up to 100% we could run our little program and our little probabilistic cubits will spit out I don't know one zero with some probability yeah that'd be really really interesting so we can set four different probabilities one probability for each of the possible states that our qubits could return this is starting to turn into quite a strange program now it might encounter much as a surprise but qubits are what quantum computers use instead of bits yeah they are they actually use these things and and this is pretty much how they work so there's a couple of really really interesting things about real qubits aside from coins and we do have to go into that because this is really what gives quantum computers their power first of all a qubit in a quantum computer just like a classical bit when you read the value of it it's gonna say 0 or 1 with no ambiguity but unlike a classical bit a qubit can be in this probabilistic state this state in between 0 & 1 where they say a 50% chance that at 0 and a 50% chance that it's 1 and then what we have to do is actually read the qubit to make it decide which state it wants to be in so what's really interesting about this as we saw just before when we move from one qubit we had to assign two probabilities we said like it's 50/50 or it's 25 to 75 and then when we moved on to two qubits we saw that there's now four possible states so if we want to completely describe the system of probabilities there what we have to supply is four probabilities so two qubits can imply four probabilities as we saw just before something like eight qubits could imply 256 probabilities so you start to see now that the amount of probabilistic data that these things are holding at any one time is exponential and it grows very very fast okay so at this point it might be thinking something like why can't we just get a classical computer to randomly select numbers we we can yeah but there's something there's something absolutely amazing absolutely amazing about the qubits and the way that they do this strange probabilistic thing no this is really I mean this is this is this is stranger than fiction really this is this is act it's magic it's magic before we read the value of a qubit it's in both states at once so these probabilistic states that we've been talking about with our qubits they're called super positions and this is a phenomena of quantum physics and it's really really really strange they call this sort of stuff quantum weirdness and I tell you what it's absolutely fascinating before we read the qubit while it's in that superposition it doesn't have a zero or one like a coin while it's spinning through the air is actually flipping from heads to tails over and over again a qubits not like that the qubit superposition is actually 0 and 1 at the same time it's both at the same time so in quantum physics they talk about the collapse of the wave functions so there's a lot of things that collapse the wave function or reduce this superposition to a classical state if you read the value of your qubit it stops being magical altogether so it stops being 0 and 1 at the same time it just picks one basically pretends that it wasn't doing anything strange the whole time and just says well I'm on one so this is really the crucial point this is what differentiates a quantum computer from a classical one this is why quantum computers are said to be able to compute things that classical computers cannot when we read the value of a qubit it's going to say that it's 0 or 1 exactly the same as a classical computer but the crucial part is before we read it while the qubit is in a superposition of 0 and 1 it's both values at the same time so to understand why quantum superpositions are something wholly different from classical computers say randomly selecting numbers I think it's very helpful to imagine a maze yeah so a classical computer just runs down some paths checks if it works out and if it doesn't runs down another path a classical computer just checks one path at a time if there's a lot of paths if the amazing is quite complicated then you could imagine that the computer might have to search thousands or millions of different paths before it actually finds the exit so with a classical computer randomly selecting a different path at each Junction it might accidentally choose the wrong path every time I mean we might run this thing and it might go on for a thousand years before the computer actually finds the way out of the maze so that's what a classical computer is like when a classical computer tries to mimic something like a quantum computer randomly choosing bits so if there's a lot of paths and the chances that a classical computer will accidentally happen upon the correct path the chances are almost 0% I mean it's going to take a lot of runs through this algorithm before the classical computer accidentally finds the correct path so with the quantum computer and qubits what we can actually do is set our qubits to all parts at once and then the objective in quantum computing is not so much check one path at a time like a classical computer but to check all paths at once and then amplify any of the paths that actually make it to the end this is the crucial difference this is what super positions allow us to do if the qubits were truly not in a superposition if they were just choosing a random number like a classical computer does and checking one path at a time then we wouldn't have the option to amplify the correct path so it's crucial to understand that what the quantum computer does here is very very different from a classical computer just choosing random zeros and ones or a coin flipping the quantum computer is in all states at once so really the trickiest trick the difficult part of all of this is actually figuring out how to program these things figuring out these steps to amplifying the path in the mains like we just saw it's not easy to do and all of this stuff is very very new I mean this is a whole new world a new frontier of computing is opening up so that in a nutshell is a simple explanation of the way that qubits differ from classical bits and the way that quantum computers differ from classical computers so another interesting point about modern quantum computing is decoherence so a lot of what we've talked about today is theoretically perfect I mean it works in theory and we hope that's we can develop quantum computers to do that but the reality is that quantum computers at the moment actually have a lot of error in them and when you've got your qubits in some detailed superposition almost anything at all threatens to actually read the qubits and make them collapse to a classical state before the computation is actually finished so anything from from from a little bit of heat coming in or maybe a photon could come in and hit your qubits and read them it's crazy really but this is why quantum computers at the moment pretty much take up a whole room or a whole cupboard yeah so the chip itself is just a little like that kind of thing the rest of the system is that is cooling it's a gigantic refrigerator so the entire field is brand-new and I think I think very soon it's about to explode okay so for this final part they're really fun I just want to show a quantum computer simulator and then a real quantum computer that we can program from from our desktop computers okay so you'll see on the screen at the moment this is quark now this is a quantum computer simulator so it's actually going to be running on your regular classical computer the first screen that you are greeted with here shows a couple of the interesting algorithms that are pre-programmed in this thing now we don't have time really to go into a lot of this stuff but Grover's search and Shahs period finding that's a very famous quantum algorithm so you can select one of those if you want to start out with a template but we might just hit escape to get rid of that end okay so what you're greeted with is this screen something like this so this is called a quantum circuit now just for small programs just for research and a bit of fun exploring qubits and quantum computing these quantum circuits are really really interesting so there's two qubits over the side here now they're both set to zero we can talk about bra ket notation in the future now that's the strange little box that it's in and over this side here you'll see that at the moment they're both off so off and off and you'll also see that there's fears here with that it's pointing upwards now we can have a look at that in another video as well that's actually a block sphere so a couple of things that we can do just play around a little bit we can turn our quantum bits or our qubits on just by putting a power Li not gate there yeah similar to classical computers you can just knock them if you want something else we can do we can make an end gate so we could say this one and this one are on there not this one but explain all of these gates and operations in a different video I think it's just too long to cram it all into one video but this is a NAND gate and this third bit here should turn on when we've got both of these first two on let's have a look okay 1 & 0 gives you 0 off 0 & 1 gives you a 0 or off but if we pair the X gate this 1 1 & 1 gives you one more on and on gives you on ok so that's pretty interesting if we just clear our circuit for a second okay so the superpositions that we were talking about before that's actually the Hadamard gate so if we just drag an 8 down here you'll see that the quirk simulator actually represents that by saying 50% so that means there's a 50% chance that when we read our qubit it will be 1 and a 50% chance that it will be 0 so this is just a simulator it's going to be running on your laptop or your desktop PC and it can deal with up to about I think it's about 30 cubits yeah before it runs out of processing power yeah but the quirks simulator so there'll be a link in the video description for the quotes emulator you go over and have a bit of a look interesting stuff the other really interesting thing that we can do is go over to IBM's quantum experience so iBM has actually set up a bunch of real quantum computers and you can actually make a little quantum circuit and then send it to one of these quantum computers so this is the IBM quantum experience and once again we don't have time in this video to go through exactly what all of this stuff means but it's good fun so what we might do just as a final little demonstration is cause the superposition on a real qubit let's do that shall we IBM quantum experience give us a circuit mate I'm gonna say a new circuit please and we might save it super position okay so once again we're greeted with a quantum circuit similar to quark the Q's over here this little bracket notation is telling us that they're all zero at the moment so the IBM quantum experience the same as the quark simulator if you want a superposition then you want a Hadamard gate so we'll just drag this h4 Hadamard we'll drag him down here to qubit number zero and the next thing that we've got to do is read our qubit that's a little measurement till just there in the IBM quantum experience all right so we've just caused a superposition this qubit number zero just here is going to be zero and one at the same time and then we're going to read it so it's going to figure out one of them zero or one and that I reckon is just about all we've got to do for this demonstration now okay so when you click run in the IBM quantum experience you'll find that you've got a bunch of options here one of which is actually a simulator yeah but we won't use this simulator for today what we might do is choose a real quantum computer I always liked Burlington I liked Burlington okay so Burley Burley Burlington forever all right so we've got Burlington 1,024 shots so this is actually gonna run our little quantum circuit a thousand and twenty four times and then it's going to get back to us with the results yeah it's gonna tell us which bits the qubit actually chose zero or one anyway we click run and off it goes to Burlington I might just pause there because this can take some time okay so Burlington has finished now performing it's running of our little circuit 1,024 times let's see what it discovered shall we so it took about seven seconds to run it sometimes just because of the way that real qubits are connected together you'll find that the program has to be translated a little bit yeah so that can actually lead to quite a bit of error but in our case it's pretty much exactly as we wrote it and if we scroll down a little bit we can see the results here we go okay so we had our superposition key bit and it was read 1,024 times and this is what happened 50 point three nine one percent of the time and a little qubit was zero and forty nine point six zero nine percent of the time our little qubit just here was one so we actually caused a real superposition there yeah good fun so there's obviously a lot of exploring that you can do with the quantum simulator quark and also a lot of exploring that you can do with ibm's quantum experience and i'll leave a link to both of them down below in the video description really good fun go over and have a bit of a look okay interesting stuff quantum computing and i just want to say thank you very much for watching i hope that was interesting and i want you to have a really good day
Info
Channel: Creel
Views: 19,493
Rating: 4.9432626 out of 5
Keywords: programming, quantum computing, qubit, explained, how to, quantum, quantum physics, quantum weirdness, bits, classical computer, speed, qubit meaning, qubit vs bits, super position, defined, ibm quantum experience, quirk, quirk simulator, quantum experience, ibm, Creel, what’s a creel, whatsacreel
Id: K8n62Dp3YDo
Channel Id: undefined
Length: 20min 26sec (1226 seconds)
Published: Thu Apr 30 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.