Linear operations feel similar because they are built from the same small moves. An array has indices. An operation tells us which indices to keep, which indices to match, and which matched indices to sum away.
The bottom layer is not mysterious:
Einstein summation notation makes this visible. Here we use the array convention: a repeated index is summed. An index that remains visible is a coordinate of the output.
Indices are handles
Think of each index as a handle attached to an array. A vector has one handle, a matrix has two, and a higher-order tensor has more.
An operation is a rule for these handles:
- keep an index: it appears in the output,
- pair indices: keep both as a joint coordinate,
- contract an index: match it across factors and sum over it.
The preconditions come from these handles. If an index is contracted, both sides must have the same range. If no index is contracted, the dimensions do not need to match.
The smallest moves
Start with a vector
Scalar multiplication has no hidden index:
Each coordinate is scaled independently. The index
Dot product contracts one index:
The index
Over
Outer product keeps both indices:
Over
Nothing is summed. The output has two handles, so it is a matrix. The vector lengths may differ.
The contrast is small but decisive:
Matrix multiplication is a repeated dot product
Let
The index
So the shape rule is not arbitrary:
The middle
Tensor product keeps the worlds separate
The tensor product does not contract. It keeps the indices from both factors.
For vectors,
For matrices,
There is no repeated index, so there is no hidden sum. The result remembers both coordinate choices. If
This is why tensor products are natural for composite systems. They do not say “line these two things up and sum”. They say “carry both coordinate choices at once”.
Vector products are not one product
The phrase “vector product” hides several different index recipes.
| operation | index form | output | hidden sum? | main precondition |
|---|---|---|---|---|
| scalar multiplication | vector | no | ||
| dot product | scalar | yes, over | same length | |
| outer product | matrix | no | none between lengths | |
| matrix multiplication | matrix | yes, over | inner dimensions match | |
| tensor product | tensor/block matrix | no | none between dimensions | |
| cross product | vector | yes, over | dimension |
The cross product looks different because it uses the Levi-Civita symbol
Why the laws differ
The properties of an operation come from how the indices move.
Matrix multiplication is associative because two contractions can be performed in either grouping:
Both expressions sum over
It is not generally commutative because swapping the factors changes the wiring:
contract different handles and may not even be well-typed.
Tensor product is bilinear because multiplication distributes over addition in each visible slot:
It is not a dot product because no index disappears.
The rule of thumb
When an operation feels unclear, rewrite it with indices.
- Write the entries with their indices.
- Mark repeated indices as summed.
- Mark unrepeated indices as the output shape.
- Check that every summed index has the same range wherever it appears.
The operation then becomes a small piece of wiring. Some wires are left visible. Some wires are tied together and summed away. Most of linear algebra is a disciplined way of doing this without drawing the wires every time.