Published on

Quantum Telepathy: Send More with Less Using Superdense Coding

Authors
quantum-computing-superdense-coding

I'll start this blog post with an illustration about information. When we talk about information, our intuition leads us to almost everything in our lives right now. Powered by Information Technology, we are flooded with information every minute of our lives from social media, online news, and more.

Most of our Information Technology today is driven by the immense power of Classical Computing (electronic devices that only understand 0 and 1). If our classical computers only understand 0 and 1, how can they be so powerful and become the backbone of modern Information Technology?

0 and 1 might seem simple, but imagine you have 24 slots that can store just 0 and 1 information. You could do a lot of things. For example, we can describe the 🔴 (Red) color using these slots just like how our Classical Computing understands the red color:

11111111 00000000 00000000

What's that? That's the binary representation of the red color using the RGB (Red, Green, Blue) system. In decimal, we see it as 255 0 0. We know that we can get "all" possible colors by only using these fundamental colors. So 11111111 00000000 00000000 or 255 0 0 represents that the Red value is set to the maximum while the others (Green and Blue) are zero.

With 24 slots, we can describe 2242^{24} different kinds of information. Wow, that's a lot. 🤔 So our Classical Computing, which might seem simple, can become powerful and solve many real-world problems using these very basic fundamentals (0 and 1).

Sending Information using Classical Computing

In a classical computer, we call that slot in the previous section a bit. To send those bits using Classical Computing, we need exactly the nn number of bits we want to send. Let's say you want to send 8 bits of information; you will need 8 bits to send that information. It makes sense because a single bit can only be in one state at a time (either 0 or 1).

So, what do we do when we want to send a large amount of data, and our computer doesn't have enough bits to send or process? Chill, we can still process or send those large amounts of data chunk by chunk. It might sound lame, but it satisfies our needs right now; nobody is really complaining about that.

What's this blog post about? It seems that we don't have any interesting problem with how our Classical Computing works. Yeah, that might be true for our daily personal lives. But our Classical Computing will struggle when we need to use it to solve more complex problems, like finding new kinds of drugs to cure diseases, modeling how natural events work, etc.

Luckily, we have Quantum Computing. Using Quantum Computers, we can send 2 bits of information using only 1 qubit. A qubit is the atomic representation of information in Quantum Computing, analogous to a bit in Classical Computing.

Superposition

In Classical Computing, a bit is the atomic part of its information and can only be in one state at a time (0 or 1). In Quantum Computing, 1 qubit can represent both states at the same time; it can be 0 and 1 simultaneously. This is what we call superposition in Quantum Computing.

12(0+1)\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})

So, it can be half zero and half one probabilistically at the same time. Don't worry about the mathematical syntax right now—nothing fancy there; it's just a way to describe a state in Quantum Computing. For now, you only need to know about:

  • Bra-Ket notation: As you can see, we define a qubit state using this weird syntax 0\ket{0}. This is just another representation of a vector: (10)\begin{pmatrix} 1\\ 0 \end{pmatrix}, while 1\ket{1} is another representation of a vector: (01)\begin{pmatrix} 0\\ 1 \end{pmatrix}.
  • Scalar: The scalar represents the probability of each state or the probability amplitude: 12\frac{1}{\sqrt{2}}. Why are we using a square root here? To calculate the actual probability, we need to get the squared absolute value of the scalars 122=12|\frac{1}{\sqrt{2}}|^{2} = \frac{1}{2}. So when the state is in superposition in this case, it means that it's in a state represented by a linear combination of half 0 and half 1.

Entanglement

Superposition is only one of the several strange capabilities of Quantum Computing. There's another one for you: Entanglement. Entanglement means that our qubits in quantum computing can become entangled. Once entangled, the qubits are somehow connected in a very strange way. Even if we bring these entangled qubits far apart, they remain entangled.

12(00+11)\frac{1}{\sqrt{2}}(\ket{00} + \ket{11})

When the first qubit is measured as 0, the second qubit will automatically become 0, and vice versa. We can imagine this mathematically using the syntax above.

Quantum Circuits and Gates

In Quantum Computing, we can manipulate qubits using Quantum Circuits and Quantum Gates. As you can see in the thumbnail of this blog post, that’s a picture of Quantum Circuits and Quantum Gates. If this is your first time seeing them, don’t worry. Quantum Circuits are just like race circuits where qubits go in one direction while also being manipulated by gates. At a high level, it’s pretty simple, though the process might be quite challenging to understand.

