Intermediate10 min read
Quantum Teleportation
Transfer quantum states instantly using entanglement - the foundation of the quantum internet.
The Protocol
- Alice and Bob share an entangled pair
- Alice performs a Bell measurement on her qubit + the message
- Alice sends 2 classical bits to Bob
- Bob applies corrections based on those bits
- Bob's qubit now has the original quantum state!
The Code
teleport.ql
# Quantum TeleportationQUBIT msg, alice, bobm1 = 0m2 = 0result = 0 # Prepare message in superpositionH(msg) # Create entangled pairH(alice)CNOT(alice, bob) # Bell measurementCNOT(msg, alice)H(msg) MEASURE msg -> m1MEASURE alice -> m2 # Bob has the teleported stateMEASURE bob -> resultUnderstanding 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 m2 | Bob's Correction |
|---|---|
| 00 | None needed |
| 01 | Apply X gate |
| 10 | Apply Z gate |
| 11 | Apply 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