/qaif-hashi

Primary LanguagePythonMIT LicenseMIT

Quantum AI Foundation Quantum Games HACKATHON 2023

👾 Quantum Hashi- Team DotQ

Team Introduction

Team Name: DotQ

Game Name: Quantum Hashi

Member Names:


Abdullah Kazi

Discord ID: LudWig Maxwell Planck

GitHub ID: AbdullahKazi500


Enrique Anguiano Vara

Discord ID: EnriqueAnguianoVara

GitHub ID: EnriqueAnguianoVara


Bakhao Dioum

Discord ID: Bakhao

GitHub ID: papidioum


Rahul Dev Sharma

Discord ID: Rahul Dev Sharma

GitHub ID: Rahulsust


Ricardo

Discord ID: Ricardo


Game Summary

The game is called Quantum Hashi, and it is a two-part game that teaches and tests your knowledge of quantum error correction on entangled qubits. The game is partially inspired by the classical Hashi game, where you have to connect islands with bridges following some rules. In Quantum Hashi, the islands are qubits and the bridges are entanglement links. In this game, we teach :

  • How to encode quantum information using entangled qubits,
  • How to detect and correct errors using syndrome measurements.

Description:

  • Each island corresponds to a Qubit.
  • The number on each qubit (island) that tells you how many other qubits it's entangled with.
  • The bridges correspond in the first part to the entanglement link between pairs of qubits and in the second part to the syndrome measurement. It will discussed more in detail.
  • For a much more simplified rule, see simplified rules
  • For a quick introduction to what error correction is see Error Correction
  • For game concept please check Game Concept

Part 1

Game Rules

In this part, you have to create a quantum error-correcting code using entangled qubits. A quantum error-correcting code is a way to encode qubits in such a way that errors can be detected and corrected without destroying the quantum information.

In this first part, you are given numbered qubits (represented by islands) that you have to connect with entanglement links (represented by bridges) following these rules:

  • Each qubit has a number that tells you how many other qubits it's entangled with.
  • There can be at most one entangled link between two qubits.
  • The entangled links cannot cross each other. This rule represents the no-cloning theorem, which states that quantum information cannot be copied exactly.
  • Qubits can only be linked perpendicularly. These are constraints that are imposed by the hardware.
  • The goal is to connect all the qubits in a fully entangled system following these rules, which means that they share the maximum amount of quantum information and correlation. This rule is very important since it ensures that measuring directly some qubits will collapse the whole state of the system.

image

How To Play

hashiqs hashii

hashiqs

hashii

  1. Click with your mouse on two qubits to link them. Click on the same qubits to unlink them.
  2. Once a qubit has as many entangled links as the number on it, it will switch to a different colour.
  3. Finding the most optimal entanglement map wins you the game
  4. Once all qubits are fully connected in a single group, you win.
  5. [Watch the Gameplay/Walthrough]
  6. https://www.youtube.com/watch?v=1ykR22tXQOY

Part 2

Game Rules

In this part, you have to use syndrome measurement to detect and correct the errors on the qubits. A syndrome measurement is a way to detect errors in your qubits without measuring them, to avoid the collapse. An example of syndrome measurement could be to check the parity (equality) of two qubits to return a true or false answer. This can be used to determine whether a correction needs to occur. If the syndrome measurement is different from what you expect for the encoded state, it means that there is an error on one of the qubits.

We start with a fully entangled map where some syndrome measurements are shown to be faulty The goal is to use the clues on the syndrome measurement to detect which of the qubits have errors in them. Then the player, using some interactive clicks, ensures to correct the concerned qubits until all the syndrome measurements are back to their normal states.

image

Beware, a faulty syndrome measurement alone will not tell us which of the two qubits of the pair is the faulty one. We need to take into account the other bridges (the neighbouring syndrome measurements).

image

How To Play

  1. Figure out which of the qubits are faulty.
  2. Click on them to correct them.
  3. You win when all the syndrome measurements (bridges) are back to their normal states .
  4. [Watch the Gameplay/Walthrough](PUT LINK HERE)

How to Install & Run

  • Dependencies needed:
    • python version >= 3.11.4
    • pygame==2.5.2: pip install pygame
    • pyyaml==6.0.1: pip install pyyaml

If there is some MESA-LOADER error, please do what it says here:

  • For executing the game, just clone / download it and execute: [your directory]/qaif-hashi/Hashi-dotQ/menu.py

Significance of the Game

