what's going on everybody and welcome to
part two of the quantum computer
programming tutorials in this tutorial
what we're gonna be talking about is
more on the qubit itself as well as the
gates and like what happens when we
apply this gate to the qubit 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 as well as if you
wanted to make your own algorithm what
gate would you use to do certain things
so sometimes you know you'll like if you
look up what a C naught gate is you'll
see oh it's the equivalent of the XOR
gate sort of 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 what I hope by
the end of this is that you'll have a
better understanding what the heck a
qubit is and what a gate is doing to
that qubit 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 first one was
the circular table example with chairs
the argument being the number of
combinations you have is n chairs
factorial people were pointing out that
well not really because you could rotate
the chairs and this wouldn't affect
anybody's happiness
so I'm amending the story to be there's
a stage in the front and like your
happiness is also a function of what's
your orientation to the stage soft but
good point that was absolutely true so
mmm 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 8-bit 8-bit string
okay
each bit could be a 0 or a 1 right this
is true for a qubit when measured and
this is true for a classical bit so the
number of possible combinations is both
for classical computers and quantum
computers for a bit string the number of
possible combinations let's say you got
8 bits it's 2 to the power of 8 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 and
a classical circuit can consider two
times n 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 to to the
power of n bits States and it can 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 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 as too slight is 60 so to put this
in perspective IBM and Google both have
50 plus qubit quantum computers already
and just like two years ago they had I
think 20 or so like it was like 20
cubits so so it's increasing pretty
quick and or was it five I can't
remember but it was a very small number
and we're up to 50 now and probably more
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 qubit quantum computer has more can
can can do calculations on more states
at a time then if we were to combine all
of the computers of the world I want to
say it's 60 it 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 to ^ 300 again that's
conceivable that we'll hit that number
in like a decade or less who knows so
that's what's exciting about quantum
computers so so hopefully 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 I
think the answer to that is probably the
wrong attitude like I wouldn't ask you
know ask not what what quantum computing
can do for you that's what you can do
for quantum computing or your job in
quantum computing is literally to answer
the question what do I do with this
right this is the same as classical
computers in the 50s 60s arguably 70s or
googley 80s 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 50s 60s 70s 80s these
were there's like kind of two people
there were people most of the people I
would argue were 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
and 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 skill 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 qubits we are
now going to visualize qubits on the
Bloch sphere so the Bloch sphere is it
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 tippity-top and at the
deputy bottom I don't know
tifany top and bottom of the sphere
you've got
your your actual qubit value you know
the top will say is a 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 qubit value so then in this
block sphere you know shooting out from
the middle is your vector this is your
qubits actual vector 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 or a one
whichever one it was pointing to but it
doesn't have to be it could be anywhere
in this fate in a space and then when
you take your measurement it's a it's a
probability right so the this little
green arrow here is our kind of our
vector and you just assume that's a
straight line when we go to take our
measurement here I don't know let's say
twenty percent of the time it'll
collapse to a 1 maybe not 20 I don't
actually know what the number would be
but a nonzero chance of collapsing to 1
it'll mostly collapse to zero but it can
collapse to a 1 but you take your
measurement it collapses and I've got
this little purple line here or pink
line or whatever you want to 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 to that
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 qubit in 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 zero one
or both it's a gate that's being applied
to this thing that has a potential or a
probability to collapse to 0 or 1 but
that probability is actually stored like
it's there
and when we perform that gate on it that
stays it goes forward but which is
freakin nuts okay so cool so that is
kind of that's that's how we're thinking
of what actually is a a qubit and how do
we represent this qubit now luckily kiss
kit does this for us we can actually
represent the qubits at least at the the
output stage we can represent them on an
actual Bloch sphere which is pretty cool
again
the visualizations from kiss kit are
just just nuts
so now we're going to actually code some
of this and play with some of the gates
as well as visualize the gates just get
an idea of what's actually happening
here and what really are these gates
doing okay so now what we're gonna do is
kind of run through some examples and
kind of visualize the the qubits
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 like what's
actually happening there's also in the
text-based version of this tutorial
might 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 the possible gates in fact I
can just do that now this is basically
all the gates there's tons of gates here
but you you basically it's all a
combination of you know you've got
Hadamard which is superposition then
you've got C not for the entanglement
right and then you've got 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 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 Bloch sphere and then
also think about what will the
distribution output
look like what should that be so yeah
I'm gonna show some examples but I
strongly encourage you to just play with
it on your own and see how wrong you are
okay import kiss kit as cue from kiss
kit dot tools dot visualization
visualization import plots block sphere
and then from kiss kit dot visualization
I 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 why
wouldn't these be in the same histo
histo Graham Lindy's be in the same
location tools because the Bloch sphere
is actually not a visualization of the
output right it's just a visualization
of the circuit so pre measurement I
don't know anyway someone let me know if
those could be imported from the same
location now I'm gonna do something
because I'm on the dark theme I'm going
to say from mat plot live in poor style
and the style dot use and 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 kit files they're just
hard coded changes I'll put them in the
tech space for another tutorial
and then hopefully at some point in the
future maybe I can make a pull request
to kiss kit to fix this because actually
matplotlib 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 it's not be cool
matplotlib in line cool I think we're
good so now what I'm gonna do is I'm
going to define our two state state
vector simulator and this will be cute
air get underscore back-end and this is
state vector simulator simulate tour and
then we'll say chasm sim equals this and
it'll be the chasm simulator
Kasim Kasim simulate or cool so we're
gonna have two simulators one to plot
the Bloch vector we need the state
vector simulator and then two to get the
distribution outputs we are going to use
the Kasim simulator and now I'm going to
just make a function that will do a
bunch of lines of code that we're going
to find ourselves needing to write many
times when we're just kind of playing
around and trying to see what changes
are made 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 cuz 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 fine do job and then
this will take a circuit and then hmm
we're just going to do basically run the
two jobs on the two sims rather so the
first job will be Q dot execute we will
execute the circuit back end will be
state vector I'm just gonna do this
state vector simulator we don't need
shots because that is irrelevant in this
case and then we'll just say dot result
and then we'll say a state Veck job dot
get underscore state vector and also
probably let me just say result I don't
want to be too confusing there state get
state vector cool so we've got the state
vector now what we want to do is also do
the chasm thing so to do that we're
gonna say n underscore qubits and in
this case we are going to only have
circuits that dot n underscore qubit
actually it's Q bits is the attribute
that have the same number of qubits 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 know there's no in
classical bits but there is CL bits and
you can do a Len on CL bits and get the
number but but if you wanted to have a
different number of classical bits and
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 and
when it comes to it so anyway circuit
measure and then we are just going to
measure a list comprehension that is I
for I in range and underscore qubits and
then again we're gonna do the same thing
here obviously I said it wants about say
it again this is your quantum register
this is your classical register we're
just saying n qubits because they're
gonna be identical in fact let me just
what can I do circuit I think I can say
Len circuit diet CL 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 Kasim will say
Kasim underscore job is going to be
equal to Q dot execute and we'll execute
that circuit again we'll say back end
equals Kasim sim and then now shots do
matter for now we'll just say 1024 maybe
later we can change the function to
accept more but 1024 will be more than
enough to give us a decent distribution
and then we'll say counts equals cat oh
we need to do the same thing as before
so dot results it suppression Kasim
results but whatever Kasim job get
underscore counts okay cool
now we return state Veck and counts
great run it oh it's not block sphere
it's multi-vector I was like pretty sure
okay okay cool good so alright 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 going to a circuit
equals quantum or actually it's Q
I want circuit two and two so it'll be
two classical but yeah two quantum bits
two classical bits it's quantum bits
than classical and then now let's just
run it real quick so state BEC counts
equals do job for circuit and then let's
do plot block multi vector vector for
the state Veck cool
so I should have asked actually what do
you expect this to look like before I do
it but I just forgot anyway mm-hmm so
this is what the Bloch sphere looks like
with our qubit vectors on it and so when
we go to take a measurement what happens
is it this vector it it's going to
collapse to either a 0 or a 1 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 0 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 heck we can
do it so plot histo gram and then counts
legend just say output so yeah so the
distribution is always a zero zero
because this will always collapse to
zero zero but what do you think happens
if we put let's say qubit 1 what do you
think happens when we put qubit at index
1 into superposition so again
superposition is this just the state
where it's one or the other in this case
it would be a 0 or a 1 what do you
expect to happen to this vector so let's
find out
so we run this we just going to change
the circuit here so we'll say circuit
dot h4 Hadamard gate and we'll do it on
qubit one so index 1 so it's the second
qubit
we graph 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 Hadamard gate
simply rotated along the Y axes now
obviously the Hadamard gate is always
going to it's going to put the qubit
into a superposition so the Hadamard
gate is a little little less of a
rotation than what everything else is
going to be right so like let's for
example what happened what do you think
would happen if we then what if what if
we took a qubit zero put it in
superposition and then we said circuit
and we'll say it controlled not on qubit
one again what do you think will happen
to both qubit 0 and qubit one so at
least for me I'm thinking okay we just
saw what happened to Hadamard on qubit
one it goes full-out to this like X but
so so we're thinking cubed 0 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 ok either qubit 1 will be
full X like it was before but that
probably won't be the case maybe oh
maybe qubit 1 will actually be in suit
in a soup sort of superposition over
here without any arrow but if that's the
case for qubit 1 does that impact or
does that not impact keep it zero
because we know what a Hadamard should
do it should just do this full vector
anyway
run it of course I forgot so the control
bit will be zero target 1 run it and
what we find is actually both qubits go
to this like centered state
whereas what if we just did like a not
on qubit one what would happen there
right so now qubit 0 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 qubit 1 and that also
seems to have impacted qubit zero so
take note so again if we were to plot
the histogram you should have an idea of
what to expect but do you write so in
theory qubit 0 and qubit 1 are 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 qubit 0 it
should 50% of the time go to 0 50% of
the 1 and then keep it one 50% of the
time go to 0 50% of the time go to 1 but
these two qubits are untangled because
if they were 50/50 independent of each
other you would get 0 0 0 1 1 0 and 1 1
you'd get 4 combinations possible but
instead we only get two because these
are contained contain gold these are
entangled right it's using the control
not because they're controlled so that's
why we see what we see here ok so moving
along now what if you wanted to what if
you had 3 in fact let's make a new one
that way we don't ruin our beautiful
example there what if we have a 3 by 3
so 3 quantum bits qubits what if we had
circuit dot h cubed Y so so now qubit 0
qubit 1 or in a superposition and what
if we actually want to use qubit 0 and 1
to control the position or a control the
vector for a qubit 2 turns out there's a
controlled controlled not so we can
actually see see X where 0 and 1 will be
our control and our tour
it will be qubit 2 now again I want you
to take a moment to think about what do
you think that looks like like what is
the Bloch sphere kind of look like for
all three of these actually we're where
will the what will the vector be for a
qubit 0 and qubit 1 and then where what
what will the vector look like for qubit
2 and so also if if they're if they are
in superposition does that what does
that mean for qubits Cuba two's
distribution of output how will that
impact just the value for qubit two but
then also how will that impact when we
if we are in this case measuring all of
the outputs so just for qubit 2 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 let's mind out so here
comes our block spheres 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 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
qubit - 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 Hadamard and a you know nothing
else involved Hadamard means this qubit
50% of time will be a0 50% of the time
it will be a 1 so if you've got a 50%
times a 50% because those first two
qubits are independent of each other for
now and then they're just control bits
two qubit two so in theory right it
should be 50% times 50%
so that should be 25% a time cubit to
gets flipped 201 is that what happens
and if that's what's happened what
happens what are the range of
possibilities of output for this 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 qubit - right
but when we've allowed all these other
qubits 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 qubit - 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
qubit - well you know this is qubit zero
can you see that yeah you can't see - on
the video cubed 0 1 - you would say oh
well 50% of time it's a 1 but that's not
true the only qubits that are 50% are a
qubit 1 0 & 1 so that would be true if
this was a qubit 0 and if this was qubit
0 you've got 0 0 1 1 the only qubit here
that is 25% of the time of 1 is this
first one so I actually think these are
in Reverse and this was the first time I
was like that's weird and then I was
like that's also weird qubit two was 50%
of the time a 1 what's going on there
but I don't think that's right because I
think this is qubit - so I actually
believe the bits on the label here are
reversed because I don't think
matplotlib does it in this order I
believe matplotlib would do it in the
correct order but much something tells
me it's probably a joint operation going
ashore
maybe another thing I would possibly fix
but again the problem
with fixing something like this is it
might not be broken um so I don't want
to get it wrong but anyway I'm pretty
sure this is qubit zero one two because
this is what we expect and I can confirm
that by changing our circuit a little
bit here and instead copy paste three
that's your quantum register classical
register one and then we'll do a circuit
dot measure and we're going to measure
qubit two to the classical bit zero
because there's only one now my
assertion is that we will see our twenty
five seventy five percent so it's 25 one
seventy-five percent zero and we're
measuring qubit two and just proving
that I'm pretty sure these are 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 we can so
draw after the measurement our Merlin
doesn't matter okay so now we actually
want to run this and we want to run it
through the chasm so do actually this
copy that come down here paste this 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 sir seems to suggest that that is
in Reverse 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
cuz I'd love to know if that actually
makes sense because I don't think to me
it doesn't
I'd 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 cubed all on its own
but it's also interesting that you have
the fort like 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 you
know combination as being the only
possibilities but even this this is not
this is not that confusing this is like
simple math I mean it's 5050 odds with
three cubits
so anyway mentally even that's
challenging for me but the plot thickens
so I don't want to show like all the
examples because I just we'd be here
forever I have a ton of examples in the
text-based version of the dispute
Orioles so if you want to check them out
go for it but what I really want to show
you are the rotations so for example I'm
gonna just copy and paste these in I
don't really see any reason to keep
writing out line by lines so here's a
circuit it's a three by three so we're
back being able to use our do job
function and we don't really need to do
the controlled controlled not here I'm
just gonna comment that out and then now
we're gonna do well first let's just
graph this without doing any effect to
qubit zero or qubit two so here you see
these are in 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 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 some
things on just super but superposition
qubits anyway qubit two is not doing
anything so it's a zero
every time we measure it it will be a
zero but now what we can do is rotate it
along the x axis again looking at this
you don't need to know what math dot pi
will rotate it by but just think with me
when you rotate along the x axis 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 x-axis so
so what this is is it's just theta so
how much do you want to rotate and then
on what qubit
so let's go ahead and run that and so as
you can see this math dot pi is this is
a 1/2 rotation round right again simple
math you should be able to calculate a
rotation by PI so anyway okay so what
does that look like to you
what if we what if we said circuit dot X
for qubit two ones 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
see not gate for example is analogous to
the classical bit XOR right because the
output does it's the same thing but as
you've already seen the see not-gay
impacts the control bit but then also
it's it's not the same right the output
if we're looking at only 2 bits yeah the
outputs the same but what's actually
going on in the in the bit itself is not
it's like it's a rotation this is
something that this doesn't happen in a
regular classical bit we've got a high
voltage a low voltage that's it so
anyway yeah ok so ok so so so yeah so
the rotational and the x-axis looks it
you know a not gate is actually a
rotation on the x-axis by math dot pi
who would have thought so but the
interesting thing however is so math up
high times too what do you think's going
to happen let's just bring that real
quick you should be able to guess right
nothing just went all the way around but
then we can do other things like you
could say math up high / - where do you
think that arrow will point when we do /
- right that's something we have not yet
seen ok 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 the question might
be how does that collapse what is that
going to look like let's say we weren't
run that now and let's actually do it so
again we can plot the count so let's
just run that real quick and then we're
gonna also have to do well Louis right
so again here is an example of all the
combinations right so because right we
only have three cubits so this quantum
circuit given that input has eight
combinations so we're already showing
the the quantum power right although
we're not doing anything but you can see
that these are all states that this
circuit is capable of at least it's sort
of dealing with right O's we get the
actual possibilities output from this so
that's interesting
anyway okay so so what's going on here
we've got this this distribution here
which is almost adds up to two one but
then you have this stuff down here which
is also curious because this is a
perfect quantum machine right that we're
on a simulator these are real outputs
like that's not noise if this happened
on it on uh on a real quantum computer
you 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 qubit 3 qubit
to rather is so we're gonna do the same
thing we did here let's see I can do
that
and then shoot actually I'm gonna keep
this I'm gonna paste that and then we're
gonna come up here we're gonna grab this
measurement and let's do a draw just for
kicks just so you can get used to seeing
it and I suppose measure drunk boom okay
so that's what it looks like so let me
see where did we do it here the other
thing we need to change is we're gonna
say it's actually three quantum bits to
one classical
and then we're gonna run the job get the
counts plot the histogram cool so what
do we see here we see actually what have
you done
why did you three - why is it happening
what am I missing here
it shouldn't have the other bit so I'm
not really sure why we're seeing the
other bits so we fixed that here what do
we do
drip it out why is that happen if I
don't figure this out on my own in the
next few minutes someone comment below
what okay whatever I don't know why they
happened it's a notebook so sometimes
things are running and not perfect order
so anyway let's show this what happened
so as we can see here for qubit to which
I suppose would have to be cute Oh know
it so this is 0 1 2 so actually this is
qubit 2 but even then we have four
examples but it's far less for or less
common so okay so that's starting to
make more sense I'm just looking for
more back up to zero one two so
obviously most of the time it's a zero
which we're seeing yeah 86 percent of
the time it's a zero that probably adds
up to 86 given enough and then the other
what third 14% is that up - yeah
probably okay yeah yeah this is
definitely reversed okay anyway so you
can see here again it's not really that
a qubit is a zero or a one
right and the gates are not simple logic
gates so a qubit is not a zero of one 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 they're gates on a
really complex Hilbert space so yeah so
it's obviously is it's even
more complex than then video number one
led you to believe so
okay and I guess the final point I would
make is like you know pretty much all of
these gates are combinations of all
right obviously we've got superposition
and then you got entanglement with the
concept of control and then you've got
rotations on any axis so for example can
you have a controlled rotation along
axis Y yes so here are I listed them in
the text makes for zoo toriel 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 I said I think control
rotation along the Y so cry nice of it
exists so theta 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 axis
absolutely you could and then what if
controlled rotation on the Y 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 a
controlled rotation on the z axis
because you also see there doesn't
appear to be a controlled rotation on
the x axis so anyway I don't think I
didn't think there was one on the CR Y
but there is but if there wasn't for
example oh and this is just the github
page that gives you the code for doing
them so you can you can see the actual
so let's just do a simple one let's do
it not gate X so we come to that was not
as exciting let me do a let's do it
let's see if I can find like a see not
gaze so how about see 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 Johnna stat
least from
the best way to learn how all this stuff
was working was to to build it think how
the Bloch sphere was gonna look and then
after seeing the Bloch sphere think
about why or I guess I guess the right
word actually it's not but like the
Bloch sphere is just the Bloch sphere
but the Bloch vector is like the vector
on the sphere so probably should say
Bloch vector anyway
think about how the Bloch vector is
gonna look and then after you see the
Bloch vector think about hmm what is the
distribution gonna look like and
honestly it's pretty easy for like one
cubit to be like oh wow okay that
distribution is gonna be such and such
but then at least 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 and
like gates don't exist on their own
right it's a gate on a cubit which then
also might be a control qubit for
another qubit like it's it gets complex
fast so anyway it's even more
complicated than what you believed from
tutorial one so anyway check those out
and then also yad for the control
rotation are why this is an example of
how you would build a controlled
rotation along the y axes if you didn't
have a CR Y gate made for you already so
looking here control rotation on the Y
so this is it's just the symbology for
symbology I need to bring this to a
close anyway the symbolism anyway
the symbol for control is this and then
you've got okay so it's a control
rotation Y by theta so then here you see
okay so first you just do a control knot
and then you do a rotation on the Y by
theta divided by two
another control not rotation on why they
divided by 2 that equals your control
rotation on the Y so you can build using
control knots and other rotation gates
you can build anything you want right
you could also build your own controlled
controlled rotation on the Y 4 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 do where do we go from
here so in the next tutorial what I'm
going to cover
is at least one of the algorithms that
at least shows a quantum computer is
better than a classical computer just as
an example and then if we have time I'll
try to cover a few of the algorithms but
we'll kind of see and go from there so
anyway questions comments concerns
suggestions Corrections whatever feel
free to leave them below again if you
know why these are in reverse order and
it makes sense to you please tell me why
I'd love to know and if you know that
these aren't and reverse order I suppose
let me know because I'm now moving
forward with the assumption that this is
in reversed in reverse orders this is
qubit 0 1 2 you know all the way out to
end ok lots of information hopefully you
guys enjoyed thank you to all of the
channel members including the brand new
channel members cargo voo Vignesh warren
jose carlos am a cacao viene che davon
shi Yan Li spaghetti monster Lukesh I
can't say your last name tell me in the
comments how to pronounce that and I
will get it right next time and Anthony
Haddad I thank you all very much for
your support you guys are amazing
until next time