{
  "cells": [
    {
      "cell_type": "markdown",
      "id": "876fcfc7",
      "metadata": {},
      "source": [
        "---\n",
        "title: Superdense coding\n",
        "description: A free IBM course on quantum information and computation\n",
        "---\n",
        "\n",
        "{/* cspell:ignore mapsto */}\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "82c24e96",
      "metadata": {},
      "source": [
        "# Superdense coding\n",
        "\n",
        "Superdense coding is a protocol that, in some sense, achieves a complementary aim to teleportation.\n",
        "Rather than allowing for the transmission of one qubit using two classical bits of communication (at the cost of one e-bit of entanglement), it allows for the transmission of two classical bits using one qubit of quantum communication (again, at the cost of one e-bit of entanglement).\n",
        "\n",
        "In greater detail, we have a sender (Alice) and a receiver (Bob) that share one e-bit of entanglement.\n",
        "According to the conventions in place for the lesson, this means that Alice holds a qubit $\\mathsf{A},$ Bob holds a qubit $\\mathsf{B},$ and together the pair $(\\mathsf{A},\\mathsf{B})$ is in the state $\\vert\\phi^+\\rangle.$\n",
        "Alice wishes to transmit two classical bits to Bob, which we'll denote by $c$ and $d,$ and she will accomplish this by sending him one qubit.\n",
        "\n",
        "It is reasonable to view this feat as being less interesting than the one that teleportation accomplishes.\n",
        "Sending qubits is likely to be so much more difficult than sending classical bits for the foreseeable future that trading one qubit of quantum communication for two bits of classical communication, at the cost of an e-bit no less, hardly seems worth it.\n",
        "However, this does not imply that superdense coding is not interesting, for it most certainly is.\n",
        "\n",
        "Fitting the theme of the lesson, one reason why superdense coding is interesting is that it demonstrates a concrete and (in the context of information theory) rather striking use of entanglement.\n",
        "A famous theorem in quantum information theory, known as *Holevo's theorem*, implies that without the use of a shared entangled state, it is impossible to communicate more than one bit of classical information by sending a single qubit.\n",
        "(Holevo's theorem is more general than this.\n",
        "Its precise statement is technical and requires explanation, but this is one consequence of it.)\n",
        "So, through superdense coding, shared entanglement effectively allows for the *doubling* of the classical information-carrying capacity of sending qubits.\n",
        "\n",
        "## Protocol\n",
        "\n",
        "The following quantum circuit diagram describes the superdense coding protocol:\n",
        "\n",
        "![Superdense coding circuit](https://quantum.cloud.ibm.com/learning/images/courses/basics-of-quantum-information/entanglement-in-action/superdense-coding.svg)\n",
        "\n",
        "In words, here is what Alice does:\n",
        "\n",
        "1. If $d=1,$ Alice performs a $Z$ gate on her qubit $\\mathsf{A}$ (and if $d=0$ she does not).\n",
        "\n",
        "2. If $c=1,$ Alice performs an $X$ gate on her qubit $\\mathsf{A}$ (and if $c=0$ she does not).\n",
        "\n",
        "Alice then sends her qubit $\\mathsf{A}$ to Bob.\n",
        "\n",
        "What Bob does when he receives the qubit $\\mathsf{A}$ is to first perform a controlled-NOT gate, with $\\mathsf{A}$ being the control and $\\mathsf{B}$ being the target, and then he applies a Hadamard gate to $\\mathsf{A}.$\n",
        "He then measures $\\mathsf{B}$ to obtain $c$ and $\\mathsf{A}$ to obtain $d,$ with standard basis measurements in both cases.\n",
        "\n",
        "## Analysis\n",
        "\n",
        "The idea behind this protocol is pretty simple:\n",
        "Alice effectively chooses which Bell state she would like to be sharing with Bob,\n",
        "she sends Bob her qubit, and Bob measures to determine which Bell state Alice chose.\n",
        "\n",
        "That is, they initially share $\\vert\\phi^+\\rangle,$ and depending upon the bits $c$ and $d,$ Alice either leaves this state alone or shifts it to one of the other Bell states by applying $\\mathbb{I},$ $X,$ $Z,$ or $XZ$ to her qubit\n",
        "$\\mathsf{A}.$\n",
        "\n",
        "$$\n",
        "\\begin{aligned}\n",
        "(\\mathbb{I} \\otimes \\mathbb{I}) \\vert \\phi^+ \\rangle & = \\vert \\phi^+\\rangle \\\\\n",
        "(\\mathbb{I} \\otimes Z) \\vert \\phi^+ \\rangle & = \\vert \\phi^-\\rangle \\\\\n",
        "(\\mathbb{I} \\otimes X) \\vert \\phi^+ \\rangle & = \\vert \\psi^+\\rangle \\\\\n",
        "(\\mathbb{I} \\otimes XZ) \\vert \\phi^+ \\rangle & = \\vert \\psi^-\\rangle\n",
        "\\end{aligned}\n",
        "$$\n",
        "\n",
        "Bob's actions have the following effects on the four Bell states:\n",
        "\n",
        "$$\n",
        "\\begin{aligned}\n",
        "\\vert \\phi^+\\rangle & \\mapsto \\vert 00\\rangle\\\\\n",
        "\\vert \\phi^-\\rangle & \\mapsto \\vert 01\\rangle\\\\\n",
        "\\vert \\psi^+\\rangle & \\mapsto \\vert 10\\rangle\\\\\n",
        "\\vert \\psi^-\\rangle & \\mapsto -\\vert 11\\rangle\\\\\n",
        "\\end{aligned}\n",
        "$$\n",
        "\n",
        "This can be checked directly, by computing the results of Bob's operations on these states one at a time.\n",
        "\n",
        "So, when Bob performs his measurements, he is able to determine which Bell state Alice chose.\n",
        "To verify that the protocol works correctly is a matter of checking each case:\n",
        "\n",
        "* If $cd = 00,$ then the state of $(\\mathsf{B},\\mathsf{A})$ when Bob receives $\\mathsf{A}$ is $\\vert \\phi^+\\rangle.$ He transforms this state into $\\vert 00\\rangle$ and obtains $cd = 00.$\n",
        "\n",
        "* If $cd = 01,$ then the state of $(\\mathsf{B},\\mathsf{A})$ when Bob receives $\\mathsf{A}$ is $\\vert \\phi^-\\rangle.$ He transforms this state into $\\vert 01\\rangle$ and obtains $cd = 01.$\n",
        "\n",
        "* If $cd = 10,$ then the state of $(\\mathsf{B},\\mathsf{A})$ when Bob receives $\\mathsf{A}$ is $\\vert \\psi^+\\rangle.$ He transforms this state into $\\vert 10\\rangle$ and obtains $cd = 10.$\n",
        "\n",
        "* If $cd = 11,$ then the state of $(\\mathsf{B},\\mathsf{A})$ when Bob receives $\\mathsf{A}$ is $\\vert \\psi^-\\rangle.$ He transforms this state into $-\\vert 11\\rangle$ and obtains $cd = 11.$ (The negative-one phase factor has no effect here.)\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "id": "a1b8767d",
      "source": "© IBM Corp., 2017-2026"
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}