IdentityMatrix

IdentityMatrix[n]

gives the nn identity matrix.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Construct a 3×3 identity matrix:

Scope  (5)

A square identity matrix:

Non-square identity matrix:

The determinant of a square identity matrix is always 1:

Compute the rank of an identity matrix:

Construct a sparse identity matrix:

The sparse representation saves a significant amount of memory for larger matrices:

Options  (1)

WorkingPrecision  (1)

Create a machine-precision identity matrix:

Properties & Relations  (3)

Use DiagonalMatrix for general diagonal matrices:

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:

Wolfram Research (1988), IdentityMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/IdentityMatrix.html (updated 2008).

Text

Wolfram Research (1988), IdentityMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/IdentityMatrix.html (updated 2008).

BibTeX

@misc{reference.wolfram_2021_identitymatrix, author="Wolfram Research", title="{IdentityMatrix}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/IdentityMatrix.html}", note=[Accessed: 29-November-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_identitymatrix, organization={Wolfram Research}, title={IdentityMatrix}, year={2008}, url={https://reference.wolfram.com/language/ref/IdentityMatrix.html}, note=[Accessed: 29-November-2021 ]}

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