Quantum Teleportation

Teleportation does not work at all like the science fiction genre depicts it. Instead of physically moving one electron from point A to point B, this experiment instantly transfers information — the quantum state of an electron at point A — to an electron waiting at point B.

I added more comments to the code than I usually do, mostly to develop my own understanding of the experiment before I could blog about it. The code is inspired by IBM Q Experience, but I translated it from Qiskit (Python) to OpenQASM (Quantum Assembly Language).

OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
creg c[3];

z q[0];
h q[0]; // secret unitary: hz

// Alice starts with qubit 1.
// Bob starts with qubit 2.
// Alice is given qubit 0.
// Alice and Bob do not know what has been done to qubit 0.

barrier q; // Alice and Bob entangle their starting qubits.
h q[1];
cx q[1], q[2];

// Alice keeps qubits 0 and 1.
// Bob leaves with qubit 2.

barrier q; // Alice teleports the quantum state of qubit 0 to Bob's qubit.
cx q[0], q[1];
measure q[1] -> c[1];
h q[0];
cx q[1], q[2];
measure q[0] -> c[0];
cz q[0], q[2];

barrier q; // Based on Alice's measurements, Bob reverses the secret unitary.
// 00 do nothing
// 01 apply X
// 10 apply Z
// 11 apply ZX
h q[2];
z q[2];
measure q[2] -> c[2]

Alice and Bob each have their own personal qubit. Through quantum entanglement, Alice teleported the quantum state of a third qubit through her qubit to Bob’s qubit far away.

Depicted graphically, the experiment looks rather simple. Quantum teleportation occurs in the third block from the left, and success is confirmed in the last block. The first 2 blocks on the left are the setup.

It worked!

The leftmost digit is Bob’s qubit. The zeroes indicate that he successfully reversed the secret unitary.

However, the perfect result also indicates that this was run on a simulator. Next up: real hardware.

Although the histogram is not clear, the left half represents Bob’s qubit having a measurement of zero. Those probabilities are noticeably higher than the right half, where Bob’s qubit is incorrectly measured as one. Errors on real hardware result from imperfect measurements and residual heat.

So, wait, how exactly does a measurement of zero on Bob’s qubit prove anything?

To start, all 3 qubits are initialized to zero. In the first 3 blocks, no gates are applied directly to Bob’s qubit that are not related to quantum entanglement. Therefore, in block 4, anything done to Bob’s qubit would result in Bob’s qubit no longer being in its ground state.

However, all quantum operations are reversible. Block 1 applies a secret unitary on qubit 0. If you reverse the secret unitary on qubit 0, it would return to its ground state. Reversing the secret unitary on Bob’s qubit in block 4 and returning Bob’s qubit to its ground state confirms that Bob’s qubit successfully received the quantum state of qubit 0 in block 3.

4 Comments

Leave a comment