# Making a game to teach quantum programming

Computers can solve any mathematical problem. But some problems take more time and resources than others: a property known as their computational complexity. In some cases, this complexity is so high that even a planet sized supercomputer would take the age of the universe to reach an output. From a practical standpoint, such problems are impossible to solve.

One example of such a complex task is simulation of quantum systems. This means that once research into things like materials, chemicals or medicine reaches the quantum realm, it is not always possible to answer the questions we want to ask.

Though quantum mechanics causes us this problem, it could also provide the solution. It allows us to conceive of a completely new kind of computer. One whose basic operations are created through quantum mechanical interactions. A quantum computer.

The basic operations of quantum computers will allow for much more subtle effects than those in normal computers. The way we build our programs will be so different, we need to re-examine computational complexity for each problem. In many interesting cases, like quantum simulation or factoring numbers, quantum computers will make the impossible possible.

To take advantage of their power, many universities and companies have spent a lot of time and effort developing quantum technology. In the last few years, prototype devices have finally reached the point where they can do interesting things. Such as performing calculations regarding the energies of molecules.

Admittedly, no application of quantum computers so far is something that your smartphone couldn’t do in a few seconds, but we are getting there.

One major company developing quantum computing hardware is IBM. They have even taken the step of putting their devices up on the cloud, allowing anyone to use them. They call this the IBM Q Experience.

So now everyone has the opportunity to program real quantum computers. But most don’t have the knowledge. This is a problem I have been trying to solve, by producing simple examples of what can be done on current quantum devices.

For example, over a year ago now, I decided to make a game with one of IBM’s prototype quantum processors. It was a simple version of Battleships that runs in a Jupyter notebook. Needless to say, it was not the 2017 game of the year. But it did allow me to write a tutorial on how I did it, to help others do the same.

It also got a reaction out of IBM. They contacted me with the idea of making another game. More fun. More accessible. But just as quantum.

After months of collaboration, it has finally been launched. It’s name is Hello Quantum.

The design brief was to create a game that would run on mobile devices, but would also allow players to use IBM’s cloud-based quantum processors in an accessible way. The result was a simple puzzle game based on wrangling a pair of qubits. It can be played very casually, and will keep you busy while you wait for a bus. But it can also be used as an interactive tutorial to using real quantum processors through the IBM Q Experience.

Over the course of the project, there were a whole bunch of additional ideas floating about. At one point, the puzzles were going to be embedded in a knock-off Zelda game. We were also going to have the user unlock little nuggets of quantum knowledge as they went along.

Another of our aims was to send jobs to the quantum processors from the app itself. There were a few ideas for this, including an ‘Image superposer’. This would let you select pictures from your photostream, and then construct a job that would create a superposition of a pair of images. It was inspired by something I made while trying to watch the least exciting Iron Man film: a quantum superposition of emoticons.

These ideas were let go along the way for various reasons. Ranging from being horrendously impractical (like making a Zelda game) to being overwhelming for casual users (bombarding them with a piecemeal lecture on quantum mechanics). By trimming them off, the result is a very simple and clean experience, that even my five year old daughter can use (Though my three year old is not so keen).

The alternative ideas didn’t die off completely, though. There was a prototype version of the game developed alongside the real version, in which all these things got tried out. As user experiences go, it is no where near as pretty as the main version. But since programmers are used to enduring similar interfaces, we decided to polish the prototype up and release it as a programmer focussed version.

Unfortunately, the Zelda knock-off did not make it over to this version either. Perhaps that’s something for the 10th Anniversary Edition.

For a whole bunch of articles on issues related to this project, check out the QISKitters publication here on Medium.

To show your support for this post and recommend it to your followers, click on the clap icon 👏 below. Each users is allowed to clap up to 50 times to show how much they appreciated a story.

The University of Basel has an international reputation of outstanding achievements in research and teaching. Founded in 1460, the University of Basel is the oldest university in Switzerland and has a history of success going back over 550 years. Learn more

--

--

## More from sci five | University of Basel

Sci Five has been discontinued. Head to www.unibas.ch for more inspiring research stories of the University of Basel.