How to obtain the eigenvector for the following graph?

asked 2019-06-22 10:36:39 -0500

anonymous user

Anonymous

updated 2019-06-23 02:08:57 -0500

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 02:10:32 -0500 )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 11:08:48 -0500 )edit

Thank you.

Kuldeep gravatar imageKuldeep ( 2019-06-25 06:18:23 -0500 )edit