Math Foundations
Dirac Notation (Bra-Ket)
A compact notation for quantum states and operators using kets like |ψ⟩ and bras like ⟨ψ|.
Definition
Dirac notation, also called bra-ket notation, is the standard way to write quantum states and operations. A column vector is written as a ket |ψ⟩, its conjugate transpose as a bra ⟨ψ|, and an inner product as ⟨φ|ψ⟩.
In depth
Three conventions cover most of what you will read. First, |0⟩ and |1⟩ are the computational basis states. Second, |+⟩ = (|0⟩ + |1⟩)/√2 and |−⟩ = (|0⟩ − |1⟩)/√2 are the equal superpositions. Third, a string such as |101⟩ is a tensor product |1⟩ ⊗ |0⟩ ⊗ |1⟩, with the left-to-right order a convention that tools may reverse. Qiskit labels qubit 0 as the rightmost bit of the printed string, the opposite of many textbooks, so be careful when comparing outputs.
An example of the inner product: ⟨+|0⟩ = (1/√2)(⟨0| + ⟨1|)|0⟩ = 1/√2. Squaring gives 1/2, the probability of reading plus in the state zero. The notation makes such calculations short.
The outer product builds operators. The projector onto |1⟩ is |1⟩⟨1| = [0 0; 0 1]. The X gate is |0⟩⟨1| + |1⟩⟨0|. The Hadamard is |+⟩⟨0| + |−⟩⟨1|. Reading a gate as a list of where each basis state goes is often faster than writing the matrix.
Technical Definition
A ket |ψ⟩ represents a state vector. The corresponding bra ⟨ψ| is its conjugate transpose, a row vector. The product ⟨φ|ψ⟩ is a complex number, the inner product. The product |φ⟩⟨ψ| is an outer product, a matrix. For a basis state, |0⟩ = [1, 0] and |1⟩ = [0, 1], and the identity on one qubit is |0⟩⟨0| + |1⟩⟨1|. The probability of measuring outcome k in state |ψ⟩ is |⟨k|ψ⟩|².
Visual Explanation: An Analogy
Dirac notation is shorthand, like writing a recipe with abbreviations. The ket says here is a state, the bra says here is a way of asking a question about a state, and putting them together gives a number: how much the state agrees with the question.
Key facts
| Item | Detail |
|---|---|
| Introduced by | Paul Dirac, 1939 |
| Ket | |ψ⟩, a column vector |
| Bra | ⟨ψ|, its conjugate transpose |
| Probability | |⟨k|ψ⟩|² for outcome k |
Where the idea comes from
Paul Dirac introduced the bra-ket notation in a 1939 paper and used it in his textbook The Principles of Quantum Mechanics. It became standard because it makes calculations with inner products and operators short.
Real-World Use Cases
- Writing states and gates compactly in textbooks and papers
- Expressing measurement probabilities and expectation values
- Building projectors and operators from outer products
How it differs from related ideas
- Matrix notation lists numbers, while Dirac notation names states and works well for symbolic reasoning.
- Both notations describe the same mathematics, and conversions are routine.
Common Misconceptions
- A ket is not a different kind of object from a vector. It is a vector written in a convenient notation.
- The notation |01⟩ means a tensor product of |0⟩ and |1⟩, not a number between zero and one.
Frequently asked questions
What is a ket?
A state vector written as |ψ⟩.
What does ⟨a|b⟩ mean?
The inner product of two states, a complex number.
Why does Qiskit reverse bit order?
Qiskit puts qubit 0 on the right of the printed bitstring, matching the way integers are written.