Malcolm Low | Practical AI, Computing & Quantum Research

Singapore-based practical guides, tutorials and experiments in AI, computing, modelling, simulation, optimisation and quantum computing, with research notes and hands-on workflows.

,

Superdense Coding Explained: 2 Bits in 1 Qubit Qiskit Guide

Yes, 1 qubit sends 2 bits with shared entanglement. Without it, the Holevo bound caps one qubit at 1 classical bit. See the 4 Pauli gates & Qiskit circuit →

·

Written by

Module 3b in the Quantum Computing: A Complete Learning Path series. Following directly from Two-Qubit Entanglement & The 4 Bell States (Module 3) and bridging the transition to Quantum Teleportation (Module 9) and the CHSH Game Simulator (Module 15).
QUANTUM SERIES 2026 • PROTOCOLS & ENTANGLED CHANNELS
Superdense Coding Explained: Transmitting 2 Classical Bits Using 1 Physical Qubit in Qiskit 2.x

In classical information theory, transmitting two bits of information (such as 00, 01, 10, or 11) strictly requires sending two physical signals. If you have only a single physical wire or send a single classical pulse, the laws of physics dictate that you can transmit at most one bit of data. In quantum information theory, a celebrated theorem known as Holevo’s Bound (1973) proved that an isolated single qubit can likewise communicate at most one bit of classical information.

Yet, in 1992, physicists Charles Bennett and Stephen Wiesner discovered a startling loophole: if the sender and receiver share an entangled pair of qubits beforehand, the sender can physically transmit just one single qubit and deliver two full classical bits with 100% deterministic accuracy. This protocol is called Superdense Coding (or Dense Coding). In this guide, we break down the mechanics of superdense coding, demonstrate how Alice transforms the shared Bell pair using local Pauli gates, step through the complete Dirac ket expansions for Bob’s decoder across all four cases, clarify the measurement mapping and Qiskit register conventions, and verify the protocol using Qiskit 2.x with circuit diagrams.


1  ·  The Communication Limit: Holevo’s Bound vs. Entanglement

To appreciate why superdense coding is remarkable, we must first understand the fundamental limit on quantum communication:

Holevo's Bound (Without Entanglement):
1 Transmitted Qubit → At most 1 Accessible Classical Bit

Superdense Coding (With 1 Pre-Shared Bell Pair):
1 Transmitted Qubit → Exactly 2 Accessible Classical Bits

Even though a single qubit pure state |ψ⟩ = α|0⟩ + β|1⟩ contains continuous complex amplitudes α and β (an infinite amount of theoretical mathematical parameters), any measurement causes the qubit to collapse into either |0⟩ or |1⟩. Therefore, a receiver without prior entanglement can never extract more than 1 classical bit of information from a single qubit.

How does superdense coding bypass this? It does not violate Holevo’s bound because entanglement acts as a physical communication resource. The two classical bits are not crammed into the single transmitted qubit alone. Instead, the transmitted qubit acts as an address key that unlocks the correlation already stored in the shared two-qubit entangled system.

2  ·  The 4-Step Protocol: Alice, Bob, and Charlie

The superdense coding protocol unfolds across four sequential stages between three actors: a source (Charlie), the sender (Alice), and the receiver (Bob):

  1. Step 1 — Entanglement Distribution: Charlie prepares an entangled Bell pair |Φ+⟩ = ( |00⟩ + |11⟩ ) / √2. He sends qubit 0 (q0) to Alice and qubit 1 (q1) to Bob. Alice and Bob can now be arbitrarily far apart.
  2. Step 2 — Alice’s Local Encoding: Alice wants to send a 2-bit message m ∈ {00, 01, 10, 11}. She applies a single local Pauli gate (I, Z, X, or ZX) to her qubit q0 only. She never touches Bob’s qubit.
  3. Step 3 — Physical Transmission: Alice sends her single physical qubit q0 over a quantum communication channel (such as an optical fiber) to Bob.
  4. Step 4 — Bob’s Bell Basis Decoding: Bob now holds both qubits (q0 and q1). He runs the Bell Basis Decoder (a CNOT gate followed by a Hadamard on q0) and measures both qubits in the computational basis, reading Alice’s 2-bit message with 100% deterministic certainty.
Superdense Coding Protocol Overview Circuit Diagram - Entanglement and Bell Basis Decoder

Figure 1: The complete Superdense Coding protocol showing Entanglement Preparation, Alice’s Local Encoding, and Bob’s Bell Basis Decoder.

