visual breakdown of the foundational quantum mechanics principles
1. Quantum State Vector & Phase as Hue
The simulator maintains an exact statevector storing complex amplitudes $\alpha = a + bi$. On the Bloch sphere (or complex plane), an amplitude's angle (phase) naturally runs around a $360^\circ$ circle. By mapping phase directly to the color wheel (hue), complex phase dynamics become visually intuitive without extra decorative layer work.
2. Phase as a Color Wheel Mapping
Because a complex amplitude's phase continuously cycles from $0$ to $2\pi$, mapping phase angle $\phi$ to color hue mirrors continuous color systems (like the Munsell or HSL color wheel). A uniform quantum superposition naturally creates a shimmering spectrum because the underlying phases are actively evolving across basis states.
3. Wave Interference & Constructive/Destructive Paths
In games like COLLAPSE, the core gameplay revolves around wave interference. Adding quantum gates alters complex phases: aligned phases reinforce path probabilities (constructive interference), while opposite phases cancel paths out (destructive interference).
Summary of Physics Mechanisms
| Quantum Concept | Engine Implementation | In-Game Mechanics |
|---|---|---|
| Statevector Simulator | 200 lines of JavaScript using two Float64Array buffers for real & imaginary numbers |
Simulates exact state space for up to $2^5 = 32$ basis state amplitudes |
| Complex Phase | Continuous angle mapped to color hue | Visualizes shimmering superposition states without artificial UI effects |
| Interference | Applying unitary gates ($H, X, Y, Z, S, T, CNOT$) rotates phase | Player arranges paths so target states reinforce while unwanted paths cancel |
| Born Rule Measurement | Probability $P(x) = \Vert{}\alpha_x\Vert{}^2$ sample collapse | Unforgiving probabilistic outcomes—even a 90% probability path loses 10% of the time |


