Giter Site home page Giter Site logo

paqman's Introduction

PAQ-MAN - PAC-MAN with a quantum flavor

We have utilized the simple game of Pacman to illustrate and understand the complex concepts of Quantum Mechanics. We made this for the IonQ + Microsoft Joint Challenge @ MIT iQuHACK 2022 iQuHACK 2022!

Dependencies

  • Pygame (tested with 2.0.3)
  • Qiskit Aer (tested with 0.10.2)

How to run

Just run main.py after installing dependencies! Move Pacman using the arrow keys.

Game rules

  • The objective is to score as many points as possible, while avoiding dying
  • Pacman has an associated quantum state, and the ghosts perform measurements in X, Y or Z basis. If the measurement result is a 0, Pacman dies. If it's a one, Pacman starts in the post-measurement state. The measurement results and post measurement states are obtained by running the relevant code on a real IonQ quantum computer, accessed via Azure! on a Qiskit Aer `statevector_simulator'.
  • There are gates strewn throughout the maze. If Pacman meets an X, Y or Z gate, the gate acts on the Pacman's state, and Pacman then is in the state obtained after the gate acts.
  • The gates and ghosts disappear after interacting with Pacman.
  • The score is increased whenever Pacman encounters an H gate followed by a CNOT gate, which allows Pacman to create Bell pairs.

Screenshots

Main gameplay window

Score increment after Pacman swallows an H followed by CN gate

Measurement being run on <s>an IonQ quantum computer<s> Qiskit Aer backend

Post death :D

Future Directions

  • Since Pacman can use H and CNOT gates to generate Bell pairs, it can run a teleportation protocol between two points. This adds another quantum aspect to the game
  • Currently the game has no lives counter, we can add that.
  • Other gates like rotation gates
  • Multiple levels
  • Multiqubit states that will add new gates and gameplay features
  • Search algorithm for ghosts, currently they just move randomly.

paqman's People

Contributors

sagnikb avatar phionx avatar tcnickolas avatar annapurna-pradhan avatar vicbeltran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.