Using these concepts, we’re going to learn about an awesome concept in Quantum Computing, which is...

Superdense Coding

You can think of Superdense Coding as a method or protocol that enables the capability of sending two classical bits using a single qubit. This method or protocol has huge potential to improve many aspects of information technology, including networking, cybersecurity, IoT, satellite communication, and more.

So, in my opinion, it’s totally worth investing our time to dive a little deeper to understand how it works. Let’s start with a simple problem illustration.

superdense-coding-alice-and-bob

In this illustration, Alice wants to send the information 01 to Bob. Using classical computing, she would need to send both bits to Bob because classical computing only allows one state at a time per bit. In this illustration, she sends the first bit with the state 0 and the second bit with the state 1.

Quantum Telepathy

This is one sample use case proving that Quantum Computing can outperform Classical Computing. Using Quantum Computing, Alice only needs to send one qubit instead of two. I will explain step by step what we need to do in Quantum Computing to help Alice improve her communication with Bob.

Let’s start with this initial Quantum Circuit:

superdense-coding-quantum-circuit-1

Imagine that Alice and Bob are each holding one qubit, so there are two qubits in this circuit. Did I lie? I said we would only use one qubit, but here we should use two qubits? Yeah, that’s actually what I questioned when I first learned about Superdense Coding.

But no, I didn’t lie. What I mean by only using one qubit is when we’re talking about sending. We will see that Alice is not sending two qubits like she would in classical computing. Instead, she will only need to send her single qubit to Bob to convey her information.

So right now, the state of the two qubits that Alice and Bob hold would be:

ψ=00\ket{\psi} = \ket{00}

Nothing special here, it's only static zero qubits. We name the combined state of the qubits of Alice and Bob as ψ\ket{\psi}

Entangle their Qubits

This step is where the first magic of "Telepathy" happens. We can entangle the qubits that Alice and Bob hold by using these two Quantum Gates:

  • HH (Hadamard Gate)
  • CNOTCNOT (Controlled Not) Gate

The Hadamard gate evolves the state of a qubit into superposition. The CNOT gate simply inverts the target qubit's state if and only if the control qubit is 1. Let’s see it in action:

superdense-coding-quantum-circuit-2

Applying the Hadamard gate to Alice’s qubit will transform her qubit into this state:

H0=120+121H\ket{0} = \frac{1}{\sqrt{2}}\ket{0} + \frac{1}{\sqrt{2}}\ket{1}

So, any Quantum Gate has its matrix representation. What I mean by applying a quantum gate to a quantum state is simply matrix-vector multiplication.

