Qubit Representation¶
How do we write a state down so we can calculate what it will do?
From a Prepared State to Numbers¶
On the previous page, a preparation produced a state, and the state came with numbers that decide the probabilities of the outcomes. We described those numbers in words. Now we write them down.
How can we write a state down so we can calculate what it will do?
The idea is simple. A qubit has two basis states, |0⟩ and |1⟩. A state gets one number for each of them. Those two numbers are the precise version of what the last page described in words.
Two Numbers for Two Basis States¶
A state is written as a|0⟩ + b|1⟩, where a and b are numbers. They are called amplitudes. In this page's main view they are ordinary real numbers, and they can be negative.
A ket such as |0⟩ is a name for a state. Each name stands for a particular pair of amplitudes:
Three words are easy to mix up, so keep them apart:
- Ket — a name for a state, such as |0⟩ or |+⟩.
- Amplitude — one of the two numbers that describe the state.
- Probability — the chance of an outcome, which we will find from an amplitude.
The balanced superposition from the last page is |+⟩. The column of two numbers in the table is just another way to list the same pair. We do not calculate with it here.
Real amplitudes are a simplification
Some states need more than real numbers. Using real amplitudes keeps this page simple, and it is enough to see how amplitudes, probabilities, and signs fit together. The formal version, with complex numbers, appears at the Intermediate level.
Why does |+⟩ show 0.71?
Its amplitudes are 1/√2, which is about 0.71. Squared, 0.71 gives about 0.5, so each outcome is about 50% likely.
Amplitude Editor¶
Set the two amplitudes and watch what happens. Start from a preset or drag the sliders. Everything updates together, and the page tells you whether what you have built is a valid state.
1. Choose a preset, or set the amplitudes yourself
Amplitude of |0⟩
Amplitude of |1⟩
2. The state you built
3. Is it a valid state?
4. The probabilities
Challenge: make outcome 1 happen 36% of the time
Notice the separate places. The numbers you set are the amplitudes. The written form is the state they describe. The validity line checks the state. The bars show the probabilities that follow.
Probabilities from Amplitudes¶
The probability of an outcome is its amplitude squared. Take the amplitudes 0.6 and 0.8:
That last part is the rule of normalization. The probabilities of all the outcomes must add to 100%, so the squares of the amplitudes must add to 1. A state that does not satisfy it is not a valid state. This is a requirement, not a free choice of numbers: you cannot pick any two amplitudes you like.
Check your understanding. First, predict before the bars appear:
Then decide which pairs are valid states:
The challenge in the editor above is the third check: set the amplitudes so that outcome 1 happens 36% of the time.
The Sign Matters¶
A negative amplitude is not a negative probability, and the sign does not change the probability at all. Compare |+⟩ and |−⟩:
The bars are identical. The amplitude lists are not. So |+⟩ and |−⟩ are different states that give the same Z-basis counts. This is the same-counts, different-states idea from the previous page, now with numbers.
If the probabilities are the same, in what way are |+⟩ and |−⟩ different?
They are different states with different amplitudes. A sign is a real difference even when it does not show up in these probabilities. Later pages show how to tell them apart. Nothing on this page does.
Beyond the Core¶
The formal layer¶
Complex numbers in one minute. A complex number has a real part and an imaginary part: \(z = x + yi\), where \(i^2 = -1\). Its modulus is \(|z| = \sqrt{x^2 + y^2}\), so \(|z|^2 = x^2 + y^2\).
Amplitudes can be complex. Write the state as \(|\psi\rangle = \alpha|0\rangle + \beta|1\rangle\). Then the probabilities are \(|\alpha|^2\) and \(|\beta|^2\), and normalization is
Real amplitudes are the special case where each amplitude has a phase of 0° or 180°. At this level the editor above shows each amplitude as a magnitude and a phase, so you can see this directly: change a phase and watch what the probabilities do.
Global phase and relative phase. Multiply both amplitudes by the same phase factor and nothing you can observe changes: no probability, and no relationship between the two amplitudes. That shared factor is the global phase. What does matter is the phase of \(\beta\) relative to \(\alpha\), the relative phase. It is 0° for |+⟩ and 180° for |−⟩, which is exactly the sign difference you saw above. Use the "shift both phases" control in the editor to see the bars and the relative phase stay put.
Bra notation and inner products¶
The bra. The ket \(|\psi\rangle\) has a partner, the bra \(\langle\psi|\). It lists the same two amplitudes, with each one replaced by its complex conjugate (the sign of the imaginary part is flipped). For real amplitudes the numbers do not change.
The inner product. \(\langle\varphi|\psi\rangle\) is a single number. Multiply the conjugate of each amplitude of \(\varphi\) by the matching amplitude of \(\psi\), then add the two products:
Three results are worth seeing. The editor above now shows the first two as numbers beside the written form.
- \(\langle\psi|\psi\rangle = |\alpha|^2 + |\beta|^2\), so normalization says \(\langle\psi|\psi\rangle = 1\). Watch it reach 1 when the state becomes valid.
- \(\langle 0|\psi\rangle = \alpha\) and \(\langle 1|\psi\rangle = \beta\). The inner product with a basis state reads off that basis state's amplitude.
- \(\langle 0|0\rangle = \langle 1|1\rangle = 1\) and \(\langle 0|1\rangle = 0\). The basis states are orthonormal: each is normalized, and the inner product of the two is zero.
The table shows the inner product of each named state (row) with each other named state (column). The diagonal is always 1, and some off-diagonal entries are 0. |+⟩ and |−⟩ are orthonormal too.
Naming the formalism¶
The language behind this is that of a Hilbert space: states are vectors, probabilities come from their inner products with other vectors (the "dual" vectors), and two vectors that differ only by a global phase are treated as the same physical state. A later treatment makes these ideas precise.
From Writing Down to Picturing¶
Compare what you can do now with what is still hard.
Here are |+⟩ and |−⟩ side by side as lists of numbers:
A list of numbers hides the sign and is hard to compare. We need a picture.
Takeaway¶
A qubit's state can be written as two amplitudes. Their squares give the probabilities and must add to 1, and the signs carry information the probabilities do not show.
How can we picture a state, including its sign, instead of reading a list of numbers?
Next: Bloch Sphere →