Quantum Basics
What is a Qubit?
A qubit (quantum bit) is like a regular computer bit, but with a twist! While a regular bit can only be 0 or 1, a qubit can be both at the same time.
Think of it like a spinning coin: While it's spinning, you can't say whether it's heads or tails. In a sense, it is both at once. When you catch it, it "collapses" to one or the other.
Superposition
We write a qubit's state as:
|ψ⟩ = α|0⟩ + β|1⟩
This is called superposition. The values α (alpha) and β (beta) tell us how "much" of |0⟩ and |1⟩ the qubit has.
In our game:
- |0⟩ = Enemy survives (full health)
- |1⟩ = Enemy dies
Probability
The chance of measuring |1⟩ (killing the enemy) is |β|² — the squared size of β. If β is 0.7 (70%), there's a 49% chance to kill!