This series will use bra-ket notation as its default language for deep learning. Standard matrix notation is efficient for implementation, but it often hides the row/column logic that matters mathematically. Bra-ket notation makes the key-value structure explicit: bras produce coefficients by dot product, kets are the vectors being combined, and sums of ket-bras expose low-rank structure directly. This is often closer to how modern work analyzes MLPs, attention, and related architectures.
Let H≅Rd be a finite-dimensional inner-product space. A ket ∣x⟩∈H is a column vector, a bra ⟨u∣∈H∗ is a row vector, the bracket ⟨u∣x⟩ is a dot product, and the ket-bra ∣v⟩⟨u∣ is a rank-one operator.
A matrix can be written in row form or column form:
Self-attention has the same overall form, but now each coefficient depends on the full set of key-query brackets. By treating the keys as bras and the query as a ket, the dot product elegantly matches the operator structure. For token i and sequence length T,
The effective rank is upper bounded by the number of available pairs. For an MLP this is at most the hidden dimension m; for a single attention head at one token this is at most the token count T. In both cases the operator is built from a bounded number of ket-bra terms in a finite-dimensional Hilbert space, while the nonlinearity comes from input-dependent coefficients:
With this notation, the common structure of linear maps, MLPs, and self-attention is immediate. All three are sums of value vectors weighted by coefficients derived from inner products; they differ only in how those coefficients are produced. This is why bra-ket notation will be the default in the rest of this series: it makes the key-value structure explicit and keeps the relevant linear-algebraic content visible.
Part 2 will use this perspective to derive linear attention, from the original formulation to modern variants such as Gated DeltaNet.
Cite this post
```bibtex
@online{bra-ket-notation-deep-learning-1,
author = {Lucas Sun},
title = {Bra-Ket (Dirac) Notation in Deep Learning (Part 1)},
year = {2026},
month = {04},
day = {26},
url = {https://xtimecrystal.com/posts/260426-bra-ket-notation/},
}
```