Skip to content

Protocol lab · reviewed 2026-10-25

Superdense Coding

Use a shared pair of qubits to send a two-bit message by sending only one qubit, then check that it decodes exactly.

  • Qiskit
  • OpenQASM 3

Recorded simulator example · open starter templates to create your own run. Open starter templates →

A modular teaching board with two glass paths, removable gates and two output tiles.
A small circuit. The whole experiment.
Qubits
2
Operations
8
Shots
4,096
  1. Share

    Create the Bell pair and hand one qubit to each party.

    visual circuit + operation list
  2. Encode

    Apply X and then Z on the sender's qubit to encode the message 11.

    encoding table
  3. Simulate

    Decode with CNOT and Hadamard, then execute 4,096 seeded shots on local Aer.

    complete counts + trace
  4. Review

    Compare the decoded bits with the message and state the pre-shared pair.

    evidence manifest

Workflow question

What this sample is testing.

Share a Bell pair between a sender and a recipient, let the sender encode the two-bit message 11 with an X and a Z gate on her qubit, decode with a controlled-X and a Hadamard, and verify that the recipient measures 11 on every shot of an ideal simulator.

Route rationale

Local Qiskit Aer simulator, no provider token required

Message 11 decoded on all 4,096 shots in a reviewer-safe result packet

Method

Create a Bell pair with a Hadamard on q0 and a controlled-X to q1; q1 stays with the recipient. The sender encodes the message 11 by applying X and then Z to q0, then sends q0 to the recipient. The recipient applies a controlled-X from q0 to q1, then a Hadamard on q0, and measures both qubits.

Run the generated Qiskit circuit on the local Qiskit Aer simulator for 4,096 shots with simulator and transpiler seed 2048. Store the circuit, source, complete counts, route note, and export manifest together.

How to read the result

For each of the four possible messages the ideal decode is deterministic. This sample sends 11, so all 4,096 shots return 11. The result to check is that the decoded bits equal the message, not the shape of a distribution.

The encoding table was checked on the same simulator for all four messages: doing nothing returns 00, X alone returns 10, Z alone returns 01, and X then Z returns 11. Bits are read as c1 c0, where c0 comes from q0 and c1 from q1.

Measured distribution

Complete seeded count table

4,096 shots

114,096100.00%

Complete ideal-simulator distribution. Engine Qiskit Aer 0.17.0; simulator and transpiler seed 2048. This static public fixture is not a live provider run.

Proof boundary

  1. The protocol needs a pre-shared entangled pair. The qubit count shown does not include the cost of distributing that pair, which is the hard part on real devices.
  2. An ideal simulator decodes without errors. On hardware, gate noise, readout error, and decoherence of the shared pair would produce wrong messages at a rate that must be measured.
  3. This is a seeded local simulation, not a live provider job, and it does not demonstrate a practical communication advantage.

Generated representations

Inspect the source behind the counts.

The public code is a review fixture. Provider credentials, workspace members, billing context, and private notes stay excluded.

Qiskit circuit

Python
from qiskit import QuantumCircuit

qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.x(0)
qc.z(0)
qc.cx(0, 1)
qc.h(0)
qc.measure([0, 1], [0, 1])

OpenQASM circuit

OpenQASM 3
OPENQASM 3;
include "stdgates.inc";
bit[2] c;
qubit[2] q;
h q[0];
cx q[0], q[1];
x q[0];
z q[0];
cx q[0], q[1];
h q[0];
c[0] = measure q[0];
c[1] = measure q[1];

Evidence manifest

JSON
{
  "workflowId": "QF-SAMPLE-SUPERDENSE",
  "runner": "qiskit-aer",
  "artifacts": [
    "encoding-table.md",
    "generated-qiskit.py",
    "generated-openqasm.qasm",
    "counts.json",
    "trace.json"
  ],
  "privateFieldsExcluded": [
    "providerCredentialId",
    "userEmail",
    "billingState",
    "adminNotes"
  ]
}

What the reviewer receives

  • encoding-table.md
  • generated-qiskit.py
  • generated-openqasm.qasm
  • counts.json
  • trace.json

Explicitly excluded

  • providerCredentialId
  • userEmail
  • billingState
  • adminNotes

Questions this record answers

Workflow FAQ

Does superdense coding send two bits with one qubit?

In a specific sense, yes: one qubit travels after encoding. But the two parties must already share an entangled pair, so the entanglement is a prepaid resource.

Why does the sample send the message 11?

It uses both the X and the Z gate, so every part of the encoder is visible. The other three messages decode the same way and were checked on the same simulator.

Is this a faster or better way to communicate?

No. It is a small protocol demonstration. It does not show a practical communication advantage, and it needs a shared entangled pair that has to be distributed first.