Transcription
Okay, let's build the quantum teleportation circuit. So, the way this works is Alice and Bob get together, and they entangle two qubits, qubit one and Q2. Then Bob takes qubit 2 and goes to a different physical location. Alice keeps q1. So, the idea is that Alice wants to send q0 to Bob by sending it through qubit one, and because qubit one is entangled with qubit 2, Bob will get it, uh, on qubit 2.
So, um, we can see right now that qubit zero is initialized to zero, and we get the same output. We get the same value, the same state in qubit 2 as the output. And similarly, if we flip q0 to po1, U2 also flips to be a one. And we could also put q0 into a superposition of states, and that, uh, makes it so that Q2 is a superposition of states. And so this, so basically any value that Alice puts into q0, Bob will get in Q2.
Now, there's a couple of things to note about this. Um, first of all, uh, we were, so we aren't, we're not violating the no-cloning theorem. So this isn't cloning, this is teleportation, uh, because ultimately we need to measure q0, which collapses the wave function and destroys any information. And we need to do that because Q2 can come out as one of four different state vectors. And so, depending on the measurements of q0 and q1, we need to relay that information to Bob so that he can perform the correct operations to obtain the correct, uh, state vector. Um, and so it's also important to notice that this is not instantaneous because Alice needs to send this, these classical measurements to Bob, and that gets sent through a classical channel, which is limited by the speed of light and things like that. So it's not instantaneous, and we're not cloning, but it is teleportation.
So let's go ahead and build this. The first thing that we need to do is we need to, I'm going to delete qubit 3 because we don't need it, but we need to entangle q1 and Q2. And we do that, uh, by putting a Hadamard on q1 and then a controlled-NOT on Q2 with q1 as the control. And this puts q1 and Q2 into what is known as the Bell state. There's actually four different Bell states, but this is the, uh, this is the one that we're going to use. And we can see down here at the bottom, the probabilities, qubit 1 and qubit 2 are both either zero zero or they are one one. So if we measure one of the qubits, we automatically know the value of the other qubit because they're entangled. So that's the first step.
The next thing I'm going to do is I'm going to put a phase disk on here so we can just see the input value of q0. And then I'm going to create another partition.
Okay, so the next thing we need to do is we need to put a controlled-NOT on Q qubit one with, uh, q0 as the control. And then we need to put a Hadamard on q0. Um, I'm going to put another barrier here. And then the last thing that we need to do is we need to measure q0 and q1 so that we can inform Bob what operations he needs to perform because, uh, like I said, Q2 can be one of four values, and we need to make sure we pick the correct one. And I'm thinking that I might make a separate video detailing the math and why we need to do this, basically showing the math behind quantum teleportation, but that will probably be in another video. So, um, yeah, the first thing we want to do is we want to do a rotation around the x-axis, and we're going to rotate pi radians. And we only want to rotate if q1, which is the control, if we measure a value of one. So if we measure a one, then we want to perform this operation, this rotation.
Next, finally, we need to perform a Z rotation or a Z rotation depending on if q0 is a one. So we're going to do that. It's a rotation of pi with q0 as the control, and we only want to run, we only want to do the rotation if we measure a one.
Okay, so that's it. This is the quantum teleportation circuit. Sometimes, uh, IBM Composer is a little bit slow. We can see that q0 doesn't match up with Q one or Q2. So I'm just going to refresh the page and, uh, hopefully this works. Hopefully we can. Okay, there we go. Um, so now q0 is the same as Q2. And again, if we flip q0 to 1, um, that will flip U2 to be a one, uh, at least it should. There we go. It's a little slow. And then we can also put a zero in a superposition of one and zero, and we can see that Q2 also becomes a superposition of the zero and one.
So, um, lastly, what I want to do is, IBM Composer generates OpenQASM code, and it also generates Qiskit code. So I'm going to copy the Qiskit code and run it in a Jupyter notebook. So this is Google Colab. It's basically a Google-hosted Jupyter Python notebook. And the first thing I did was install Qiskit. If you type `!pip install qiskit` and then hit Shift+Enter, you will, you know, it'll install Qiskit. I've already done that, so I'm going to paste this code here. Um, you might get this message telling you that `phase_disk` is not an allowed annotation. Just ignore that for now. And we're going to do `circuit.draw()` Shift+Enter, and this will draw the quantum teleportation circuit that we had, we just built. Uh, you can see that the phase disk is missing, but aside from that, it's, uh, everything is there.
So, uh, yeah, that's pretty much it. Um, that's how you build a quantum teleportation circuit. Uh, and I, I think I'm probably going to go into the math a little bit in another video, showing basically how all of these, these, uh, these logic gates and these operations, show them, show what they're doing and a little bit more mathy detail. So that's it.