1 | initial version |
Do you mean a basis for a Jordan normal form?
Then you can use jordan_form
with transformation=True
.
Example using the matrix in the question:
sage: a = matrix(ZZ, 3, [[6, -2, -1], [3, 1, -1], [2, -1, 2]])
sage: m, p = a.jordan_form(transformation=True)
sage: m
[3 1 0]
[0 3 1]
[0 0 3]
sage: p
[1 3 1]
[1 3 0]
[1 2 0]