CodeFactor

This is our submission with which we achieved 2nd place in the MIT iQuHack 2022 Microsoft IonQ Division.

QuHackJack Logo

Cheating with Quantum Computers since 2022

The Team

Karim Alaa El-Din
Francesco Scala
Rabins Wosti
Arunava Majumder

Introduction

  • BlackJack is a game of chance where the player tries to reach a sum of 21 with their card values, without going over
  • The player is opposed by a dealer, who plays by the same rules
  • Whoever gets closer to 21 wins
  • But that's gambling, we can't allow that...
  • Counting cards makes it a game of skill
  • But it's hard and requires thinking
  • Introducing: QuHackJack

    Game Concepts

  • Use quantum computer to generate all random numbers
  • Random numbers correspond to playing cards being drawn
  • Allow the user to manipulate the quantum circuit before drawing a card, to change their odds
  • Rules

  • Deck of 32 cards, values 3 to 10 and suits ♣, ♠, ♥, ♦
  • The player and dealer compete to reach as close as possible to a total of 16, without going over
  • Each card corresponds to a 5 q-bit computational basis state (3 qubits for the number, 2 for the suit)
  • Random outcomes are achieved through a single hadamard gate on each q-bit
  • hack_pt1
  • Different gamemodes allow player to apply different types & numbers of gates
  • Gamemodes:
    EASY
    MEDIUM
    HARD
    ULTRA
    NOGATENOCRY
    WATERGATE
    Some have no element of luck, others have some! All require a good amount of puzzling.

    Featuring

  • Newest Ascii Graphics
  • first_draw
  • Dynamic Circuit editing
  • hack_pt3
  • Simulating probability of cards for each circuit
  • flat_distrib
  • Different Backends (Including REAL IonQ QPU)
    • Comprehensive UI messages and tons of introduction

    help

    Achievements

    • Created a fully-fletched, fun game
    • Useful as a teaching device (tried and tested on friends & family)
    • Extensive documentation of quantum computing concepts & independent exploration of different gates
    • Very fun puzzle game (We have spent some time puzzling ourselves)
    • Tons of variety through random 1st cards & different gamemodes

    Potential improvements

    • Limited to a non-standard deck by the use of q-bit basis
    • Hardware noise may mess with the user, even if all the gates are correct (It's NISQ, Baby!)
    • Queued jobs make the game quite slow
    • The victory, loss messages could use some work

    Thoughts & Reflections

    • Incredible Experience throughout
    • Extremely creative & fun challenge (Thanks @Microsoft & @IonQ)
    • Met people from all across the world (4 people, 4 timezones & countries)
    Thank you!