Algosim documentation: NilpotencyIndex

NilpotencyIndex

Computes the nilpotency index of a square matrix.

Syntax

Description

If A is a square matrix, then NilpotencyIndex(A, ε) returns the nilpotency index of A, that is, the smallest positive number k such that A^k = 0 or −1 if A^k ≠ 0 for all positive integers k. Floating-point comparisons are made with epsilon ε.

Examples

A ≔ ❨❨2, -3, -2, -1, 2❩, ❨2, 0, -2, 2, 2❩, ❨-3, -2, -1, -2, 1❩, ❨-1, -2, 1, -3, -1❩, ❨-3, -2, -1, -3, 2❩❩
⎛ 2  −3  −2  −1   2⎞
⎜ 2   0  −2   2   2⎟
⎜−3  −2  −1  −2   1⎟
⎜−1  −2   1  −3  −1⎟
⎝−3  −2  −1  −3   2⎠
NilpotencyIndex(A)
5
'(IsZeroMatrix(A^4), IsZeroMatrix(A^5))
false
true

See also