In mathematics, a square matrix is a matrix with the same number of rows and columns. An n-by-n matrix is known as a square matrix of order Any two square matrices of the same order can be added and multiplied.
Square matrices are often used to represent simple linear transformations, such as shearing or rotation. For example, if is a square matrix representing a rotation (rotation matrix) and is a column vector describing the position of a point in space, the product yields another column vector describing the position of that point after that rotation. If is a row vector, the same transformation can be obtained using where is the transpose of
Main diagonal
The entries () form the main diagonal of a square matrix. They lie on the imaginary line which runs from the top left corner to the bottom right corner of the matrix. For instance, the main diagonal of the 4×4 matrix above contains the elements , , , .
The diagonal of a square matrix from the top right to the bottom left corner is called antidiagonal or counterdiagonal.
Special kinds
Diagonal or triangular matrix
If all entries outside the main diagonal are zero, is called a diagonal matrix. If only all entries above (or below) the main diagonal are zero, is called an upper (or lower) triangular matrix.
Identity matrix
The identity matrix of size is the matrix in which all the elements on the main diagonal are equal to 1 and all other elements are equal to 0, e.g.
It is a square matrix of order and also a special kind of diagonal matrix. It is called identity matrix because multiplication with it leaves a matrix unchanged: for any matrix
Invertible matrix and its inverse
A square matrix is called invertible or non-singular if there exists a matrix such that
If exists, it is unique and is called the inverse matrix of denoted
Symmetric or skew-symmetric matrix
A square matrix that is equal to its transpose, i.e., is a symmetric matrix. If instead then is called a skew-symmetric matrix.
For a complex square matrix often the appropriate analogue of the transpose is the conjugate transpose defined as the transpose of the complex conjugate of A complex square matrix satisfying is called a Hermitian matrix. If instead then is called a skew-Hermitian matrix.
By the spectral theorem, real symmetric (or complex Hermitian) matrices have an orthogonal (or unitary) eigenbasis; i.e., every vector is expressible as a linear combination of eigenvectors. In both cases, all eigenvalues are real.
Definite matrix
A symmetric -matrix is called positive-definite (respectively negative-definite; indefinite), if for all nonzero vectors the associated quadratic form given by
takes only positive values (respectively only negative values; both some negative and some positive values). If the quadratic form takes only non-negative (respectively only non-positive) values, the symmetric matrix is called positive-semidefinite (respectively negative-semidefinite); hence the matrix is indefinite precisely when it is neither positive-semidefinite nor negative-semidefinite.
A symmetric matrix is positive-definite if and only if all its eigenvalues are positive. The table at the right shows two possibilities for 2×2 matrices.
Allowing as input two different vectors instead yields the bilinear form associated to :
Orthogonal matrix
An orthogonal matrix is a square matrix with real entries whose columns and rows are orthogonal unit vectors (i.e., orthonormal vectors). Equivalently, a matrix A is orthogonal if its transpose is equal to its inverse:
which entails
where I is the identity matrix.
An orthogonal matrix is necessarily invertible (with inverse ), unitary (), and normal (). The determinant of any orthogonal matrix is either +1 or −1. The special orthogonal group consists of the orthogonal matrices with determinant +1.
The complex analogue of an orthogonal matrix is a unitary matrix.
Normal matrix
A real or complex square matrix is called normal if If a real square matrix is symmetric, skew-symmetric, or orthogonal, then it is normal. If a complex square matrix is Hermitian, skew-Hermitian, or unitary, then it is normal. Normal matrices are of interest mainly because they include the types of matrices just listed and form the broadest class of matrices for which the spectral theorem holds.
Operations
Trace
The trace, tr(A) of a square matrix A is the sum of its diagonal entries. While matrix multiplication is not commutative, the trace of the product of two matrices is independent of the order of the factors: