Matrix multiplication
The core mathematical operation powering artificial intelligence and neural networks.
First Mentioned
10/18/2026, 3:40:58 AM
Last Updated
10/18/2026, 3:46:04 AM
Research Retrieved
10/18/2026, 3:46:04 AM
Summary
Matrix multiplication is a fundamental binary operation in linear algebra that yields a new matrix from two factor matrices, provided the number of columns in the first matrix equals the number of rows in the second. First described by French mathematician Jacques Philippe Marie Binet in 1812 to represent the composition of linear maps, it is central to numerical analysis, statistics, physics, economics, and computational science. Standard matrix multiplication of square n x n matrices exhibits a worst-case computational complexity of O(n³), which researchers have progressively lowered via algorithms such as Strassen's algorithm and Coppersmith–Winograd variants. In modern computational architectures, matrix multiplication underpins deep learning and artificial intelligence workloads, driving the specialized design of hardware accelerators such as Nvidia's H100 and B100 graphics processing units (GPUs).
Referenced in 1 Document
Research Data
Extracted Attributes
Wikipedia
View on WikipediaMatrix multiplication
In mathematics, specifically in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the second matrix. The resulting matrix, known as the matrix product, has the number of rows of the first and the number of columns of the second matrix. The product of matrices A and B is denoted as AB. Matrix multiplication was first described by the French mathematician Jacques Philippe Marie Binet in 1812, to represent the composition of linear maps that are represented by matrices. Matrix multiplication is thus a basic tool of linear algebra, and as such has numerous applications in many areas of mathematics, as well as in applied mathematics, statistics, physics, economics, and engineering. Computing matrix products is a central operation in all computational applications of linear algebra.
Web Search Results
- Matrix multiplication - Wikipedia
Matrix multiplication was first described by the French mathematician Jacques Philippe Marie Binet in 1812, to represent the composition of linear maps that are represented by matrices. Matrix multiplication is thus a basic tool of linear algebra, and as such has numerous applications in many areas of mathematics, as well as in applied mathematics, statistics, physics, economics, and engineering. Computing matrix products is a central operation in all computational applications of linear algebra. ## Notation [edit] [...] Mathematical operation in linear algebra ") from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the second matrix. The resulting matrix, known as the matrix product, has the number of rows of the first and the number of columns of the second matrix. The product of matrices A and B is denoted as AB. [...] } The matrix multiplication algorithm that results from the definition requires, in the worst case, {\displaystyle n^{3}} multiplications and {\displaystyle (n-1)n^{2}} additions of scalars to compute the product of two square n×n matrices. Its computational complexity is therefore {\displaystyle O(n^{3})}, in a model of computation for which the scalar operations take constant time.
- Matrix multiplication algorithm - Wikipedia
## Iterative algorithm [edit] The definition of matrix multiplication is that if C = AB for an n × m matrix A and an m × p matrix B, then C is an n × p matrix with entries : {\displaystyle c_{ij}=\sum _{k=1}^{m}a_{ik}b_{kj}.} From this, a simple algorithm can be constructed which loops over the indices i from 1 through n and j from 1 through p, computing the above using a nested loop: Input: matrices A and B Let C be a new matrix of the appropriate size For i from 1 to n: + For j from 1 to p: - Let sum = 0 - For k from 1 to m: Set sum ← sum + Aik × Bkj - Set Cij ← sum Return C [...] Algorithm to multiply matrices Because matrix multiplication is such a central operation in many numerical algorithms, much work has been invested in making matrix multiplication algorithms efficient. Applications of matrix multiplication in computational problems are found in many fields including scientific computing and pattern recognition and in seemingly unrelated problems such as counting the paths through a graph "Graph (graph theory)"). Many different algorithms have been designed for multiplying matrices on different types of hardware, including parallel and distributed systems, where the computational work is spread over multiple processors (perhaps over a network). [...] It is an open question in theoretical computer science how well Strassen's algorithm can be improved in terms of asymptotic complexity. The matrix multiplication exponent, usually denoted {\displaystyle \omega }, is the smallest real number for which any {\displaystyle n\times n} matrix over a field can be multiplied together using {\displaystyle n^{\omega +o(1)}} field operations. The current best bound on {\displaystyle \omega } is {\displaystyle \omega <2.371339}, by Alman, Duan, Williams, Xu, Xu, and Zhou. This algorithm, like all other recent algorithms in this line of research, is a generalization of the Coppersmith–Winograd algorithm, which was given by Don Coppersmith and Shmuel Winograd in 1990. The conceptual idea of these algorithms is similar to Strassen's algorithm: a way is
- Matrix-by-matrix multiplication algorithm with 𝑂(𝑁^2𝑙𝑜𝑔_2𝑁) computational complexity for variable precision arithmetic
The matrix multiplication algorithm is a core element of scientific computing and machine learning. Its computational complexity affects other algebraic algorithms , including the matrix inversion (expressed in a recursive way), LU factorization (extension of Gaussian elimination), the determinant computations (via multiplications of diagonals of L and U), as well as neural-network training. The computational complexity of traditional matrix-by-matrix multiplications introduced by Jacques Philippe Marie Binét in 1812 is O(N3)O(N^{3}). It has been reduced by Volker Strassen to O(Nlog2(7)=N2.8074)O(N^{log\_{2}(7)}=N^{2.8074}) and further by Coppersmith-Winegrod down to O(N2.496)O(N^{2.496}). [...] In practice, the numerical operations are performed with some accuracy related to the number of digits stored with the floating-point representation. The state-of-the-art matrix-by-matrix multiplication algorithm assumes that we can process numbers in O(1)O(1) time without losing accuracy, including large numbers processed by galactic algorithms. [...] The term ϵbc\epsilon bc is of order ϵ\epsilon and it is considered to be too small. The term 1/ϵad1/\epsilon ad is of order 1/ϵ1/\epsilon and it is considered to be too big. We cancel them out after performing the multiplication (a+ϵb)(c+1/ϵd)(a+\epsilon b)(c+1/\epsilon d). We cancel small term using floor operator and we cancel large term using modulo operator. We cancel them after performing the multiplication, so the term ϵb\epsilon b can multiply the term 1/ϵd1/\epsilon d, cancel out ϵ\epsilon with 1/ϵ1/\epsilon and remain bdbd. In the general case, we replace a,b,c,da,b,c,d with matrices and use recursion.
- Matrix Multiplication - GeeksforGeeks
using System; using System.Collections.Generic; class GfG { static List< List< int>> multiply(int[,] mat1, int[,] mat2) { // rows in mat1 int n = mat1. GetLength(0); // cols in mat1 = rows in mat2 int m = mat1. GetLength(1); // cols in mat2 int q = mat2. GetLength(1); // Initialize the result matrix with dimensions n×q, filled with 0s List< List< int>> res = new List< List< int>>(); for (int i = 0; i < n; i ++) { List< int> row = new List< int>(new int[q]); res. Add(row); } // Matrix multiplication for (int i = 0; i < n; i ++) { for (int j = 0; j < q; j ++) { for (int k = 0; k < m; k ++) { res[i][j] += mat1[i, k] mat2[k, j]; } } } return res; } static void Main() { int[,] mat1 = {{1, [...] mat2. size(); // Initialize result matrix with dimensions n×q vector< vector< int>> res(n, vector< int>(q, 0)); // Matrix multiplication logic for (int i = 0; i < n; ++ i) { for (int j = 0; j < q; ++ j) { for (int k = 0; k < m; ++ k) { res[i][j] += mat1[i][k] mat2[k][j]; } } } return res;} int main() { vector< vector< int>> mat1 = { {1, 2, 3}, {4, 5, 6} }; vector< vector< int>> mat2 = { {7, 8}, {9, 10}, {11, 12} }; vector< vector< int>> res = multiply(mat1, mat2); for (auto & row : res) { for (int val : row) { cout << val << " "; } cout << endl; } return 0;} [...] Examples: > Input: mat1[][] = [[1, 2, 3], > [4, 5, 6]], > mat2[][] = [[7, 8], > [9, 10], > [11, 12]] > Output: [[58, 64], > [139, 154]] > Explanation: Matrix mat1[ ][ ] (2×3) is multiplied with Matrix mat2[ ][ ] (3×2) by computing the dot product of a's rows with b's columns. This results in a new matrix of size 2×2 containing the summed products for each position. > > Input: mat1[][] = [[17, 4], > [17, 16]], > mat2[][] = [9, 2], > [7, 1]] > Output: [[181, 38], > [265, 50]] > Explanation: Matrix mat1[ ][ ] (2×2) is multiplied with Matrix mat2[ ][ ] (2×2) by computing the dot product of a's rows with b's columns. This results in a new matrix of size 2×2 containing the summed products for each position. Try It Yourself redirect icon
- New Breakthrough Brings Matrix Multiplication Closer to Ideal | Quanta Magazine
## Enter the Matrix It may seem like an obscure problem, but matrix multiplication is a fundamental computational operation. It’s incorporated into a large proportion of the algorithms people use every day for a variety of tasks, from displaying sharper computer graphics to solving logistical problems in network theory. And as in other areas of computation, speed is paramount. Even slight improvements could eventually lead to significant savings of time, computational power and money. But for now, theoreticians are mainly interested in figuring out how fast the process can ever be.