Encoding Text onto Qubits

Brian N. Siegelwax
Level Up Coding

--

After All, Everything is Binary

It’s a subtle reference in the “Mike & Ike" quantum computing bible. I’ve probably skimmed over it quite a few times. But, just a few days ago, I skimmed up to it one more time and just couldn’t get past it.

…in principle one could store an entire text of Shakespeare in the infinite binary expansion of θ.

Wait, what?

I’m still digesting the statement from Dr. Seth Lloyd that a terabit of data can be mapped to 40 qubits. The answer to that seems to be amplitude encoding. Is this statement from “Mike & Ike" suggesting I could map a terabit to only one qubit?

One Method

This may not be an optimal method, but “Mike & Ike" didn’t delve beyond this brief statement, so here’s a possibility that I’ve discovered:

  1. Convert each character to binary.
  2. From left to right, count the nth place of each character.
  3. Calculate each character’s value as (1 / 2^n) * [0 or 1].
  4. Add up all the values.

the

As an exercise, let’s use the most commonly-used word in the English language: the.

t: 01110100

--

--