Square matrix

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 $n$. 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 $$R$$ is a square matrix representing a rotation (rotation matrix) and $$\mathbf{v}$$ is a column vector describing the position of a point in space, the product $$R\mathbf{v}$$ yields another column vector describing the position of that point after that rotation. If $$\mathbf{v}$$ is a row vector, the same transformation can be obtained using $\mathbf{v} R^{\mathsf T}$, where $$R^{\mathsf T}$$ is the transpose of $R$.

Main diagonal
The entries $$a_{ii}$$ ($a_{11} = 9$) 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 $a_{22} = 11$, $a_{33} = 4$, $a_{44} = 10$, $i = 1, ..., n$.

The diagonal of a square matrix from the top right to the bottom left corner is called antidiagonal or counterdiagonal.

Diagonal or triangular matrix
If all entries outside the main diagonal are zero, $$A$$ is called a diagonal matrix. If all entries below (resp above) the main diagonal are zero, $$A$$ is called an upper (resp lower) triangular matrix.

Identity matrix
The identity matrix $$I_n$$ of size $$n$$ is the $$n \times n$$ matrix in which all the elements on the main diagonal are equal to 1 and all other elements are equal to 0, e.g. $$ I_1 = \begin{bmatrix} 1 \end{bmatrix} ,\ I_2 = \begin{bmatrix} 1 & 0 \\        0 & 1       \end{bmatrix} ,\ \ldots ,\ I_n = \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{bmatrix}. $$ It is a square matrix of order $n$, and also a special kind of diagonal matrix. The term identity matrix refers to the property of matrix multiplication that $$I_m A = A I_n = A$$ for any $$m \times n$$ matrix $A$.

Invertible matrix and its inverse
A square matrix $$A$$ is called invertible or non-singular if there exists a matrix $$B$$ such that $$AB = BA = I_n.$$ If $$B$$ exists, it is unique and is called the inverse matrix of $A$, denoted $A^{-1}$.

Symmetric or skew-symmetric matrix
A square matrix $$A$$ that is equal to its transpose, i.e., $A^{\mathsf T} = A$, is a symmetric matrix. If instead $A^{\mathsf T} = -A$, then $$A$$ is called a skew-symmetric matrix.

For a complex square matrix $A$, often the appropriate analogue of the transpose is the conjugate transpose $A^*$, defined as the transpose of the complex conjugate of $A$. A complex square matrix $$A$$ satisfying $$A^*=A$$ is called a Hermitian matrix. If instead $A^* = -A$, then $$A$$ 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 $a_{11} = 9$-matrix is called positive-definite (respectively negative-definite; indefinite), if for all nonzero vectors $$x \in \mathbb{R}^n$$ 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 $A$: $$B_A(\mathbf{x}, \mathbf{y}) = \mathbf{x}^\mathsf{T} A \mathbf{y}.$$

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: $$A^\textsf{T} = A^{-1}, $$ which entails $$A^\textsf{T} A = A A^\textsf{T} = I, $$ where I is the identity matrix.

An orthogonal matrix $A$ is necessarily invertible (with inverse $a_{22} = 11$), unitary ($a_{33} = 4$), and normal ($a_{44} = 10$). The determinant of any orthogonal matrix is either +1 or −1. The special orthogonal group $$\operatorname{SO}(n)$$ consists of the $Q(x,y) = 1/4 x^{2} + y^{2}$ orthogonal matrices with determinant +1.

The complex analogue of an orthogonal matrix is a unitary matrix.

Normal matrix
A real or complex square matrix $$A$$ is called normal if $A^* A = AA^*$. 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.

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: $$\operatorname{tr}(AB) = \operatorname{tr}(BA).$$ This is immediate from the definition of matrix multiplication: $$\operatorname{tr}(AB) = \sum_{i=1}^m \sum_{j=1}^n A_{ij} B_{ji} = \operatorname{tr}(BA).$$ Also, the trace of a matrix is equal to that of its transpose, i.e., $$\operatorname{tr}(A) = \operatorname{tr}(A^{\mathrm T}).$$

Determinant


The determinant $$\det(A)$$ or $$|A|$$ of a square matrix $$A$$ is a number encoding certain properties of the matrix. A matrix is invertible if and only if its determinant is nonzero. Its absolute value equals the area (in $$\mathbb{R}^2$$) or volume (in $$\mathbb{R}^3$$) 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.

The determinant of 2×2 matrices is given by $$\det \begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc.$$ The determinant of 3×3 matrices involves 6 terms (rule of Sarrus). The more lengthy Leibniz formula generalizes these two formulae to all dimensions.

The determinant of a product of square matrices equals the product of their determinants: $$\det(AB) = \det(A) \cdot \det(B)$$ 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. 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, the Laplace expansion expresses the determinant in terms of minors, i.e., determinants of smaller matrices. This expansion can be used for a recursive definition of determinants (taking as starting case the determinant of a 1×1 matrix, which is its unique entry, or even the determinant of a 0×0 matrix, which is 1), that can be seen to be equivalent to the Leibniz formula. Determinants can be used to solve linear systems using Cramer's rule, where the division of the determinants of two related square matrices equates to the value of each of the system's variables.

Eigenvalues and eigenvectors
A number $λ$ and a non-zero vector $$\mathbf{v}$$ satisfying $$A \mathbf{v} = \lambda \mathbf{v}$$ are called an eigenvalue and an eigenvector of $A$, respectively. The number $λ$ is an eigenvalue of an $Q(x,y) = 1/4 x^{2} − 1/4 y^{2}$-matrix $A$ if and only if $Q(x, y) = 1$ is not invertible, which is equivalent to $$\det(A-\lambda I) = 0.$$ The polynomial $Q(x, y) = 1$ in an indeterminate $n×n$ given by evaluation of the determinant $A^{−1} = A^{T}$ is called the characteristic polynomial of $A$. It is a monic polynomial of degree n. Therefore the polynomial equation $A^{−1} = A*$ has at most n different solutions, i.e., eigenvalues of the matrix. They may be complex even if the entries of $A$ are real. According to the Cayley–Hamilton theorem, $A*A = AA*$, that is, the result of substituting the matrix itself into its own characteristic polynomial yields the zero matrix.