Learn/Teleportation
Intermediate10 min read

Quantum Teleportation

Transfer quantum states instantly using entanglement - the foundation of the quantum internet.

The Protocol

  1. Alice and Bob share an entangled pair
  2. Alice performs a Bell measurement on her qubit + the message
  3. Alice sends 2 classical bits to Bob
  4. Bob applies corrections based on those bits
  5. Bob's qubit now has the original quantum state!

The Code

teleport.ql
# Quantum Teleportation
QUBIT msg, alice, bob
m1 = 0
m2 = 0
result = 0
 
# Prepare message in superposition
H(msg)
 
# Create entangled pair
H(alice)
CNOT(alice, bob)
 
# Bell measurement
CNOT(msg, alice)
H(msg)
 
MEASURE msg -> m1
MEASURE alice -> m2
 
# Bob has the teleported state
MEASURE bob -> result

Understanding the Results

The 3-bit outcome is m1 m2 result. Bob's qubit shows ~50% 0 and ~50% 1 - the original superposition was teleported!

m1 m2Bob's Correction
00None needed
01Apply X gate
10Apply Z gate
11Apply X then Z

Real-World Applications

  • Quantum Internet - Connect quantum computers globally
  • Quantum Key Distribution - Unhackable encryption
  • Distributed Quantum Computing - Share quantum states between processors

Try It Yourself

python qubitlang_cli.py run teleport.ql --shots 10000Request Files