Always appropriate

I met boatloads of physicists as a master’s student at the Perimeter Institute for Theoretical Physics in Waterloo, Canada. Researchers pass through Perimeter like diplomats through my current neighborhood—the Washington, DC area—except that Perimeter’s visitors speak math instead of legalese and hardly any of them wear ties. But Nilanjana Datta, a mathematician at the University of Cambridge, stood out. She was one of the sharpest, most on-the-ball thinkers I’d ever encountered. Also, she presented two academic talks in a little black dress.

The academic year had nearly ended, and I was undertaking research at the intersection of thermodynamics and quantum information theory for the first time. My mentors and I were applying a mathematical toolkit then in vogue, thanks to Nilanjana and colleagues of hers: one-shot quantum information theory. To explain one-shot information theory, I should review ordinary information theory. Information theory is the study of how efficiently we can perform information-processing tasks, such as sending messages over a channel. 

Say I want to send you n copies of a message. Into how few bits (units of information) can I compress the n copies? First, suppose that the message is classical, such that a telephone could convey it. The average number of bits needed per copy equals the message’s Shannon entropy, a measure of your uncertainty about which message I’m sending. Now, suppose that the message is quantum. The average number of quantum bits needed per copy is the von Neumann entropy, now a measure of your uncertainty. At least, the answer is the Shannon or von Neumann entropy in the limit as n approaches infinity. This limit appears disconnected from reality, as the universe seems not to contain an infinite amount of anything, let alone telephone messages. Yet the limit simplifies the mathematics involved and approximates some real-world problems.

But the limit doesn’t approximate every real-world problem. What if I want to send only one copy of my message—one shot? One-shot information theory concerns how efficiently we can process finite amounts of information. Nilanjana and colleagues had defined entropies beyond Shannon’s and von Neumann’s, as well as proving properties of those entropies. The field’s cofounders also showed that these entropies quantify the optimal rates at which we can process finite amounts of information.

My mentors and I were applying one-shot information theory to quantum thermodynamics. I’d read papers of Nilanjana’s and spoken with her virtually (we probably used Skype back then). When I learned that she’d visit Waterloo in June, I was a kitten looking forward to a saucer of cream.

Nilanjana didn’t disappoint. First, she presented a seminar at Perimeter. I recall her discussing a resource theory (a simple information-theoretic model) for entanglement manipulation. One often models entanglement manipulators as experimentalists who can perform local operations and classical communications: each experimentalist can poke and prod the quantum system in their lab, as well as link their labs via telephone. We abbreviate the set of local operations and classical communications as LOCC. Nilanjana broadened my view to the superset SEP, the operations that map every separable (unentangled) state to a separable state.

Kudos to John Preskill for hunting down this screenshot of the video of Nilanjana’s seminar. The author appears on the left.

Then, because she eats seminars for breakfast, Nilanjana presented an even more distinguished talk the same day: a colloquium. It took place at the University of Waterloo’s Institute for Quantum Computing (IQC), a nearly half-hour walk from Perimeter. Would I be willing to escort Nilanjana between the two institutes? I most certainly would.

Nilanjana and I arrived at the IQC auditorium before anyone else except the colloquium’s host, Debbie Leung. Debbie is a University of Waterloo professor and another of the most rigorous quantum information theorists I know. I sat a little behind the two of them and marveled. Here were two of the scions of the science I was joining. Pinch me.

My relationship with Nilanjana deepened over the years. The first year of my PhD, she hosted a seminar by me at the University of Cambridge (although I didn’t present a colloquium later that day). Afterward, I wrote a Quantum Frontiers post about her research with PhD student Felix Leditzky. The two of them introduced me to second-order asymptotics. Second-order asymptotics dictate the rate at which one-shot entropies approach standard entropies as n (the number of copies of a message I’m compressing, say) grows large. 

The following year, Nilanjana and colleagues hosted me at “Beyond i.i.d. in Information Theory,” an annual conference dedicated to one-shot information theory. We convened in the mountains of Banff, Canada, about which I wrote another blog post. Come to think of it, Nilanjana lies behind many of my blog posts, as she lies behind many of my papers.

But I haven’t explained about the little black dress. Nilanjana wore one when presenting at Perimeter and the IQC. That year, I concluded that pants and shorts caused me so much discomfort, I’d wear only skirts and dresses. So I stuck out in physics gatherings like a theorem in a newspaper. My mother had schooled me in the historical and socioeconomic significance of the little black dress. Coco Chanel invented the slim, simple, elegant dress style during the 1920s. It helped free women from stifling, time-consuming petticoats and corsets: a few decades beforehand, dressing could last much of the morning—and then one would change clothes for the afternoon and then for the evening. The little black dress offered women freedom of movement, improved health, and control over their schedules. Better, the little black dress could suit most activities, from office work to dinner with friends.

Yet I didn’t recall ever having seen anyone present physics in a little black dress.

