Matrices for qubit states and operations
In Chapter 1, New Ways to Think about Bits, we represented bits with kets and vectors:

Let’s expand that notation for qubits.
When you apply a Hadamard (h
) gate to a |0⟩ qubit, the qubit goes into a halfway state. Here’s how we represent that halfway state in Dirac notation:

And here’s how we represent that state with a vector:

This qubit state crops up so often in quantum computing that it’s convenient to give the state its own symbol.
We put a plus sign inside a ket and say that .
In vector notation, the vector’s top number represents the amount of |0⟩’ness, while the bottom number represents an equal amount of |1⟩’ness. But what do the square roots do? What follows is a slight simplification.
Important note
A qubit’s state has two parts. When you take the square of either...