# IdentityMatrix

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: