Lukas' Notes

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 and a scalar .

Scalar multiplication has no hidden index:

Each coordinate is scaled independently. The index is kept.

Dot product contracts one index:

The index appears twice and disappears. The output has no index, so it is a scalar. This is why the dot product requires and to have the same length.

Over , the inner-product version conjugates one side, for example . The wiring is unchanged; only the entry rule changes.

Outer product keeps both indices:

Over , the bra-ket version is .

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 and . Matrix multiplication is

The index is internal. It is the wire between the column handle of and the row handle of . The indices and remain visible, so the output has shape .

So the shape rule is not arbitrary:

The middle is consumed by the sum. The outside dimensions survive.

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 chooses a coordinate in the first space and chooses one in the second, then chooses a coordinate in the combined space.

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.

operationindex formoutputhidden sum?main precondition
scalar multiplicationvectorno
dot productscalaryes, over same length
outer productmatrixnonone between lengths
matrix multiplicationmatrixyes, over inner dimensions match
tensor producttensor/block matrixnonone between dimensions
cross productvectoryes, over dimension

The cross product looks different because it uses the Levi-Civita symbol . That extra tensor encodes orientation and antisymmetry. The result is still an index recipe: sum over hidden indices, keep the free index .

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 and and keep . The wiring is the same.

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.

  1. Write the entries with their indices.
  2. Mark repeated indices as summed.
  3. Mark unrepeated indices as the output shape.
  4. 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.