I almost never use this verb, but Nilanjana rocked that little black dress. She imbued it with all the professionalism and competence ever associated with it. Also, Nilanjana had long, dark hair, like mine (although I’ve never achieved her hair’s length); and she wore it loose, as I liked to. I recall admiring the hair hanging down her back after she received a question during the IQC colloquium. She’d whirled around to write the answer on the board, in the rapid-fire manner characteristic of her intellect. If one of the most incisive scientists I knew could wear dresses and long hair, then so could I.

Felix is now an assistant professor at the University of Illinois in Urbana-Champaign. I recently spoke with him and Mark Wilde, another one-shot information theorist and a guest blogger on Quantum Frontiers. The conversation led me to reminisce about the day I met Nilanjana. I haven’t visited Cambridge in years, and my research has expanded from one-shot thermodynamics into many-body physics. But one never forgets the classics.

Building a Visceral Understanding of Quantum Phenomena

A great childhood memory that I have comes from first playing “The Incredible Machine” on PC in the early 90’s. For those not in the know, this is a physics-based puzzle game about building Rube Goldberg style contraptions to achieve given tasks. What made this game a standout for me was the freedom that it granted players. In many levels you were given a disparate set of components (e.g. strings, pulleys, rubber bands, scissors, conveyor belts, Pokie the Cat…) and it was entirely up to you to “MacGuyver” your way to some kind of solution (incidentally, my favorite TV show from that time period). In other words, it was often a creative exercise in designing your own solution, rather than “connecting the dots” to find a single intended solution. Growing up with games like this undoubtedly had significant influence in directing me to my profession as a research scientist: a job which is often about finding novel or creative solutions to a task given a limited set of tools.

From the late 90’s onwards puzzle games like “The Incredible Machine” largely went out of fashion as developers focused more on 3D games that exploited that latest hardware advances. However, this genre saw a resurgence in 2010’s spearheaded by developer “Zachtronics” who released a plethora of popular, and exceptionally challenging, logic and programming based puzzle games (some of my favorites include Opus Magnum and TIS-100). Zachtronics games similarly encouraged players to solve problems through creative designs, but also had the side-effect of helping players to develop and practice tangible programming skills (e.g. design patterns, control flow, optimization). This is a really great way to learn, I thought to myself.

So, fast-forward several years, while teaching undergraduate/graduate quantum courses at Georgia Tech I began thinking about whether it would be possible to incorporate quantum mechanics (and specifically quantum circuits) into a Zachtronics-style puzzle game. My thinking was that such a game might provide an opportunity for students to experiment with quantum through a hands-on approach, one that encouraged creativity and self-directed exploration. I was also hoping that representing quantum processes through a visual language that emphasized geometry, rather than mathematical language, could help students develop intuition in this setting. These thoughts ultimately led to the development of The Qubit Factory. At its core, this is a quantum circuit simulator with a graphic interface (not too dissimilar to the Quirk quantum circuit simulator) but providing a structured sequence of challenges, many based on tasks of real-life importance to quantum computing, that players must construct circuits to solve.

An example level of The Qubit Factory in action, showcasing a potential solution to a task involving quantum error correction. The column of “?” tiles represents a noisy channel that has a small chance of flipping any qubit that passes through. Players are challenged to send qubits from the input on the left to the output on the right while mitigating errors that occur due to this noisy channel. The solution shown here is based on a bit-flip code, although a more advanced strategy is required to earn a bonus star for the level!

Quantum Gamification and The Qubit Factory

My goal in designing The Qubit Factory was to provide an accurate simulation of quantum mechanics (although not necessarily a complete one), such that players could learn some authentic, working knowledge about quantum computers and how they differ from regular computers. However, I also wanted to make a game that was accessible to the layperson (i.e. without a prior knowledge of quantum mechanics or the underlying mathematical foundations like linear algebra). These goals, which are largely opposing one-another, are not easy to balance!

A key step in achieving this balance was to find a suitable visual depiction of quantum states and processes; here the Bloch sphere, which provides a simple geometric representation of qubit states, was ideal. However, it is also here that I made my first major compromise to the scope of the physics within the game by restricting the game state to real-valued wave-functions (which in turn implies that only gates which transform qubits within the X-Z plane can be allowed). I feel that this compromise was ultimately the correct choice: it greatly enhanced the visual clarity by allowing qubits to be represented as arrows on a flat disk rather than on a sphere, and similarly allowed the action of single-qubit gates to depicted clearly (i.e. as rotations and flips on the disk). Some purists may object to this limitation on grounds that it prevents universal quantum computation, but my counterpoint would be that there are still many interesting quantum tasks and algorithms that can be performed within this restricted scope. In a similar spirit, I decided to forgo the standard quantum circuit notation: instead I used stylized circuits to emphasize the geometric interpretation as demonstrated in the example below. This choice was made with the intention of allowing players to infer the action of gates from the visual design alone.

