If you want a high-level explanation of quantum teleportation, read this article.
Quantum teleportation is a technique for transferring quantum information from a sender at one location to a receiver some distance away.
Let's say Alice wants to send a message to Bob. Specifically, suppose she wants to send the qubit state |𝜓⟩=𝛼|0⟩+𝛽|1⟩.
According to the "no-cloning" theorem, you cannot make an exact copy of an unknown quantum state. Therefore, Alice cannot generate a copy of |𝜓⟩ and send the copy to Bob as we cannot copy a superposition of state. However, if we were transmitting classical information, we can do this task of copying and sending the bits.
If two classical bits and an entangled qubit pair is used, Alice can transfer her state |𝜓⟩ to Bob. This is called quantum teleportation as at the end Bob will have |𝜓⟩ and Alice will not anymore. Quantum teleportation is important because this is the only way Alice can send information to Bob and not violate the law of conservation of information.
We will import the libraries:
Since the quantum teleportation protocol uses 3 qubits, and 2 classical bits (stored in different registers), we will initialize the Quantum Registers and make our teleportation circuit.
A third party, Eve, needs to create an entangled pair of qubits. She will give one to Bob and one to Alice. The pair Eve creates is a special pair called a Bell pair. In order to create a bell pair between two qubits she must first transfer one of them to the X-basis (|+⟩ and |−⟩) using a Hadamard gate( the default basis used in Qiskit is the computational basis), and apply a CNOT gate onto the other qubit controlled by the one in the X-basis. The CNOT gate is a binary gate that is applied on two qubits that is the way used to create an entangled pair. We will write code to create a circuit and apply the CNOT gate.
Alice needs to apply a CNOT gate to 𝑞1 , controlled by |𝜓⟩ (the qubit she sends to Bob which is q0). Then Alice applies a Hadamard gate to |𝜓⟩.
Next, Alice applies a measurement to both qubits that she owns, 𝑞1 and |𝜓⟩ , and stores this result in two classical bits. She then sends these two bits to Bob as we know that this will not violate the no-cloning theorem.
Bob, who already has the qubit 𝑞2, applies quantum gates based on bits he receives
00 →→ Identity
01 →→ Apply 𝑋 gate
10 →→ Apply Z gate
11 →→ Apply 𝑍𝑋 gate
We will initialize Alice's qubit in a random state |𝜓⟩ . This state will be created using an Initialize gate on |𝑞0⟩ . First, we will create a random state function.
Define initialization gate to create |𝜓⟩ from the state |0⟩ :
Now, we will call all the functions we have created so far and test our quantum teleportation protocol.
Quantum teleportation is designed to send qubits between two parties.
On a real quantum computer, we would not be able to use the state-vector, so to check teleportation circuit is working, we need to do things slightly differently. You will remember that we used Initialize to turn our |0⟩ qubit into the state |𝜓⟩
Since all quantum gates are reversible, we can find the the inverse of Initialize using:
Plot the histogram of the results:
We can see that we have a 100% chance of measuring 𝑞2 (the leftmost bit in the string) in the state |0⟩ . This is the expected result, and indicates the teleportation protocol has worked properly.