← Quantum Store · Guides · Lessons · Glossary · Packages · About · Türkçe
Communication and cryptography course: teleportation, BB84 and post-quantum encryption · Lesson 3 / 5 · 10 min
Superdense coding: two bits with one qubit
The mirror image of teleportation: sending two classical bits by sending a single qubit, thanks to previously shared entanglement. Encode and decode all four messages with Qiskit.
One qubit, two bits
When a single qubit is measured it gives only one bit of information; this limit is called the Holevo bound. But if Alice and Bob already share a Bell pair, Alice can send two bits by sending her half to Bob. Bennett and Wiesner proposed this protocol in 1992.
Encoding and decoding
Depending on the message Alice applies one of four operations to her qubit: nothing (00), X (10), Z (01) or X and Z together (11). These four operations turn the Bell pair into four different Bell states that can be told apart with certainty.
When Bob receives the qubit he applies a CNOT and an H to his two qubits; this is the reverse of the circuit that built the Bell pair. The measurement gives the message with certainty.
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
for msg in ['00', '01', '10', '11']:
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1) # Bell pair: q0 with Alice, q1 with Bob
if msg[0] == '1':
qc.x(0)
if msg[1] == '1':
qc.z(0) # Alice only touches her own qubit
qc.cx(0, 1)
qc.h(0) # Bob decodes both qubits together
probs = Statevector(qc).probabilities_dict()
print(msg, '→', max(probs, key=probs.get))
# 00 → 00
# 01 → 01
# 10 → 10
# 11 → 11
What does it teach?
Superdense coding gives no free information: a qubit was also sent to get the entangled pair to Bob. In total two qubits carry two bits. But the entanglement can be distributed in advance, for example at a quiet hour; after that one qubit is enough per message.
Teleportation and superdense coding are like mirror images: one carries a qubit with two classical bits and a Bell pair, the other carries two classical bits with one qubit and a Bell pair. Both show that entanglement can be spent like a resource.
Try it yourself
Alice encoded the message 11: X and Z. Remove the Z: the message becomes 10. Then remove the X too: 00. In every case Bob’s result is certain, with no randomness at all.
Open the circuit in your browserThe circuit playground is in Turkish. Button guide: “1000 kez ölç” = measure 1000 times, “Durum vektörünü göster” = show the state vector, “Bu devrenin Qiskit kodu” = this circuit’s Qiskit code, “Geri al” = undo, “Temizle” = clear. Click a gate in the circuit to remove it.
Key points
- Thanks to a shared Bell pair, two classical bits can be sent with a single qubit.
- Alice encodes the four messages into four different Bell states with X and Z gates.
- Bob decodes the Bell state with a CNOT and an H and reads the message with certainty.
- Teleportation and superdense coding are two mirror protocols in which entanglement is spent as a resource.
Test yourself
In superdense coding, how many classical bits does Alice send by sending a single qubit?
- 1
- 2
- 4
Show the answer
2. Thanks to the previously shared Bell pair, the single qubit Alice sends carries a two-bit message.
← Quantum teleportation: moving a state with entanglement · BB84: quantum key distribution that detects eavesdropping →