A diagonal matrix with equal diagonal entries is a
scalar matrix; that is, a scalar multiple of the
identity matrix . Its effect on a
vector is
scalar multiplication by . For example, a 3×3 scalar matrix has the form: \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.{{efn|Proof: given the
elementary matrix e_{ij}, Me_{ij} is the matrix with only the
i-th row of
M and e_{ij}M is the square matrix with only the
M j-th column, so the non-diagonal entries must be zero, and the
ith diagonal entry much equal the
jth diagonal entry.}} 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). 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. Diagonal matrices where the diagonal entries are not all equal or all distinct have centralizers intermediate between the whole space and only diagonal matrices. For an abstract vector space (rather than the concrete vector space ), the analog of scalar matrices are
scalar transformations. 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. 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. 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 . The former is more generally true
free modules M \cong R^n, for which the endomorphism algebra is isomorphic to a matrix algebra. == Vector operations ==