How to obtain the eigenvector for the following graph?

asked 5 years ago

anonymous user

Anonymous

updated 5 years ago

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?

Preview: (hide)

Comments

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

FrédéricC gravatar imageFrédéricC ( 5 years ago )

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 ( 5 years ago )

Thank you.

rewi gravatar imagerewi ( 5 years ago )