© Vladimir Silva 2018
Vladimir SilvaPractical Quantum Computing for Developershttps://doi.org/10.1007/978-1-4842-4218-6_6

6. Fun with Quantum Games

Vladimir Silva1 
(1)
CARY, NC, USA
 
In this chapter you will learn how to implement a basic game in a quantum computer. For this purpose we use the quintessential Quantum Battleship distributed with the QISKit Python tutorial. The first part looks at the mechanics of the game including
  • Using qubits to represent ship positions in the board

  • How to calculate damage percentages using a quantum program to be run in the local, remote simulator or real quantum device

  • How to perform rotations on the X-axis of a single qubit using a partial NOT quantum gate

Yet we don’t stop there. The second part of this chapter takes ...

Get Practical Quantum Computing for Developers: Programming Quantum Rigs in the Cloud using Python, Quantum Assembly Language and IBM QExperience now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.