Placeholder Image

字幕列表 影片播放

  • What's going on, everybody.

  • And welcome to part two of the quantum computer programming tutorials in this tutorial we're gonna be talking about is more on the Cuban itself as well as the gates.

  • And like what happens when we apply this gate to the cubit?

  • Really, my hope is at the end of this, you'll be able to sort of visualize what's going on when you see like an algorithm or a combination of gates.

  • A CZ Well, as if you wanted to make your own out rhythm.

  • What gate would you use to do certain things?

  • So sometimes you know you like, If you look up what a c not gate is, you'll see.

  • Oh, it's the equivalent of the X or gate.

  • Um, sort off.

  • It sort of is.

  • But it's also not so like the output is.

  • But if you start incorporating other bits, not anymore.

  • So anyway, that's by hope.

  • By the end of this is that you'll have a better understanding what the heck a cubit is and what a gait is doing to that Cuba, at least in terms of computer science.

  • Before we get into that, though, I want to address some of the more common kind of suggest not suggestions, but questions and points people made from video one.

  • There's only three, so it shouldn't take long.

  • So the 1st 1 was the circular table example with chairs Thea argument being, um, the number of combinations you have his end chairs, factorial.

  • People were pointing out that well, not really, because you could rotate the chairs and this one affect anybody's happiness.

  • So, um, I'm amending the story to be There's a stage in the front and, like, your happiness is also a function of what your orientation to the stage solved.

  • But good point.

  • That was absolutely true.

  • So so anyway, yeah, So that was the first thing.

  • The next thing is possible states versus like actually considered states logically.

  • So with bits you have, let's say you've got an eight bit a bit string.

  • Okay, each bit could be a zero or a one, right?

  • This is true for a cubit when measured, and this is true for a classical bit.

  • So the number of possible combinations is both for classical computers and quantum peters.

  • For a bit string the number of possible combinations of eight bits.

  • It's two to the power of eight.

  • This is true for both classical and quantum computers.

  • The difference is, what can a quantum circuit consider all in one pass?

  • And what can a classical circuit consider all in one pass?

  • A classical computer in a classical circuit can consider two times in bits states in, like one pass through the circuit.

  • So when you're when you're applying a logic gate to something, it can only consider the two states times and bits a quantum computer can consider logically in one pass through the quantum circuit, two to the power of n bits states.

  • And it could do this logically with a combination of bits and gates and all that.

  • And that is where we get this incredible ability this, this paradigm shifting, um, capability that we just don't have today with with classical computers but also can't have, like there are certain numbers.

  • Like, for example, I want to say the number I've seen is to 60.

  • So to put this in perspective, IBM and Google both have 50 plus cubit quantum computers already, and just like two years ago, they had, I think, 20 or so it was like 20 cubits so So it's increasing pretty quick and or was it five?

  • I can't remember, but it's a very small number and we're up to 50 now and probably Maur.

  • And who knows, like there's probably places I don't know.

  • Some Chinese company might have a bunch, too.

  • So So, anyway, we're already to that point, and I want to say it's two to the power of 60.

  • So a 60 Cuba quantum computer has Maur, um, can can can do calculations on more states at a time than if we were to combine all of the computers of the world.

  • I want to say it's 60.

  • It could be 70.

  • Whatever it's, it's an achievable number in the next say, 10 years even.

  • But probably in the next year or two, Max will be there, right?

  • That's crazy.

  • Also, number of particles in the entire universe two to the power of 300 again, that's conceivable.

  • That will hit that number in, like, a decade or less, who knows?

  • So, um, that's what's exciting about Quantum Peter's So, um so over that answers that question, but it also leads us into the next one, which is how is this useful What do I do with this?

  • Can I get a job with this?

  • Um, I think the answer to that is it's probably wrong attitude.

  • Like I wouldn't ask you.

  • Ask not what what quantum computing can do for you.

  • Ask what you can do for quantum computing or your job and quantum computing is literally to answer the question.

  • What do I do with this, right?

  • This is the same as is classical computers in the fifties sixties, arguably seventies, arguably eighties.

  • It's it's what do we do with this stuff?

  • How can we actually employ this?

  • And if you look at you know, the people that were into classical computers in the 50 60 seventies eighties, these were there's kind of two people.

  • There were people.

  • Most of the people, I would argue we're just there because it was interesting and cool, and they just were passionate on the subject.

  • But there were also pioneers, and there were people in businesses who made billions for themselves and generated trillions of dollars for the world.

  • I mean, we are almost certainly on a new age of technology and computing here.

  • I think that should be motivation enough, and then it's for free.

  • To me.

  • It's crazy.

  • You can't afford not to get into it.

  • But whatever I understand, if you want an employable skilled, I've got Web development, data analysis, machine learning tutorials.

  • If you want to follow those instead.

  • So anyway, I'm gonna get back to driving my Mars rover for free.

  • So So, back to our story of cubits.

  • Um, we're now going to visualize cubits on the block sphere.

  • So the block sphere is, um, is this this representation of the Hilbert space, which is a step above the Euclidean space, which is just basically it's just infinite number of dimensions.

  • Okay, but that doesn't matter.

  • You don't need to know that it's a sphere and it has a space inside it.

  • Okay.

  • And then at the tippy top Bibbidi bottom, tippy top and bottom of the sphere, You've got your actual cubit value.

  • Um, you know the top.

  • Well, let's say is zero.

  • The bottom is a one.

  • So the notation you see here it's like a bar, the actual zero or a one, and then you've got this kind of, like, arrow looking thing.

  • That's just the notation for the cubit value.

  • So them in this block sphere.

  • You know, shooting out from the middle is your vector.

  • This is your cubits.

  • Actual vector.

  • Um, And again, it could be pointing perfectly to a zero or one value.

  • And then when you measure it, it will always collapse to a zero world one, whichever one it was pointing to.

  • But it doesn't have to be.

  • It could be anywhere in this faith in the space.

  • Um, and then when you take your measurement, it's a It's a probability, right?

  • So this little green arrow here is our kind of our vector, and you just assume that's a straight line.

  • Um, when we go to take our measurement here, I don't know, let's say 20% of the time it will collapse to a one.

  • Maybe not 20.

  • I don't actually know what the number would be, but a non zero chance of collapsing toe one.

  • It'll mostly collapsed to zero, but it can collapse to a one.

  • But you take your measurement, it collapses, and I've got a little purple line here, pink line, whatever you wanna call it.

  • That's what happens when we actually go to measure it.

  • But before we measure that we can.

  • Actually, we apply our gates to it so the gate can take your vector and do all kinds of things.

  • Um, basically, all of them, I believe, are just a rotation.

  • It's some function of a rotation.

  • So as you can see here, we've got that green vector, and it's just rotating to the where I've got this yellow vector.

  • And then again, so So all of the gates that we're doing are actually applying this logic to the Cube it while it's in this this this Hilbert space here.

  • We're applying the gate to that.

  • So it's not a gate that's being applied to a 01 or both.

  • It's a gate is being applied to this thing that has a potential or a probability to collapse to zero or one.

  • But that probability is actually stored like it's there.

  • And when we perform that gate on it that stays, it goes forward, which is freaking nuts.

  • Um, okay, so cool.

  • So that is kind of that's That's how our thinking of what actually is a ah Cubitt.

  • And how do we represent this Cuban now?

  • Luckily kiss kit does this for us.

  • We can actually represent um uh, the cubits is at least at the output stage.

  • We can represent them on a national bloc sphere, which is pretty cool again.

  • The visualizations from kiss kit or just just nuts.

  • So now we're going to actually code some of this and play with some of the gates as well as, um, visualized the gates, get just get an idea of what's actually happening here and what really are these Gates doing?

  • Okay, so now we're gonna do is kind of run through some examples and kind of visualize that the cubits themselves on their block sphere as well as see the actual distribution of outputs from some of the circuits that we build.

  • I'm only gonna build like a handful and show you a handful of gates just to give you an idea of what's actually happening.

  • There's also in the text based version of the story.

  • I'm gonna have way more examples of just things that you can do and how that's changing things.

  • But honestly, I encourage you to just kind of do it on your own.

  • So once you see some of the things that I've shown you, I'm gonna show you also all of the possible gates.

  • In fact, I could just do that.

  • Now, this is basically all the gates.

  • There's tons of gates here.

  • Um, but you basically it's all a combination of, you know, you've got Hatem art, which is super position.

  • Then you've got see, not for the entanglement.

  • Right.

  • And then you've got, um, rotations.

  • That's it.

  • So, really, it's the concept of controlled for the entanglement, and then it's just a bunch of rotations that'll make more sense momentarily.

  • Um, so, yeah, I encourage you to kind of think about, you know, apply a gate.

  • And before you visualize it, think about what it will look like on the block sphere.

  • And then also think about what will the distribution output look like?

  • What should that be?

  • Um, so, yeah, I'm gonna show some examples, but I strongly encourage you t just play with it on your own and see how wrong you are.

  • Okay.

  • Keyboard kiss, kid as q from kiss kit dot tools dot visualization, visualization, import plots, block, sphere.

  • Uh, and then from kiss kit dot visualization.

  • Actually.

  • Don't know.

  • Something tells me one of these is the old way and one of these is the new way.

  • To be honest, wouldn't this be in the same visto hist o gram?

  • Wendy's being the same location tools because the block sphere is actually not a visualization of output, right?

  • It's just a visualization of the circuit.

  • So price, pre measurement?

  • I don't know.

  • Anyway, someone let me know if those could be imported from the same location.

  • Uh, I'm gonna do something because I'm on the dark theme I'm gonna say from Matt plot live in poor style And this style that use we're gonna use the dark background.

  • I'm doing this because I've got the dark theme and I want to see the labels.

  • I also made some edits to the kiss get files.

  • They're just hard coded changes.

  • I'll put them in the textbooks for another editorial, and then, hopefully, at some point in the future, maybe I could make a pull request to kiss kit to fix this.

  • Because actually, Matt plot live dynamically changes the colors of labels for you, given the style that you use.

  • So this could be dynamic.

  • I believe so.

  • Anyway, I could maybe make a contribution to kiss kiss because this would be the only one that I could possibly make.

  • Um, typical.

  • Ah, Matt, Plot lib in line.

  • Cool.

  • I think we're good.

  • So now we're gonna do is I'm going to find our two state state vector simulator on.

  • This will be cute.

  • I air not get underscore Back end on This is State vector simulator Sim, you late tour.

  • Uh, and then we'll say chasm Sim equals this would be the chasm simulator chasm HQ as m simulate tour.

  • Cool.

  • We're gonna have to simulators one to plant the block vector.

  • We need the state vector simulator and then to to get the distribution outputs.

  • We're going to use the chasm simulator.

  • And now I'm gonna just make a function that will do a bunch of lines of code that we're gonna find ourselves needing to write many times when we're just kind of playing around and trying to see what changes are made.

  • Um, and I know in a notebook you could, like, go up, change one thing and then run it again.

  • But I kind of at least this is what I did when I was kind of playing around.

  • I actually wanted to save the changes that I meant I made along the way just to kind of see how how things were actually impacting things.

  • So anyway, find duke job, Uh, and then this will take a circuit, and then we're just going to dio um, basically run the two jobs on the two Sims.

  • Rather.

  • So the first job will be cute dot Exe cute.

  • We will execute the circuit.

  • Back end will be state vector.

  • I'm just gonna do this.

  • Say factors, simulator.

  • We don't need shots because that is a relevant in this case.

  • Um and then we'll just say dot result And then we'll say, uh, state vek equals job dot get under scorer State vector and also probably want me to say result.

  • I don't want to be too confusing there, State get state vector.

  • So we've got the state vector.

  • Now we want to do is also do the chasm thing.

  • So to do that, we're gonna say n underscore cubits.

  • And in this case, we are goingto only have circuits that dot n underscore a Cuban.

  • Um, actually, cubits is the attribute that have the same number of cubits and classical bits in the register.

  • If they're different, we'll just have to run these lines manually.

  • I know there is.

  • You could get.

  • I don't There's no n classical bits, but there is CEO bits, and you can do a Len on seal bits and get the number.

  • But, um, but if you want to have a different number of classical bits in quantum bits, chances are you're trying to map a really specific quantum bit to a classical bit.

  • Or at least that's my what I've been trying to do, and there's really no good way to do that here.

  • So So I'm not.

  • I'm just gonna We'll just do those lines manually when it comes to it.

  • So anyway, circuit dot measure and then we're just gonna measure a list comprehension.

  • That is eye for eye in range, um, and underscore er cubits.

  • And then again, we're gonna do the same thing here.

  • Obviously, I said it wants, but I'll say it again.

  • This is your quantum register.

  • This is your classical register.

  • We're just saying and cubits because they're gonna be identical.

  • In fact, let me just, um, what could I do?

  • Circuit?

  • I think I can say Len circuit diet C l bits.

  • I think we'll find out if that keeps throwing an error, I'll just fix it.

  • But just to make it abundantly clear what's going on here?

  • Um, I'll just do that.

  • Okay?

  • Chasm will say chasm.

  • Underscore.

  • Job is going to be equal to q dot executes and will execute that circuit again.

  • We'll say back end equals chasms.

  • Um, and then now shots do matter for now.

  • We'll say 10.

  • 24.

  • Maybe later.

  • We can change the function to accept more, but 10 24 will be more than enough to give us a decent distribution.

  • And there was a count's equals.

  • Uh, cat.

  • Oh, we need to do the same thing as before, so dot results Kassandra pressure chasm results, but chasm job dot Get underscore counts.

  • Okay, Cool.

  • Uh, now we return state beck and counts.

  • Great.

  • Run it.

  • Plot blocks.

  • Uh um Oh, it's not blocks.

  • Fear its multi vector was like pressure.

  • Okay.

  • Okay, good.

  • So All right.

  • So now we're just gonna make some circuits and then kind of talk about what's going on, so we'll start with a really basic circuit.

  • So we're just gonna say circuit equals, um, quantum are Actually, it's cute dot want circuit?

  • Uh, two and two.

  • So would be to classical yet to quantum bits to classical bits.

  • It's quantum bits than classical.

  • Um, and then now let's just brought it right quick.

  • So state bek counts equals do job for circuit.

  • Then let's do plot block, multi vector factor for the state bek.

  • Cool.

  • So, um, I should have asked.

  • Actually, what do you expect this to look like before I do it?

  • But, um, I just forgot anyway, So this is what the block sphere looks like with our Cuban vectors on it.

  • And so when we go to take a measurement, what happens is this vector it's going to collapse to either a zero or a one with respect to the probability, which is all a function of what is where is this vector?

  • So in this case, it's completely pointing to zero.

  • Every time we take a measurement here, it will always be a zero.

  • And we can obviously, um, we could plot that, but I think it's kind of silly to do the distribution, but we could do it so plot hist Oh, Graham, um And then counts, uh, legend.

  • Um, just say output.

  • So Yes.

  • So the distribution is always a 00 because this will always collapse 200 But, um, what do you What do you think happens if we'd put, um Let's a cubit one.

  • What do you think happens when we put Cuba Index one into superposition?

  • So again, superposition is just that state where it's one or the other.

  • In this case, it would be a zero or a one.

  • What do you expect to happen to this vector?

  • So let's find out.

  • So we run this, um, we just gonna change the circuit here.

  • So it was a circuit dot h for hat Amar gate, and we'll do it on Cuba one.

  • So Index one.

  • So it's a second Cubit.

  • I regret that.

  • And at least for me, that wasn't what I expected.

  • Right?

  • The first time I knew that was gonna happen this time.

  • But at least for me, I didn't expect that.

  • It just it points fully to the X right now.

  • What?

  • How would you if we were to say this vector rotated on one of these axes?

  • Which axes did it rotate on in this case, the hatem Our gate simply rotated along the Y axes.

  • Now, obviously, the Hatem our gate is always going to, um it's gonna put the Cuba into a super position.

  • So that had a bar gate, Um is a little a little less of a rotation than what everything else is going to be.

  • Right.

  • So, like, let's for example, um, what happened?

  • What do you think would happen if we then what if what if we took a cubit zero, put it in superposition?

  • And then we said circuit on.

  • We'll say control.

  • Not on cue, but one again.

  • What do you think will happen to both Cuba Zero and Cubit one.

  • So at least for me, I'm thinking, OK, we just saw what happened.

  • Had a mard on cue, but one, it goes full out to this like X.

  • But so we're thinking Cuba zero will go all the way to X and then controlled.

  • Not that would mean 50% of the time.

  • Well, this one's in superposition, so I would then expect Okay, either Cubit one will be full X like it was before, but that probably won't be the case.

  • Maybe maybe Cubit one will actually be in a soup sort of superposition over here.

  • Um, well, how any arrow?

  • But if that's the case for Q, but one does that impact or does that not impact Cuba zero?

  • Because we know what a Hatem art should do.

  • It should just do this full vector anyway.

  • Run it.

  • Of course I forgot s o the control bit will be zero target one.

  • Run it.

  • And what we find is actually both cubits go to this like centered state.

  • Whereas what if we just did like a knot on cue, but one what would happen there, Right?

  • So now Cuba zero is back to fully pointing towards this X Whereas we don't change anything to H.

  • But we just make it a control bit for cubit one.

  • Um and that also seems to have impacted Cuban zero.

  • So take note.

  • So again, if we were to plot the hist a gram, you should have an idea of what to expect.

  • But do you write so, in theory, Cuba zero and keep it one or both in this kind of superposition looking type of state, right?

  • It's in the middle here and in theory, you might think every time you take a measurement of Cuba zero.

  • It should 50% of the time go to 0 50% of one, and then Cubit 1 50% of the time go to 0 50% of the time Goto one.

  • But these two cubits are entangled because if they were 50 50 independent of each other, you would get 000110 and 11 get four combinations possible, but instead, we only get to because these are contained.

  • Contain called these air entangled, right?

  • It's using the control, not because they're controlled.

  • So that's why we see what we see here.

  • Um okay, so moving on.

  • Um, now what if you wanted to What if you had three?

  • In fact, let's make a new one that way.

  • We don't ruin our beautiful example there.

  • Uh, what if we have a three by three s 03 quantum bits cubits?

  • Uh, what if we had circuit dot h Q?

  • But why?

  • So now, Cuba, zero Q bit one a superposition.

  • And what if we actually want to use Cuba zero and one to control the position or control the vector for a cubit two?

  • Turns out there's a controlled controlled Not so we can actually see.

  • See X, where zero and one will be our control and our target will be Cuba to now.

  • Again, I want you to take a moment to think about, um What do you think that looks like?

  • Like what is the blocks?

  • Fear kind of look like for all three of these, actually.

  • Where Where will the what will the vector B for a Cuban zero in Cuba?

  • It won.

  • And then where?

  • What?

  • What will the vector look like for Cuba too?

  • And so also, if if there, if they are in superposition, does that what does that mean for cubits Cuba two's distribution of output.

  • How will that impact just the value for Cuba to?

  • But then also, how will that impact when we if we are in this case, measuring all of the outputs?

  • Um, so just for Cuba to what should that distribution look like?

  • And then for the entire circuit, How many combinations should we see?

  • And at what distribution?

  • That's a lot of questions, but just kind of think about it real quick.

  • So cool.

  • Um, let's find out.

  • So here comes our, um, blocks fears.

  • Okay, so it looks like someone.

  • Correct me if I'm wrong, I want to call this amplitude or something.

  • You know, this vector coming out over here?

  • Um, anyway, that looks a little different than anything we've seen before.

  • It's either been completely out or right in the middle.

  • Now there's some sort of amplitude thing going on here.

  • Then we also see another weird thing for Cuba to it's it's kind of up here about half of the way.

  • Is that what you would expect?

  • It's what I expected, because had a MARD, you know, nothing else involved had a Marte means this Cuban 50% of time will be a 0 50% of the time.

  • It will be a one.

  • So if you've got a 50% times of 50% cause those 1st 2 cubits are independent of each other for now and then they're just control bits to Cuba, too.

  • So in theory, right, it should be 50% times 50%.

  • Um, so that should be a 25% of the time.

  • Cube it to gets flipped 21 Is that what happens?

  • And if that's what's happened, what happens?

  • What are the range of possibilities of output for the circuit And at what distributions?

  • Pause the video If you really want to think about it.

  • Otherwise I'm gonna copy and paste.

  • So what we see here, at least for me, kind of confused me initially because I'm like, Wait, shouldn't there be a 75% freaking chance for Cuba too, Right.

  • But when we we've allowed all these other cubits to get measured in their entangled state, what we end up seeing is actually a nice distribution, all 25% chance.

  • And if we look at Cuba too, Um, here is your 25%.

  • So I I'm gonna have to go back and check the documentation.

  • But I'm starting to think that these are in reverse and I didn't see anything that exactly told me so.

  • But if you thought Cuba too What?

  • You know this is Cuba Zero.

  • Can you see you can't see them Us on video.

  • Keep it 012 You would say, Oh, well, 50% of time.

  • It's a one.

  • But that's not true.

  • The only cubits that air 50% or a cubit 10 and one.

  • So that would be true if this was a cubit zero.

  • And if this was Cuba zero, you got 0011 The only cubit here that is 25% of the time of one is this 1st 1 So I actually think these air in reverse.

  • And this was the first time I was like, That's weird.

  • And then I was like, That's also weird Cuba to 50% of the time of one.

  • What's going on there?

  • Um, I don't think that's right, because I think this is Q bit too.

  • So actually believe the bits on the label here are reversed because I don't think Matt plot lib does it in this order.

  • I believe Matt Plot Live would do it in the correct order, but something tells me it's probably join operation going on.

  • I'm not sure.

  • Maybe another thing I would possibly fix.

  • But again, the problem with fixing something like this is it might not be broken.

  • Um, don't want to get it wrong, but anyway, I'm pretty sure this is Cuba 012 because this is what we expect.

  • You know, I can confirm that by changing our circuit a little bit here, um, and instead, copy Paste three That's your quantum register.

  • Classical register one.

  • Um And then we'll do a circuit dot measure.

  • And we're gonna measure Cuba too, to the classical bit.

  • Zero.

  • There's only one Now.

  • My assertion is that, um we will see her 25 75% 25 1 75% 0.

  • And we're measuring cubit too, and just proving that I'm pretty sure these were reversed.

  • And I'm sure somewhere in the documentation, they say that if that's true, but that's not expected by me.

  • And so if you are somebody that knows is that correct?

  • Is that how you would really want to display them in reverse?

  • So someone let me know, because otherwise I'd love to help them fix that too.

  • Okay, so we make the measurement, um, we can so draw after the measurement.

  • Doesn't matter.

  • Um, okay, so now we actually wanna run this, and we want to run it through the chasm.

  • So do actually this Copy that.

  • Come down here, paste this end.

  • This okay?

  • Yeah, That's what we expected.

  • So I'm pretty sure these are reversed.

  • Moving forward.

  • Have to confirm that hopefully by video three, I'll know with 100% certainty if that's true or not.

  • But this sure seems to suggest that that is a universe and everything points to that.

  • So anyway, if you know that to be true or false, let me know.

  • And then also, if you know that to be true and you believe that is within good reason, let me know.

  • I'd love to know if that actually makes sense, because I don't to me, it doesn't love to know why that makes sense if it does so Okay.

  • Anyway, what you see here is what we expected, regardless of combination of Gates and for at least this cube, it all on its own.

  • But it's also interesting that you have the four.

  • If you would ask me to conceptually think of this maybe given enough time and a pencil and paper, I could have come up with this exact combination is being the only possibilities.

  • Um, but even this this is not this not that confusing.

  • This is like simple math.

  • I mean, it's 50 50 odds with three cubits.

  • So anyway, mentally, even that's challenging for me.

  • But the plot thickens.

  • So, um, I don't want to show, like all the examples I just We'd be here forever.

  • I have a ton of examples in the text based version of this tutorial.

  • So if you want to check him out, go for it.

  • But what I really want to show you or the rotations.

  • So, for example, um, I'm gonna just copy and paste these in.

  • I don't really see any reason to keep writing outlined by lines.

  • So here's a circuit.

  • So three by three.

  • So we're back being able to use our do job function, and, um, we don't really need to do that.

  • Controlled, controlled, not here.

  • I'm gonna comment that out.

  • Uh, and then now we're going to do well.

  • First, let's just graph this without doing any effect to keep it zero or, uh, Cuba, too.

  • So here you see these Aaron superposition superposition, and this clearly.

  • Soon you'll be able to recognize this as a superposition that's not entangled with anything else.

  • But it's just a superposition.

  • So, um, anyway, moving on, then we have here, and at some point we'll have to play with that because I also want to show some something's on just superb superposition.

  • Cubans anyway, keep it too, is not doing anything.

  • So it's a zero.

  • Every time we measure it will be a zero.

  • But now what we can do is rotate it along the X axes again.

  • Looking at this, you don't need to know what math dot pie will rotate it by.

  • But just think with me when you rotate along the X axes.

  • How do you expect that arrow to, like Move?

  • If it's rotating on the X axes, right, It's just gonna rotate around the ex axes.

  • So, um, so what?

  • This is is just data.

  • So how much do you want to rotate?

  • Um, and then on what?

  • Cuba.

  • So let's go ahead.

  • Run that.

  • So, as you can see, this math up high is this is 1/2 rotation round, right?

  • Um, against simple math, you should be able to calculate a rotation by pie.

  • So anyway, um okay.

  • So what does that look like to you?

  • What if we What if we said circuit dot Exe for a cubit two when you know it's the same thing.

  • Do you think X Do you think a not gate is actually a rotation?

  • So yes, it is, by the way.

  • So this is why you know we can say, you know, the output wise of a sea not gate, for example, is analogous to the classical bit X or right, because the output it does, it's the same thing.

  • But as you've already seen, the sea, not gay, impacts the control bit.

  • But then also, it's it's not the same phrase the output If we're looking at only two bits, Yeah, the outputs the same.

  • But what's actually going on in the bit itself is not It's like it's a rotation.

  • This is something that is, it doesn't happen in a regular classical bit.

  • We've got high voltage, low voltage.

  • That's it.

  • So, anyway, um, yeah.

  • Okay, So, um Okay, so So, yes.

  • So the rotational on the X axes looks, You know, a not gate is actually a rotation on the X axes by math dot pie.

  • Who would've thought so?

  • But the interesting thing, however, is Samantha pi times to what you think's going to happen.

  • Let's just bring that real quick.

  • You should be able to guess.

  • Nothing just went wrong, Aaron.

  • But then we could do other things.

  • Like you could say, Math up high, divided by two.

  • Where do you think that arrow will point when we do divided by two.

  • Right?

  • That's something we have not yet seen.

  • Okay, um but you could also you could take it a step further.

  • You could say, divided by four again.

  • Where do you think that arrow is going to point?

  • Also something we have yet to see that looks nothing like any of the gates that we've seen.

  • But again, um, the question might be how does that collapse?

  • What is that gonna look like?

  • Um, let's say we won't run that now and let's actually do it.

  • So again, um, we can plot the count, so it's just run that real quick, and then we're gonna also have to do Well, it was Ryan.

  • So again, here is an example of all the combinations.

  • Right.

  • So, uh, because right, we only have three cubits.

  • So this quantum circuit, given that input, um, has eight combinations, So we're already showing the quantum power, right?

  • Although we're not doing anything, but you can see that these are all states that this is a circuit is capable of at least sort of dealing with writers.

  • We get the actual possibilities output from this so that's interesting.

  • Anyway, um okay, so So what's going on here?

  • We've got this this distribution here, which is almost adds upto one.

  • But they got this stuff down here, which is also curious, because this is a perfect quantum machine, right, that we're on a simulator.

  • These air really outputs like that's not noise.

  • If this happened on it on Ah, um, on a real quantum computer, you would probably say, Oh, that's noise.

  • It's not noise.

  • Which is buggers, anyway.

  • What?

  • What?

  • What do you think?

  • The distribution of output for Cuba.

  • Three Cuba to rather is.

  • So we're gonna do the same thing we did here.

  • Um, see, I could do that, um, and then shoot, actually, a continent.

  • Keep this.

  • I'm gonna pace that.

  • Uh, we're gonna come up here, grab this measurement, and let's do a draw just for kicks.

  • Just say you could get used to seeing it.

  • I suppose.

  • Measure, draw.

  • Boom.

  • Okay, so that's what it looks like.

  • So, uh, let me see.

  • Where did we do it here?

  • The other thing we need to change is we're going to say it's actually three quantum bits, toe one class school, then We're gonna run the job, get the count's blood.

  • The hist a gram.

  • Cool.

  • So, what we see here?

  • We see, actually, uh, what have you done?

  • Why did you?

  • 32?

  • Why is it happening?

  • What am I missing here?

  • It shouldn't have the other bits.

  • I'm not really sure why we're seeing the other bits.

  • So we fixed that here.

  • What do we do too?

  • Tripping out.

  • Why is that happening?

  • If I don't figure this out on my own in the next few minutes, Someone comment.

  • Blow.

  • What?

  • Okay, whatever.

  • I don't know why they happen.

  • It's a notebook.

  • So sometimes things were running and not perfect order.

  • So anyway, that's sure that's what happened.

  • So as we can see here for Cuba, to which I suppose would have to be this queue Oh, no.

  • So this is 012 So actually, this is Q bit too.

  • But even then we have four examples, but it's far less for less common.

  • So Okay, so it's starting to make more sense.

  • I'm just looking for more backup Thio 012 So, obviously, most of the time it's a zero, which we're seeing 86% of the time.

  • It's a zero.

  • That pride adds up to 86.

  • Given enough, um, and then the other What, 3rd 14% Is that up to?

  • Yeah, probably.

  • Okay, Yeah.

  • Yeah, this is definitely reversed.

  • Okay, Anyway, so you can see here again.

  • It's not really that a Cuban is a zero or one, right.

  • And the gates are not simple logic Gates.

  • So a cubit is not a 01 or both.

  • It's a zero or one or anything.

  • Any probability distribution in between it can be.

  • And then the gates or not, just simple logic gates their gates on a really complex, um, Hilbert space.

  • So yeah.

  • So it's, um obviously it's It's even more complex than video number one led you to believe.

  • So Okay, um, I guess the final point I would make is like, you know, pretty much all of these gates are combinations of obviously got superposition, and then you got entanglement with the concept of control, and then you've got rotations on any access.

  • So, for example, can you have a controlled rotation along access?

  • Why, yes.

  • So here are I listed them in the text messages editorial, and I might just copy and paste at least this link in the YouTube description.

  • But if I don't, they're in the text based version.

  • Anyway, this method summaries all the methods which just so happens to be mostly Gates.

  • So, for example, I forget which one is that?

  • I think control rotation along the Why so cry?

  • Nice of it exists.

  • So data, the control bit the target bit.

  • But, of course, like this could just continue to be extrapolated out forever.

  • Right?

  • So could you have a controlled controlled rotation along the Y axes?

  • Absolutely.

  • You could.

  • And then what if control the rotation on the why didn't exist?

  • I swear, this is brand new.

  • I swear it wasn't here like, a few days ago because I looked it up because the only one I could find was actually control rotation on the Z axis.

  • Because you also see there doesn't appear to be a controlled rotation on the X axes.

  • So anyway, I don't think I didn't think there was one on the sea or why, but there is.

  • But if there wasn't, for example, um oh, and this is just to get home page that gives you the code for doing them.

  • So you you can see the actual So let's just do a simple one.

  • Let's do it.

  • Not gate.

  • Uh, ex.

  • So we come down where you're That was not as exciting.

  • Let me do a Let's do this.

  • Let's see if I could find, like, a sea not gay.

  • So how about C X?

  • Right.

  • So this has, like, that actual matrix.

  • So you can kind of see and start to have an idea for, like, how these things work.

  • And if you look at this and this doesn't make any sense to you, that's okay.

  • Um honest.

  • At least for me, the best way to learn how all this stuff was working was t to build it.

  • Think how the blocks fear was gonna look.

  • And then after seeing the blocks fear, think about, um what?

  • Or I guess I guess the right word.

  • Actually, it's not blocked.

  • Like the blocks.

  • Fear is just blocks fear.

  • But the block vector is like the vector on the sphere, so probably should say block factor.

  • Anyway, um, I think about how the block vector is gonna look.

  • And then after you see the block vector, think about what is the distribution gonna look like?

  • And honestly, it's pretty easy for, like, one cubit to be like Oh, okay, that distribution is gonna be such and such.

  • But then I'm personally, I'm finding it hard to predict out what the possible combinations of bits will be.

  • And then what the distribution will be for those combinations.

  • It's just It's interesting, though, but then obviously you can do like Gates don't exist on their own, right?

  • It's a gate on a cubit, which then also might be a control cubit for another cube.

  • It like it's it gets complex fast.

  • So anyway, it's even more complicated that, um that what you believed from tutorial one.

  • So anyway, check those out.

  • And then also, you had that for the control rotational.

  • Why?

  • This is an example of how you would build a controlled rotation along the Y axes.

  • Um, if you didn't have a CR y gate made for you already so looking here, control rotation on the wife.

  • So this is just the symbology for simple.

  • Uh, I need to bring this to a close anyway.

  • Symbols.

  • Anyway, the symbol for control is this.

  • And then you got okay, so It's a control rotation.

  • Why?

  • By theta So then here, you see?

  • Okay, So first you just to do a control, Not?

  • And then you do a rotation on the why?

  • By fate a divided by two another control not rotation on why they divided by two.

  • That equals your control.

  • Rotation of the way.

  • So you can build using control knots and other rotation gates, You could build anything you want, right?

  • You could also build your own control of control rotation on the wife and so on.

  • So anyway, if you can think of it, think of it, it can be done.

  • But the next question and the question still remains.

  • Okay, what can we D'oh!

  • Where do we go from here?

  • So in the next tutorial, what I'm gonna cover is at least one of the algorithms that at least shows a quantum computer is better than a classical computer.

  • Um, just as an example.

  • And then if we have time, I'll try to cover a few of the algorithms.

  • But what kind of sea?

  • And go from there.

  • So anyway, Questions, comments, concerns, suggestions, corrections, whatever.

  • Feel free to leave and below again.

  • If you know why these Aaron reversed order and it makes sense to you.

  • Please tell me why I'd love to know.

  • Um And if you know that these aren't in reverse order, I suppose.

  • Let me know, because I'm now moving forward with the assumption that this is in reversed in reverse.

  • Order is this is Cuba 012 You know, all the way out to end.

  • Okay, Lots of information.

  • Hopefully you guys enjoyed Thank you to all of the channel members, including the brand new channel members.

  • Cargo Veuve ignition Warn Jose Carlos A Maka Kau Vin A shade of on Shii on Lee Spaghetti Monster Lukash.

  • I can't say your last name.

  • Tell me the comments, how to pronounce that.

  • And I will get it right next time.

  • And Anthony Hedda, thank you all very much for your support.

What's going on, everybody.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

B1 中級

Qubits and Gates - Quantum Computer Programming w/ Qiskit p.2 (Qubits and Gates - Quantum Computer Programming w/ Qiskit p.2)

  • 10 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字