-
classmethod galois.FieldArray.Identity(size: int, dtype: DTypeLike | None =
None
) Self Creates an \(n \times n\) identity matrix.
- Parameters:¶
- size: int¶
The size \(n\) along one dimension of the identity matrix.
- dtype: DTypeLike | None =
None
¶ The
numpy.dtype
of the array elements. The default isNone
which represents the smallest unsigned data type for thisFieldArray
subclass (the first element indtypes
).
- Returns:¶
A 2-D identity matrix with shape
(size, size)
.
Examples¶
In [1]: GF = galois.GF(31) In [2]: GF.Identity(4) Out[2]: GF([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]], order=31)