IdentityMatrix
gives the nn identity matrix.
Details and Options

- IdentityMatrix[{m,n}] gives the mn identity matrix.
- IdentityMatrix by default creates a matrix containing exact integers.
- The option WorkingPrecision can be used to specify the precision of matrix elements.
- IdentityMatrix[n,SparseArray] gives the identity matrix as a SparseArray object.
Examples
open allclose allBasic Examples (2)
Scope (4)
Options (2)
Applications (3)
Use IdentityMatrix to quickly define the standard basis on :
The variables ,
, and
can now be used as the standard basis variables:
Compute the characteristic polynomial using IdentityMatrix:
Compare with a direct computation using CharacteristicPolynomial:
Form the augmented matrix that combines a matrix m with the identity matrix:
Row reduction of the augmented matrix gives an identity matrix augmented with Inverse[m]:
Verify that the right half of r truly is Inverse[m]:
Properties & Relations (12)
The determinant of a square identity matrix is always 1:
For an nm matrix ℳ, Tr[ℳ]==Min[n,m]:
A square identity matrix is its own inverse and its own transpose:
The scalar multiple of an identity matrix is a diagonal matrix:
The ,
entry of any identity matrix is given by KroneckerDelta[i,j]:
The row or column of IdentityMatrix[n] is UnitVector[n,i]:
For IdentityMatrix[{n,m}], the rows are instead UnitVector[m,i] for i<=Min[n,m]:
Use DiagonalMatrix for general diagonal matrices:
For an invertible n×n matrix m, Inverse[m].m==m.Inverse[m]==IdentityMatrix[n]:
For an n×m matrix a, a.PseudoInverse[a]==IdentityMatrix[n]:
The pseudoinverse of an identity matrix is its transpose:
The KroneckerProduct of a matrix with the identity matrix is a block diagonal matrix:
The WorkingPrecision option is equivalent to creating the matrix, then applying N:
Possible Issues (1)
IdentityMatrix gives a matrix with dense storage. SparseArray is more compact:
The SparseArray representation uses a fraction of the memory:
For matrix and arithmetic operations they are effectively equal:
Text
Wolfram Research (1988), IdentityMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/IdentityMatrix.html (updated 2008).
CMS
Wolfram Language. 1988. "IdentityMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/IdentityMatrix.html.
APA
Wolfram Language. (1988). IdentityMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IdentityMatrix.html