Beam Me Up: Simulating Quantum Teleportation

Project Overview:

Quantum teleportation does not move matter or energy across space the way science fiction implies, it transfers the exact quantum state of one particle onto another distant particle, using entanglement plus a small amount of ordinary classical communication. In this project you will build a real quantum circuit that takes an unknown qubit state and teleports it onto a second qubit, then verify the teleportation actually worked, all inside a simulator.

Materials Required:

A computer with internet access

A free Google account, to use Google Colab, no installation needed

Basic comfort reading Python

Background: How Quantum Teleportation Actually Works

Alice has a qubit in some unknown state she wants to send to Bob. She cannot simply measure it and tell Bob the result, because measuring a quantum state destroys the very superposition that makes it special, and she would only learn a partial answer anyway.

Instead, Alice and Bob first share a pair of entangled qubits, one each, created before the protocol starts. Alice then performs a joint measurement combining her original qubit with her half of the entangled pair. This measurement produces one of four possible classical outcomes, two ordinary bits of information, which she sends to Bob over a normal classical channel, a phone call or the internet, nothing quantum required for this part.

Depending on which two bits Bob receives, he applies one of four simple fixes to his half of the entangled pair. After applying the correct fix, Bob's qubit is now in the exact original state Alice's qubit was in, even though his qubit never directly touched Alice's. The original qubit on Alice's side is destroyed in the process, which is required by a rule called the no cloning theorem, quantum states cannot be copied, only moved.

Step by Step Instructions

Set up your notebook.

Go to Google Colab at colab.research.google.com and create a new notebook.

Install Qiskit.

Type the following into a code cell and run it:

pip install qiskit qiskit-aer

Prepare the qubit you want to teleport.

We will teleport a specific, recognizable state so it is easy to check later. Qubit 0 is the one being teleported, qubits 1 and 2 are the entangled pair shared between Alice and Bob.

from qiskit import QuantumCircuit

from qiskit_aer import AerSimulator

qc = QuantumCircuit(3, 3)

qc.h(0)

qc.barrier()

Create the entangled pair between Alice and Bob.

Qubit 1 belongs to Alice, qubit 2 belongs to Bob.

qc.h(1)

qc.cx(1, 2)

qc.barrier()

Alice performs her joint measurement.

This combines the qubit she wants to send with her half of the entangled pair.

qc.cx(0, 1)

qc.h(0)

qc.measure(0, 0)

qc.measure(1, 1)

qc.barrier()

Bob applies his fix based on Alice's results.

These are the corrections that depend on Alice's two measured bits.

qc.cx(1, 2)

qc.cz(0, 2)

qc.barrier()

Measure Bob's final qubit to check the teleportation worked.

qc.measure(2, 2)

print(qc.draw())

Run the circuit and check the results.

simulator = AerSimulator()

result = simulator.run(qc, shots=1000).result()

counts = result.get_counts()

print(counts)

Interpret your output.

The rightmost bit in each result represents Bob's final qubit. Since we started qubit 0 in a superposition using a Hadamard gate, Bob's qubit should also land as roughly half 0 and half 1 across your runs, matching the same superposition the original qubit had, confirming his qubit now carries the teleported state, not just a random guess.

Stretch step, teleport a different state.

Change step 3 by replacing qc.h(0) with qc.x(0) to prepare qubit 0 in a definite state of 1 instead of a superposition. Rerun the whole circuit and confirm Bob's final qubit now reads 1 almost every time, showing the teleportation correctly carries over whatever state you started with.

Congratulations, you just simulated real quantum teleportation, the same protocol that has been experimentally demonstrated between labs, across cities using fiber optic cables, and even between ground stations and orbiting satellites.

Fun Fact:

Quantum teleportation has already been achieved over genuinely long distances, including a 2017 experiment where Chinese researchers teleported a qubit's state from the ground up to the Micius satellite orbiting roughly 500 kilometers overhead, the same satellite used for quantum key distribution experiments.

Previous
Previous

Through the Wall: Modeling Quantum Tunneling

Next
Next

Schrödinger's Cat: Build Your Own Quantum Cat Simulator