Skip to content

Matrix Multiplication

The ordered contraction of compatible matrices, producing cᵢⱼ=Σₖaᵢₖbₖⱼ and representing composition of linear transformations.

Version
v1 · 2026-09-28 · History
Domain-specific #
10614
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomains
Linear Algebra, Matrix Operations → Mathematics
Aliases
Matrix product

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

  1. Assign domain and codomain dimensions.
  2. Match the inner dimension.
  3. Pair row and column entries.
  4. Aggregate over the shared index.
  5. 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

Local relationship map for Matrix MultiplicationParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Matrix MultiplicationDOMAINPrime abstraction: Composition — is a kind ofCompositionPRIME

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

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

Computed from structural-signature embeddings · 2026-10-08