Superdense Coding

Updated: 18/11/2025

Interested in learning how to program quantum computers? Then check out our Qiskit textbook Introduction to Quantum Computing with Qiskit.

What is Superdense coding ?

Superdense coding is a quantum communications protocol that allows a user to send two classical bits by sending only one qubit.

The protocol

Circuit diagram showing the Superdense coding protocol

Circuit diagram showing the Superdense coding protocol

Step 1: Preparing the Bell pair

First a bell pair consisting of two qubits is prepared where q0 is the senders qubit and q1 is the receivers qubit. In order to create a bell pair a Hadamard gate is applied to q0 followed by a CNOT operation where q0 is the control and q1 is the target.

For more information on bell pairs see our primer on bell states here: https://quantumcomputinguk.org/tutorials/introduction-to-bell-states

Step 2: Encode the information on to q0

Next the sender has to encode the information they want to send on to q0 by applying certain operations to it.

  • If they want to send 00 then they perform no operation.

  • If they want to send 01 then they apply a Pauli-Z gate

  • If they want to send 10 then they apply a Pauli-X gate.

  • If they want to send 11 then apply a Pauli-Z gate followed by a Pauli-X gate

Step 3: Receiver decodes the information

Next q0 is sent and once received has to be decoded in order to retrieve the information. This is done by applying a CNOT where q0 is the control and q1 is the target. Next a Hadamard gate is applied to q0 and both qubits are measured.

Device used

This tutorial uses the Qiskit Aer simulator in order to run the circuit. Note that results from this simulator contain no errors unlike on real quantum devices which are prone to noise.

More information on Qiskit Aer can be found here: https://qiskit.github.io/qiskit-aer/tutorials/1_aersimulator.html

In order to use to a real quantum device follow the steps here: https://quantum.cloud.ibm.com/docs/en/guides/initialize-account

Note: This program requires that you have an API token. To get one sign up to IBM Q Experience and get your token here: https://quantum-computing.ibm.com/account

Code

from qiskit import QuantumCircuit, transpile, ClassicalRegister, QuantumRegister
from qiskit_aer import AerSimulator

def executeCircuit(circuit, backend, shots=1024):

    result = backend.run(circuit,shots=shots).result()
    counts = result.get_counts(circuit)
    print('RESULT: ',counts) # Print result 


backend = AerSimulator() # Using local Aer simulator  

q = QuantumRegister(2,'q') 
c = ClassicalRegister(2,'c')  

#################### 00 ########################### 
circuit = QuantumCircuit(q,c)  
circuit.h(q[0]) # Hadamard gate applied to q0 
circuit.cx(q[0],q[1]) # CNOT gate applied 
circuit.cx(q[0],q[1])  
circuit.h(q[0])    
circuit.measure(q,c) # Qubits measured 

executeCircuit(circuit, backend, shots=10)                                 

#################### 10 ########################### 
circuit = QuantumCircuit(q,c)   
circuit.h(q[0]) 
circuit.cx(q[0],q[1]) 
circuit.x(q[0]) # X-gate applied 
circuit.cx(q[0],q[1]) 
circuit.h(q[0])  
circuit.measure(q,c)  

executeCircuit(circuit, backend, shots=10)

#################### 01 ########################### 
circuit = QuantumCircuit(q,c)   
circuit.h(q[0]) 
circuit.cx(q[0],q[1]) 
circuit.z(q[0]) # Z-gate applied to q0  
circuit.cx(q[0],q[1]) 
circuit.h(q[0])  
circuit.measure(q,c)        

executeCircuit(circuit, backend, shots=10)   

#################### 11 ########################### 
circuit = QuantumCircuit(q,c)   
circuit.h(q[0]) 
circuit.cx(q[0],q[1]) 
circuit.z(q[0]) # Z-gate applied  
circuit.x(q[0]) # X-gate applied  
circuit.cx(q[0],q[1]) 
circuit.h(q[0])  
circuit.measure(q,c)  

executeCircuit(circuit, backend, shots=10)