How to obtain the eigenvector for the following graph?

asked 2019-06-22 17:36:39 +0100

anonymous user

Anonymous

updated 2019-06-23 09:08:57 +0100

FrédéricC gravatar image

Here is some code:

G=graphs.EmptyGraph()
G.add_edges([(1,2),(2,3),(2,4),(1,6),(1,5)])
G.show()
l=G.laplacian_matrix()
show(l)
g=l[[1,2,3,4,5],[1,2,3,4,5]]
d=~g
show(d)
t=d[[0,1,2],[0,1,2]]
show(t)
Q=matrix(QQ,3 , 3, lambda x, y: 1)
e=t-0.5*Q
z=e.eigenvectors_right()
z.sort()
show(z)

My eigenvectors are not coming and sage is giving some error report. How to recover it?

edit retag flag offensive close merge delete

Comments

try using e=t - (1/2)*Q

FrédéricC gravatar imageFrédéricC ( 2019-06-23 09:10:32 +0100 )edit

or

sage: e.change_ring(RDF).eigenvectors_right()

The current error message is clearly misleading

eigenspaces cannot be computed reliably for inexact rings such as Real Field with 53 bits of precision,
consult numerical or symbolic matrix classes for other options
vdelecroix gravatar imagevdelecroix ( 2019-06-23 18:08:48 +0100 )edit

Thank you.

rewi gravatar imagerewi ( 2019-06-25 13:18:23 +0100 )edit