Quantum Tic-Tac-Toe
A downloadable QTTT
A qubit simulator built on a tic-tac-toe board. Each cell on the board is a qubit with real complex amplitudes, gate operations, and probabilistic collapse. Not a gimmick — the physics is actually correct.
Built with C++ and SFML 3.
What it is
Each of the 9 cells holds a qubit in superposition. You manipulate qubits using quantum gates via a command line interface, then measure them to collapse their state to 0 or 1. The probabilities are real — amplitudes are stored as complex numbers, gates are matrix multiplications, and measurement samples from the actual probability distribution.
Commands
- select X Y select a qubit at position X Y (1-indexed)
- hadamard apply Hadamard gate — puts qubit into 50/50 superposition
- rotateY <deg> apply Ry gate — shifts probability toward 0 or 1
- rotateZ <deg> apply Rz gate — rotates phase without changing probability
- measure collapse the qubit — locks it permanently
- exit close
How the physics works
A qubit has two complex amplitudes — alpha for |0⟩ and beta for |1⟩. The probability of measuring 0 or 1 is the magnitude squared of each amplitude. Gates are unitary matrices applied to the state vector.
Ry directly shifts probabilities. Ry(180°) on |0⟩ gives 100% chance of measuring 1.
Rz rotates phase only — probabilities don't visibly change. But it changes how subsequent Ry gates behave, making it a trap/setup move.
Hadamard puts the qubit on the equator of the Bloch sphere — perfect 50/50. Applied twice it returns to the original state.
Once measured a qubit is locked. No further gates can be applied.
| Published | 2 days ago |
| Status | Released |
| Author | Rage |
| Genre | Educational |
| Content | No generative AI was used |
Download
Click download now to get access to the following files:




Leave a comment
Log in with itch.io to leave a comment.