A quantum circuit in conventional notation versus the same circuit depicted in The Qubit Factory.

Okay, so while the Bloch sphere provides a nice way to represent (unentangled) single qubit states, we also need a way to represent entangled states of multiple qubits. Here I made use of some creative license to show entangled states as blinking through the basis states. I found this visualization to work well for conveying simple states such as the singlet state presented below, but players are also able to view the complete list of wave-function amplitudes if necessary.

\textrm{Singlet: }\left| \psi \right\rangle = \tfrac{1}{\sqrt{2}} \left( \left| \uparrow \downarrow \right\rangle - \left| \downarrow \uparrow \right\rangle \right)

A singlet state is created by entangling a pair of qubits via a CNOT gate.

Although the blinking effect is not a perfect solution for displaying superpositions, I think that it is useful in conveying key aspects like uncertainty and correlation. The animation below shows an example of the entangled wave-function collapsing when one of the qubits is measured.

A single qubit from a singlet is measured. While each qubit has a 50/50 chance of giving ▲ or ▼ when measured individually, once one qubit is measured the other qubit collapses to the anti-aligned state.

So, thus far, I have described a quantum circuit simulator with some added visual cues and animations, but how can this be turned into a game? Here, I leaned heavily on the existing example of Zachtronic (and Zachtronic-like) games: each level in The Qubit Factory provides the player with some input bits/qubits and requires the player to perform some logical task in order to produce a set of desired outputs. Some of the levels within the game are highly structured, similar to textbook exercises. They aim to teach a specific concept and may only have a narrow set of potential solutions. An example of such a structured level is the first quantum level (lvl QI.A) which tasks the player with inverting a sequence of single qubit gates. Of course, this problem would be trivial to those of you already familiar with quantum mechanics: you could use the linear algebra result (AB)^\dag = B^\dag A^\dag together with the knowledge that quantum gates are unitary, so the Hermitian conjugate of each gate doubles as its inverse. But what if you didn’t know quantum mechanics, or even linear algebra? Could this problem be solved through logical reasoning alone? This is where I think that the visuals really help; players should be able to infer several key points from geometry alone:

  • the inverse of a flip (or mirroring about some axis) is another equal flip.
  • the inverse of a rotation is an equal rotation in the opposite direction.
  • the last transformation done on each qubit should be the first transformation to be inverted.

So I think it is plausible that, even without prior knowledge in quantum mechanics or linear algebra, a player could not only solve the level but also grasp some important concepts (i.e. that quantum gates are invertible and that the order in which they are applied matters).

An early level challenges the player to invert the action of the 3 gates on the left. A solution is given on the right, formed by composing the inverse of each gate in reverse order.

Many of the levels in The Qubit Factory are also designed to be open-ended. Such levels, which often begin with a blank factory, have no single intended solution. The player is instead expected to use experimentation and creativity to design their own solution; this is the setting where I feel that the “game” format really shines. An example of an open-ended level is QIII.E, which gives the player 4 copies of a single qubit state \left| \psi \right\rangle, guaranteed to be either the +Z or +X eigenstate, and tasks the player to determine which state they have been given. Those familiar with quantum computing will recognize this as a relatively simple problem in state tomography. There are many viable strategies that could be employed to solve this task (and I am not even sure of the optimal one myself). However, by circumventing the need for a mathematical calculation, the Qubit Factory allows players to easily and quickly explore different approaches. Hopefully this could allow players to find effective strategies through trial-and-error, gaining some understanding of state tomography (and why it is challenging) in the process.

An example of a level in action! This level challenges the player to construct a circuit that can identify an unknown qubit state given several identical copies; a task in state tomography. The solution shown here uses a cascaded sequence of measurements, where the result of one measurement is used to control the axis of a subsequent measurement.

The Qubit Factory begins with levels covering the basics of qubits, gates and measurements. It later progresses to more advanced concepts like superpositions, basis changes and entangled states. Finally it culminates with levels based on introductory quantum protocols and algorithms (including quantum error correction, state tomography, super-dense coding, quantum repeaters, entanglement distillation and more). Even if you are familiar with the aforementioned material you should still be in for a substantial challenge, so please check it out if that sounds like your thing!

The Potential of Quantum Games

I believe that interactive games have great potential to provide new opportunities for people to better understand the quantum realm (a position shared by the IQIM, members of which have developed several projects in this area). As young children, playing is how we discover the world around us and build intuition for the rules that govern it. This is perhaps a significant reason why quantum mechanics is often a challenge for new students to learn; we don’t have direct experience or intuition with the quantum world in the same way that we do with the classical world. A quote from John Preskill puts it very succinctly:

“Perhaps kids who grow up playing quantum games will acquire a visceral understanding of quantum phenomena that our generation lacks.”


The Qubit Factory can be played at www.qubitfactory.io