9 min read
Complex Numbers and Vectors
The complex-number and vector-space toolkit every later lesson leans on, i, modulus, inner products, and norms.
Quantum amplitudes are complex numbers, not just probabilities, and quantum states are vectors built from them. Everything in this course, gates, superposition, interference, eigenvalues, is linear algebra over the complex numbers. This lesson is the toolkit; the next four build on it one piece at a time before the course touches a single line of Qiskit.
A complex number is , where (the real part) and (the imaginary part) are ordinary real numbers and satisfies . There's no "solving for "; it's simply defined into existence because has no real solution, and it turns out to be exactly the right extra ingredient quantum mechanics needs.
Two operations matter most for this course:
That second identity is the one you'll use constantly: whenever a lesson says "the probability of measuring this outcome is ," this is exactly what's being computed.
Every complex number can also be written as (Euler's formula), where is the modulus and is the phase, the angle makes on the complex plane. Multiplying two complex numbers in this form just adds their phases and multiplies their moduli: .
This is why quantum computing talks about "phase" so much: a gate that only changes an amplitude's phase (leaves alone) doesn't change any measurement probability at all, since regardless of , but phase differences between amplitudes are exactly what produce interference once you combine them, which is the entire mechanism later lessons (starting with superposition and interference) are built on.
Drag the sliders to change 's modulus and phase , and watch its position on the complex plane along with its conjugate and squared modulus .
Complex plane
1.00
45°
0.71 + 0.71i
1.000
1.000
0.71 - 0.71i
Drag either slider: sets how far sits from the origin, sets its angle. If were a qubit amplitude, (bottom row) is exactly the measurement probability it contributes, regardless of what is, only matters for that number.
A qubit's state is a column vector with complex entries, living in :
qubits together live in (the Tensor Products lesson later in this track covers exactly how that space is built up). The ket notation is just a label for "this is a vector"; and are the two vectors you'll see the most.
The inner product of two vectors and is
The bra is 's entries, conjugated and laid out as a row instead of a column; is literally that row times 's column, ordinary matrix multiplication. Conjugating the first vector is what makes come out real and non-negative for every vector, which is exactly what makes the next definition work:
This is the norm, and it's why every valid quantum state satisfies : a state vector is required to have norm 1, since and are measurement probabilities that must sum to 1.
Two vectors are orthogonal when . Check and : . They're orthogonal, and each has norm 1, together making them orthonormal, exactly what you want from the two basis states of a bit.