3  ·  The 4 Encoding Operations: Ket Expansions and Measurement Mechanics

In Module 3 (The 4 Bell States), we established that the 4 Bell states form an orthonormal basis for two qubits. Alice’s brilliance in superdense coding is that by applying only local single-qubit gates to her half (q0) of |Φ+⟩, she can steer the joint two-qubit state into any one of the four orthogonal Bell states.

To understand precisely why and how Bob’s decoder unravels the message, let us follow the complete step-by-step Dirac ket expansion for each case. We denote the joint two-qubit state as |q0 q1⟩, where qubit 0 (q0) belongs to Alice (and is later sent to Bob) and qubit 1 (q1) was held by Bob from the start.

Case 1: Message 00 — Identity Gate I

Alice leaves her qubit untouched (applies Identity I). The joint state remains the original Bell state |Φ+⟩:

Superdense Coding Message 00 Circuit Diagram - Identity Gate

Figure 2: Superdense coding for message 00 (Identity gate on q0 → Bob measures 00).

Step 1 (Entangled Bell State):
|ψ0⟩ = ( |0⟩0|0⟩1 + |1⟩0|1⟩1 ) / √2 = |Φ+⟩

Step 2 (Alice encodes m = '00' via I on q0):
|ψ1⟩ = (I ⊗ I) |ψ0⟩ = ( |0⟩0|0⟩1 + |1⟩0|1⟩1 ) / √2 = |Φ+⟩

