Incorrect Eigenvalues/Eigenvectors

I'm trying to compute eigenvalues and eigenvectors for certain matrices. Most of the time sage is giving me what seems to be the correct output, but sometimes it's quite wrong and I'm not sure why this is happening. Here's a concrete example with a circulant matrix.

sage: M=matrix.circulant([1,-1/2*I,0,0,0,0,0,0,0,0,1/2*I])
sage: M.eigenvectors_right()
[(1, [(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)], 1)]


That is, it only returns a single eigenvector when I know there's in fact 11. A different issue appears with matrix.circulant([1,-1/2I,0,0,0,0,1/2I]), where now sage produces all the eigenvalues but produces no eigenvectors for most of these values.

edit retag close merge delete

Sort by ยป oldest newest most voted

Your circulant matrix has a characteristic polynomial of degree 11, which has (probably) no explicit solution by radicals ; Sage has herefore little chance of finding them:

sage: M=matrix.circulant([1,-1/2*I,0,0,0,0,0,0,0,0,1/2*I])
sage: M.parent()
Full MatrixSpace of 11 by 11 dense matrices over Symbolic Ring
sage: M.charpoly()
x^11 - 11*x^10 + 209/4*x^9 - 561/4*x^8 + 935/4*x^7 - 1001/4*x^6 + 11011/64*x^5 - 4719/64*x^4 + 4719/256*x^3 - 605/256*x^2 + 121/1024*x - 1/1024
sage: M.charpoly().parent()
Univariate Polynomial Ring in x over Symbolic Ring


However, one can get a designation of these in QQbar. Moving your matrix to QQbar allows you to get your solution:

sage: Mprime=M.change_ring(QQbar)


Now, the characteristic polynomial has its coefficients in QQbar:

sage: Mprime.charpoly().parent()
Univariate Polynomial Ring in x over Algebraic Field


And Sage can use specialied methods for polynomials over QQbar:

sage: EV=Mprime.eigenvectors_right()
sage: len(EV)
11


You have indeed 11 solutions, which are triples (eigenvalue, eigenvector, multiplicity).Let's look at one:

sage: EV[0]
(1.989821441880933?, [
(1.00000000000? + 0.?e-11*I, -0.14231483828? + 0.98982144188?*I, -0.95949297362? - 0.28173255684?*I, 0.41541501300? - 0.90963199536?*I, 0.84125353283? + 0.54064081746?*I, -0.65486073395? + 0.75574957436?*I, -0.65486073395? - 0.75574957436?*I, 0.84125353283? - 0.54064081746?*I, 0.41541501300? + 0.90963199536?*I, -0.95949297362? + 0.28173255684?*I, -0.14231483828? - 0.98982144188?*I)
], 1)


A similar solution applies to your second problem:

sage: M2=matrix.circulant([1,-1/2*I,0,0,0,0,1/2*I])
(1/12*sqrt(144*(7/1152*I*sqrt(3) - 7/3456)^(1/3) + 7/(7/1152*I*sqrt(3) - 7/3456)^(1/3) + 84) + 1,
[],
1)
sage: EV2=M2.change_ring(QQbar).eigenvectors_right()
sage: EV2[5]
(0.2181685175319702?, [
(1.000000000000000? + 0.?e-15*I, 0.623489801858734? - 0.781831482468030?*I, -0.222520933956314? - 0.974927912181824?*I, -0.900968867902419? - 0.433883739117558?*I, -0.900968867902419? + 0.433883739117558?*I, -0.222520933956315? + 0.974927912181824?*I, 0.623489801858734? + 0.781831482468030?*I)
], 1)


HTH,

more

I don't know what's going on there either, but at least you can work around it by switching the base ring of your matrices from the symbolic ring SR to the algebraic field QQbar (which is a good idea anyway):

sage: M = matrix.circulant(vector(QQbar, [1,-1/2*I,0,0,0,0,0,0,0,0,1/2*I]))
sage: M.eigenvectors_right()


This gives 11 eigenvectors.

more