everyone in this video I'm gonna explain
what a quantum computer is and how it
works using a relatively simple example
and I'm gonna try to explain it as
clearly as possible so you'll be able to
understand this video even with no prior
knowledge of either quantum mechanics or
computer science so let's get started
okay first of all let me give you a one
sentence summary of what a corner
computer is a quantum computer is a type
of computer that makes use of quantum
mechanics so that it can perform certain
types of competitions more efficiently
than a regular computer can ok so right
now that sentence might seem a little
bit vague but my goal in this video is
to make that sentence make a little bit
more sense and a little bit more
concrete by the end of this video to get
started with that we need to get started
with a noun quantum computer or a
classical computer as it's known just
like my laptop right here a classical
computer stores information and what's
called bits as you might already know
and bits are expressed as a bunch of
ones and zeros and different kinds of
information can be represented as bits
whether it's numbers texts photos or
videos now a quantum computer is
radically different from that because it
does not use you know these classical
bits to store information instead it
uses what's called qubits each qubit is
just like a bit but the difference is
it's possible for a qubit to be not just
1 or 0 but it's also possible for it to
be 1 and 0 at the same time and that's
achieved by making use of the properties
of quantum mechanics and the reason why
it's possible for a qubit to be 1 and
there at the same time is because on an
extremely tiny scale or in the quantum
realm it's possible for a particle to
have two different states at the same
time so it's possible for example for a
particle to point up and down at the
same time it's a really strange concept
but once you accept that you'll be able
to assign one of those States let's say
up to me 1 and then the other state I
let's sit down to mean 0 once you do
that
if that particular particle happens to
be pointing up and down at the same time
then that would mean that the qubit that
it's supposed to represent is 1 and 0 at
the same time and by the way in theory
you could use a number of different
types of particles to represent a qubit
whether it's a photo on an electron an
ion or regular atom so here you might
think that it's kind of strange for a
particle to be able to point up and down
at the same time and I find it pretty
strange to you know some people try to
explain it with some kind of analogy
from the classical world which we're
used to but there's actually no good
analogy for it because this phenomenon
of a particle having two states at the
same time is really unique to the
quantum realm anyway all you need to
know for now for this video is that it's
possible for a qubit to be 1 and 0 at
the same time ok and once you have a
bunch of qubits like that and not just
one qubit then it's possible to put them
together so that they'll interact with
each other in a certain way so for
example you might design a system with
two qubits where when the first cubed is
1 the second qubit always becomes 0 and
when the first qubit is 0 the second
qubit always becomes 1 and if you have
those two conditions then when the first
qubit is 1 and they're at the same time
the second qubit becomes 0 and 1 at the
same time and in order for us to have
those two conditions be true for those
two qubits we need to first design a
physical system where they equivalent to
conditions or true for the two particles
representing those two qubits and once
we have a way of doing that you know a
way of having two qubits interact with
each other in a way that we want them to
we can expand the same thing to a number
of different qubits not just two we're
talking hundreds to thousands of qubits
right now and that's basically what a
quantum computer consists of so in
summary a quantum computer is
essentially a group of qubits designed
to interact with each other in a certain
way that we want them to so that we can
for
some competition on them and because of
the way qubits work as opposed to have
regular bits work a quantum computer can
be faster at solving certain kinds of
problems than a regular computer can
okay now to give you a better idea about
how a quantum computer works exactly I'm
gonna dive into the relatively simple
example I mentioned at the beginning of
this video now this particular example
might not be particularly realistic or
maybe practical but I think it's still
good for understanding how quantum
computing works okay so for this example
suppose that you're running a travel
agency of some kind and that you need to
move a group of people from one location
to another and to keep this simple let's
say that for now you only need to move a
group of three people for now Alice
Becky and Chris and for this purpose
let's say that you have booked two taxis
and you want to figure out who gets into
which taxi and you're also given some
information about who's friends with who
and whose enemies with who and here
let's say that Alison Becky of friends
Alice and Krys are enemies and Becky and
Chris are enemies as well and the goal
of this problem is to divide this group
of three people into the two taxis that
we have to achieve the following two
objectives the first one is to maximize
the number of friend pairs sharing the
same car and the second objective is to
minimize the number of enemy pairs
sharing the same car okay so this is the
basic premise of the problem let's first
think about how we would solve this
problem using a non quantum classical
computer first and then we'll come back
to solving this problem using a quantum
computer later now to solve this problem
using a classical computer you need to
first figure out how to store all the
relevant information with bits to do
that
let's first label the two taxis taxis
arrow and taxi one and then you might
decide to represent who gets into which
car with three bits these three boxes
representing those
it's and the first bit is gonna show
which car Alice gets into and the second
bit is gonna be for Becky and the third
bit is computed for Chris so for example
you might set these three bits to 0 0 1
to show that Alice gets into taxi 0
Becky gets into taxis there as well and
Chris is gonna be in taxi 1 and just
like that
you can represent all the possible ways
of dividing this group of three people
into the two taxis with just three bits
and if you want you can put all of those
possible ways into a single table just
like this one so just like we saw
earlier one possible combination of
these three values is 0 0 & 1 another
possible combination of these values is
if they all get into taxi 0 they would
all be 0 and just like that we can keep
populating at this table as you can see
right here there are 8 possible
configurations here and that makes sense
because there are three people here and
for each person there are two
possibilities and that's why we have 2
to the power 3 or 8 way of dividing the
three people into the two taxis now
using a classical computer how can we
determine which of these configurations
is the best solution well in order for
us to do that we'll first need a
concrete way of measuring how well each
of these configurations achieves the two
following objectives that we saw earlier
and they were first maximize the number
of friend pairs sharing the same car and
then also minimizing the number of enemy
pairs sharing the same car and we
remember that we were given a summary
information about the relationships
between these three people so again the
question is how can we measure how well
each of these configurations achieves
the two objectives one way of doing this
is by defining a single score that we
can compute for each of these
configurations and this course should be
made so that the better
each of these configurations achieves
the two objectives the higher the score
becomes
now there is a number of different ways
of defining such a score but here is one
simple way of doing it the score of a
given configuration is defined as the
number of friend pairs sharing the same
car in that configuration minus the
number of enemy pairs sharing the same
car so this way we're basically
incorporating both of these two
objectives into a single score so if we
have a lot of friend peers sharing the
same car in that particular
configuration we're doing well on the
first objective so the score will be
higher but if we have a lot of enemy
pairs sharing the same car at the same
time we'd be doing poorly on the second
objective so the score will be lower so
in order for us to maximize this score
ideally we need to achieve these two
objectives at the same time okay so for
example if Alice Becky and Chris all get
into the taxi zero that can be expressed
as zero zero zero in these three bits
and what's the score of this one well
there is only one friend pair and that's
sharing the same car that's Alison Vicky
so the first part of this equation will
be one and there are two enemy pairs
sharing the same car that's Becky and
Chris as well as Alice and Krys as
sharing car number zero so the second
part of this equation will be two so the
total score of this particular
configuration let's call it s will be 1
minus 2 which is equal to minus 1 now
given this set up all we need to do now
is we just need to find the
configuration with the highest score and
that's going to be our answer and to do
that with a classical computer we'll
need to compute the score for each
configuration one by one sequentially so
first set the three bits we have to 0 0
0 and then compute the score for that
which as we saw earlier is minus 1 and
then set the same 3 bits to 0 0 1 this
time and then compute the score for that
and that's going to be 1 and just like
that
we'll need to go through all of these
configurations one by one sequentially
after computing all of that you see that
there are actually two best solutions
here with the highest score that there's
our one with the score one and one one
zero with the score of one and here you
might notice that there's actually one
simple optimization step that you can
make here and that is you actually don't
have to look at all the configurations
to find the best solution you only need
to look at exactly half of them but just
to keep this whole argument as simple as
possible we're gonna continue our
discussion with this brute force
solution of looking at all the possible
configurations for now anyway even
without the optimization step this
problem is pretty simple to solve
because there are only eight values to
compute here but as we increase the
number of people in this problem this
problem quickly becomes too difficult to
solve with a classical computer so let's
quickly see why that's the case here
when we have three people in this
problem like we saw earlier we needed to
compute two to the power three or eight
values for eight possible configurations
what if there are four people in this
problem then the number of
configurations that we need to consider
becomes 2 to the power 4 or 16 so if we
keep going like that if there are n
people in this problem we need to
consider 2 to the power n values without
that optimization step so now just
consider increasing this problem size to
100 people so it's sort of like trying
to divide 100 people into two buses and
once you have that you would need to
consider 2 to the power of 100
configurations to solve this problem
exactly and that's about equal to 10 to
the power of 30 or 1 million million
million million million configurations
and that's simply impossible to solve
with an on quantum classical computer
because it would just take too long now
how can we solve this problem using a
quantum computer to think about that
let's go back to the case of trying to
divide three people into two taxis like
we saw earlier there were 8 possible
solutions to this problem and with a
classical computer
using three bits we were only able to
represent one of these configurations at
a time for example at 0 0 & 1 but what
if we had a quantum computer with three
qubits represented by these three boxes
then what we can do is we can set each
of these qubits to be one on there at
the same time and I'm gonna use this
symbol to denote that it's set to one on
there at the same time so we can do that
with all of these three qubits and once
we do that these three qubits together
are actually representing all of these
eight possible solutions all at the same
time personally I think it's a pretty
strange notion that these three qubits
are able to represent all of these eight
possible configurations all at the same
time and there are debates as to what it
means exactly but here's the way I think
about it first
let's examine the first qubit out of
these three qubits and let's say that
that qubit is set to one on there at the
same time right now
then what's funny about this qubit is
that if we try to measure what the value
of this qubit is it turns out to be 0
50% of the time and it turns out to be 1
the other 50% of the time these
percentages might be a little bit
different depending on your particular
environment but let's just say that in
our current environment and this is 50%
anyway as soon as we measure the value
of this qubit it turns out to be either
0 or 1 but until we measure it it's in
both of those states at the same time 0
& 1 now what if we have two qubits that
are both set to 0 and 1 at the same time
then when we try to measure the values
of these two qubits these turn out to be
one of these 4 outcomes 0 0 0 1 1 0 or 1
1 and each of these outcomes would
appear with the Eco probability of 25%
and here just like the previous case of
having just one qubit
as soon as we measure the values of
these two cubits they turn out to be one
of these four states but until we
measure them they're in all of these
four states all at the same time and
what if we have three cubits just like
that each of which is in the states of 1
& 0 at the same time and then those
three cubits together would be in all of
these 8 states at the same time until we
measure them and so that's why three
cubits together is able to actually
represent all of these eight possible
configurations all at the same time
again I think it's kind of strange that
it's possible for us to even have
something like that but it is possible
and that's how a real quantum computer
works too now when you apply some sort
of competition on these three qubits in
a quantum computer and the results from
all of these eight possible
configurations are computed all at the
same time so with a quantum computer you
don't need to compute the score for each
of these states one by one sequentially
you can just apply the function that
turns each of these states into a single
score that we define earlier on these
three qubits and then the quantum
computer will be able to find one of the
best solutions in a matter of
milliseconds now if you actually wanted
to solve this problem using a quantum
computer you will need two things now
the first one is of course you need a
quantum computer with at least three
qubits so that you'll be able to
represent these three values a B and C
and then the other thing you need is the
function that turns each of these
potential configurations into a single
score and in our particular case we had
this equation that we saw earlier and
this equation was defined with the
relationships that we were given earlier
as well and to solve this problem you
will need to convert this function with
the data that's associated with it into
a format your chrono computer will be
able to understand and if you wanted to
solve a different problem all you need
to do
is you need to change this function to
fit that particular problem and the data
that's associated with it and convert
that new set of information into a
format your quantum computer will be
able to understand now in theory your
corner computer should be able to find
one of the best solutions of a human
problem every single time it runs but in
reality there are some errors associated
with it and it doesn't necessarily find
one of the best solutions every single
time and these errors are caused by
physical limitations so for example if
this problem was a much bigger problem
with a lot more people let's say 100
people then every time you run the same
operation on your quantum computer it's
possible that it will find the best
solution which might be for example
right here but it could also find the
second best solution the third best
solution or the fourth best solution and
sewn and these errors become worse as
the problem becomes more and more
complex or in this particular case as
there are more and more people in this
problem so in practice if you're trying
to solve a complex problem like this one
with a quantum computer it's probably
best to run the same operation dozens of
times or maybe even hundreds of times
and pick the best result out of the many
results that you get now
even with this error the quantum
computer does not suffer from the same
scaling issue as a classical computer
suffers from so for example if you
wanted to solve this particular problem
with 100 people with a con on computer
then what you would need to do is you
will need to just set one hundred qubits
into both 1 and 0 and then apply the
function that turns each of these
potential solutions into a single score
on those one hundred qubits and then
your corner computer would essentially
compute the score for all of those at 2
to the power of 100 potential solutions
all at the same time and it would be
able to find a good solution although
not necessarily the best solution
okay so I think a natural question here
would be to say is a quantum computer
actually better at solving this
particular problem now let's say with
100 people the answer is actually
unfortunately it's unclear and that's
just because you know the brute force
solution that we saw earlier with a
classical computer that's not
necessarily the only plausible solution
for this problem and there are other
optimization techniques that you could
use with a classical computer when you
compare the performance of those with
the performance of the state of art
quantum computer today it's actually
unclear which one performs better but I
still wanted to talk about this
particular example because I still think
it's a good simple example to illustrate
and explain how quantum computing works
okay and what about practical
applications well historically speaking
we haven't seen quantum computers being
used on a wide scale yet but I think
it's possible that it would change
sometime soon
because we're just starting to see a
very small subset of problems where
corner computers actually outperform
classical computers for example
according to one expert I spoke to there
are some promising results in what's
called quantum simulation and there are
some efforts to use quantum computers in
other problem areas to for example
circuit fault diagnosis and certain
types of chemical analysis anyway in
case you're curious about any of that
I'm gonna put links to relevant articles
in the description below and I'm also
gonna put a link there to D waves cloud
environment where you can actually try
using a quantum computer yourself using
Python anyway that's it for this video
thank you as always for watching my
videos and I'll see you guys in the next
one