# How to calculate generalized eigenvectors How to calculate generalized eigenvectors of a defective matrix? e.g.:

matrix([6,-2,-1],[3,1,-1],[2,-1,2])


Daniel

edit retag close merge delete

Sort by » oldest newest most voted

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]

more

Thank you @slelievre, that is exactly what I needed.

Now I'm trying to confirm the chain of generalized eigenvectors like this:

sage: a = matrix(ZZ, 3, [[6, -2, -1], [3, 1, -1], [2, -1, 2]])
sage: d, m = a.jordan_form(transformation=True)

sage: d

sage: m

sage: I = matrix.identity(3)
sage: zero = transpose(matrix(ZZ, [, , ]))
sage: x1 = m.column(0)
sage: x2 = m.column(1)
sage: x3 = m.column(2)

sage: (a-d[0,0]*I)*x1 == zero

sage: (a-d[1,1]*I)*x2 == x1

sage: (a-d[2,2]*I)*x3 == x2


Please notice the first equality is False, but it should be True, what I am doing wrong?

Daniel

Define zero as a vector instead of a matrix:

sage: zero = vector(ZZ, 3,  * 3)


Then you get True for (a-d[0,0]*I)*x1 == zero.

I am not sure about your exact question. Does the following help ?

sage: m = matrix([[6,-2,-1],[3,1,-1],[2,-1,2]])
sage: m.eigenvalues()
[3, 3, 3]
sage: m.eigenvectors_right()
[(3, [
(1, 1, 1)
], 3)]
sage: a = m-3
sage: a
[ 3 -2 -1]
[ 3 -2 -1]
[ 2 -1 -1]
sage: a.right_kernel()
Free module of degree 3 and rank 1 over Integer Ring
Echelon basis matrix:
[1 1 1]
sage: (a^2).right_kernel()
Free module of degree 3 and rank 2 over Integer Ring
Echelon basis matrix:
[1 1 0]
[0 0 1]
sage: (a^2).right_kernel().basis()
[
(1, 1, 0),
(0, 0, 1)
]
sage: (a^3).right_kernel()
Free module of degree 3 and rank 3 over Integer Ring
Echelon basis matrix:
[1 0 0]
[0 1 0]
[0 0 1]
sage: (a^3).right_kernel().basis()
[
(1, 0, 0),
(0, 1, 0),
(0, 0, 1)
]

more

What's wrong with

sage:  M=matrix(SR, [[6,-2,-1],[3,1,-1],[2,-1,2]]);M
[ 6 -2 -1]
[ 3  1 -1]
[ 2 -1  2]
sage: V=M.eigenvectors_left();V
[(3, [(1, -1, 0)], 3)]
sage: V*M
(3, -3, 0)
sage: V=M.eigenvectors_right();V
[(3, [(1, 1, 1)], 3)]
sage: M*(V)
(3, 3, 3)


?

more

"In linear algebra, a generalized eigenvector of an n × n matrix A {\displaystyle A} A is a vector which satisfies certain criteria which are more relaxed than those for an (ordinary) eigenvector." Generalized_eigenvector on wikipedia