Diagonal matrix
In linear algebra, a diagonal matrix is a matrix in which the entries outside the main diagonal are all zero; the term usually refers to square matrices.[src] Elements of the main diagonal can either be zero or nonzero.[src] An example of a 2×2 diagonal matrix is \left[\begin{smallmatrix} 3 & 0 \\ 0 & 2 \end{smallmatrix}\right] , while an example of a 3×3 diagonal matrix is \left[\begin{smallmatrix} 6 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 4 \end{smallmatrix}\right] .[src] An identity matrix of any size, or any multiple of it is a diagonal matrix called a scalar matrix, for example, \left[\begin{smallmatrix} 0.5 & 0 \\ 0 & 0.5 \end{smallmatrix}\right] .[src] In geometry, a diagonal matrix may be used as a scaling matrix, since matrix multiplication with it results in changing scale (size) and possibly also shape; only a scalar matrix results in uniform change in scale.[src]
In linear algebra, a diagonal matrix is a matrix in which the entries outside the main diagonal are all zero; the term usually refers to square matrices.[src] Elements of the main diagonal can either be zero or nonzero.[src] An example of a 2×2 diagonal matrix is \left[\begin{smallmatrix} 3 & 0 \\ 0 & 2 \end{smallmatrix}\right] , while an example of a 3×3 diagonal matrix is \left[\begin{smallmatrix} 6 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 4 \end{smallmatrix}\right] .[src] An identity matrix of any size, or any multiple of it is a diagonal matrix called a scalar matrix, for example, \left[\begin{smallmatrix} 0.5 & 0 \\ 0 & 0.5 \end{smallmatrix}\right] .[src] In geometry, a diagonal matrix may be used as a scaling matrix, since matrix multiplication with it results in changing scale (size) and possibly also shape; only a scalar matrix results in uniform change in scale.[src] ==Definition== As stated above, a diagonal matrix is a matrix in which all off-diagonal entries are zero.[src] That is, the matrix with columns and rows is diagonal if \forall i,j \in \{1, 2, \ldots, n\}, i \ne j \implies d_{i,j} = 0.[src] However, the main diagonal entries are unrestricted.[src] The term diagonal matrix may sometimes refer to a , which is an -by- matrix with all the entries not of the form being zero.[src] For example: \begin{bmatrix} 1 & 0 & 0\\ 0 & 4 & 0\\ 0 & 0 & -3\\ 0 & 0 & 0\\ \end{bmatrix} \quad \text{or} \quad \begin{bmatrix} 1 & 0 & 0 & 0 & 0\\ 0 & 4 & 0& 0 & 0\\ 0 & 0 & -3& 0 & 0 \end{bmatrix} More often, however, diagonal matrix refers to square matrices, which can be specified explicitly as a .[src] A square diagonal matrix is a symmetric matrix, so this can also be called a .[src] The following matrix is square diagonal matrix: \begin{bmatrix} 1 & 0 & 0\\ 0 & 4 & 0\\ 0 & 0 & -2 \end{bmatrix} If the entries are real numbers or complex numbers, then it is a normal matrix as well.[src] In the remainder of this article we will consider only square diagonal matrices, and refer to them simply as "diagonal matrices".[src] ==Vector-to-matrix diag operator== A diagonal matrix can be constructed from a vector \mathbf{a} = \begin{bmatrix}a_1 & \dots & a_n\end{bmatrix}^\textsf{T} using the \operatorname{diag} operator: \mathbf{D} = \operatorname{diag}(a_1, \dots, a_n).[src] This may be written more compactly as \mathbf{D} = \operatorname{diag}(\mathbf{a}) .[src] The same operator is also used to represent block diagonal matrices as \mathbf{A} = \operatorname{diag}(\mathbf A_1, \dots, \mathbf A_n) where each argument is a matrix.[src] The operator may be written as \operatorname{diag}(\mathbf{a}) = \left(\mathbf{a} \mathbf{1}^\textsf{T}\right) \circ \mathbf{I}, where \circ represents the Hadamard product, and is a constant vector with elements 1.[src] ==Matrix-to-vector diag operator== The inverse matrix-to-vector operator is sometimes denoted by the identically named \operatorname{diag}(\mathbf{D}) = \begin{bmatrix}a_1 & \dots & a_n\end{bmatrix}^\textsf{T}, where the argument is now a matrix, and the result is a vector of its diagonal entries.[src] The following property holds: \operatorname{diag}(\mathbf{A}\mathbf{B}) = \sum_j \left(\mathbf{A} \circ \mathbf{B}^\textsf{T}\right)_{ij} = \left( \mathbf{A} \circ \mathbf{B}^\textsf{T} \right) \mathbf{1}.[src] \begin{bmatrix} \lambda & 0 & 0 \\ 0 & \lambda & 0 \\ 0 & 0 & \lambda \end{bmatrix} \equiv \lambda \boldsymbol{I}_3 The scalar matrices are the center of the algebra of matrices: that is, they are precisely the matrices that commute with all other square matrices of the same size.[src] By contrast, over a field (like the real numbers), a diagonal matrix with all diagonal elements distinct only commutes with diagonal matrices (its centralizer is the set of diagonal matrices).[src] That is because if a diagonal matrix \mathbf{D} = \operatorname{diag}(a_1, \dots, a_n) has a_i \neq a_j, then given a matrix with m_{ij} \neq 0, the term of the products are: (\mathbf{DM})_{ij} = a_im_{ij} and (\mathbf{MD})_{ij} = m_{ij}a_j, and a_jm_{ij} \neq m_{ij}a_i (since one can divide by ), so they do not commute unless the off-diagonal terms are zero.[src] Diagonal matrices where the diagonal entries are not all equal or all distinct have centralizers intermediate between the whole space and only diagonal matrices.[src] For an abstract vector space (rather than the concrete vector space ), the analog of scalar matrices are scalar transformations.[src] This is true more generally for a module over a ring , with the endomorphism algebra (algebra of linear operators on ) replacing the algebra of matrices.[src] Formally, scalar multiplication is a linear map, inducing a map R \to \operatorname{End}(M), (from a scalar to its corresponding scalar transformation, multiplication by ) exhibiting as a -algebra.[src] For vector spaces, the scalar transforms are exactly the center of the endomorphism algebra, and, similarly, scalar invertible transforms are the center of the general linear group .[src] The former is more generally true free modules M \cong R^n, for which the endomorphism algebra is isomorphic to a matrix algebra.[src] Multiplying a vector by a diagonal matrix multiplies each of the terms by the corresponding diagonal entry.[src] Given a diagonal matrix \mathbf{D} = \operatorname{diag}(a_1, \dots, a_n) and a vector \mathbf{v} = \begin{bmatrix} x_1 & \dotsm & x_n \end{bmatrix}^\textsf{T} , the product is: \mathbf{D}\mathbf{v} = \operatorname{diag}(a_1, \dots, a_n)\begin{bmatrix}x_1 \\ \vdots \\ x_n\end{bmatrix} = \begin{bmatrix} a_1 \\ & \ddots \\ & & a_n \end{bmatrix} \begin{bmatrix}x_1 \\ \vdots \\ x_n\end{bmatrix} = \begin{bmatrix}a_1 x_1 \\ \vdots \\ a_n x_n\end{bmatrix}.[src] This can be expressed more compactly by using a vector instead of a diagonal matrix, \mathbf{d} = \begin{bmatrix} a_1 & \dotsm & a_n \end{bmatrix}^\textsf{T} , and taking the Hadamard product of the vectors (entrywise product), denoted \mathbf{d} \circ \mathbf{v} : \mathbf{D}\mathbf{v} = \mathbf{d} \circ \mathbf{v} = \begin{bmatrix} a_1 \\ \vdots \\ a_n \end{bmatrix} \circ \begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} = \begin{bmatrix} a_1 x_1 \\ \vdots \\ a_n x_n \end{bmatrix}.[src] This is mathematically equivalent, but avoids storing all the zero terms of this sparse matrix.[src] This product is thus used in machine learning, such as computing products of derivatives in backpropagation or multiplying IDF weights in TF-IDF, since some BLAS frameworks, which multiply matrices efficiently, do not include Hadamard product capability directly.[src] \operatorname{diag}(a_1,\, \ldots,\, a_n) + \operatorname{diag}(b_1,\, \ldots,\, b_n) = \operatorname{diag}(a_1 + b_1,\, \ldots,\, a_n + b_n) and for matrix multiplication, \operatorname{diag}(a_1,\, \ldots,\, a_n) \operatorname{diag}(b_1,\, \ldots,\, b_n) = \operatorname{diag}(a_1 b_1,\, \ldots,\, a_n b_n).[src] The diagonal matrix is invertible if and only if the entries are all nonzero.[src] In this case, we have \operatorname{diag}(a_1,\, \ldots,\, a_n)^{-1} = \operatorname{diag}(a_1^{-1},\, \ldots,\, a_n^{-1}).[src] In particular, the diagonal matrices form a subring of the ring of all -by- matrices.[src] Multiplying an -by- matrix from the left with amounts to multiplying the -th row of by for all ; multiplying the matrix from the right with amounts to multiplying the -th column of by for all .[src] As explained in determining coefficients of operator matrix, there is a special basis, , for which the matrix takes the diagonal form.[src] Hence, in the defining equation \mathbf{Ae}_j = \sum_i a_{i,j} \mathbf e_i , all coefficients with are zero, leaving only one term per sum.[src] The surviving diagonal elements, , are known as eigenvalues and designated with in the equation, which reduces to \mathbf{Ae}_i = \lambda_i \mathbf e_i.[src] The resulting equation is known as eigenvalue equation and used to derive the characteristic polynomial and, further, eigenvalues and eigenvectors.[src] In other words, the eigenvalues of are with associated eigenvectors of .[src]
48 sentences · 48 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Diagonal matrix." encyclopegia.org, 2026, https://encyclopegia.org/wiki/diagonal-matrix. Accessed 01 December 2026.
Chicago
"Diagonal matrix." encyclopegia.org. Accessed December 1, 2026. https://encyclopegia.org/wiki/diagonal-matrix.
APA
encyclopegia.org. (2026). Diagonal matrix. Retrieved December 1, 2026, from https://encyclopegia.org/wiki/diagonal-matrix
Accessed December 1, 2026 · CC BY-SA 4.0 · citation page · JSON