Skip to content

Latest commit

 

History

History
37 lines (18 loc) · 2.88 KB

README.md

File metadata and controls

37 lines (18 loc) · 2.88 KB

Quantum Games

Computer games have been around almost as long as computers. They begin with examples like Nimrod, OXO and Spacewar!, which were designed to help people learn about how early computers worked, and how to program them.

This is exactly what we'd like to replicate in this folder. Here you'll find basic examples of the tools and techniques of quantum programming, used to create the core of simple games. These all run in Jupyter notebooks, which are also used to explain the quantum programming behind the game.

Contents

  • Hello Qiskit - Solve puzzles by creating simple Qiskit programs.

  • Battleships with partial NOT gates - Battleships implemented with single qubit rotations.

  • Quantum Counterfeit Coin Problem - A game based on finding a counterfeit coin, with a quantum strategy based on the Bernstein-Vazirani algorithm.

  • Quantum Tic-tac-toe - Tic-tac-toe was one of the first games for a classical computer. Now we have a quantum version too!

  • Quantum Awesomeness - Puzzles that aim to give hands-on experience of a quantum device's most important features: number of qubits, connectivity and noise.

You can also find the following game related content in the 'creative' folder.

  • Random Terrain Generation - A simple example of using quantum computers for the kind of procedural generation often used in games.

  • Quantum Animations - A simple example of making pixel art animations with quantum computers.

  • Quantum Coin Game - A quantum coin game to illustrate the power of quantum superposition and interference.

Contributing

Each game should have a Jupyter notebook in which the game is played, and in which the quantumness behind the game mechanic is explained.

If you are intimidated by the idea of explaining the quantum program, don't hesitate to contribute your game without it. Others will be happy to build on your work, and bring it in line with the required style.

To make even a simple command line game, you'll most likely need many lines of classical programming. This will handle the subtleties of input and output, and so not be directly relevant to someone learning quantum programming. You can therefore hide this away in a .py file that can then be imported into your notebook. These files can be placed in the game_engines folder. For example see battleships_engine.py and its use in Battleships with partial NOT gates.

For more on how to contribute, see the main README for these tutorials.