# How Quantum Programing Turned into a 3-D Puzzle Game

If you enjoy 3-D puzzles, you’ll love quantum programing. There’s even an online game to challenge your skills.

Software is the part of a computer that consists of encoded information and instructions. It is entirely separate from the hardware—the physical structures that perform these instructions. At least that’s true for conventional computers.

But in recent years, computer scientists have become increasingly focused on quantum computers that use the strange laws of quantum mechanics to process information. This results in much more powerful computations. However, in the quantum world, it is much harder to separate the software and the hardware.

Nevertheless, a powerful new way of thinking of about quantum software is beginning to emerge. And the curious thing about this approach is that it turns quantum programming into a kind of 3-D puzzle. That leads to an interesting question: is it possible to gamify quantum program in way that produces useful results?

Today, we get an answer thanks to the work of Simon Devitt at Riken in Saitama, Japan, who has built an online game that has the potential to play a crucial role in the future of quantum programming. Not only can the game help humans create better programs, but it could also help a new generation of artificial intelligence machines take on the task themselves.

First some background. One way to think about a quantum program is as a two-dimensional lattice of qubits, like a sheet, or a three-dimensional lattice, like a crystal. Information is encoded by creating a hole or defect in the lattice.

This is a powerful approach because the information is naturally protected against errors by the properties of lattice itself, which effectively locks it in place.

The information can be processed by moving defects through the lattice and wrapping them around each other, like a tangled ball of string. The process of tangling can enact logic gates which together perform computations.

This is essentially a topological process. So the mathematics of topology describe the entire process, regardless of how messy the tangling becomes. As long as the lattices are topologically identical, the other details of the tangling don’t matter.

This is analogous to the famous link between a doughnut and a coffee cup. These shapes are entirely different to look at but are topologically identical because they both contain a single hole. Each one can be converted into the other by squeezing and stretching but not by tearing.

Exactly the same is true of quantum programs. Two programs perform the same job provided they are topologically identical but regardless of how tangled the lattices become.

That raises an interesting problem. Given a tangled lattice representing a quantum computer program, how simple can it be made while preserving its topology? In other words, how can the quantum program be optimized?

That’s important because today’s quantum computers can handle only a few qubits. With quantum resources so scarce, the simpler a program can be made, the more easily it can be implemented.

This is where Devitt steps in. He has developed a powerful way to visualize quantum programs as 3-D lattices with interlocking sections representing the way information is stored and processed. The task of optimization is to simplify the lattice by moving, shrinking, stretching, and reworking the interlocking sections while preserving the same topology.

Devitt’s has gone further by gamifying the task—he’s turned it into a Web-based puzzle called MeQuanics, which you can try here. The idea behind the game is that a quantum program can power your spacecraft. But the program you have is too big and therefore has to be made smaller using various tools that can refashion it.

The game is fascinating and not so different to various other puzzlers. It’s a bit buggy but it looks good and is worth a try if you have a few minutes.

There is another hidden aspect to the game. One way to speed up the process of optimizing quantum programs would be to train a machine-learning algorithm to do the job. These algorithms have been hugely successful in other tasks and this kind of optimization seems ideally suited.

But there is a problem. These algorithms have to be trained, and that requires a large data set of examples that they can learn from. However, quantum program optimization is so new that there are no suitable data sets for this task.

That’s why MeQuanics is important—the process of playing the game creates a database of examples that can be used to train a machine. And given enough data, the machines should eventually outperform humans. Google’s AlphaGo program showed how powerful they can be when it recently thrashed one of the best human Go players after devouring a massive dataset of Go games played online.

Devitt’s is interesting work that has the potential to introduce a new generation of people to quantum programming. And best of all, it’ll let them have some fun while they learn.

Ref: arxiv.org/abs/1609.06628: Programming Quantum Computers Using 3-D Puzzles, Coffee Cups, and Doughnuts