Anm × n matrix: them rows are horizontal and then columns are vertical. Each element of a matrix is often denoted by a variable with twosubscripts. For example,a2,1 represents the element at the second row and first column of the matrix.
For example,denotes a matrix with two rows and three columns. This is often referred to as a "two-by-three matrix", a2 × 3 matrix, or a matrix of dimension2 × 3.
Inlinear algebra, matrices are used aslinear maps. Ingeometry, matrices are used forgeometric transformations (for examplerotations) andcoordinate changes. Innumerical analysis, many computational problems are solved by reducing them to a matrix computation, and this often involves computing with matrices of huge dimensions. Matrices are used in most areas of mathematics and scientific fields, either directly, or through their use in geometry and numerical analysis.
Square matrices, matrices with the same number of rows and columns, play a major role in matrix theory. Thedeterminant of a square matrix is a number associated with the matrix, which is fundamental for the study of a square matrix; for example, a square matrix isinvertible if and only if it has a nonzero determinant and theeigenvalues of a square matrix are the roots of itscharacteristic polynomial,.
A matrix is a rectangular array ofnumbers (or other mathematical objects), called the "entries" of the matrix. Matrices are subject to standardoperations such asaddition andmultiplication.[1] Most commonly, a matrix over afield is a rectangular array ofelements of.[2][3] Areal matrix and acomplex matrix are matrices whose entries are respectivelyreal numbers orcomplex numbers. More general types of entries are discussedbelow. For instance, this is a real matrix:
The numbers (or other objects) in the matrix are called itsentries or itselements. The horizontal and vertical lines of entries in a matrix are respectively calledrows andcolumns.[4]
The size of a matrix is defined by the number of rows and columns it contains. There is no limit to the number of rows and columns that a matrix (in the usual sense) can have as long as they are positive integers. A matrix withm rows andn columns is called anm × n matrix,[4] orm-by-n matrix,[5] wherem andn are called itsdimensions.[6] For example, the matrix above is a3 × 2 matrix.
Matrices with a single row are calledrow matrices orrow vectors, and those with a single column are calledcolumn matrices orcolumn vectors. A matrix with the same number of rows and columns is called asquare matrix.[7] A matrix with an infinite number of rows or columns (or both) is called an infinite matrix. In some contexts, such ascomputer algebra programs, it is useful to consider a matrix with no rows or no columns, called an empty matrix.[8]
The specifics of symbolic matrix notation vary widely, with some prevailing trends. Matrices are commonly written insquare brackets orparentheses,[9] so that anm × n matrix is represented asThis may be abbreviated by writing only a single generic term, possibly along with indices, as inor in the case that.
Matrices are usually symbolized usingupper-case letters (such as in the examples above),[10] while the correspondinglower-case letters, with two subscript indices (e.g.,, or), represent the entries.[11] In addition to using upper-case letters to symbolize matrices, many authors use a specialtypographical style, commonly boldface roman (non-italic), to further distinguish matrices from other mathematical objects. An alternative notation involves the use of a double-underline with the variable name, with or without boldface style, as in.[12]
The entry in theith row andjth column of a matrixA is sometimes referred to as the or entry of the matrix, and commonly denoted by or.[13] Alternative notations for that entry are and. For example, the entry of the following matrix is5 (also denoted,, or):
Sometimes, the entries of a matrix can be defined by a formula such as. For example, each of the entries of the following matrix is determined by the formula.In this case, the matrix itself is sometimes defined by that formula, within square brackets or double parentheses. For example, the matrix above is defined as or. If matrix size ism × n, the above-mentioned formula is valid for any and any. This can be specified separately or indicated usingm × n as a subscript. For instance, the matrix above is3 × 4, and can be defined as or.
Some programming languages utilize doubly subscripted arrays (or arrays of arrays) to represent an {m-by-n matrix. Some programming languages start the numbering of array indexes at zero, in which case the entries of anm × n matrix are indexed by and.[14] This article follows the more common convention in mathematical writing where enumeration starts from1.
Theset of allm-by-n real matrices is often denoted, or. The set of allm × n matrices over anotherfield, or over aringR, is similarly denoted, or. Ifm =n, such as in the case ofsquare matrices, one does not repeat the dimension:, or.[15] Often,, or, is used in place of.[16]
Several basic operations can be applied to matrices. Some, such astransposition andsubmatrix do not depend on the nature of the entries. Others, such asmatrix addition,scalar multiplication,matrix multiplication, androw operations involve operations on matrix entries and therefore require that matrix entries are numbers or belong to afield or aring.[17]
In this section, it is supposed that matrix entries belong to a fixed ring, which is typically a field of numbers.
Matrix addition and subtraction require matrices of a consistent size, and are calculated entrywise. ThesumA +B and the differenceA −B of twom × n matrices are:[18]
For example,
Familiar properties of numbers extend to these operations on matrices: for example, addition iscommutative, that is, the matrix sum does not depend on the order of the summands:A +B =B +A.[19]
The productcA of a numberc (also called ascalar in this context) and a matrixA is computed by multiplying each entry ofA byc:[20]This operation is calledscalar multiplication, but its result is not named "scalar product" to avoid confusion, since "scalar product" is often used as a synonym for "inner product".[21] For example:
Matrix subtraction is consistent with composition of matrix addition with scalar multiplication by–1:[22]
Schematic depiction of the matrix productAB of two matricesA andB
Multiplication of two matrices corresponds to the composition oflinear transformations represented by each matrix. It is defined if and only if the number of columns of the left matrix is the same as the number of rows of the right matrix. IfA is anm × n matrix andB is ann × p matrix, then theirmatrix productAB is them × p matrix whose entries are given by thedot product of the corresponding row ofA and the corresponding column ofB:[24]where1 ≤i ≤m and1 ≤j ≤p.[25] For example, the underlined entry 2340 in the product is calculated as(2 × 1000) + (3 × 100) + (4 × 10) = 2340:
Matrix multiplication satisfies the rules(AB)C =A(BC) (associativity), and(A +B)C =AC +BC as well asC(A +B) =CA +CB (left and rightdistributivity), whenever the size of the matrices is such that the various products are defined.[26] The productAB may be defined withoutBA being defined, namely ifA andB arem × n andn × k matrices, respectively, andm ≠k. Even if both products are defined, they generally need not be equal, that is:[27]
In other words,matrix multiplication is notcommutative, in marked contrast to (rational, real, or complex) numbers, whose product is independent of the order of the factors.[24] An example of two matrices not commuting with each other is:whereas
Besides the ordinary matrix multiplication just described, other less frequently used operations on matrices that can be considered forms of multiplication also exist, such as theHadamard product and theKronecker product.[28] They arise in solving matrix equations such as theSylvester equation.[29]
Asubmatrix of a matrix is a matrix obtained by deleting any collection of rows or columns or both.[33][34][35] For example, from the following3 × 4 matrix, we can construct a2 × 3 submatrix by removing row 3 and column 2:
Theminors and cofactors of a matrix are found by computing thedeterminant of certain submatrices.[35][36]
Aprincipal submatrix is a square submatrix obtained by removing certain rows and columns. The definition varies from author to author. According to some authors, a principal submatrix is a submatrix in which the set of row indices that remain is the same as the set of column indices that remain.[37][38] Other authors define a principal submatrix as one in which the firstk rows and columns, for some numberk, are the ones that remain;[39] this type of submatrix has also been called aleading principal submatrix.[40]
Matrices can be used to compactly write and work with multiple linear equations, that is, systems of linear equations. For example, ifA is anm × n matrix,x designates a column vector (that is,n × 1 matrix) ofn variablesx1,x2, ...,xn, andb is anm × 1 column vector, then the matrix equationis equivalent to the system of linear equations[41]
Using matrices, this can be solved more compactly than would be possible by writing out all the equations separately. Ifn =m and the equations areindependent, then this can be done by writing[42]whereA−1 is theinverse matrix ofA. IfA has no inverse, solutions—if any—can be found using itsgeneralized inverse.[43]
The vectors represented by a2 × 2 matrix correspond to the sides of a unit square transformed into a parallelogram.
Matrices and matrix multiplication reveal their essential features when related tolinear transformations, also known aslinear maps.A realm-by-n matrixA gives rise to a linear transformation mapping each vectorx in to the (matrix) productAx, which is a vector in Conversely, each linear transformation arises from a uniquem-by-n matrixA: explicitly, the(i,j)-entry ofA is theith coordinate off (ej), whereej = (0, ..., 0, 1, 0, ..., 0) is theunit vector with1 in thejth position and0 elsewhere. The matrixA is said to represent the linear mapf, andA is called thetransformation matrix off.[44]
For example, the2 × 2 matrixcan be viewed as the transform of theunit square into aparallelogram with vertices at(0, 0),(a,b),(a +c,b +d), and(c,d). The parallelogram pictured at the right is obtained by multiplyingA with each of the column vectors,,, and in turn. These vectors define the vertices of the unit square.[45] The following table shows several2 × 2 real matrices with the associated linear maps of. Theblue original is mapped to thegreen grid and shapes. The origin(0, 0) is marked with a black point.
Under the1-to-1 correspondence between matrices and linear maps, matrix multiplication corresponds tocomposition of maps:[50] if ak-by-m matrixB represents another linear map, then the compositiong ∘f is represented byBA since[51]
The last equality follows from the above-mentioned associativity of matrix multiplication.
Therank of a matrixA is the maximum number oflinearly independent row vectors of the matrix, which is the same as the maximum number of linearly independent column vectors.[52] Equivalently it is thedimension of theimage of the linear map represented byA.[53] Therank–nullity theorem states that the dimension of thekernel of a matrix plus the rank equals the number of columns of the matrix.[54]
Asquare matrix is a matrix with the same number of rows and columns. Ann-by-n matrix is known as a square matrix of ordern. Any two square matrices of the same order can be added and multiplied.The entriesaii form themain diagonal of a square matrix. They lie on the imaginary line running from the top left corner to the bottom right corner of the matrix.[55]
Square matrices of a given dimension form anoncommutative ring, which is one of the most common examples of a noncommutative ring.[56]
If all entries ofA below the main diagonal are zero,A is called anuppertriangular matrix. Similarly, if all entries ofA above the main diagonal are zero,A is called alower triangular matrix.[57] If all entries outside the main diagonal are zero,A is called adiagonal matrix.[58]
Theidentity matrixIn of sizen is then-by-n matrix in which all the elements on themain diagonal are equal to1 and all other elements are equal to0,[59] for example,It is a square matrix of ordern, and also a special kind ofdiagonal matrix. It is called an identity matrix because multiplication with it leaves a matrix unchanged:[59]for anym-by-n matrixA.
A scalar multiple of an identity matrix is called ascalar matrix.[60]
A square matrixA that is equal to its transpose, that is,A =AT, is asymmetric matrix. If instead,A is equal to the negative of its transpose, that is,A = −AT, thenA is askew-symmetric matrix. In complex matrices, symmetry is often replaced by the concept ofHermitian matrices, which satisfiesA∗ =A, where the star orasterisk denotes theconjugate transpose of the matrix, that is, the transpose of thecomplex conjugate ofA.[61]
By thespectral theorem, real symmetric matrices and complex Hermitian matrices have aneigenbasis; that is, every vector is expressible as alinear combination of eigenvectors. In both cases, all eigenvalues are real.[62] This theorem can be generalized to infinite-dimensional situations related to matrices with infinitely many rows and columns.[63]
A square matrixA is calledinvertible ornon-singular if there exists a matrixB such that[64][65]whereIn is then × nidentity matrix with1 for each entry on themain diagonal and0 elsewhere. IfB exists, it is unique and is called theinverse matrix ofA, denotedA−1.[66]
There are manyalgorithms for testing whether a square matrix is invertible, and, if it is, computing its inverse. One of the oldest, which is still in common use isGaussian elimination.[67]
A symmetric real matrixA is calledpositive-definite if the associatedquadratic formhas a positive value for every nonzero vectorx in. Iff(x) yields only negative values thenA isnegative-definite; iff does produce both negative and positive values thenA is indefinite.[68] If the quadratic formf yields only non-negative values (positive or zero), the symmetric matrix is calledpositive-semidefinite (or if only non-positive values, then negative-semidefinite); hence the matrix is indefinite precisely when it is neither positive-semidefinite nor negative-semidefinite.[69]
A symmetric matrix is positive-definite if and only if all its eigenvalues are positive, that is, the matrix is positive-semidefinite and it is invertible.[70] The table at the right shows two possibilities for 2-by-2 matrices. The eigenvalues of a diagonal matrix are simply the entries along the diagonal,[71] and so in these examples, the eigenvalues can be read directly from the matrices themselves. The first matrix has two eigenvalues that are both positive, while the second has one that is positive and another that is negative.
Allowing as input two different vectors instead yields thebilinear form associated toA:[72]
An orthogonal matrixA is necessarilyinvertible (with inverseA−1 =AT),unitary (A−1 =A*), andnormal (A*A =AA*). Thedeterminant of any orthogonal matrix is either+1 or−1. Aspecial orthogonal matrix is an orthogonal matrix withdeterminant+1. As alinear transformation, every orthogonal matrix with determinant+1 is a purerotation without reflection, i.e., the transformation preserves the orientation of the transformed structure, while every orthogonal matrix with determinant−1 reverses the orientation, i.e., is a composition of a purereflection and a (possibly null) rotation. The identity matrices have determinant1 and are pure rotations by an angle zero.[76]
Thetrace,tr(A) of a square matrixA is the sum of its diagonal entries. While matrix multiplication is not commutative as mentionedabove, the trace of the product of two matrices is independent of the order of the factors:[78]This is immediate from the definition of matrix multiplication:[79]It follows that the trace of the product of more than two matrices is independent ofcyclic permutations of the matrices; however, this does not in general apply for arbitrary permutations. For example,tr(ABC) ≠ tr(BAC), in general.[80] Also, the trace of a matrix is equal to that of its transpose,[81] that is,
A linear transformation on given by the indicated matrix. The determinant of this matrix is−1, as the area of the green parallelogram at the right is1, but the map reverses theorientation, since it turns the counterclockwise orientation of the vectors to a clockwise one.
Thedeterminant of a square matrixA (denoteddet(A) or|A|) is a number encoding certain properties of the matrix. A matrix is invertibleif and only if its determinant is nonzero.[82] Itsabsolute value equals the area (in) or volume (in) of the image of the unit square (or cube), while its sign corresponds to the orientation of the corresponding linear map: the determinant is positive if and only if the orientation is preserved.[83]
The determinant of2 × 2 matrices is given by[84]The determinant of3 × 3 matrices involves six terms (rule of Sarrus). The more lengthyLeibniz formula generalizes these two formulae to all dimensions.[85]
The determinant of a product of square matrices equals the product of their determinants:or using alternate notation:[86]Adding a multiple of any row to another row, or a multiple of any column to another column, does not change the determinant. Interchanging two rows or two columns affects the determinant by multiplying it by−1.[87] Using these operations, any matrix can be transformed to a lower (or upper) triangular matrix, and for such matrices, the determinant equals the product of the entries on the main diagonal; this provides a method to calculate the determinant of any matrix. Finally, theLaplace expansion expresses the determinant in terms ofminors, that is, determinants of smaller matrices.[88] This expansion can be used for a recursive definition of determinants (taking as starting case the determinant of a1 × 1 matrix, which is its unique entry, or even the determinant of a0 × 0 matrix, which is1), that can be seen to be equivalent to the Leibniz formula. Determinants can be used to solvelinear systems usingCramer's rule, where the division of the determinants of two related square matrices equates to the value of each of the system's variables.[89]
A number and a nonzero vectorv satisfyingare called aneigenvalue and aneigenvector ofA, respectively.[90][91] The numberλ is an eigenvalue of ann × n matrixA if and only if(A −λIn) is not invertible, which isequivalent to[92]The polynomialpA in anindeterminateX given by evaluation of the determinantdet(XIn −A) is called thecharacteristic polynomial ofA. It is amonic polynomial ofdegreen. Therefore the polynomial equationpA(λ) = 0 has at mostn different solutions, that is, eigenvalues of the matrix.[93] They may be complex even if the entries ofA are real.[94] According to theCayley–Hamilton theorem,pA(A) =0, that is, the result of substituting the matrix itself into its characteristic polynomial yields thezero matrix.[95]
Matrix calculations can be often performed with different techniques. Many problems can be solved by both direct algorithms and iterative approaches. For example, the eigenvectors of a square matrix can be obtained by finding asequence of vectorsxnconverging to an eigenvector whenn tends toinfinity.[96]
To choose the most appropriate algorithm for each specific problem, it is important to determine both the effectiveness and precision of all the available algorithms. The domain studying these matters is callednumerical linear algebra.[97] As with other numerical situations, two main aspects are thecomplexity of algorithms and theirnumerical stability.
Determining the complexity of an algorithm means findingupper bounds or estimates of how many elementary operations such as additions and multiplications of scalars are necessary to perform some algorithm, for example, multiplication of matrices. Calculating the matrix product of twon-by-n matrices using the definition given above needsn3 multiplications, since for any of then2 entries of the product,n multiplications are necessary. TheStrassen algorithm outperforms this "naive" algorithm; it needs onlyn2.807 multiplications.[98] Theoretically faster but impracticalmatrix multiplication algorithms have been developed,[99] as have speedups to this problem usingparallel algorithms ordistributed computation systems such asMapReduce.[100]
In many practical situations, additional information about the matrices involved is known. An important case concernssparse matrices, that is, matrices whose entries are mostly zero. There are specifically adapted algorithms for, say, solving linear systemsAx =b for sparse matricesA, such as theconjugate gradient method.[101]
An algorithm is, roughly speaking, numerically stable if little deviations in the input values do not lead to big deviations in the result. For example, one can calculate the inverse of a matrix by computing itsadjugate matrix:However, this may lead to significant rounding errors if the determinant of the matrix is very small. Thenorm of a matrix can be used to capture theconditioning of linear algebraic problems, such as computing a matrix's inverse.[102]
There are several methods to render matrices into a more easily accessible form. They are generally referred to asmatrix decomposition ormatrix factorization techniques. These techniques are of interest because they can make computations easier.
TheLU decomposition factors matrices as a product of lower (L) and an uppertriangular matrices (U).[103] Once this decomposition is calculated, linear systems can be solved more efficiently by a simple technique calledforward and back substitution. Likewise, inverses of triangular matrices are algorithmically easier to calculate. TheGaussian elimination is a similar algorithm; it transforms any matrix torow echelon form.[104] Both methods proceed by multiplying the matrix by suitableelementary matrices, which correspond topermuting rows or columns and adding multiples of one row to another row.Singular value decomposition (SVD) expresses any matrixA as a productUDV∗, whereU andV areunitary matrices andD is a diagonal matrix.[105]
An example of a matrix in Jordan normal form. The grey blocks are called Jordan blocks.
Theeigendecomposition ordiagonalization expressesA as a productVDV−1, whereD is a diagonal matrix andV is a suitable invertible matrix.[106] IfA can be written in this form, it is calleddiagonalizable. More generally, and applicable to all matrices, the Jordan decomposition transforms a matrix intoJordan normal form, that is to say matrices whose only nonzero entries are the eigenvaluesλ1 toλn ofA, placed on the main diagonal and possibly entries equal to one directly above the main diagonal, as shown at the right.[107] Given the eigendecomposition, thenth power ofA (that is,n-fold iterated matrix multiplication) can be calculated viaand the power of a diagonal matrix can be calculated by taking the corresponding powers of the diagonal entries, which is much easier than doing the exponentiation forA instead. This can be used to compute thematrix exponentialeA, a need frequently arising in solvinglinear differential equations,matrix logarithms andsquare roots of matrices.[108] To avoid numericallyill-conditioned situations, further algorithms such as theSchur decomposition can be employed.[109]
Matrices can be generalized in different ways. Abstract algebra uses matrices with entries in more generalfields or evenrings, while linear algebra codifies properties of matrices in the notion of linear maps. It is possible to consider matrices with infinitely many columns and rows. Another extension istensors, which can be seen as higher-dimensional arrays of numbers, as opposed to vectors, which can often be realized as sequences of numbers, while matrices are rectangular or two-dimensional arrays of numbers.[110] Matrices, subject to certain requirements tend to formgroups known as matrix groups.[111] Similarly under certain conditions matrices formrings known asmatrix rings.[112] Though the product of matrices is not in general commutative, certain matrices formfields sometimes called matrix fields.[113] (However the term "matrix field" is ambiguous, also referring to certain forms of physicalfields that continuously map points of some space to matrices.[114]) In general, matrices over any ring and theirmultiplication can be represented as the arrows and composition of arrows in acategory, thecategory of matrices over that ring. The objects of this category are natural numbers, representing the dimensions of the matrices.[115]
This article focuses on matrices whose entries are real or complex numbers.However, matrices can be considered with much more general types of entries than real or complex numbers. As a first step of generalization, anyfield, that is, aset whereaddition,subtraction,multiplication, anddivision operations are defined and well-behaved, may be used instead of or, for examplerational numbers orfinite fields. For example,coding theory makes use of matrices over finite fields.[116] Wherevereigenvalues are considered, as these are roots of a polynomial, they may exist only in a larger field than that of the entries of the matrix. For instance, they may be complex in the case of a matrix with real entries. The possibility to reinterpret the entries of a matrix as elements of a larger field (for example, to view a real matrix as a complex matrix whose entries happen to be all real) then allows considering each square matrix to possess a full set of eigenvalues.[117] Alternatively one can consider only matrices with entries in analgebraically closed field, such as from the outset.[118]
Matrices whose entries arepolynomials,[119] and more generally, matrices with entries in aringR are widely used in mathematics.[1] Rings are a more general notion than fields in that a division operation need not exist. The very same addition and multiplication operations of matrices extend to this setting, too. The setM(n,R) (also denotedMn(R)[15]) of all squaren-by-n matrices overR is a ring calledmatrix ring, isomorphic to theendomorphism ring of the leftR-moduleRn.[120] If the ringR iscommutative, that is, its multiplication is commutative, then the ringM(n,R) is also anassociative algebra overR. Thedeterminant of square matrices over a commutative ringR can still be defined using theLeibniz formula; such a matrix is invertible if and only if its determinant isinvertible inR, generalizing the situation over a fieldF, where every nonzero element is invertible.[121] Matrices oversuperrings are calledsupermatrices.[122]
Matrices do not always have all their entries in the same ring– or even in any ring at all. One special but common case isblock matrices, which may be considered as matrices whose entries themselves are matrices. The entries need not be square matrices, and thus need not be members of anyring; but in order to multiply them, their sizes must fulfill certain conditions: each pair of submatrices that are multiplied in forming the overall product must have compatible sizes.[123]
Linear maps are equivalent tom-by-n matrices, as describedabove. More generally, any linear mapf :V →W between finite-dimensionalvector spaces can be described by a matrixA = (aij), after choosingbasesv1, ...,vn ofV, andw1, ...,wm ofW (son is the dimension ofV andm is the dimension ofW), which is such thatIn other words, columnj ofA expresses the image ofvj in terms of the basis vectorswi ofW; thus this relation uniquely determines the entries of the matrixA. The matrix depends on the choice of the bases: different choices of bases give rise to different, butequivalent matrices.[124] Many of the above concrete notions can be reinterpreted in this light, for example, the transpose matrixAT describes thetranspose of the linear map given byA, concerning thedual bases.[125]
These properties can be restated more naturally: thecategory of matrices with entries in a field with multiplication as composition isequivalent to the category of finite-dimensionalvector spaces and linear maps over this field.[126]
More generally, the set ofm × n matrices can be used to represent theR-linear maps between the free modulesRm andRn for an arbitrary ringR with unity. Whenn =m composition of these maps is possible, and this gives rise to thematrix ring ofn × n matrices representing theendomorphism ring ofRn.[127]
Agroup is a mathematical structure consisting of a set of objects together with abinary operation, that is, an operation combining any two objects to a third, subject to certain requirements.[128] A group in which the objects areinvertible matrices and the group operation is matrix multiplication is called amatrix group of degree.[129] Every such matrix group is asubgroup of (that is, a smaller group contained within) the group ofall invertible matrices, thegeneral linear group of degree.[130]
Any property of square matrices that is preserved under matrix products and inverses can be used to define a matrix group. For example, the set of all matrices whose determinant is1 form a group called thespecial linear group of degree.[131] The set oforthogonal matrices, determined by the conditionform theorthogonal group.[132] Every orthogonal matrix hasdeterminant1 or−1. Orthogonal matrices with determinant1 form a group called thespecial orthogonal group.[133]
It is also possible to consider matrices with infinitely many rows and columns.[136] The basic operations introduced above are defined the same way in this case. Matrix multiplication, however, and all operations stemming therefrom are only meaningful when restricted to certain matrices, since thesum featuring in the above definition of the matrix product will contain an infinity of summands.[137] An easy way to circumvent this issue is to restrict tofinitary matrices all of whose rows (or columns) contain only finitely many nonzero terms.[138] As in the finite case (seeabove), where matrices describe linear maps, infinite matrices can be used to describeoperators on Hilbert spaces, where convergence andcontinuity questions arise. However, the explicit point of view of matrices tends to obfuscate the matter,[139] and the abstract and more powerful tools offunctional analysis are used instead, by relating matrices to linear maps (as in the finite caseabove), but imposing additional convergence and continuity constraints.
Anempty matrix is a matrix in which the number of rows or columns (or both) is zero.[140][8] Empty matrices can be a usefulbase case for certainrecursive constructions,[141] and can help to deal with maps involving thezero vector space.[142] For example, ifA is a3 × 0 matrix andB is a0 × 3 matrix, thenAB is the3 × 3zero matrix corresponding to the null map from a 3-dimensional spaceV to itself, whileBA is a0 × 0 matrix. There is no common notation for empty matrices, but mostcomputer algebra systems allow creating and computing with them.[143] The determinant of the0 × 0 matrix is conventionally defined to be 1, consistent with theempty product occurring in the Leibniz formula for the determinant.[144] This value is also needed for consistency with the2 × 2 case of theDesnanot–Jacobi identity relating determinants to the determinants of smaller matrices.[145]
Asemiring is similar to a ring, but elements need not haveadditive inverses, therefore one cannot do subtraction freely there. The definition of addition and multiplication of matrices with entries in a ring applies to matrices with entries in a semiring without modification. Matrices of fixed size with entries in a semiring form acommutative monoid under addition.[146] Square matrices of fixed size with entries in a semiring form a semiring under addition and multiplication.[146]
The determinant of ann × n square matrix with entries in acommutative semiring cannot be defined in general because the definition would involve additive inverses of semiring elements. What plays its role instead is the pair of positive and negative determinants
Matrices and their multiplication can be defined with entries objects of acategory equipped with a "tensor product" similar to multiplication in a ring, havingcoproducts similar to addition in a ring, in that the former isdistributive over the latter.[149] However, the multiplication thus defined may be only associative in a sense weaker than usual. These are part of a bigger structure called thebicategory of matrices. The complete description of the above summary for interested readers follows.
The functor is distributive over coproducts; i.e., for all object and a family of objects in, the canonical-morphisms areisomorphisms. In particular, the canonical morphisms and are isomorphisms.
The composition of 1-morphisms and, which can be understood as matrix multiplication, is
The identity 1-morphism on is
A 2-morphism between 1-morphisms is a family of-morphisms. The definition of vertical and horizontal composition of 2-morphisms is natural: the vertical composition is componentwise composition of-morphisms; the horizontal composition is that derived from the functoriality of and theuniversal property of coproducts.
In general, the bicategory of matrices need not be a strict2-category. For example, the composition of 1-morphisms may not be associative in the usual strict sense, but only up tocoherent isomorphism.
There are numerous applications of matrices, both in mathematics and other sciences. Some of them merely take advantage of the compact representation of a set of numbers in a matrix. For example,Text mining and automatedthesaurus compilation makes use ofdocument-term matrices such astf-idf to track frequencies of certain words in several documents.[150]
Complex numbers can be represented by particular real 2-by-2 matrices viaunder which addition and multiplication of complex numbers and matrices correspond to each other. For example, 2-by-2 rotation matrices represent the multiplication with some complex number ofabsolute value 1, asabove. A similar interpretation is possible forquaternions[151] andClifford algebras in general.[152]
Ingame theory andeconomics, thepayoff matrix encodes the payoff for two players, depending on which out of a given (finite) set of strategies the players choose.[153] The expected outcome of the game, when both players playmixed strategies, is obtained by multiplying this matrix on both sides by vectors representing the strategies.[154] Theminimax theorem central to game theory is closely related to theduality theory of linear programs, which are often formulated in terms of matrix-vector products.[155]
Earlyencryption techniques such as theHill cipher also used matrices. However, due to the linear nature of matrices, these codes are comparatively easy to break.[156]Computer graphics uses matrices to represent objects; to calculate transformations of objects using affinerotation matrices to accomplish tasks such as projecting a three-dimensional object onto a two-dimensional screen, corresponding to a theoretical camera observation; and to apply image convolutions such as sharpening, blurring, edge detection, and more.[157] Matrices over apolynomial ring are important in the study ofcontrol theory.[158]
Theadjacency matrix of afinite graph is a basic notion ofgraph theory.[160] It records which vertices of the graph are connected by an edge. Matrices containing just two different values (1 and0 meaning for example "yes" and "no", respectively) are calledlogical matrices. Thedistance (or cost) matrix contains information about the distances of the edges.[161] These concepts can be applied towebsites connected byhyperlinks,[162] or cities connected by roads etc., in which case (unless the connection network is extremely dense) the matrices tend to besparse, that is, contain few nonzero entries. Therefore, specifically tailored matrix algorithms can be used innetwork theory.[163]
At thesaddle point(x = 0,y = 0) (red) of the functionf (x,−y) =x2 −y2, the Hessian matrix isindefinite.
It encodes information about the local growth behavior of the function: given acritical pointx = (x1, ...,xn), that is, a point where the firstpartial derivatives off vanish, the function has alocal minimum if the Hessian matrix ispositive definite.Quadratic programming can be used to find global minima or maxima of quadratic functions closely related to the ones attached to matrices (seeabove).[165]
Another matrix frequently used in geometrical situations is theJacobi matrix of a differentiable map. Iff1, ...,fm denote the components off, then the Jacobi matrix is defined as[166]Ifn >m, and if the rank of the Jacobi matrix attains its maximal valuem,f is locally invertible at that point, by theimplicit function theorem.[167]
Partial differential equations can be classified by considering the matrix of coefficients of the highest-order differential operators of the equation. Forelliptic partial differential equations this matrix is positive definite, which has a decisive influence on the set of possible solutions of the equation in question.[168]
Thefinite element method is an important numerical method to solve partial differential equations, widely applied in simulating complex physical systems. It attempts to approximate the solution to some equation by piecewise linear functions, where the pieces are chosen concerning a sufficiently fine grid, which in turn can be recast as a matrix equation.[169]
Two different Markov chains. The chart depicts the number of particles (of a total of 1000) in state "2". Both limiting values can be determined from the transition matrices, which are given by (red) and (black).
Stochastic matrices are square matrices whose rows areprobability vectors, that is, whose entries are non-negative and sum up to one. Stochastic matrices are used to defineMarkov chains with finitely many states.[170] A row of the stochastic matrix gives the probability distribution for the next position of some particle currently in the state that corresponds to the row. Properties of the Markov chain—likeabsorbing states, that is, states that any particle attains eventually—can be read off the eigenvectors of the transition matrices.[171]
The first model ofquantum mechanics (Heisenberg, 1925) used infinite-dimensional matrices to define the operators that took over the role of variables like position, momentum and energy from classical physics.[177] (This is sometimes referred to asmatrix mechanics.[178]) Matrices, both finite and infinite-dimensional, have since been employed for many purposes in quantum mechanics. One particular example is thedensity matrix, a tool used in calculating theprobabilities of the outcomes ofmeasurements performed onphysical systems.[179][180]
Another matrix serves as a key tool for describing the scattering experiments that form the cornerstone of experimental particle physics: Collision reactions such as occur inparticle accelerators, where non-interacting particles head towards each other and collide in a small interaction zone, with a new set of non-interacting particles as the result, can be described as the scalar product of outgoing particle states and a linear combination of ingoing particle states. The linear combination is given by a matrix known as theS-matrix, which encodes all information about the possible interactions between particles.[183]
A general application of matrices in physics is the description of linearly coupled harmonic systems. Theequations of motion of such systems can be described in matrix form, with a mass matrix multiplying a generalized velocity to give the kinetic term, and aforce matrix multiplying a displacement vector to characterize the interactions. The best way to obtain solutions is to determine the system'seigenvectors, itsnormal modes, by diagonalizing the matrix equation. Techniques like this are crucial when it comes to the internal dynamics ofmolecules: the internal vibrations of systems consisting of mutually bound component atoms.[184] They are also needed for describing mechanical vibrations, and oscillations in electrical circuits.[185]
Geometrical optics provides further matrix applications. In this approximative theory, thewave nature of light is neglected. The result is a model in whichlight rays are indeedgeometrical rays. If the deflection of light rays by optical elements is small, the action of alens or reflective element on a given light ray can be expressed as multiplication of a two-component vector with a two-by-two matrix calledray transfer matrix analysis: the vector's components are the light ray's slope and its distance from the optical axis, while the matrix encodes the properties of the optical element. There are two kinds of matrices, viz. arefraction matrix describing the refraction at a lens surface, and atranslation matrix, describing the translation of the plane of reference to the next refracting surface, where another refraction matrix applies.The optical system, consisting of a combination of lenses and reflective elements, is simply described by the matrix resulting from the product of the components' matrices.[186]
Electronic circuits that are composed of linear components (such as resistors, inductors and capacitors) obeyKirchhoff's circuit laws, which leads to a system of linear equations, which can be described with a matrix equation that relates the source currents and voltages to the resultant currents and voltages at each point in the circuit, and where the matrix entries are determined by the circuit.[187]
This use of the termmatrix in mathematics (an English word for "womb" in the 19th century, from Latin, as well as a jargon wordin printing,in biology andin geology[194]) was coined byJames Joseph Sylvester in 1850,[195] who understood a matrix as an object giving rise to several determinants today calledminors, that is to say, determinants of smaller matrices that derive from the original one by removing columns and rows. In an 1851 paper, Sylvester explains:[196]
I have in previous papers defined a "Matrix" as a rectangular array of terms, out of which different systems of determinants may be engendered from the womb of a common parent.
Arthur Cayley published a treatise on geometric transformations using matrices that were not rotated versions of the coefficients being investigated as had previously been done. Instead, he defined operations such as addition, subtraction, multiplication, and division as transformations of those matrices and showed the associative and distributive properties held. Cayley investigated and demonstrated the non-commutative property of matrix multiplication as well as the commutative property of matrix addition.[189] Early matrix theory had limited the use of arrays almost exclusively to determinants and Cayley's abstract matrix operations were revolutionary. He was instrumental in proposing a matrix concept independent of equation systems. In 1858, Cayley published hisA memoir on the theory of matrices[197][198] in which he proposed and demonstrated theCayley–Hamilton theorem.[189]
The English mathematicianCuthbert Edmund Cullis was the first to use modern bracket notation for matrices in 1913 and he simultaneously demonstrated the first significant use of the notationA = [ai,j] to represent a matrix whereai,j refers to theith row and thejth column.[189]
The modern study of determinants sprang from several sources.[199]Number-theoretical problems ledGauss to relate coefficients ofquadratic forms, that is, expressions such asx2 +xy − 2y2, andlinear maps in three dimensions to matrices.Eisenstein further developed these notions, including the remark that, in modern parlance,matrix products arenon-commutative.Cauchy was the first to prove general statements about determinants, using as the definition of the determinant of a matrixA = [ai,j] the following: replace the powersajk byaj,k in thepolynomialwhere denotes theproduct of the indicated terms. He also showed, in 1829, that theeigenvalues of symmetric matrices are real.[200]Jacobi studied "functional determinants"—later calledJacobi determinants by Sylvester—which can be used to describe geometric transformations at a local (orinfinitesimal) level, seeabove.Kronecker'sVorlesungen über die Theorie der Determinanten[201] andWeierstrass'sZur Determinantentheorie,[202] both published in 1903, first treated determinantsaxiomatically, as opposed to previous more concrete approaches such as the mentioned formula of Cauchy. At that point, determinants were firmly established.[203][199]
Many theorems were first established for small matrices only, for example, theCayley–Hamilton theorem was proved for2 × 2 matrices by Cayley in the aforementioned memoir, and byHamilton for4 × 4 matrices.Frobenius, working onbilinear forms, generalized the theorem to all dimensions (1898). Also at the end of the 19th century, theGauss–Jordan elimination (generalizing a special case now known asGauss elimination) was established byWilhelm Jordan. In the early 20th century, matrices attained a central role in linear algebra,[204] partially due to their use in the classification of thehypercomplex number systems of the previous century.[205]
Let us give the name ofmatrix to any function, of however many variables, that does not involve anyapparent variables. Then, any possible function other than a matrix derives from a matrix using generalization, that is, by considering the proposition that the function in question is true with all possible values or with some value of one of the arguments, the other argument or arguments remaining undetermined.
For example, a functionΦ(x,y) of two variablesx andy can be reduced to acollection of functions of a single variable, such asy, by "considering" the function for all possible values of "individuals"ai substituted in place of a variablex. And then the resulting collection of functions of the single variabley, that is,∀ai: Φ(ai,y), can be reduced to a "matrix" of values by "considering" the function for all possible values of "individuals"bi substituted in place of variabley:
Alfred Tarski in his 1941Introduction to Logic used the word "matrix" synonymously with the notion oftruth table as used in mathematical logic.[209]
^Greub (1975, p. 90). Note however that Greub follows a transposed convention of representing a transformation by multiplying a row vector by a matrix, rather than multiplying a matrix by a column vector, leading to the reversed order for the two matrices in the product that represents a composition.
^"Not much of matrix theory carries over to infinite-dimensional spaces, and what does is not so useful, but it sometimes helps." Halmos 1982, p. 23, Chapter 5.
^"Empty Matrix: A matrix is empty if either its row or column dimension is zero",GlossaryArchived 2009-04-29 at theWayback Machine, O-Matrix v6 User Guide
^The earliest published example is J. J. Sylvester (1850) "Additions to the articles in the September number of this journal, 'On a new class of theorems,' and on Pascal's theorem,"The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science,37: 363-370.From page 369: "For this purpose, we must commence, not with a square, but with an oblong arrangement of terms consisting, suppose, of m lines and n columns. This does not in itself represent a determinant, but is, as it were, a Matrix out of which we may form various systems of determinants ... "
^Whitehead, Alfred North; and Russell, Bertrand (1913)Principia Mathematica to *56, Cambridge at the University Press, Cambridge UK (republished 1962) cf page 162ff.
Bernstein, Dennis S. (2009),Matrix mathematics: theory, facts, and formulas (2nd ed.), Princeton, N.J: Princeton University Press,ISBN978-1-4008-3334-4
Bhaya, Amit; Kaszkurewicz, Eugenius (2006),Control Perspectives on Numerical Algorithms and Matrix Problems, Advances in Design and Control, vol. 10, SIAM,ISBN9780898716023
Bierens, Herman J. (2004),Introduction to the Mathematical and Statistical Foundations of Econometrics, Cambridge University Press,ISBN9780521542241
Boos, Johann (2000),Classical and Modern Methods in Summability, Oxford mathematical monographs, Oxford University Press,ISBN9780198501657
Bretscher, Otto (2005),Linear Algebra with Applications (3rd ed.), Prentice Hall
Cameron, Peter J. (2014),"Matrix groups"(PDF), in Hogben, Leslie (ed.),Handbook of Linear Algebra, Discrete Mathematics and its Applications (Boca Raton) (2nd ed.), CRC Press, Boca Raton, FL,ISBN978-1-4665-0728-9,MR3013937
Gilbarg, David;Trudinger, Neil S. (2001),Elliptic partial differential equations of second order (2nd ed.), Berlin, DE; New York, NY: Springer-Verlag,ISBN978-3-540-41160-4
Krzanowski, Wojtek J. (1988),Principles of multivariate analysis, Oxford Statistical Science Series, vol. 3, The Clarendon Press Oxford University Press,ISBN978-0-19-852211-9,MR0969370
Latouche, Guy; Ramaswami, Vaidyanathan (1999),Introduction to matrix analytic methods in stochastic modeling (1st ed.), Philadelphia, PA: Society for Industrial and Applied Mathematics,ISBN978-0-89871-425-8
Manning, Christopher D.; Schütze, Hinrich (1999),Foundations of statistical natural language processing, MIT Press,ISBN978-0-262-13360-9
Margalit, Dan; Rabinoff, Joseph (2019),"Determinants and Volumes",Interactive Linear Algebra, Georgia Institute of Technology, retrieved2025-05-10
Matoušek, Jiří; Gärtner, Bernd (2007),Understanding and Using Linear Programming, Springer Science & Business Media,ISBN9783540307174
Maxwell, E. A. (1969),Algebraic Structure and Matrices, Being Part II of Advanced Algebra, Cambridge University Press
McHugh, Andrew (2025),Finite Mathematics: An Introduction with Applications in Business, Social Sciences, and Music, Academic Press,ISBN9780443290954
Misra, Chandan; Bhattacharya, Sourangshu; Ghosh, Soumya K. (June 2022), "Stark: Fast and scalable Strassen's matrix multiplication using Apache Spark",IEEE Transactions on Big Data,8 (3):699–710,arXiv:1811.07325,doi:10.1109/tbdata.2020.2977326
Nering, Evar D. (1970),Linear Algebra and Matrix Theory (2nd ed.), New York:Wiley,LCCN76-91646
Nocedal, Jorge; Wright, Stephen J. (2006),Numerical Optimization (2nd ed.), Berlin, DE; New York, NY: Springer-Verlag, p. 449,ISBN978-0-387-30303-1
Pop; Furdui (2017),Square Matrices of Order 2, Springer International Publishing,ISBN978-3-319-54938-5
Press, William H.; Flannery, Brian P.;Teukolsky, Saul A.; Vetterling, William T. (1992),"LU Decomposition and Its Applications"(PDF),Numerical Recipes in FORTRAN: The Art of Scientific Computing (2nd ed.), Cambridge University Press, pp. 34–42, archived from the original on 2009-09-06
Protter, Murray H.; Morrey, Charles B. Jr. (1970),College Calculus with Analytic Geometry (2nd ed.), Reading:Addison-Wesley,LCCN76087042
Punnen, Abraham P.; Gutin, Gregory (2002),The traveling salesman problem and its variations, Boston, MA: Kluwer Academic Publishers,ISBN978-1-4020-0664-7
Ramachandra Rao, A.; Bhimasankaram, P. (2000),Linear Algebra, Texts and Readings in Mathematics, vol. 19 (2nd ed.), Springer,ISBN9789386279019
Reyes, Manuel (2025), "A tour of noncommutative spectral theories",Notices of the American Mathematical Society,72 (2):145–153,arXiv:2409.08421,doi:10.1090/noti3100,MR4854325
Vassilevska Williams, Virginia; Xu, Yinzhan; Xu, Zixuan; Zhou, Renfei (2024), "New bounds for matrix multiplication: from alpha to omega",Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 3792–3835,arXiv:2307.07970,doi:10.1137/1.9781611977912.134,ISBN978-1-61197-791-2
Abłamowicz, Rafał (2000),Clifford Algebras and their Applications in Mathematical Physics, Volume 1: Algebra and Physics, Progress in Mathematical Physics, vol. 18, Birkhäuser / Springer,ISBN9780817641825
Bauchau, O. A.; Craig, J. I. (2009),Structural Analysis: With Applications to Aerospace Structures, Solid Mechanics and Its Applications, vol. 163, Springer,ISBN9789048125166
Reichl, Linda E. (2004),The transition to chaos: conservative classical systems and quantum manifestations, Berlin, DE; New York, NY: Springer-Verlag,ISBN978-0-387-98788-0
Riley, Kenneth F.; Hobson, Michael P.; Bence, Stephen J. (1997),Mathematical methods for physics and engineering, Cambridge University Press,ISBN0-521-55506-X
Knobloch, Eberhard (1994), "From Gauß to Weierstraß: determinant theory and its historical evaluations", in Sasaki, Chikara; Sugiura, Mitsuo; Dauben, Joseph W. (eds.),The Intersection of History and Mathematics, Science Networks: Historical Studies, vol. 15, Birkhäuser, pp. 51–66,doi:10.1007/978-3-0348-7521-9_5,ISBN3-7643-5029-6,MR1308079
Tarski, Alfred (1941),Introduction to Logic and the Methodology of Deductive Sciences, Oxford University Press,MR0003375; reprint of 1946 corrected printing, Dover Publications, 1995,ISBN0-486-28462-X