gives the nn identity matrix.
gives the mn identity matrix.
Details and Options
- The identity matrix is the identity element for the multiplication of square matrices.
- The entries of the identity matrix are given by ; that is, one for main diagonal entries and zeros elsewhere.
- The nn identity matrix ℐ satisfies the relation m.ℐ=ℐ.m=m for any nn matrix m.
- The nn identity matrix is symmetric, positive definite and unitary, while the mn identity matrix is unitary.
- IdentityMatrix by default creates a matrix containing exact integers.
- IdentityMatrix[…,SparseArray] gives the identity matrix as a SparseArray object.
- The following options can be given:
TargetStructure Automatic the structure of the returned matrix WorkingPrecision Infinity precision at which to create entries
- Possible settings for TargetStructure include:
Automatic automatically choose the representation returned "Dense" represent the matrix as a dense matrix "Sparse" represent the matrix as a sparse array "Structured" represent the matrix as a structured array
- With the setting TargetStructureAutomatic, a dense matrix is returned if the number of matrix entries is less than a preset threshold, and a structured array is returned otherwise.
- Identity matrices, when represented as structured arrays, allow for efficient storage and more efficient operations, including Det, Dot, Inverse and LinearSolve.
- Operations that are accelerated for IdentityMatrix include:
Det time Dot time Inverse time LinearSolve time
- For a structured IdentityMatrix id, the following properties "prop" can be accessed as id["prop"]:
"WorkingPrecision" precision used internally "Properties" list of supported properties "Structure" type of structured array "StructuredData" internal data stored by the structured array "StructuredAlgorithms" list of functions with special methods for the structured array "Summary" summary information, represented as a Dataset
- Normal[IdentityMatrix[…]] gives the identity matrix as an ordinary matrix.
Examplesopen allclose all
Basic Examples (2)
Construct a sparse identity matrix using the option setting TargetStructure"Sparse":
Generate a structured identity matrix using the option setting TargetStructure"Structured":
IdentityMatrix objects include properties that give information about the array:
Use IdentityMatrix to quickly define the standard basis on :
Compute the characteristic polynomial using IdentityMatrix:
Compare with a direct computation using CharacteristicPolynomial:
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 (14)
The , entry of any identity matrix is given by KroneckerDelta[i,j]:
Use DiagonalMatrix for general diagonal matrices:
For an n×m matrix a, a.PseudoInverse[a]==IdentityMatrix[n]:
For a nonsingular n×n matrix m, MatrixPower[m,0]==IdentityMatrix[n]:
Wolfram Research (1988), IdentityMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/IdentityMatrix.html (updated 2023).
Wolfram Language. 1988. "IdentityMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/IdentityMatrix.html.
Wolfram Language. (1988). IdentityMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IdentityMatrix.html