!!!READ INSTRUCTIONS!!! Qubit B (middle pixel) is a “quantum coin”. It could be 0, 1 or a superposition of those states. Once the green flag is clicked, B might have some bias towards either landing on 0 or 1. You control qubit A and try to guess what qubit B will land on. There are five possible options: 1- All in on B being 0 2- All in on B being 1 3- 50/50- let luck determine whether you get a point 4- B might be 0 5- B might be 1 After your guess, you can click “Collapse!” And the superposition states (you can think of it as probabilities) will collapse. The pixels will light up if 1, and not light up if 0. If your qubit A matches qubit B, qubit C will light up, and you score a point. If it doesn’t match, qubit C won’t light up and you’ll lose a point. After many rounds, maybe you’ll notice a trend for qubit B. See how many points you can get! Qubit B’s bias resets if you click the green flag. Details: This quantum game can be made with 3 qubits A, B and C. So what is “quantum superposition”? It’s when multiple states “stack together”, creating a unique, strange state that isn’t quite describable with regular physics. This is one of the interesting things about quantum physics. Can we observe quantum superposition? Interestingly, we can’t. When we try and observe particles which are in a superposition, they “collapse” into one state. And usually, how they collapse depends on probability depending on the kind of superposition state it was in. This project is a simple demonstration of this concept- you get to guess a superposition of states, the actual quoin is also in a superposition of heads and tails, and then the final qubit which tells you whether you gained or lost a point- enters an “entangled state”, a special kind of state where the qubit’s state depends on the other qubit states. And by looking at the results, you collapse qubits A and B, then the entangled qubit C will also collapse showing you whether you got a point or not.
Yup lol, made a quantum video game. Came up with the game myself. It only uses 3 qubits, but my engine supports up to 17, I'm just a bad quantum programmer, or whatever that's called. Code: All start at 0. After A and B are initialized from the user input using hadamard gates, phase shift gates and X gates, and C is initialized to 0, the code to simulate the round is: X(B) CNOT(Control: A, Target: B) CNOT(Control: B, Target: C) X(B) Observe (collapse state) Incredibly simple code. Then the initialization: All out on 0: Do nothing, this is the default. All out on 1: X(A) 50/50 guess: Hadamard(A) Bias towards 0: PhaseShift(A, shift: -90 degrees) Hadamard(A) PhaseShift(A, shift: 2acos(0.5)) Hadamard(A) PhaseShift(A, shift: 90 degrees) Bias towards 1: PhaseShift(A, shift: -90 degrees) Hadamard(A) PhaseShift(A, shift: 2acos(0.5)) Hadamard(A) PhaseShift(A, shift: 90 degrees) X(A) And the same for initializing B based on bias, just do all of the things but to qubit B instead of qubit A.