- [Elisa] Okay.
So let's continue with entanglement.
I already talked a tiny bit about it.
We've seen already one Bell state.
The definition is that
if we have a pure state
and I'm on purpose
talking about pure state,
because I mentioned before
that, then it simplifies,
if we have a pure state
on the systems A and B.
And if this pure state cannot be written
as some state via A then
some other state on B,
then it isn't entangled.
Well, as I said before,
this was actually the
definition of correlated.
But I mentioned when we have pure states
that are correlated,
they're always entangled.
Well for mixed state could
be a difference, but yeah.
If you cannot write it like this,
and if you have a pure state,
it means it is entangled.
And then a very specific
or very special states,
entangled states are the
so-called Bell states.
We have four of them.
And so these states are very special
because they're maximally entangled.
And they build an orthonormal basis.
So that the fact that
they're maximally entangled
is something that I cannot
explain you in detail now,
but just there's first, there's
some tests that one can do
to check entanglement for
some of the most famous one
is the so-called Bell tests,
where we can make some measurements
and look at some statistics
and then calculate some values.
And we can do that with classical states.
And we know that for classical
states we have bound,
in this case, the most famous Bell test
which is the CHSH inequality.
We know that there's a bound of two.
But then when we do look at
maximal entangled states,
or in general entangled states,
there can be above that value
and the maximal entangled
states are states
that violate the (indistinct)
inequality maximally.
So they get the highest possible value,
in this case they would get
two times square root of two,
which is not too important,
but just it's states
that's under some kind of measures.
There's different
measures for entanglement
that we can definitely
not discuss them now.
But if we use these measures
and we have the highest possible value
then this is what we call
maximal entanglement.
But yeah, don't worry about it too much.
I'll give you the definition
of those four Bell states.
The first one is psi zero, zero,
that's the one that you have already seen.
For normalization we have
one over square root of two.
And then we have zero, zero plus one, one.
Then the next one that we have
is the state psi zero, one.
It's given by zero, one plus one, zero.
So in this case, second bit
is flipped, or the first one.
Then we have the state psi one, zero.
Where we have zero, zero minus one, one.
And as you can easily check,
they all orthogonal to each other.
And then we have psi one, one,
and here we have zero,
one minus one, zero.
Now a nice way to write them in general,
which is something that we will use
for the teleportation protocol.
It's very handy to know how
to write it in this form.
If I look at the state psi, I, J,
so I and J can both be
now either zero or one.
But in general, I can write it as,
identity acting on the first qubit.
So I'm not doing anything
with the first qubit.
And on the second qubit,
depending on weather, on my values
I and J, I apply sigma X to the power J
and sigma Z to the power I.
So if I have something to the power zero,
if I is zero, I have
sigma Z to the power zero
which is just identities,
I'm not applying.
If it's zero, it means I'm
not applying that gate.
If the value is one, it means
I am applying that gate.
And then applying on the
state psi zero, zero.
So for example, if I have
the state psi one, zero,
that means that i equals
one, J equals zero.
So I'm only applying the gate sigma Z.
If I apply sigma Z,
that means I'm getting
instead of a plus one,
I'm getting a minus one.
So I have this minus phase here.
And if I apply, for example an X gate,
then I'm having a bit flip here.
So I'm changing this and this.
I think you can easily
check that this is true.
And now maybe an example
that I would like to give you though.
For example,
the first Bell state is a
state where we can tell that,
whenever I do a measurement,
and I measure that the first
qubit is in the state zero
then this means that the state collapses
and the output will be zero, zero.
If however our measure ring stayed one,
then I know immediately
that the state collapses to one, one.
So immediately know that the
output on the second qubit
will also be one.
And for the state psi
zero, one it's the same,
but with opposite numbers.
So I know for the state, if I
have the state psi zero, one,
and I'm measuring the
first qubit, and it's zero.
I know immediately that the
second qubit will be one,
and the opposite way.
This is a very strong
correlation because I always,
one party always knows
after measuring this state,
what the state of the other party is,
even if the party's far away.
However, this is not yet something
that happens only in quantum mechanics.
Actually,
I can also have such kind
of correlation, classically.
For example, if I let's
say I have two cards,
one black card and one red card.
And I give one card to one person
and one card to the other person.
Now if one person looks at their card,
they immediately know what the
card of the other person is,
and the opposite way.
So because they know there was
one black and one red card.
Once they look at their card,
they immediately know the other one.
So this is an example
now of a classical state.
However, the difference is that
this would be a mixed state.
This would be a mixed state.
We would be either in 01 or in 10,
but we would not be in a superposition.
And to just very quickly
mention why this is different,
is that, so the state psi
zero, zero for example,
that I looked at now,
it can be written as
zero, zero plus one, one.
So whenever I measure
in the zero, one basis,
and that gets zero for one,
I will get zero for the other one as well.
However, I can also
write it as plus, plus,
plus, minus, minus.
So the strong correlation
holds actually for every basis
that I wanna write the state in,
I will always have the strong correlation.
So even if I do an X measurement,
if party A measures their qubit,
they know immediately what party B has.
Which is something that, okay classically,
it's not hard to make an analog,
but maybe if I have two cards,
if I have the black and red card,
measuring in a different
basis would be okay.
I have something that can tell me
whether this card is blue or green.
And well, in this case it would just
output randomly one of the two colors
because it's neither red nor black,
and then I would not learn anything
about the other state as well.
So entanglement is a
very strong correlation.
I just wanted to make sure that this fact
that both have zero and both have one
it's not a purely
quantum mechanical thing.
But if we talk about pure states,
then this only happens
in quantum mechanics.
Anyway.
So we have this very strong
correlation called entanglement,
and we have these Bell
states, but the question's
how do we create now
all these Bell states?
So let's look at the
creation of Bell states.
I will write you down a circuit
and claim that this circuit
gives me the Bell state or any Bell state.
So I apply a Hadamard gate,
which you have learned already.
And then I apply a CNOT gate,
which you have also already seen.
And I claim that now,
if I do these two gates,
I will get the state psi i, J.
Given that i and J are either zero or one.
So let's very quickly make a
table to see that this is true.
So the initial state i, J,
when I have one of the four
basis states zero, zero.
Zero, one.
One, zero.
Or one, one.
And then I'm applying a Hadamard
gate on the first qubit.
So mathematically I would write,
Hadamard gate on A times identity on B,
because at the same time, what
I'm just doing, going here,
I'm not doing anything on my qubit B.
Apply to i, J.
So if I look at the first qubit,
what I have here is I have zero.
I had the first state,
00 turns into 00 plus 10.
Because the first qubit
gets in a superposition
of zero plus one.
And the second qubit stays in zero.
The same, for the initial state zero, one.
The first qubit gets
again in a superposition
of zero and one, zero plus one.
While the second qubit
stays in the state one.
Now, if I have the state
one on the first qubit,
it would get into a
superposition of zero minus one.
While the second qubit in
this case stays is state zero.
And then the last case, we
also get the first qubit
gets into a zero minus one,
and the second qubit stays in states one.
Then we apply the CNOT gate,
controlled on A acting on B.
And then I'm claiming
I'm getting psi i, J,
the CNOT gate we said
if the control qubit,
so that in this case, the first
qubit is in the state zero.
I'm not doing anything
with my second qubit.
But if it's in state one, I'm
flipping the second qubit.
So instead of one, zero,
I will get one, one.
Then in the second case,
always the first term here,
if the first qubit is in
zero, nothing happens.
If the first qubit is in
one, we flip the second one.
And also for the other two cases,
you would have the minus sign.
So they get that minus one, one.
And in the last case, we
get zero, one minus one.
And again, we have to flip, one, zero.
Which is exactly our
definition of the Bell states.
This would be psi zero, zero.
Psi zero, one.
Psi one, zero.
And psi one, one.
But now we also want to look
at the opposite direction.
If we just apply the
gates the other direction.
So first the CNOT gate,
and then the Hadamard gate.
This is then what we
call a Bell measurement.
Well, it includes also measurement then.
So if we have the state psi i, J.
And we apply first the CNOT gate,
and then the Hadamard gate.
And then just do a simple measurement
in the zero, one basis.
So this is just zero, one
measurement, a Z measurement.
Just can do the same
calculations as before,
but I'm just going backwards.
So if I had the state
psi zero, zero before,
and I'm applying first the CNOT gate
and then the Hadamard gate,
I would get the state, I would be here,
I would get the state zero, zero.
So the two measurement
outcomes that I'm getting
are just zero and zero.
If I have the state psi one, one,
I would measure one, one and so on.
So the classical outcomes,
by the way, this is why
I have two lines now,
one line, if I write
down quantum circuits,
one line corresponds
to a quantum, a qubit.
While two lines correspond
to classical bits,
or classical outputs,
outcomes in this time.
In this case so I have the
classical outcomes i and J,
and then they correspond to
a measurement of the state,
or it means that the state collapsed
to basically to psi i, J.
Because experimentally,
if I gave you one of the four Bell states,
but you do not know which one that is,
experimentally you can
usually just do measurements,
as I said before in the Z basis.
So you can just measure zero or one,
but you don't know, if
you just measure both
and both give zero you still do not know
whether you're in the psi zero, zero state
or the psi one, zero state, could be both.
And if you just do one single measurement
without applying gates before
you cannot tell which
Bell state I gave you.
In this case, however, you will always,
depending on what your
outcomes I and J are,
you know exactly which Bell
state you were in before.
So yeah, this is the way,
we then put a big box around it
and just call it a Bell measurement.
And that means exactly doing this,
as you will see in the
teleportation protocol.
Good, now time for questions.
- [Man] All right, so hopping
into our top rated question
that we have right now.
Can we only discriminate
orthogonal quantum states?
- [Elisa] So what we are looking at are,
we are looking at projective measurements
where we always project
onto orthogonal basis.
Sorry.
Project onto orthogonal
states that form a basis,
we can also look at POVM's,
Positive Operator Valued Measures.
Which is a generalization
where you can actually have,
for example, more different
outputs than the number
the dimension that you actually have,
so you can have also non-orthogonal,
you can project also
non-orthogonal quantum states.
This is something that we can just...
It's out of the scope of this lecture,
so we cannot discuss it here.
But if you're interested in that,
I would recommend to
look, just Google P-O-V-M.
- [Man] Great, thank you.
And for the sake of time,
we're gonna cap it at
one question for now.
- [Elisa] Yes, let's
continue with Teleportation.
Which is actually a thing and
not just the science fiction.
Not just science fiction,
but it actually is possible.
So the goal of our teleportation protocol,
is that we have two
parties, Alice and Bob.
And Alice wants to send
her possibly unknown.
Doesn't matter.
She might not know what state
it even is that she has,
but she has a state phi, which I call
and now I have the index S,
that's the state that
she wants to send to Bob.
Which is in sum, in general,
we just write it A times
zero plus B times one.
A could now be the, like, it
could both be complex numbers
so that we have general states.
So we have here the index
S and she wants to send,
she wants to send that state to Bob.
However, she can only send
him two classical bits.
And two classical bits,
even if she would know what her state is,
it would not be enough because
alpha can be any number
between zero and one.
So two bits would not be enough
to characterize any number.
So she can not just tell
him, "Hey, this is alpha,
"and this is beta."
But there is another way to do it,
because they both share the
maximally entangled state,
we just learned about.
Psi zero, zero.
On Alison and Bob, so
that's another qubit.
Both have one part of this state.
One qubit of this entangled state.
So that's the state
zero, zero plus one, one.
Which could have been created in theory,
long time in the past.
And then both of them
got one of the qubits
and traveled away with them,
and are not now in
different parts on earth,
or one is maybe even on the moon.
Of course, experimentally
not so feasible, but yeah,
theoretically, this could have happened
long time in the past and they just,
but they still share this
maximally entangled state.
Now the initial state,
that the way we can,
I would give you very
soon the protocol of how
a teleportation works,
but basically what it comes
down to is just describing
the initial state of the total system.
So if I look at all three qubits together,
so I have my system S
which is in the state phi,
the one that I want to send,
and then I have my state psi zero, zero,
the Bell state that Alice and Bob share.
And now I want to write
this state, the total state,
the global state of the whole system.
So I have alpha,
which comes from the phi times 000.
So if I multiply both of the states
if you can just see it on
top, then multiply them both,
what I get is alpha times 000,
on SAB, plus alpha times 011,
plus beta times 100,
and then plus beta times 111.
This is not that helpful yet though.
What we wanna to do is we
wanna rewrite it a bit.
And this is how we can then read off
how teleportation works in the end.
So I wanna show you, I wanna just give you
now a slightly more
complicated way to write down
this initial state, but you will see,
you can check later if you want to,
but this is actually the same
status in the line above.
So I'm basically just adding
and removing some terms,
or actually just adding for now terms.
But you can see that some of
these terms cancel, maybe.
So, for example now,
if you look at the term that I just wrote
and the term right above that.
Screen is back.
If you look at what I just
wrote and the term above,
you can see that we have two times
the term of 000, alpha times 000.
But then we also have
this additional two here
in the prefactor.
So that's the same term as we had before.
But then we have, for
example, the term 110,
we have it once with a plus,
and once with a minus sign,
so it will cancel out.
So it's just a different
way of writing it,
but it disappears if the terms all cancel.
And the last terms that I
have are zero, one on S and A
minus one, zero,
times one minus beta times zero.
Okay.
Now the reason I wrote it this way
is because we can write
it yet another way,
by noting that the first state
zero, zero plus one, one,
that is exactly our Bell
state psi zero, zero.
However, now not an AB but
this is the Bell state,
but on S and A.
And similarly,
when we have alpha times
zero, plus beta times one,
then this is exactly the state phi.
Maybe Brian you wanna
scroll up a tiny bit so
that they can still see the
definition of the state phi.
Yes, there we go.
Hey, they might remember, but yeah.
So this is our state phi,
but now it's actually the
state phi on B because we,
I mean, we didn't do anything
we just rewrote it and
this is on system B.
Now the second part,
what we can notice is
that this is now the state
phi zero, one, the Bell
state on S and A tensor
and on B we have alpha times
one plus beta times zero,
which is very similar to the state phi,
but the bits are flipped.
So it's the same as
applying the sigma X gate
towards state phi on B.
And we flip the bits and
then we get the state phi.
Now the third part, we can
write as psi one, zero, SA,
and we can tell again, the
state looks very similar,
but it has a phase flip.
So we have sigma Z apply to phi.
And the last term we
have psi one, one, SA.
And in the last part we
have sigma X times sigma Z,
times phi it's both the phase
and the bit set up flipped.
Good.
So this is still the initial system,
the initial state of our total system.
We did not do anything yet,
but just rewrote the initial state.
I mean, this is of course
now a superposition
so we would not be able to
measure any of that yet.
Well, if we measure
something, it will collapse.
But this is exactly, well it's
exactly what we're gonna do.
So now I'll give you the protocol.
So we have our two party's,
Alice and Bob that are
spatially separated,
but that's share the initial
state phi zero, zero.
So one goes to Alice, one goes to Bob.
Now Alice has in addition
to her state phi,
which is the one that she
wants to teleport to Bob.
Now what she does,
she has these two qubits
and she in the first step,
she performs a Bell measurement
on those two states.
A Bell measurement is
what we have just seen.
That's first applying the
CNOT gate and Hadamard gate
and then measuring in the Z basis.
Then she gets two outputs, i and J
and she sends those two
classical bits to Bob.
And depending on what the output is,
Bob applies sigma X to the power J,
and Sigma i to the power
i, sigma Z to the power i.
And then the claim is
that then the final state
that Bob gets is state
phi, on Bob's system.
So let's look at in a table
write down what we're doing.
So in our first step Alice measures
on S and A in the Bell basis,
that's the first step.
I'm gonna have to scroll down
and up a couple of times,
I hope that delay is not too bad.
So let's say if Alice
does a Bell measurement,
that means she knows that she
measured either psi zero, zero
or psi 101
or one of the four Bell
measurements, Bell states.
Let's say she measured
the state psi zero, zero.
We can have a look now
at the initial state.
The initial state, the last line,
the last two lines on how
we wrote the initial state.
We wrote it as a superposition of these
four different Bell states,
times something similar to phi.
These four Bell states are orthogonal.
So if you measure one,
we know that the whole
system will actually collapse
to that state times,
whatever we have then on B.
So if Alice measures psi zero, zero,
then we know that immediately
that Bob state will be phi.
So we know that here we get phi.
If however, Alice measures
the state phi zero, one,
and with the same argument as before,
we know from the initial state,
that then Bob's state
will be sigma X times phi.
Okay.
And while we can do it for
the other two states as well,
if she mentioned psi one, zero,
Bob's state will be sigma Z, times phi.
And if she measures psi, one, one.
So if her two output
bits are just one, one,
she knows that Bob's state is
sigma X times sigma Z, times phi.
Then in a second step, Alice
sends her classical outputs,
i and J to Bob, because
Bob so far he didn't know,
even if Alice does the measurement,
he doesn't know which state he's in,
because he doesn't know what
the outputs of Alice were.
So in this second step,
she sends them to him.
So Alice sends i, J.
In the first case where
she measures psi zero, zero
is first data i, J are both
zero, when they are zero, one,
they would be 10 or 11,
just as we saw it in the Bell measurement.
And then in the third step,
Bob applies sigma Z to the power i,
times sigma X to the power J to his qubit,
and thereby gets the state phi.
So this is the third step.
So for now look at the table.
In the first case where Alice
just sends zero and zero,
Bob applies sigma Z to the
power zero times sigma X
to the power zero, which is just identity.
In the second case he applies sigma X.
In the third case sigma Z.
And in the last case
sigma Z times sigma X.
When we look back here
to what Bob's state was,
if he applies identity to the state phi,
the state stays in the state phi.
If he applies sigma X to the state,
which in this case was sigma X times phi.
Then we have sigma X times sigma X,
which we learned before.
It's two times the rotation
by 180 degrees so in the end,
they both cancel, we
have 360 degrees rotation
so basically identity,
which means that we have,
we also stay with our state
phi B, same holds for sigma Z.
And then the last case we have
sigma Z times X, times
sigma X, times sigma Z
so we can first take the middle
two write identity instead,
and then the other two.
So we will also get phi as final state.
So in any case, no matter
what Alice measured
after Bob then does his operation,
he will have the state phi.
One thing that we should note though,
is that Alice's state collapsed
during the measurement.
So she does not have the
initial state anymore.
I mean, we know that because
she did a measurement
and then what she got were
two classical outcomes.
When she does the Bell
measurement her state collapses,
and she will get either a 00 or 01
or one of the other combinations.
But she will not have
the state phi anymore.
This is something that
is actually expected
that has to hold because
of the no-cloning theorem.
The no-cloning theorem tells us that
if I give you an arbitrary state,
it's impossible for you to
copy any arbitrary state.
So she can not copy her state.
But if she wants to send it to Bob,
it means that she has to
destroy her own state,
or the state has to be destroyed
somehow in the process.
It's impossible that she just
copies it and sends it to Bob
because then they would both have it.
So she cannot copy her state,
but just send it to Bob when
she's destroying her own.
This is something that is
actually very nicely done.
And also in a very famous movie,
maybe some of you know
the movie "Prestige",
which is about two magicians
and one of them is teleporting himself.
And there's also very nicely done that
this person that is teleporting
himself always makes
basically copies himself somewhere else
but then the original version
of him dies each time.
And like, yeah,
so they nicely implemented
this no-cloning theorem.
Of course one has to note,
so this is now we call it teleportation,
but we do not actually
teleport any matter.
We only teleport the state.
You can also call it a state teleportation
because in the end,
it's the state that gets
teleported from Alice to Bob,
but she does not send him matter.
But still it's nice that this is possible.
And not only is that a
very theoretical concept,
but it has also been
experimentally implemented already
a couple of times by a couple
of different research labs
in China and I think the
biggest distance was actually
on the Canary islands
where they teleported for
over more than a hundred kilometers,
the state one state to the other, so yeah.
It's not only theoretically possible,
but even proven physics experimentally,
which is really nice.
Yeah, so now I would make the
next break for quick questions
before will then tell
you about the Q-sphere.
- [Man] We'll just jump
into one question here
while we have time the top voted one.
It's a pretty broad question,
but how do we measure the
given states physically?
- [Elisa] Yes, someone
gave a nice answer to that
and it depends a lot on the
physical implementation, yeah.
So it depends on whether you have,
which platform you look at,
whether you look at
superconducting qubits,
whether you look at iron traps,
whether you consider photons, NV centers.
There's a lot of different
platforms that you can use
for quantum computers to
implement quantum computers.
And I'm not an experimentalist.
So I must admit that I do not know
for each of these platforms
how exactly it works, but yeah.
You can have a look at some
textbooks or I think, yeah,
Nielsen and Chuang is a great textbook.
I can also highly recommend that one
that was mentioned there.
It depends (indistinct)
experimental implementation.
- [Man] One second to
just describe to people,
when you say you're not
an experimentalists,
what does that mean?
Like, what is your role?
And if they are interested
in that type of thing,
what should they get involved with?
- [Elisa] So my background is you mean?
- [Man] Just helping people understand
the difference in the roles.
- [Elisa] So I'm a PhD student
in quantum information theory.
So I'm doing theoretical research.
So I'm working on quantum computing
and quantum non-locality,
quantum thermodynamics.
So I'm trying to
understand quantum effects
for various different
systems, for example,
quantum networks how
entanglement there behaves
and what we can learn from that.
So I'm doing theoretical research,
which is different from experimentalists,
which are the ones that
are actually building
the quantum computers and that
are reading out the states
and that are, well then
proving all the things
that I theoretically
tried to derive basically.
- [Man] Perfect, thanks very much.
So let's dive into our
end of the lecture now.
- [Elisa] Yes, sorry.
We have to go very quickly now.
I'm sorry, I might take
a bit of extra time,
but I will try to be fast.
So the last topic is the Q-sphere.
Which I mentioned earlier
when we talked about the Qiskit logo.
So we know that the Bloch
sphere can only illustrate
the state of one qubit.
So if we have multiple qubits.
We use instead the Q-sphere.
But nevertheless even though I just said,
we use it for multiple qubits,
let's first look at how it
looks for one qubit, because
of course on the Q-sphere
we can plot it for,
illustrates an arbitrary number of qubits.
So we can also illustrate one qubit.
So let's start with some rules basically.
So the North pole,
I call it this way because
I'm sure everyone knows
what I mean if I'm talking about
the North pole of a sphere,
it represents the state zero.
While the South pole represents state one.
This is just as in the Bloch sphere.
However one really needs to be careful
to not mix those two up,
because everything else is very different.
And actually if we only look at one qubit,
we will have two at most two blobs.
So two like points on the sphere,
but they will always only be either up
either on the top or at the bottom.
Either North pole or South pole,
but they will not be anywhere else.
So even if we do some rotations,
as we did on the Bloch sphere,
if we apply Hadamard gate,
and then we go to the superposition state,
we've seen the second
(indistinct) looks like here,
but we will never be anywhere else
but on the top or on the bottom.
So we have these blobs
and the size of them
is proportional to the probability
of measuring the respective state.
And then what's different,
very different now,
especially from the
philosophy, first of all,
that we have different sizes,
but also we have different
colors of the blobs.
And these colors are the ones
that indicate the phases,
the are relative phases.
And we always compare it to state zero.
And so now I should actually
import very quickly a picture.
These are the (indistinct)
that you will get by the way.
Sorry, I should have
done that earlier, maybe,
but yeah, now here we go.
This is the diagram that tells
us which color corresponds
to which phase.
So let's do very quick some examples.
I have this sphere here.
If I wanted to show the
state zero, the state zero
I would just have one
blob on the North pole
as I just explained.
So this is state zero.
While here would be state one,
but there we have no block
because we're just in state zero.
If we're in state one,
we're in the South pole,
this is state one.
Then if we wanna, for example,
considered superposition state.
Let's say we consider one where
it's not equal probabilities,
but where we have, for example,
one over square root of
three times zero plus
one over square root of
two thirds times one.
Then we have two blobs now.
We have one blob on the top,
which has a smaller blob.
Then the one at the bottom,
because I told you that the
size of the blob is proportional
to the probability of measuring the state.
In this case,
we have a probability of two
third to measure the state
on the top, on the bottom
to measure the state one.
And we have a probability
of one third to measure
the state zero in the North pole.
So both blobs are also smaller
than the ones we were looking at before,
because here it was probability
one for each of the states.
And now we have this mixture,
now the superposition state.
And as a last example,
because so far I made all of them red
because they were all, none
of them had a relative phase.
First of all, if we look,
just look at a single state zero or one,
they have any way no
phase, no relative phase.
So we have zero relative phase.
But then also the third
example that I made,
I have a plus sign in between.
So it's just zero phases each
with a power zero basically.
So we have no phase here as well.
And now in this case we have,
so we have each with a
i phi equals minus one,
which means that here in this case,
because we have the minus one
phase, which means that phi,
our phase is 180 degrees, so it's pi.
Maybe here we should also, this is pi.
So I have the state on the top
and the state on the bottom
that in this case equally
likely because we have both of
them have equal...
Actually forgot the normalization factor.
So although both of them have probability
one have to be measured,
but one is blue and the other one is red.
Now I hope this is clear of
how it works with one qubit.
And now we can generalize
this for n qubits.
And so for n qubits we have
not only two basis states
as we had now, zero and one.
But for n qubits we have two
to the power N basis states.
For example if we have,
let us considered N equal to three,
then we have a number of different states,
which I just color a bit now.
So we have the states
000 as a basis state.
Then we have the state 001,
010 and 100.
And then we have the states 011
101 and 110.
And we have the state 111.
These are our eight basis states,
that we have when we look at three qubits.
And now we plot these basis states
as equally distributed states
as equally distributed points
on this sphere.
Well, we have zero to the power N.
In this case,
would be zero to the power
three is on the the North pole.
Before we had zero on the
North pole, now we have
zero to the power N on the North pole.
It's easy to remember.
And then we have the
state one to the power N
on the South pole.
And all other states,
are aligned on parallels.
So parallels are lines that
have the same latitude.
And we align them in a way
that the number of ones
on each latitude is constant,
and it's increasing from North to South.
And I will of course, give
you an example for that.
So we look at N equal to
three because that just,
gave you basis states for that one.
And I told you on the North pole,
we have the state 000.
On the South pole we have the state 111.
And now we have the other
states are on latitudes.
So on some lines here,
in this case,
we have two more lines, where we have,
a constant number of ones and increasing,
on the North pole we have zero ones.
Now, here we have the
states that have one, one.
So we have 001,
and the state 010.
And the state 100.
And then on the second latitude
or the second parallel,
we have those states that have two ones.
So we have the states 011
and 101, and 110.
As before in general, the size
and the color of the blobs,
are just as before.
So we again have the size
proportional to the probability.
For example,
if we look at the state one half times,
now I used the right colors, already 000,
'cause we always take the
color is depending on the
relative phase compared to our state zero
minus 011,
plus square root of
two, times i times 111.
If we look how the state looks like,
we have the probability of one quarter
to be in the state 000.
We have two lines because
we have three qubits.
Then we have the
probability also one quarter
to measure the state 011,
which would be somewhere on
this parallel, let's say here.
And it has a blob as small as the red one,
should be the same size.
And then we have the
probability of one half,
it's twice as big for the state 101,
which is also on this
parallel, let's say here,
and this one has a bigger blob.
So by the way,
the colors that I used before
here when I showed this,
they do not have anything
to do with phases.
I just wanted to show where
the different points lie,
for the different basis states.
There were no blobs it was
just showing some locations.
But now here in this, in the last example,
you will see the actual
colors that we use to show
the different states on the Q-sphere..
And now I would quickly like very quickly,
just a few minutes, show you
how this looks like in Qiskit.
Good.
So I'm on the IQX.
What I meant the IBM Quantum
Experience, which is very easy.
I can just create a notebook.
And now what I do in a first step,
I will very quickly go through
a bit of Qiskit code here.
Now first step I just
important NumPy because
I needed it later to use pi and so on.
Then I will import from
Qiskit Quantum Circuit,
'cause I want to create a quantum circuit
and I will import the state vector
and plotting the Q-sphere.
'Cause I just want to
show you the illustrations
of a Q-sphere with Qiskit.
Everything else you will learn,
you will learn much more
about quantum circuits
later in the labs.
Let's first start with one
qubit, such N equal to one.
Then I create a quantum
circuit on this one qubit,
and then I'm taking the state vector.
I'm getting the state vector
from my quantum circuit,
which I call QC.
So I'm getting this with this command.
I can print it.
So you see the state
vector in the beginning
and then I will plot it on the Q-sphere.
I first need to import of course.
Did not run the first line.
Sorry it's gonna take a few seconds.
Just taking long.
Okay.
So now we already see the state vector.
The state vector is just
given by one and zero.
So you see the plus zero
times J, which the J is the i,
the imaginary i, so don't be confused.
I don't know why it's J instead of i.
So we have this one plus i,
and the first entry on the state vector
and zero plus zero times i, so
just zero on the second one.
The state vector in the
beginning is just one, zero.
And we can see here on the Q-sphere
we just have the zero
state, the North pole.
Which is because we didn't do anything,
I just created a quantum
circuit with one qubit,
and that did not do anything on that.
Now what I can do instead is for example,
at this command here, by
the way the blue commands,
in case you're not familiar with that,
are things that I've commanded,
so they are not executed
if you put this symbol in front,
then it's gonna ignore that line.
So now I've added here
QC.h, on qubit zero.
I'm counting my qubits
from zero to N minus one.
So I'm applying a Hadamard
gate on my first qubit.
Applying the Hadamard gate means
that we're in an equal
superposition of zero and one.
So you can tell now we have a blob here
and a blob on the bottom
and the blobs both got a bit smaller
and when the equal super
position the phase is zero,
because both blobs are red.
And you can also tell the
state vector now change
to 0.707 which is one of
the square root of two.
And we have it here and
there both entrance.
Now what I can do is I
can increase my number
to plot the state on two qubits.
On two qubits the blob on
the top is the state 00 now.
Well this is now, we're
on the middle of parallel.
We have the states 01 and 10
because we applied
Hadamard only to one cubit.
We have one qubit that is in a
superposition of zero and one
and the other qubit that
is still in the state zero.
That's why we have that.
Now we learned before how
to create a Bell state.
So let's try that.
The Bell state means we
apply first the Hadamard gate
on state zero, for example,
and then the CNOT gate,
and CNOT because the NOT
gate is basically the X gate.
We read it as CX.
And so we have qc.cx where now
the zero is my control qubit.
I control on state zero, on qubit zero
and then I have the
target qubit as qubit one.
So if I apply this, I'm
gonna get the Bell state,
which is now,
now we can see we have a four
dimensional state vector.
And the first and the
last entries are both
one over square root of two,
which is just what we would expect.
And we can also see from the plot now,
if we plot the Q-spher here,
we get zero, zero on top
and one, one on the bottom
and we have an equal
superposition and both are red.
If however,
I apply another X gate in
the end to one of my qubits.
Then I will get the state 01 plus 10.
So I'm rotating the states
to this middle parallel,
because on this one we have 01 and 10,
and we're not anymore
on what we had before.
If instead of as an X gate I
for example apply a Z gate,
then this means that we
still have 00 and 11,
but now the phase changed.
The phase changed we have 00 minus 11.
So we have the phase of pi,
so this thing comes blue.
What we could also do is instead
of plotting the Q-sphere,
we could plot our circuit
just with qc.draw.
And then we see here, this is what we did.
We applied the Hadamard
gate, the CNOT gate,
and then the Z gate.
Now, if I want to increase I
could of course also do that
for more qubits, let's say for six qubits.
If I make a circuit on six qubits,
I would just have in the beginning,
I would just have one blob at the top
because it's all in zero.
But what I'm doing here
is I'm taking all qubits,
all N qubits, all six qubits
and apply a Hadamard gate
on each of them.
Which means that I get
in an equal superposition
of all the possible states
that we have on six qubits.
However, the Hadamard
gate acting on state zero,
which gives me always zero
plus one so I never have any
phase that is other than the zero phase.
So all points are still red.
This is maybe a nice
illustration of how we can see
that quantum computing, how it scales up,
because you can see already on six qubits
if I apply a Hadamard
gate to all six qubits,
I'm getting all those states.
Not to make it a bit more
colorful, I can apply a phase.
And now the phase this time
before I was just applying
the Z gate which is a
phase by pi by 180 degrees.
And I want to apply different phases.
And what I do here with
this line is I apply a phase
that is in this case two pi over six.
So it will be received two pi over six,
two pi is the full circle, two pi over six
if I applied once I will
be in the yellow part,
if I applied twice, I would be
in the green part, then blue,
bright blue, dark blue,
purple, and then red again.
What I do is I apply our Z gate,
so it will always be applied
to every one that I have.
And now on the first line, I have one,
I have other states like
0000001, that have one, one.
On the second line I have those
states that have two ones,
then three ones.
So what we see is if I plot this now,
I'm getting all the different nice colors.
I'm getting like a rainbow here,
'cause the first line has
one qubit in the state one.
And therefore rotation by pi
over six, two pi over six.
Then on the second line,
we have a rotation by two
pi over times two over six,
or two pi over three.
So we have a rotation by pi and so on.
And now as a very last thing,
I would like to show you the Qiskit logo
because we discussed it also earlier.
I know for the Qiskit logo,
it's actually a bit hard to interpret
how it's supposed to be,
about what it is supposed to be,
because we have these super small circuits
at the top and at the bottom.
And we were wondering
whether this is actually
just the North and the South pole,
or whether this is another parallel.
Now from our discussions
and with J and how it was
initially meant to be.
We figured out that
these two small circles
are opposed to be the
North and the South pole.
So it's just some designers
probably change it
to be a circle instead of a point.
But so what we can see is
we have three parallels.
So we know that we have
in total four qubits,
and then what we do in the beginning,
to get the state where we
have one line basically
going through the diameter of a sphere,
is by creating a GHZ state.
GHZ state means I apply
Hadamard gate one qubit,
and then I apply a CNOT
gate on every qubit,
always controlled on this first qubit,
which gives me a state 000
to the power six plus 11111.
So like the Bell state but a
generalized version of that,
which is what we call a GHZ state.
And so if I do this, then
I'm getting that state.
This is the GHZ state on four qubits.
So you see, we have the three parallels,
but there's no blobs on them
But now I want to move this
point to the first parallel.
And this point to the second last,
to the second last parallel,
which means that I need
to get one, one here
and one, zero here.
So I apply one X gate
on one of the qubits.
And if I do this, Oh, wait,
actually I want to apply to qubit one.
And I'm getting this,
which is as close as we
can get to the Qiskit logo,
'cause we only have four
points here that are here.
So we actually do not get this angle
if we use the Qiskit version
of plotting the Q-sphere.
This is basically what the
Qiskit logo is meant to be.
And yeah, with that,
I'm gonna be finished for today.
I'm looking forward to teach you much more
about quantum computing and
the basic algorithms tomorrow.
Like we're gonna talk about
the Deutsch-Jozsa algorithm
and the robust algorithm.
Tomorrow we will immediately
after doing the theory
for each of the quantum circuits,
we will directly show how to
implement that with Qiskit.
So it will be more Qiskit then today,
today it was just an introduction
and just got to see the very
basics for Qiskit.
