qubit
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| qubit [May 11, 2026 at 12:31] – yanevskiv | qubit [May 25, 2026 at 13:16] (current) – Ivan Janevski | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # Qubit | ||
| + | **Qubit** is the quantum computing equivalent of a bit. | ||
| + | |||
| + | A classical bit can be `0` or `1`. There are no probabilities involved at all, but we can assign them anyway. If a bit is `1`, then it's `1` with 100% probability and `0` with 0% probability. Conversely, if a bit is `0`, then it's `1` with 0% probability and `0` with 100% probability. | ||
| + | |||
| + | A qubit works in a similar way. It also has two states: $\lvert 0\rangle$ and $\lvert 1\rangle$, except the total probability is distributed between those two. A qubit is often in both states at the same time: a small amount in state $\lvert 0\rangle$ and a small amount in state $\lvert 1\rangle$. A qubit $\lvert\psi\rangle$ is written in the following form, using what is known as [[dirac-notation|Dirac notation]]: | ||
| + | |||
| + | $$\lvert\psi\rangle = a\lvert 0\rangle + b\lvert 1\rangle$$ | ||
| + | |||
| + | These probabilities $a$ and $b$ are not percentages. Rather, they are complex numbers called " | ||
| + | |||
| + | A qubit state continues to evolve as this weird object of two complex probabilities amplitudes -- until it is measured. When a qubit is measured, it collapses to either $\lvert 0\rangle$ or $\lvert 1\rangle$ with 100% probability. At that point, there are no longer any probabilities or complex numbers inolved. The qubit behaves exactly like a classical bit and we might as well refer to $\lvert 0\rangle$ as `0`, and $\lvert 1\rangle$ as `1`. | ||
| + | |||
| + | But how do we know whether a qubit is going to collapse to `0` or `1` if $a$ and $b$ are complex numbers rather than percentages? | ||
| + | |||
| + | $$P_0 = |a|^2 \qquad P_1 = |b|^2$$ | ||
| + | |||
| + | We do, however, require the qubit always exists as *at least something* with 100% probability when we measure it i.e. a qubit can't half exist or exist with 150% probability. Therefore the square magnitudes must add up to 100% which in probability theory is written as $1$. This is also called the second axiom of probability: | ||
| + | |||
| + | $$|a|^2 + |b|^2 = 1$$ | ||
