beginner · Programming · The Qubit State Vector & Dirac Notation
The |+⟩ and |−⟩ States
Two of the most important states in quantum computing are not ∣0⟩ or ∣1⟩ but equal
superpositions of them. They appear constantly in algorithms, error correction, and teleportation,
and they have their own names: ∣+⟩ and ∣−⟩.
Expanding |+⟩ and |−⟩ in the computational basis
Written explicitly in the {∣0⟩,∣1⟩} basis:
∣+⟩=21(∣0⟩+∣1⟩),∣−⟩=21(∣0⟩−∣1⟩).
Both states are unit vectors: the probabilities of the two outcomes sum to one,
212+212=21+21=1.
They differ only in the relative sign of the ∣1⟩ amplitude. That sign is invisible to a
single measurement in the computational basis — both give outcome 0 or 1 with probability
21 each — but it becomes observable when the states are made to interfere with one
another, for example by applying a second Hadamard gate.
Preparing these states with the Hadamard gate
The Hadamard gate H has the matrix
H=21(111−1).
Applying it to the column vectors for ∣0⟩ and ∣1⟩ immediately recovers the
definitions above:
H∣0⟩=21(11)=∣+⟩,H∣1⟩=21(1−1)=∣−⟩.
So starting from the ground state ∣0⟩, a single Hadamard puts the qubit into ∣+⟩.
Try it
Prepare the qubit in the ∣+⟩ state. The simulator will compare your circuit's state vector
to the expected amplitudes 21 and 21, so the starting ∣0⟩
alone will not pass.
Run your code to see the quantum state.
After running, inspect the State Vector panel: you should see two amplitudes both equal to
≈0.707=21, with identical signs — that is ∣+⟩.
Sign in on the full site to ask questions and join the discussion.