A = matrix(ZZ, [[3,0,0],[0,-8,0],[0,0,4]])
print 'spectrum = ' ,str(A.eigenvalues())

A.eigenspaces()