Lesson 10 of 15

Quantum Teleportation

Quantum Teleportation

Quantum teleportation transmits an unknown qubit state ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle from Alice to Bob using only a pre-shared Bell pair and 2 classical bits of communication.

Crucially, no quantum channel is used after the setup — only classical communication. The quantum information "teleports" because the entanglement carries the correlations.

The Protocol

Setup: Alice and Bob share the Bell pair Φ+=00+112|\Phi^+\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}}.

Step 1 — Bell Measurement: Alice performs a joint measurement on her target qubit and her half of the Bell pair. This projects onto one of four Bell states, yielding two classical bits (m0,m1)(m_0, m_1).

Step 2 — Classical Communication: Alice sends (m0,m1)(m_0, m_1) to Bob.

Step 3 — Correction: Bob applies Xm1Zm0X^{m_1} Z^{m_0} to his qubit.

Bob's State Before Correction

(m0,m1)(m_0, m_1)Bob's qubit
(0,0)(0, 0)$\alpha
(0,1)(0, 1)$\beta
(1,0)(1, 0)$\alpha
(1,1)(1, 1)$-\beta

Applying the Correction

The XX gate swaps amplitudes; the ZZ gate negates the second:

  • m1=1m_1 = 1: swap αβ\alpha \leftrightarrow \beta
  • m0=1m_0 = 1: negate β\beta

After both corrections, Bob always holds the original ψ|\psi\rangle.

import math

def teleport_correction(bob_state, m0, m1):
    alpha, beta = complex(bob_state[0]), complex(bob_state[1])
    if m1:
        alpha, beta = beta, alpha   # X gate
    if m0:
        beta = -beta                # Z gate
    norm = math.sqrt(abs(alpha)**2 + abs(beta)**2)
    return [alpha / norm, beta / norm]

def teleport(state):
    alpha, beta = complex(state[0]), complex(state[1])
    sq2 = 1 / math.sqrt(2)
    raw = [alpha * sq2, beta * sq2]
    norm = math.sqrt(abs(raw[0])**2 + abs(raw[1])**2)
    return [raw[0]/norm, raw[1]/norm]

result = teleport([1, 0])
print(round(abs(result[0]), 4))  # 1.0
print(round(abs(result[1]), 4))  # 0.0

No-Cloning Theorem

Teleportation does not violate the no-cloning theorem: Alice's original qubit is destroyed by her Bell measurement. The state is transferred, not copied.

Your Task

Implement two functions:

  1. teleport_correction(bob_state, m0, m1) — applies Xm1Zm0X^{m_1} Z^{m_0} to Bob's 2-element state list, then normalizes.
  2. teleport(state) — simulates the deterministic (0,0)(0,0) outcome path, returning the normalized recovered state.
Python runtime loading...
Loading...
Click "Run" to execute your code.