https://github.com/Lumorti/Quandoom Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} Lumorti / Quandoom Public * Notifications You must be signed in to change notification settings * Fork 6 * Star 184 A port of DOOM for a quantum computer License MIT license 184 stars 6 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 1 * Pull requests 0 * Actions * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Security * Insights Lumorti/Quandoom This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 21 Commits LICENSE LICENSE README.md README.md example.gif example.gif main.cpp main.cpp makefile makefile quandoom.rar quandoom.rar View all files Repository files navigation * README * MIT license Quandoom It is a well-known fact that all useful computational devices ever created are capable of running DOOM. Despite decades of active research, there is yet to be developed a single practical use for quantum computers. This changes today, with the release of Quandoom, a port of the first level of DOOM designed for a quantum computer, given as a single QASM file, using a mere 70,000 qubits and 80 million gates. Although such a quantum computer doesn't exist right now, Quandoom is efficiently simulatable on a classical computer, capable of running at 10-20 fps on my laptop using the accompanying lightweight (150 lines of C++) QASM simulator. The game loop is as follows: 1. the user pressing a key sets the value of one of the input qubits 2. the QASM file containing all of the quantum gates is applied to the entire state 3. the last 64,000 qubits are measured and displayed as a 320 x 200 screen of binary pixels 4. the screen and input qubits are reset and the process repeats Gif of Quandoom How To Play It Please note - it will use about 5-6 GB of ram and take a while to load since it's a very large circuit file. First, download the latest release for your system from here and unzip it. Windows: run the quantum circuit (quandoom.qasm) with the simulator by dragging it onto simulator.exe Linux: add run permissions to the simulator using chmod +x ./ simulator.AppImage and then run the circuit by running ./ simulator.AppImage quandoom.qasm Changes Versus The Original Alright, so after like a year of working on this I got bored, so it doesn't have all the features from the original DOOM. More specifically: * it's only the first level, more could be added, it's just a matter of mapping them * everything is x-ray due to reversibility shenanigans * no color because it'd make rendering a lot harder and the x-ray would look weirder * no music or sound * no level secrets, although again it's just a matter of mapping * enemies can't travel between rooms * no automap, because eh * imp fireball is hitscan rather than a projectile * minor tweaks regarding armor/health/damage to make it more reversible-friendly Compiling The Simulator If the distributed executable doesn't work for you (or you don't trust my binaries), you can compile it yourself on Linux using: sudo apt-get install g++ make libsdl2-dev libomp-dev -y git clone https://github.com/Lumorti/Quandoom cd Quandoom make Or on macOS using: brew install libomp sdl2 git clone https://github.com/Lumorti/Quandoom cd Quandoom make macos Technical Details The circuit needs 72,376 total qubits, 8,376 qubits not counting the screen, of which 6,986 are ancilla qubits. The circuit file has 83,651,224 lines, so at least that many gates (will actually be more, since many lines are subroutines). Please note that the simulator is tailor-made for the this QASM file, it will not run a general QASM file. The Quandoom QASM file is also not completely QASM compliant, as described in a comment at the top of the QASM, but only because some qubit lists are abbreviated as "ALLQUBITS" because if I didn't do that then it'd be a >30GB file. The rest of the instructions are all valid n-controlled Toffolis and Hadamards, but of course mostly Toffolis since it's replicating a classical algorithm. There is no quantum advantage, it's just a classical algorithm written in a format compatible with a quantum computer. For now I'm still tidying up the engine code, but basically I have about 8,000 lines of c++ functions allowing a number of reversible binary and arithmetic operations on quantum registers, for example "flipIfLessThanOrEqualTo" which flips all qubits in a register if the value of another register is less than some given value. Everything is done with integers. Using such functions I then wrote a small 3D engine as well as all the game logic. Also present is an ancilla system, a garbage system, as well as a quantum subroutine system and many other handy tools. Mapping and spritework was done by hand. Sprite scaling and ray casting are baked-in (i.e. pre-calculated). Parallelisation is done at the rendering stage, such that the list of render objects is split between cores and comments are left in the QASM to tell the simulator where to jump based on OpenMP thread ID. Maybe soon I'll make a little document and put it on the arXiv if there's interest. Or, if you want the code to expand or improve it, let me know and I'll rush the tidying up. Legal Disclaimer This is a recreation from scratch of the first level of the original DOOM game, which was released as shareware by Id Software in 1997. This project is released as a non-commercial open-source project made in good faith in relation to the "anything can run DOOM" internet meme, for which a vast number of fan-made ports to various devices already exist. This project does not serve as a replacement for the original DOOM, acting purely as a joke/parody, a fact which should be obvious to anyone using it. DOOM, its characters, assets and level design are the intellectual property of Id Software. The author of this work advises anyone who actually wants to play the game to download the official shareware version. About A port of DOOM for a quantum computer Topics doom quantum-computing quantum-circuit qasm Resources Readme License MIT license Activity Stars 184 stars Watchers 2 watching Forks 6 forks Report repository Releases 1 Quandoom v1.0.0 Latest Sep 28, 2024 Languages * C++ 94.2% * Makefile 5.8% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.