Quantum error correction is a crucial aspect of quantum computing. By gamifying it, we can make this complex topic more accessible and engaging to a broader audience, including students and enthusiasts. It can help demystify quantum error correction codes like the syndrome measurements and the principles behind them.

Our Game is based on the Classical Hashi game and there has never been a Quantum error correction game made on the Hashi Game before.

Our Game idea is Unique and it is can be used for educational purposes to teach Quantum error correction in the future

Games are an effective way to facilitate hands-on learning. A Quantum Error Correction Hashi Game provides a practical way for players to understand how qubits can be protected from errors.

Hashi puzzles involve connecting islands with bridges under specific rules. By incorporating quantum error correction into this puzzle, players can intuitively grasp the idea that qubits (represented as islands) need to be connected or "entangled" in a specific way to correct errors, just like bridges connecting islands in Hashi.

Hashi puzzles are known for enhancing players' problem-solving skills. By adding a quantum error correction element, we challenge players to not only solve traditional Hashi puzzles but also strategically correct errors in their quantum configurations. This adds complexity and depth to the game.

Games can serve as a fun introduction to quantum concepts. A Quantum Error Correction Hashi Game can promote awareness and interest in quantum computing and quantum error correction among individuals who may not have prior exposure to these fields.

Combining educational elements with gameplay makes learning more enjoyable and engaging. Players are more likely to invest time and effort in understanding quantum error correction if it's presented in a game format.

Submission for Special Category (Sonovero R&D)

Team DotQ Have expressed their interest for this special category from Sonovero R&D and we would like to thank the organizers for giving us the opportunity to work on this amazing problem statement In the context of quantum error correction, fidelity refers to a measure of how accurately a quantum state has been preserved or protected against errors. It quantifies the closeness between the ideal or desired quantum state and the actual state that results from applying quantum error correction codes or techniques. Fidelity is often used to assess how well a quantum error correction system maintains a quantum state that is considered ideal or target. For example, in the context of qubits used for quantum computation, the ideal state might be an entangled state or a specific quantum superposition. Quantum systems are susceptible to various types of errors, such as decoherence, noise, and gate imperfections. These errors can cause quantum states to deviate from their desired forms. Fidelity measures how effectively error correction mitigates or compensates for these errors. Fidelity is a measure of how close the final quantum state of the real-life qubits is to the ideal case. If the fidelity of logic gates is too low, calculations will fail because errors will accumulate faster than they can be corrected. We have introduced the concept of fidelity as a scoring system in our game A high-fidelity score indicates that the quantum state is very close to the target state, while a low-fidelity score suggests that errors have accumulated and needs to be corrected . Players should aim to solve Hashi puzzles strategically to correct errors which will lead to higher fidelity scores.

Software & Tools Used

  • Python
  • Pygame

Acknowledgement

We would like to extend our heartfelt gratitude to the Quantum AI Foundation, particularly Pawel Gora, for their exceptional efforts in organizing and hosting the Quantum Games Hackathon 2023. We would also like to express our sincere appreciation to mentors Adam Glos and Artur , whose expertise and guidance were invaluable throughout the hackathon. We would also like to Thank Abdullah Khalid for providing insights and reviewing the game. We would also like to thank Piotr Biskupski from IBM for an insightful talk on Error mitigation with Qiskit Runtime We would also like to Thanks Sonovero R&D For their challenge and to give us a chance to work on their special category This hackathon has been an incredible learning experience, and it wouldn't have been possible without the support and encouragement of the Quantum AI Foundation

Future Plans

  • The game can be adapted to a different Bell pair but that will require a reinterpretation of the results of the parity measurements. This add some unecessary complexity.
  • We could also consider the case of Phase Flip errors, it will not change the principes of the game
  • we can increase difficulty in the future game levels by implementing More qubits + larger grids.
  • we can increase difficulty by implementing Harder to deduce types of error and larger number of errors in the map.

License

MIT License

References

https://builtin.com/hardware/quantum-computer-games

https://www.wilsoncenter.org/blog-post/games-round-quantum-computing

https://www.researchgate.net/publication/361022971_Defining_Quantum_Games

https://decodoku.medium.com/why-we-need-to-make-quantum-games-6f8c7bc4ace7

https://uwaterloo.ca/news/news/new-quantum-cats-game-launches-better-understanding-quantum

https://decodoku.medium.com/quantum-battleships-the-first-multiplayer-game-for-a-quantum-computer-e4d600ccb3f3