Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QPong 2.0 #26

Open
HuangJunye opened this issue Aug 16, 2022 · 12 comments
Open

QPong 2.0 #26

HuangJunye opened this issue Aug 16, 2022 · 12 comments

Comments

@HuangJunye
Copy link
Contributor

Description

QPong is a quantum version of the classic Pong game. It is built using Pygame engine and Qiskit. The paddle position of the player (quantum computer) is determined by the output state of a quantum circuit. It was featured in the first episode of the popular Coding with Qiskit series and its Unity port was installed in a Quantum Arcade machine that went on tour around Europe including EU Quantum Flagship event in Finland in 2019.

In this project, we are trying to reimagine QPong! Adding multiplayer mode, adding online / browser playable options, revamp the visuals, you name it! All ideas are welcome!

Deliverables

A significantly revamped QPong

Mentors details

  • Mentor 1
    • Name: Junye Huang
    • GitHub ID: @HuangJunye
    • What they do: Quantum Developer Advocate and co-creator of the original QPong

Number of mentees

1

Type of mentees

  • Mentee 1
    • Required:
      • Interested in game development
    • Nice to have:
      • Experience in game development
      • Knowledge in quantum information
@hamzakamel1
Copy link

I'm very interested in this project as I have a good background in Game development. I would like to join as a mentee

@tula3and
Copy link

@GemmaDawson Hello, I've just checked your email. Could you please assign me here? Thank you! 🙂

@Unathi-Skosana
Copy link

🕹️🕹️🕹️ @GemmaDawson

@Siddharthgolecha
Copy link

@GemmaDawson Really sorry, your email was buried in the inbox 😅

@HuangJunye
Copy link
Contributor Author

Presentation slides for Checkpoint 1

@tula3and
Copy link

tula3and commented Nov 3, 2022

The 2nd checkpoint:

Our main challenge is to make a 2-player mode for QPong. This 2-player mode will be based on a server to match 2 people online. We determined to use Python as a server and there will be a HTML file for the frontend. After the server file is ready, we also have a plan to deploy the server on the cloud so everyone can enjoy to play it!

There are several versions of QPong and we chose a PICO-8 version among them. There are not that many examples for multiplay mode of PICO-8 so it is quite hard defining the network communication part. For that our team has a small hackathon to understand PICO-8. Through the several hackathons, we figured out how to send data between .p8 and .js. Actually, PICO-8 is based on Lua but it supports an export to .html and .js. Therefore, there is a kind of shared array between .p8 and .js. The detailed explanation is below (Reference: joshiemoore/p8modem) :

  • In PICO-8, poke means "write" and peek means "read"
  • If you poke something, it can be found in the array pico8_gpio in .js file
  • In .p8, the first element can be accessed by using the base index _gpio_base = 0x5f80

In addition, using the p8modem, I checked the network communication works well. However, there is still a concern that table (a kind of array in PICO-8) is not sent with the p8modem. We need to figure out that to share the variables well for a ball position and the opponent status. We will also add a function for a result-sharing form after the game ended. (Like Wordle!) This will use the shared array as well: Make a PICO-8 demo of sharing something.

In conclusion, we are going to update QPong PICO-8 for a 2-player mode and modify it to communicate well with the server. After all this process goes well and works good on the local, we will deploy the server on the cloud to make it public. For the frontend, if it is possible, we will use Github page. In the below, you can check an example image for our upcoming QPong!

@tula3and
Copy link

tula3and commented Nov 3, 2022

qpong2_0

@Siddharthgolecha
Copy link

The 2nd checkpoint:

One of our features was to implement noise bombs. Noise bombs are collectibles players can throw on opponents to introduce different kinds of noise in their Quantum circuits. We have decided on 4 types of bombs till now,

  1. Cosmic Bomb: These bombs represent noise introduced by cosmic rays and their impact on quantum circuits. Cosmic rays are invisible, microscopic particle beams that constantly bombard the Earth from sources as far away as other galaxies. A cosmic ray strike on an operating quantum computer core can form a quasiparticle called a phonon. These phonons have the capacity to disrupt operations by inverting the quantum state of not only a single qubit, but an entire entangled set of qubits as they proliferate across the processor. Google Quantum AI Team published a paper in Nature Science on the same topic demonstrating its effect on Qubits.
    image
  2. Thermal Bomb: Thermal noise refers to thermal fluctuations, mechanical vibrations, industrial noise, fluctuations of voltage from a power supply, thermal noise due to Brownian motion, instrumentation noise, a laser's output mode deviating from the desired mode of operation, etc. This type of noise is one of the most common types of noise that affects a quantum system. Thermal noise destroys the quantum state, thus destroying the fragile quantum state of qubits. You can read more about the effects of Thermal noise on Quantum Computers here.
    image
  3. Gate Bomb: Gate Bomb introduces the errors generated while implementing a gate or performing an operation on a qubit. This bomb could introduce errors as per the number of gates implemented on the circuit. This is also a common type of error introduced in Quantum systems due to the limitations of the current instruments to accurately perform a quantum operation. Read more about quantum gate errors and quantum gate fidelities here.
    image
  4. Readout Bomb: Readout noise refers to the noise generated due to experimental imperfections and quantum measurements. They typically arise from two sources: (1) measurement times are significant in comparison to decoherence times, and thus a qubit in the |1⟩ state can decay to the |0⟩ state during measurement, and (2) probability distributions of measured physical quantities that correspond to the |0⟩ and |1⟩ states have overlapping support, and there is a small probability of measuring the opposite value. You can read about Readout/Measurement Error here.
    image

image

@GemmaDawson
Copy link
Contributor

@tula3and, @Siddharthgolecha, & @Unathi-Skosana - please upload your Final Showcase presentation materials, and if needed, update the project Title and/or description.

@Unathi-Skosana
Copy link

Unathi-Skosana commented Dec 22, 2022

Here is part 1 (I and @tula3and) of our final showcase presentation.

The repository hosting our code for Qpong2.0 can be found here. Additionally, a repository used to track the team's activities can be found here.

Our major future plans (excluding polishing the game), include hosting the Qpong2.0 on a permanent public URL, and one we are all most excited about is potentially hosting a QPong2.0 tournament sometime next year. 😁

@GemmaDawson
Copy link
Contributor

Congratulations on completing all the requirements for QAMP Fall 2022!! 🌟🌟🌟

@Siddharthgolecha
Copy link

Here's the Part 2(Of me) of our final showcase presentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Final Showcase Submitted
Development

No branches or pull requests

6 participants