(12121212)(10)=(12+012+0)=(1212)\begin{pmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} \frac{1}{\sqrt{2}} + 0 \\ \frac{1}{\sqrt{2}} + 0 \end{pmatrix} = \begin{pmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{pmatrix}

So far, it's just high school math 😮‍💨, nothing to worry about. Next, we need to apply the CNOTCNOT gate where Alice's qubit is the control and Bob's qubit is the target. This means that whenever Alice's qubit is 1, Bob's qubit will be inverted. Before applying the CNOTCNOT gate, the combined state of Alice and Bob’s qubits (ψ\ket{\psi}) is:

ψ=(120+121)0\ket{\psi} = (\frac{1}{\sqrt{2}}\ket{0} + \frac{1}{\sqrt{2}}\ket{1}) \otimes \ket{0}

Or:

ψ=1200+1210\ket{\psi} = \frac{1}{\sqrt{2}}\ket{00} + \frac{1}{\sqrt{2}}\ket{10}

After applying the CNOTCNOT gate:

ψ=1200+1211\ket{\psi} = \frac{1}{\sqrt{2}}\ket{00} + \frac{1}{\sqrt{2}}\ket{11}

Whenever Alice's qubit is 1, Bob's qubit will be inverted (0 -> 1). This means that their qubits are now entangled. The state of Bob's qubit will now depend on Alice's qubit.

After their qubits are entangled, they can go as far as they want. Scientists even say that the qubits would still be entangled no matter how far apart they are. When Alice is on Earth and Bob is on Mars, their qubits will still be entangled. Einstein called this event "Spooky Action at a Distance."

einstein-spooky-action-at-a-distance-meme

Now, let's imagine that Alice and Bob are separated:

superdense-coding-quantum-circuit-3

Let's focus on Alice now. As you can see in the image above, Alice has some kind of interface with controlled operations connected to it. The first is the CZCZ (Controlled Z) gate and the CNOTCNOT gate. This means that before sending her qubit to Bob, she will apply one or two operations depending on the information she wants to send.

  • If Alice wants to send 00, she will not perform any operation on her qubit.
  • If Alice wants to send 01, she will perform a NOTNOT operation on her qubit.
  • If Alice wants to send 10, she will perform a ZZ operation on her qubit.
  • If Alice wants to send 11, she will perform both NOTNOT and ZZ operations on her qubit.

Let's break down the mathematical representation of each possible case.

Alice Wants to Send 00

In this case, Alice is not doing any operations on her qubit. So, the state of her qubit will be the same, nothing's changed.

Alice Wants to Send 01

Applying the NOTNOT gate on Alice's qubit, will transform the state from:

ψ=1200+1211\ket{\psi} = \frac{1}{\sqrt{2}}\ket{00} + \frac{1}{\sqrt{2}}\ket{11}

Become:

ψ=1210+1201\ket{\psi} = \frac{1}{\sqrt{2}}\ket{10} + \frac{1}{\sqrt{2}}\ket{01}

We just simply invert the state on Alice's qubit.

Alice Wants to Send 10

Applying the ZZ gate on Alice's qubit will simply transform the state from:

ψ=1200+1211\ket{\psi} = \frac{1}{\sqrt{2}}\ket{00} + \frac{1}{\sqrt{2}}\ket{11}

Become:

ψ=12001211\ket{\psi} = \frac{1}{\sqrt{2}}\ket{00} - \frac{1}{\sqrt{2}}\ket{11}

The sign changed from + into -. How it happens? To understand it completely. We need to start from our very initial state. First, Alice qubit in the state:

0=(10)\ket{0} = \begin{pmatrix}1 \\ 0 \end{pmatrix}

The combination of both qubits owned by Alice and Bob is represented by the tensor products of their qubit state:

ψ=00=(10)(10)=(11100100)=(1000)\ket{\psi} = \ket{0} \otimes \ket{0} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \cdot 1 \\ 1 \cdot 0 \\ 0 \cdot 1 \\ 0 \cdot 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix}

Applying HH Hadamard operation on multiple systems (tensor products of two qubits in this case) is quite different. Before we could apply HH operation on state vector, we should multiply HH operation with II (Identity Matrix). Because we can't apply 2 by 2 matrix to 1 by 4 matrix.

HI=12(1111)(1001)=12(1010010110100101)H \otimes I = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \otimes \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \end{pmatrix}

As you can see that by doing this, we get the 4 by 4 matrix. Now we could apply this HIH \otimes I operation into our multi-qubit state.

(HI)00=(1010010110100101)(1000)=12(1010)=12(00+10)(H \otimes I)\ket{00} = \begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 0 \\ 1 \\ 0 \end{pmatrix} = \frac{1}{\sqrt{2}}(\ket{00} + \ket{10})

As you remember that to create entanglement, we need to apply the CNOTCNOT gate with Alice's qubit as control and Bob's qubit as target. CNOTCNOT matrix is having this matrix representation:

CNOT = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{ pmatrix }

It's similar with II matrix but as you can see in the third row, column 3 and 4 the II matrix seems to be swapped. So what we need to do is just multiply this matrix with our qubit state in vector representation"

ψ=(1000010000010010)(1010)=(1001)\ket{\psi} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 1 \end{pmatrix}

Or in Bra-ket notation would look like this:

CNOT(12(00+10))=12(00+11)CNOT(\frac{1}{\sqrt{2}}(\ket{00} + \ket{10})) = \frac{1}{\sqrt{2}}(\ket{00} + \ket{11})

Now as you can see, you see how two qubits are entangled in their matrix representations. How about ZZ gate?

Z=(1001)Z = \begin{pmatrix}1 & 0 \\ 0 & -1 \end{pmatrix}

It's similar with II matrix but the 11 in the bottom right is 1-1 instead of 11. Similar to the previous HH operation that we need to do the tensor product of ZZ and II.

