Matrix Multiplication¶
The ordered contraction of compatible matrices, producing cᵢⱼ=Σₖaᵢₖbₖⱼ and representing composition of linear transformations.
Core Idea¶
For A of shape m×n and B of shape n×p, AB has shape m×p. Each entry sums products between one row of A and one column of B across n intermediate coordinates.
The formula expresses linear-map composition: B acts first and A second. This explains associativity and typical noncommutativity, while implementations can vary without changing the operation.
Scope of Application¶
- Linear algebra. Composes transformations.
- Numerical computing. Implements dense and sparse kernels.
- Machine learning. Expresses linear layers and models.
- Graph algebra. Aggregates paths under chosen semirings.
Clarity¶
State shapes, scalar domain, vector convention, and factor order. For boolean, tropical, block, or sparse products, specify addition and multiplication. Inclusion test: Verify inner-dimension compatibility and compute each output by multiplying row-column components and aggregating over the shared index. Exclusion test: Exclude Hadamard multiplication, outer product, scalar multiplication, and contractions over different axes. Nearest boundary: The Hadamard product multiplies same-position entries and needs equal shapes; matrix product contracts one shared dimension. Exit condition: It ceases to be standard matrix multiplication when components are paired without the shared-index sum or factors are reordered. Common misclassifications: It is not Hadamard multiplication. It is not generally commutative. Outer dimensions do not determine compatibility. A faster algorithm does not define a different product. Nearest named distinctions: Hadamard product: Multiplies corresponding entries. Outer product: Forms pairwise products without summing. Dot product: Produces one scalar. Matrix addition: Combines equal shapes entrywise.
Manages Complexity¶
The shared-index rule compresses dependency paths into one operation and lets evaluation be optimized independently of meaning.
Abstract Reasoning¶
- Assign domain and codomain dimensions.
- Match the inner dimension.
- Pair row and column entries.
- Aggregate over the shared index.
- Interpret order and verify shape.
Knowledge Transfer¶
The contraction transfers to tensors and semirings when axes and algebra are restated. Elementwise array operations remain distinct.
Relationships to Other Abstractions¶
Current abstraction Matrix Multiplication Domain-specific
Parents (1) — more general patterns this builds on
-
Matrix Multiplication is a kind of Composition Prime
Matrix Multiplication is Composition of compatible linear transformations expressed by index contraction.
Hierarchy path (1) — routes to 1 parentless root
- Matrix Multiplication → Composition → Gestalt Principles → Holism
Neighborhood in Abstraction Space¶
Matrix Multiplication sits in a crowded region of the domain-specific corpus (23rd percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.
Family — Matrices, Measures & Numeric Structures (30 abstractions)
Nearest neighbors
- Distance Matrix — 0.91
- Symmetric Successive Over-Relaxation — 0.90
- Semidirect Product — 0.90
- Tensor Network — 0.90
- Symbolic Cholesky Decomposition — 0.89
Computed from structural-signature embeddings · 2026-10-08