Step 3 (Bob's CNOT with control q0, target q1):
For |0⟩0|0⟩1: control is 0 → target q1 unchanged → |0⟩0|0⟩1
For |1⟩0|1⟩1: control is 1 → target q1 flipped (1→0) → |1⟩0|0⟩1
|ψ2⟩ = ( |0⟩0|0⟩1 + |1⟩0|0⟩1 ) / √2 = [ ( |0⟩0 + |1⟩0 ) / √2 ] ⊗ |0⟩1 = |+⟩0 |0⟩1

Step 4 (Bob's Hadamard on q0):
Since H|+⟩ = |0⟩:
|ψ3⟩ = (H ⊗ I) |ψ2⟩ = (H ⊗ I) ( |+⟩0 |0⟩1 ) = ( H|+⟩0 ) |0⟩1 = |0⟩0 |0⟩1

Step 5 (Measurement):
Measure q0 → c[0] = 0
Measure q1 → c[1] = 0
Output bitstring c[1]c[0] = "00" (100% deterministic)

Case 2: Message 01 — Pauli-Z Gate Z (Phase-Flip)

Alice applies a phase-flip Z gate to q0. Notice how the phase flip travels through Bob’s Hadamard to resolve on q0:

Superdense Coding Message 01 Circuit Diagram - Pauli-Z Gate Phase Flip

Figure 3: Superdense coding for message 01 (Z gate on q0 → Bob measures 01).

Step 1 (Entangled Bell State):
|ψ0⟩ = ( |0⟩0|0⟩1 + |1⟩0|1⟩1 ) / √2 = |Φ+⟩

Step 2 (Alice encodes m = '01' via Z on q0):
Since Z|0⟩ = |0⟩ and Z|1⟩ = −|1⟩:
|ψ1⟩ = (Z ⊗ I) |ψ0⟩ = ( |0⟩0|0⟩1 − |1⟩0|1⟩1 ) / √2 = |Φ−⟩

Step 3 (Bob's CNOT with control q0, target q1):
For |0⟩0|0⟩1: control is 0 → target q1 unchanged → |0⟩0|0⟩1
For −|1⟩0|1⟩1: control is 1 → flips q1 (1→0) → −|1⟩0|0⟩1
|ψ2⟩ = ( |0⟩0|0⟩1 − |1⟩0|0⟩1 ) / √2 = [ ( |0⟩0 − |1⟩0 ) / √2 ] ⊗ |0⟩1 = |−⟩0 |0⟩1

Step 4 (Bob's Hadamard on q0):
Since H|−⟩ = |1⟩:
|ψ3⟩ = (H ⊗ I) |ψ2⟩ = (H ⊗ I) ( |−⟩0 |0⟩1 ) = ( H|−⟩0 ) |0⟩1 = |1⟩0 |0⟩1

Step 5 (Measurement):
Measure q0 → c[0] = 1  (Phase flip detected on q0!)
Measure q1 → c[1] = 0
Output bitstring c[1]c[0] = "01" (100% deterministic)

Case 3: Message 10 — Pauli-X Gate X (Bit-Flip)

Alice applies a bit-flip X gate to q0. The bit-flip is transferred to Bob’s qubit q1 during the CNOT gate:

Superdense Coding Message 10 Circuit Diagram - Pauli-X Gate Bit Flip

Figure 4: Superdense coding for message 10 (X gate on q0 → Bob measures 10).

Step 1 (Entangled Bell State):
|ψ0⟩ = ( |0⟩0|0⟩1 + |1⟩0|1⟩1 ) / √2 = |Φ+⟩

Step 2 (Alice encodes m = '10' via X on q0):
Since X|0⟩ = |1⟩ and X|1⟩ = |0⟩:
|ψ1⟩ = (X ⊗ I) |ψ0⟩ = ( |1⟩0|0⟩1 + |0⟩0|1⟩1 ) / √2 = |Ψ+⟩

Step 3 (Bob's CNOT with control q0, target q1):
For |1⟩0|0⟩1: control is 1 → flips q1 (0→1) → |1⟩0|1⟩1
For |0⟩0|1⟩1: control is 0 → target q1 unchanged → |0⟩0|1⟩1
|ψ2⟩ = ( |1⟩0|1⟩1 + |0⟩0|1⟩1 ) / √2 = [ ( |0⟩0 + |1⟩0 ) / √2 ] ⊗ |1⟩1 = |+⟩0 |1⟩1

Step 4 (Bob's Hadamard on q0):
Since H|+⟩ = |0⟩:
|ψ3⟩ = (H ⊗ I) |ψ2⟩ = (H ⊗ I) ( |+⟩0 |1⟩1 ) = ( H|+⟩0 ) |1⟩1 = |0⟩0 |1⟩1

Step 5 (Measurement):
Measure q0 → c[0] = 0
Measure q1 → c[1] = 1  (Bit flip detected on q1!)
Output bitstring c[1]c[0] = "10" (100% deterministic)

Case 4: Message 11 — Both Gates ZX (Bit & Phase Flip)

Alice applies both Z (phase-flip) and X (bit-flip) on q0:

Superdense Coding Message 11 Circuit Diagram - ZX Gate Bit and Phase Flip

Figure 5: Superdense coding for message 11 (Z followed by X on q0 → Bob measures 11).

Step 1 (Entangled Bell State):
|ψ0⟩ = ( |0⟩0|0⟩1 + |1⟩0|1⟩1 ) / √2 = |Φ+⟩

Step 2 (Alice encodes m = '11' via Z then X on q0):
After Z: ( |0⟩0|0⟩1 − |1⟩0|1⟩1 ) / √2
After X: |ψ1⟩ = ( |1⟩0|0⟩1 − |0⟩0|1⟩1 ) / √2 = −| Ψ−⟩

Step 3 (Bob's CNOT with control q0, target q1):
For |1⟩0|0⟩1: control is 1 → flips q1 (0→1) → |1⟩0|1⟩1
For −|0⟩0|1⟩1: control is 0 → target q1 unchanged → −|0⟩0|1⟩1
|ψ2⟩ = ( |1⟩0|1⟩1 − |0⟩0|1⟩1 ) / √2 = −[ ( |0⟩0 − |1⟩0 ) / √2 ] ⊗ |1⟩1 = −|−⟩0 |1⟩1

Step 4 (Bob's Hadamard on q0):
Since H|−⟩ = |1⟩:
|ψ3⟩ = (H ⊗ I) |ψ2⟩ = (H ⊗ I) ( −|−⟩0 |1⟩1 ) = −( H|−⟩0 ) |1⟩1 = −|1⟩0 |1⟩1 ≡ |1⟩0 |1⟩1  (global phase of −1 is unobservable)

Step 5 (Measurement):
Measure q0 → c[0] = 1  (Phase flip detected on q0!)
Measure q1 → c[1] = 1  (Bit flip detected on q1!)
Output bitstring c[1]c[0] = "11" (100% deterministic)

ⓘ Understanding the Circuit Measurement Stage & Qiskit Ordering Conventions

When inspecting the circuit diagrams for the 4 cases, readers frequently ask two key questions:

  • Why do all 4 circuit diagrams show identical numbers (0 and 1) at the measurement block?
    In Qiskit circuit diagrams (both text and graphical), the numbers 0 and 1 on the double-line classical bus (c: 2/ === 0 === 1 ===) represent classical register slot indices (c[0] and c[1]), not the measured bit values! In all 4 circuits, the measurement instruction is identical:
    qc.measure([0, 1], [0, 1]). This directs the outcome of physical qubit q0 into slot c[0], and q1 into slot c[1]. A circuit diagram is a static structural schematic of operations; dynamic runtime measurement results (such as 00, 01, 10, or 11) appear only upon state execution.
  • The Little-Endian Bitstring Convention (Why ’01’ and ’10’ look flipped vertically):
    In Qiskit, classical registers and computational basis kets are ordered little-endian:

    Bitstring = c[1] c[0]

    Notice that c[0] (measured from q0) is the least significant bit (rightmost bit), while c[1] (measured from q1) is the most significant bit (leftmost bit).

    • For message 01: q0 (top wire) = |1⟩ and q1 (bottom wire) = |0⟩. Looking vertically top-to-bottom looks like (1, 0), but formatted as c[1]c[0] it produces "01".
    • For message 10: q0 (top wire) = |0⟩ and q1 (bottom wire) = |1⟩. Looking vertically top-to-bottom looks like (0, 1), but formatted as c[1]c[0] it produces "10".
    • For 00 and 11: Both qubits are identical (|00⟩ or |11⟩), so reading top-to-bottom or in Qiskit bit order yields the same result.

In summary: Alice’s phase-flip gate (Z) directly controls the state of q0 (the right bit), while Alice’s bit-flip gate (X) activates Bob’s CNOT to flip q1 (the left bit).

Superdense Coding Protocol Truth Table

Target Message Alice’s Local Gate & Encoded Bell State Post-Decoder State & Measurement
00 Gate: I (None) → Encoded: |Φ+⟩ Decoded: |00⟩ · c[0]=0, c[1]=0
01 Gate: Z (Phase-Flip) → Encoded: |Φ−⟩ Decoded: |01⟩ · c[0]=1, c[1]=0
10 Gate: X (Bit-Flip) → Encoded: |Ψ+⟩ Decoded: |10⟩ · c[0]=0, c[1]=1
11 Gate: Z then X (Bit & Phase) → Encoded: |Ψ−⟩ Decoded: |11⟩ · c[0]=1, c[1]=1

4  ·  Why Superdense Coding Cannot Transmit Faster Than Light

A natural question arises: If Alice applies her encoding gate immediately on qubit 0, does Bob instantly receive her message across the universe?

Can Bob read Alice's message before receiving her qubit?
Answer: NO. Bob's qubit in isolation is in a Maximally Mixed State (|r| = 0).

As we established in Module 3, as long as Bob holds only qubit q1 in isolation, his reduced density matrix is identical regardless of which gate Alice applied:

  • If Alice applies I: Bob’s local state is 50% |0⟩, 50% |1⟩ (pure noise)
  • If Alice applies Z: Bob’s local state is 50% |0⟩, 50% |1⟩ (pure noise)
  • If Alice applies X: Bob’s local state is 50% |0⟩, 50% |1⟩ (pure noise)
  • If Alice applies ZX: Bob’s local state is 50% |0⟩, 50% |1⟩ (pure noise)

No measurement Bob performs on his own qubit alone can reveal any information about which gate Alice selected! Zero information is transmitted until Alice physically transports qubit q0 across space to Bob. Because the physical transmission of a qubit is bounded by the speed of light c, Einstein’s causality is rigorously preserved.

5  ·  The Quantum Resource Duality: Superdense Coding vs. Teleportation

Superdense coding and Quantum Teleportation (Module 9) form the fundamental dual pillars of quantum communication. They represent the exact reciprocal exchange rate between quantum and classical channels:

Feature Superdense Coding (Module 3b) Quantum Teleportation (Module 9)
Objective Transmit 2 classical bits Transmit 1 unknown quantum state
Pre-Shared Resource 1 shared Bell pair (|Φ+⟩) 1 shared Bell pair (|Φ+⟩)
Channel Transmitted 1 physical qubit (quantum channel) 2 classical bits (classical radio/fiber)
Information Exchange 1 e-bit + 1 qubit → 2 classical bits 1 e-bit + 2 classical bits → 1 qubit

In both protocols, 1 Bell pair (1 e-bit of entanglement) acts as a currency that doubles the power of the transmitted channel!

6  ·  Complete Qiskit 2.x Python Implementation

Below is the complete, self-contained Python script implementing Superdense Coding in Qiskit 2.x. The script defines the parameterized circuit for any 2-bit string and verifies that all four messages decode with 100% deterministic fidelity using statevector simulation:

import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector

def build_superdense_circuit(message: str) -> QuantumCircuit:
    """
    Builds an end-to-end Superdense Coding circuit in Qiskit 2.x.
    
    Parameters:
        message (str): A 2-bit string, one of '00', '01', '10', '11'.
    
    Returns:
        QuantumCircuit: The full 2-qubit circuit with encoding and decoding.
    """
    qc = QuantumCircuit(2, 2)
    
    # --- PHASE 1: PRE-SHARED ENTANGLEMENT (Charlie) ---
    qc.h(0)
    qc.cx(0, 1)
    qc.barrier(label="Bell Pair")
    
    # --- PHASE 2: ALICE'S LOCAL ENCODING (on qubit 0) ---
    if message == "00":
        qc.id(0)          # Identity: do nothing
    elif message == "01":
        qc.z(0)           # Phase-flip: |Phi+> -> |Phi->
    elif message == "10":
        qc.x(0)           # Bit-flip:   |Phi+> -> |Psi+>
    elif message == "11":
        qc.z(0)
        qc.x(0)           # Bit & Phase: |Phi+> -> -|Psi->
    else:
        raise ValueError("Message must be '00', '01', '10', or '11'")
        
    qc.barrier(label="Alice Transmits q0")
    
    # --- PHASE 3: BOB'S BELL BASIS DECODER ---
    qc.cx(0, 1)
    qc.h(0)
    qc.barrier(label="Bob Decodes")
    
    # Measure both qubits into classical register
    qc.measure([0, 1], [0, 1])
    return qc

# --- SIMULATION & VERIFICATION OF ALL 4 MESSAGES ---
print("=== Superdense Coding Simulation (Qiskit 2.x) ===\n")

test_messages = ["00", "01", "10", "11"]

for msg in test_messages:
    # Build circuit without measurement for exact statevector analysis
    qc = build_superdense_circuit(msg)
    qc_no_meas = qc.remove_final_measurements(inplace=False)
    
    sv = Statevector(qc_no_meas)
    probs = sv.probabilities_dict()
    
    # Format non-zero probabilities
    formatted_probs = {k: round(float(v), 2) for k, v in probs.items() if v > 1e-6}
    
    print(f"Target Message Sent : '{msg}'")
    print(f"Bob's Decoded State : {formatted_probs}")
    print(f"Verification Status : {'PASS (100% Certainty)' if msg in formatted_probs and formatted_probs[msg] == 1.0 else 'FAIL'}")
    print("-" * 45)

Execution Output:

=== Superdense Coding Simulation (Qiskit 2.x) ===

Target Message Sent : '00'
Bob's Decoded State : {'00': 1.0}
Verification Status : PASS (100% Certainty)
---------------------------------------------
Target Message Sent : '01'
Bob's Decoded State : {'01': 1.0}
Verification Status : PASS (100% Certainty)
---------------------------------------------
Target Message Sent : '10'
Bob's Decoded State : {'10': 1.0}
Verification Status : PASS (100% Certainty)
---------------------------------------------
Target Message Sent : '11'
Bob's Decoded State : {'11': 1.0}
Verification Status : PASS (100% Certainty)
---------------------------------------------

Key Insights & Takeaways:
  1. Entanglement Doubles Classical Capacity: With one pre-shared Bell pair, transmitting 1 physical qubit transfers 2 classical bits deterministically.
  2. Local Gates Steer Global States: Alice applies local Pauli operations (I, Z, X, ZX) to her qubit alone, yet changes the joint entanglement basis into one of the 4 orthogonal Bell states.
  3. Deterministic Bell Decoding: Bob applies CNOT (converting bit correlations to qubit q1) followed by Hadamard (converting phase correlations to qubit q0), perfectly disentangling the state into product eigenstates.
  4. Qiskit Ordering vs Wire Layout: In Qiskit, bitstrings are ordered little-endian (c[1]c[0]). The top wire (q0) stores the right bit (LSB), and the bottom wire (q1) stores the left bit (MSB).
  5. No FTL Communication: Bob gains zero bits of information until Alice’s physical qubit arrives through space. Causality is strictly maintained.
  6. The Teleportation Duality: Superdense coding trades 1 qubit for 2 classical bits; quantum teleportation trades 2 classical bits for 1 qubit.

Continue the Quantum Series


Quantum Series 2026  ·  Built with Qiskit 2.5  ·  Tested on Android Termux  ·  malcolmlow.com

Comments

Leave a Reply