Try the Nilpotent Matrix Calculator
Open the existing calculator to test a square matrix and inspect its powers.
A nilpotent matrix calculator tests if a square matrix A equals the zero matrix at some power A^k. It multiplies A by itself, checks each power up to A^n, and reports the smallest k as the index of nilpotency. Enter the matrix below to see every power and the result.
- Definition: A^k = 0 for some positive integer k
- Index rule: k never exceeds n for an n × n matrix
- Eigenvalues: all equal 0
- Determinant and trace: both equal 0
What Does a Nilpotent Matrix Calculator Show After You Enter a Matrix?
A nilpotent matrix calculator shows every power of the matrix after you enter a matrix, highlights the first power that equals the zero matrix, and reports the index k. It also returns a Yes or No verdict. Each multiplication appears step by step.
The tool takes three inputs. You pick the matrix size, type the entries, and press Check. An example loader fills in a sample matrix for a quick test.
The output has four parts. It lists each power A, A², A³, and onward, shows the row-by-column sums behind each product, marks the first zero matrix, and states the index k. A Yes or No badge closes the result.
Decimal entries follow a tolerance of 1e-9. A value such as 0.0000000003 counts as 0, so floating-point rounding can't hide a zero matrix. Integer entries stay exact.
Need one specific power instead of the full sequence? The matrix power calculator (A^k) computes A^5 or A^10 in one step. The checker stops at the first zero, and every Yes verdict rests on the definition of a nilpotent matrix.
What Is a Nilpotent Matrix?
A nilpotent matrix is a square matrix N that equals the zero matrix when you multiply it by itself k times, for some positive integer k. In symbols, N^k = 0. The zero matrix has the same size as N, and every entry equals 0.
Think of a nilpotent matrix as a candle burning down. Each multiplication shortens the flame, and after k steps nothing remains. Wikipedia's nilpotent matrix entry gives the same definition and extends it to linear transformations.
The name combines nil, meaning zero, and potent, meaning power. Some power of the matrix gives zero. The simplest example is the 2 × 2 matrix below.
N = [0 1] N² = [0 0]
[0 0] [0 0]
A nilpotent matrix can hold nonzero diagonal entries. The matrix [[1, -1], [1, -1]] squares to zero because the products cancel. Row 1 gives 1·1 + (-1)·1 = 0, and the other three entries follow the same pattern.
Every nilpotent matrix reaches zero at a smallest power, and that power has a name.
What Is the Index of Nilpotency?
The index of nilpotency is the smallest positive integer k for which N^k equals the zero matrix. It's also called the degree of the nilpotent matrix. For an n × n matrix, the index never exceeds n, so you only check the powers N, N², up to N^n.
The index of nilpotency tells you how many multiplications a check needs. The zero matrix has index 1. The matrix [[0, 1], [0, 0]] has index 2.
| Matrix size | Possible index values |
|---|---|
| 2 × 2 | 1 or 2 |
| 3 × 3 | 1, 2, or 3 |
| 4 × 4 | 1, 2, 3, or 4 |
| n × n | 1 up to n |
The limit of n comes from the characteristic polynomial. A nilpotent n × n matrix has characteristic polynomial λ^n, and the Cayley-Hamilton theorem says a matrix satisfies its own characteristic polynomial. That gives N^n = 0.
A 6 × 6 matrix therefore needs at most 6 powers. If A^6 still holds a nonzero entry, the matrix fails the test.
How Do You Check If a Matrix Is Nilpotent by Hand?
You check if a matrix is nilpotent by hand in one of two ways. Multiply the matrix by itself up to the power n, or confirm its characteristic polynomial equals λ^n. A zero matrix at any power from 1 to n proves nilpotency.
Method 1: Compute the Powers of the Matrix
Computing the powers of the matrix takes four steps.
- Confirm the matrix is square, with size n × n.
- Compute A², then A³, and onward up to A^n.
- Stop at the first power that equals the zero matrix. That power is the index.
- If A^n still holds a nonzero entry, the matrix fails the test.
Take E = [[1, 0], [0, 0]]. Every power of E equals E, so no power reaches zero. E fails the test.
Each product follows the row-by-column rule. The matrix multiplication calculator shows those sums for any pair of matrices. A 4 × 4 check needs up to 3 matrix products, which equals 192 scalar multiplications by hand.
A matrix with full rank n fails at once. Nilpotent matrices always have rank below n. The rank of matrix calculator gives that number in one step.
Method 2: Read the Characteristic Polynomial
Reading the characteristic polynomial takes three steps.
- Compute det(λI - A).
- Compare the result with λ^n.
- If they match, A is nilpotent.
The Cayley-Hamilton theorem explains why this works. A matrix satisfies its own characteristic polynomial, so λ^n gives A^n = 0. For N = [[0, 3], [0, 0]], the determinant det(λI - N) equals λ².
This method confirms nilpotency but doesn't give the index. The index comes from the powers or from the minimal polynomial. The 2x2 example below shows both results side by side.
How Do You Solve a 2x2 Nilpotent Matrix Example?
To solve a 2x2 nilpotent matrix example, multiply the matrix by itself and check for the zero matrix. For N = [[0, 3], [0, 0]], N × N gives the zero matrix. N holds the nonzero entry 3, so N is nilpotent with index 2.
Step 1: Confirm the size. N has 2 rows and 2 columns, so it's square.
Step 2: Compute N².
N × N = [0 3] × [0 3]
[0 0] [0 0]
Row 1, Column 1: 0·0 + 3·0 = 0
Row 1, Column 2: 0·3 + 3·0 = 0
Row 2, Column 1: 0·0 + 0·0 = 0
Row 2, Column 2: 0·3 + 0·0 = 0
N² = [0 0]
[0 0]
Step 3: Read the result. N² equals the zero matrix, and N itself doesn't. The index is 2.
Method 2 agrees. The determinant det(λI - N) = det [[λ, -3], [0, λ]] = λ², which matches λ^n for n = 2.
Every 2 × 2 nilpotent matrix squares to zero. This check therefore finishes in one multiplication. Larger matrices need more powers, as the strictly upper triangular case shows.
How Do You Solve a 3x3 Nilpotent Matrix Example?
To solve a 3x3 nilpotent matrix example, compute N², then N³, and stop at the first zero matrix. For the strictly upper triangular matrix N = [[0, 2, 5], [0, 0, 3], [0, 0, 0]], N² still holds the entry 6, but N³ equals the zero matrix. The index is 3.
Step 1: Write the matrix. Every entry on and below the main diagonal equals 0.
N = [0 2 5]
[0 0 3]
[0 0 0]
Step 2: Compute N².
Row 1: [0·0+2·0+5·0, 0·2+2·0+5·0, 0·5+2·3+5·0] = [0, 0, 6]
Row 2: [0, 0, 0·5+0·3+3·0] = [0, 0, 0]
Row 3: [0, 0, 0]
N² = [0 0 6]
[0 0 0]
[0 0 0]
N² still holds a nonzero entry, so the check continues.
Step 3: Compute N³ = N² × N.
Row 1: [0·0+0·0+6·0, 0·2+0·0+6·0, 0·5+0·3+6·0] = [0, 0, 0]
N³ = [0 0 0]
[0 0 0]
[0 0 0]
Step 4: Read the result. N³ equals the zero matrix, so N is nilpotent with index 3.
Each multiplication pushes the nonzero entries one diagonal further from the main diagonal. After 3 multiplications, nothing stays inside the 3 × 3 grid. Picture a ladder where each step moves the entries up one rung until they fall off the top.
Not every 3 × 3 nilpotent matrix reaches index 3. The matrix [[0, 0, 1], [0, 0, 0], [0, 0, 0]] squares to zero, so its index is 2.
Method 2 gives the same verdict for N, since an upper triangular matrix with zeros on the diagonal has det(λI - N) = λ³. The determinant of N equals 0 and its trace equals 0, two values that every nilpotent matrix shares.
Try this matrix in the checker: Enter N = [[0, 2, 5], [0, 0, 3], [0, 0, 0]] into the Nilpotent Matrix Checker. The tool shows N², N³, and the index 3 in one run.
Which Properties Confirm a Nilpotent Matrix?
These properties confirm a nilpotent matrix: determinant 0, trace 0, and all eigenvalues equal to 0. The characteristic polynomial equals λ^n, and the index never exceeds n. Each property holds for every nilpotent n × n matrix over ℝ or ℂ.
| Property | Value | Reason |
|---|---|---|
| Determinant | 0 | (det N)^k = det(0) = 0 |
| Trace | 0 | The trace equals the sum of the eigenvalues |
| Eigenvalues | All 0 | Nv = λv gives N^k v = λ^k v = 0 |
| Characteristic polynomial | λ^n | All n eigenvalues equal 0 |
| Minimal polynomial | λ^k | k is the index |
| Invertibility | Singular | The determinant is 0 |
| Diagonalizable | Only the zero matrix | A diagonal matrix with all zero entries is the zero matrix |
| I + N and I - N | Always invertible | (I - N)^-1 = I + N + ... + N^(k-1) |
The eigenvalue and eigenvector calculator lists 0 as the only eigenvalue of any nilpotent matrix. The diagonalizable matrix checker shows why only the zero matrix passes. Wolfram MathWorld lists the equivalent conditions.
These properties form a quick screen. A matrix with a nonzero determinant fails at once. Other matrix classes, such as idempotent and involutory matrices, pass parts of this screen with different values.
How Does a Nilpotent Matrix Differ From Idempotent and Involutory Matrices?
A nilpotent matrix differs from idempotent and involutory matrices in its defining equation. A nilpotent matrix satisfies N^k = 0, an idempotent matrix satisfies A² = A, and an involutory matrix satisfies A² = I. The zero matrix is the only matrix that's both nilpotent and idempotent.
| Matrix type | Condition | Eigenvalues | Example |
|---|---|---|---|
| Nilpotent | N^k = 0 | All 0 | [[0, 1], [0, 0]] |
| Idempotent | A² = A | 0 or 1 | [[1, 0], [0, 0]] |
| Involutory | A² = I | 1 or -1 | [[0, 1], [1, 0]] |
The idempotent matrix checker tests A² = A, and the involutory matrix checker tests A² = I. Each condition produces a different eigenvalue pattern, which makes the three classes easy to separate.
The proof for the zero matrix takes one line. If A² = A and A^k = 0, then A = A^k = 0. A zero determinant and a zero trace also appear in many matrices that fit neither class.
Why Do Determinant 0 and Trace 0 Not Prove Nilpotency?
Determinant 0 and trace 0 do not prove nilpotency because many non-nilpotent matrices share both values. The matrix diag(1, -1, 0) has determinant 0 and trace 0, yet its powers never reach the zero matrix. Only a power equal to the zero matrix, or a characteristic polynomial of λ^n, proves it.
The powers of diag(1, -1, 0) equal diag(1, (-1)^k, 0). The first entry stays 1 for every k, so the zero matrix never appears.
Three more mistakes cause wrong answers:
- A triangular matrix needs zeros on the main diagonal to be nilpotent. The matrix [[1, 2], [0, 0]] is triangular but equals its own square.
- A rectangular matrix can't be nilpotent, because powers need a square matrix.
- Decimal rounding can hide a zero matrix, so a tolerance such as 1e-9 treats tiny values as 0.
Some sources also call a nilpotent matrix a scalar matrix. That claim is false, since only the zero matrix is both. Correct tests matter because nilpotent matrices appear in several fields.
Where Do Nilpotent Matrices Appear?
Nilpotent matrices appear in matrix exponentials, graph theory, and Jordan canonical form. Each use depends on the same fact, that high powers of the matrix vanish. For index k, the exponential series of N stops after k terms, so the result is an exact finite sum.
- Matrix exponential: e^(tN) = I + tN + t²N²/2! + ... + t^(k-1)N^(k-1)/(k-1)!, a sum that ends at k terms.
- Graph theory: The adjacency matrix of a directed acyclic graph is strictly triangular when the vertices follow a topological order, so it's nilpotent. Its index equals the length of the longest path plus 1.
- Jordan canonical form: The index equals the size of the largest Jordan block.
Nick Higham's article on nilpotent matrices covers the Jordan structure in more depth. After the index, other matrix tests give a fuller profile of the same matrix.
What Should You Test After Finding the Index?
After finding the index, test the matrix's eigenvalues, rank, and matrix class. The eigenvalues should all equal 0, and the rank should sit below n for any size. These two results support the index and describe the matrix's structure.
A nilpotent matrix of index k has a rank sequence that falls with each power until it reaches 0. That sequence also reveals the Jordan block sizes.
The matrix property checker hub lists the other class tests, such as symmetric, orthogonal, and positive definite checks, in one place.
Frequently Asked Questions About Nilpotent Matrices
Is there a simple nilpotent 3x3 matrix of index 5?
No, a 3x3 nilpotent matrix can't have index 5. A nilpotent n × n matrix always satisfies N^n = 0 by the Cayley-Hamilton theorem, so a 3x3 matrix has index 1, 2, or 3 and never more. The simplest index-3 example is [[0, 1, 0], [0, 0, 1], [0, 0, 0]]. To get index 5 you need at least a 5 × 5 matrix, such as the 5 × 5 matrix with ones directly above the main diagonal and zeros elsewhere. You can test any matrix in the Nilpotent Matrix Checker above, or read how the index is found in the index of nilpotency section.
Is a nilpotent matrix always singular?
Yes, a nilpotent matrix is always singular. Its determinant equals 0, so no inverse exists. The related matrices I + N and I - N are invertible.
Can a nilpotent matrix have nonzero diagonal entries?
Yes, a nilpotent matrix can have nonzero diagonal entries. The matrix [[1, -1], [1, -1]] has diagonal entries 1 and -1 and squares to zero. Any nonzero nilpotent matrix needs both positive and negative entries.
What is the maximum index of a 3x3 nilpotent matrix?
The maximum index of a 3x3 nilpotent matrix is 3. The matrix with ones directly above the main diagonal and zeros elsewhere reaches zero at the third power.
Is the zero matrix nilpotent?
Yes, the zero matrix is nilpotent with index 1. It equals zero at the first power.
Is every triangular matrix nilpotent?
No, a triangular matrix is nilpotent only when every diagonal entry equals 0. Such a matrix is strictly upper or strictly lower triangular. The matrix [[1, 2], [0, 0]] is triangular but equals its own square, so it never reaches zero.
Ready to test a matrix?
Use the existing calculator to check powers and the nilpotency index.