Superdense Coding

In classical communication, sending two bits of information requires transmitting two physical bits. But with the help of quantum entanglement, we can bend this rule.

Superdense coding proposed by Bennet and Wiesner in 1992 [1] lets Alice send two classical bits to Bob by transmitting just one qubit. The catch here is that they must share an entangled pair of qubits beforehand. We will explain this protocol in detail below:

Superdense coding protocol

  1. Before any communication begins, a third party prepares two qubits in Bell state:

    \[\begin{equation} \begin{aligned} \ket{\psi} = \frac{\ket{00} + \ket{11}}{\sqrt{2}} \end{aligned} \end{equation}\]

    Alice takes the first qubit, Bob takes the second, and they both separate. This entangled pair is responsible for linking the qubits non-locally, allowing Alice’s local operations to affect the global state.

32 import numpy as np
33 from toqito.states import bell
34 from toqito.matrices import pauli, cnot, hadamard
35
36 np.set_printoptions(precision=8, suppress=True)
37
38 bell_state = bell(0)
39 print(f"Initial Bell state (|Φ⁺⟩): \n {bell_state}")
Initial Bell state (|Φ⁺⟩):
 [[0.70710678]
 [0.        ]
 [0.        ]
 [0.70710678]]
  1. Alice holds two classical bits (\(a\) and \(b\)) that she wants to send. For the tutorial, she is choosing to send \(11\). Depending on the values of her classical bits, she applies one of the four Pauli Gates to her qubit for encoding:

\(a\)

\(b\)

message

Gate applied

Final output (Bell state)

\(0\)

\(0\)

\(\ket{00}\)

\(I\)

\(\frac{|00\rangle + |11\rangle}{\sqrt{2}}\)

\(0\)

\(1\)

\(\ket{01}\)

\(X\)

\(\frac{|10\rangle + |01\rangle}{\sqrt{2}}\)

\(1\)

\(0\)

\(\ket{10}\)

\(Z\)

\(\frac{|00\rangle - |11\rangle}{\sqrt{2}}\)

\(1\)

\(1\)

\(\ket{11}\)

\(XZ = iY\)

\(\frac{|10\rangle - |01\rangle}{\sqrt{2}}\)

 85 pauli_gate_operations = {
 86     # Identity gate.
 87     "00": pauli("I"),
 88     # Pauli-X gate.
 89     "01": pauli("X"),
 90     # Pauli-Z gate.
 91     "10": pauli("Z"),
 92     # X followed by Z (equivalent to iY).
 93     "11": 1j * pauli("Y"),
 94 }
 95
 96 message_to_encode = "11"
 97
 98 # Alice sends her encoded entangled state after this step.
 99 entangled_state_encoded = np.kron(pauli_gate_operations[message_to_encode], pauli("I")) @ bell_state
100 print(f"Entangled state is: {entangled_state_encoded}")
Entangled state is: [[ 0.        +0.j]
 [ 0.70710678+0.j]
 [-0.70710678+0.j]
 [ 0.        +0.j]]
  1. Bob performs operations to reverse the entanglement on encoded state sent by Alice and extract the bits. First, he applies a Controlled-NOT or \(CX\) (CNOT) Gate with the qubit received from Alice as the control qubit and Bob’s original qubit as the target qubit. After this, Bob moves ahead and applies a Hadamard or \(H\) gate to Alice’s qubit.

110 state_after_cnot = cnot() @ entangled_state_encoded
111 decoded_state = np.kron(hadamard(1), pauli("I")) @ state_after_cnot
112 print(f"Decoded state:\n {decoded_state}")
Decoded state:
 [[0.+0.j]
 [0.+0.j]
 [0.+0.j]
 [1.+0.j]]
  1. Finally, Bob measures both qubits in the computational basis (\(\ket{0}, \ket{1}\)). The result is guaranteed to be \(11\); the two bits that Alice sent.

119 measurement_probabilities = np.abs(decoded_state.flatten()) ** 2
120 print(f"Measurement probabilities for basis states |00>, |01>, |10>, |11>: \n {measurement_probabilities}")
Measurement probabilities for basis states |00>, |01>, |10>, |11>:
 [0. 0. 0. 1.]

References

Total running time of the script: (0 minutes 0.645 seconds)

Gallery generated by Sphinx-Gallery