ZI=(1001)(1001)=(1000010000100001)Z \otimes I = \begin{pmatrix}1 & 0 \\ 0 & -1 \end{pmatrix} \otimes \begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & -1 \end {pmatrix}

Then we could apply this to our entangled qubits:

(ZI)ψ=(1000010000100001)(1001)=(1001)(Z \otimes I) \ket{\psi} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\ -1 \end{pmatrix}

In Bra-ket notation:

ψ=12(0011)\ket{\psi} = \frac{1}{\sqrt{2}}(\ket{00} - \ket{11})

Alice Wants to Send 01

In this case, Alice will apply NOTNOT gate to her qubit so the state becomes:

ψ=12(01+10)\ket{\psi} = \frac{1}{\sqrt{2}}(\ket{01} + \ket{10})

Alice Wants to Send 11

In this case, Alice will apply both the ZZ gate and NOTNOT gate to her qubit. So the state will simply becomes:

ψ=12(0110)\ket{\psi} = \frac{1}{\sqrt{2}}(\ket{01} - \ket{10})

Alice Sends her Qubit to Bob

Now, Alice already applied a certain operation on her qubit based on information she wants to send. Next, Alice just need to give her qubit to Bob.

superdense-coding-quantum-circuit-4

After Alice sends her qubit to Bob, the spotlight is on Bob. After Bob receives Alice's qubit, he cannot directly know what classical information Alice sent. He needs to perform some operations on the qubits (now he has two qubits).

First, he needs to perform a CNOT operation, followed by an HH operation on Alice's qubit before he finally measures those two qubits to get the classical information.

For the sake of simplification, I'll provide one example based on one of the use cases we've seen in the previous section. Let's say the classical information that Alice sent is 11. First, Alice and Bob share entangled qubits:

ψ=12(00+11)\ket{\psi} = \frac{1}{\sqrt{2}}(\ket{00} + \ket{11})

Applying XZXZ operation to the state could be represented by the result of multiplication of those two operations:

XZ=(0110)(1001)=(0110)XZ = \begin{pmatrix}0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix}1 & 0 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix}0 & 1 \\ -1 & 0 \end{pmatrix}

As usual, before we could apply this operation matrix to our state vector, we need to do the tensor product with matrix II:

XZI=(0110)(1001)=(0010000110000100)XZ \otimes I = \begin{pmatrix}0 & 1 \\ -1 & 0 \end{pmatrix} \otimes \begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix}0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ -1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \end {pmatrix}

Performing the (XZI)(XZ \otimes I) to the entangled qubits produced this matrix:

(0010000110000100)12(1001)=12(0110)\begin{pmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ -1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \end{pmatrix} \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 0 \\ 0 \\ 1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 0 \\ 1 \\ -1 \\ 0 \end{pmatrix}

In Bra-ket notation:

ψ=12(0110)\ket{\psi} = \frac{1}{\sqrt{2}}(\ket{01} - \ket{10})

Bob Applies the CNOT Operation

CNOT(12(0110))=12(0111)CNOT(\frac{1}{\sqrt{2}}(\ket{01} - \ket{10})) = \frac{1}{\sqrt{2}}(\ket{01} - \ket{11})

In matrix representation:

12(0101)\frac{1}{\sqrt{2}} \begin{pmatrix} 0 \\ 1 \\ 0 \\ -1 \end{pmatrix}

Bob Applies the H Operation

Last step is applying the HH operation to Alice's qubit.

(HI)12(0101)=1212(1010010110100101)(0101)=12(0002)=(0001)(H \otimes I) \frac{1}{\sqrt{2}} \begin{pmatrix} 0 \\ 1 \\ 0 \\ -1 \end{pmatrix} = \frac{1}{\sqrt{2}} \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \\ 0 \\ -1 \end{pmatrix} = \frac{1}{2} \begin{pmatrix} 0 \\ 0 \\ 0 \\ 2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 1 \end{pmatrix}

The resulting state is:

11\ket{11}

Ooh, ooh, ooh, it's magic! You knooow.. ♫♪... Yes, it's true! With Quantum Computing, we can transfer two classical bits by sending just one qubit. Isn't that amazing? This is just one example of how Quantum Computing surpasses Classical Computing.

Understanding Superdense Coding opens the door to many more "magical" powers of Quantum Computing. There's so much more waiting for us to explore! Share your thoughts in the comments below! 🍻