0

I want to find the eigen vector for a matrix. I am using the numpy.linalg.eig library in python. The output obtained from this command is not giving eigen vector in the vector form.

x = np.array([[0, 1], [-2, -3]])
val, vec=np.linalg.eig(x)

vec gives the output array([[ 0.70710678, -0.4472136 ], [-0.70710678, 0.89442719]]). And hence vec[0] and vec[1] are [ 0.70710678, -0.4472136 ] and [-0.70710678, 0.89442719] respectively.(These are not the eigen vectors for this matrix).

The eigen vectors for this matrix are [0.70710678,-0.70710678] and [-0.4472136, 0.89442719].(which cannot be obtained from vec[0] or vec[1] as it is the transpose). How to get the actual eigen vectors from vec variable?

Igor Nikolaev
  • 4,597
  • 1
  • 19
  • 19
Subham Kumar
  • 477
  • 1
  • 6
  • 12
  • The documentation says that the result must be read in columns which is what you have: "The normalized (unit “length”) eigenvectors, such that the column v[:,i] is the eigenvector corresponding to the eigenvalue w[i]." – Eskapp Apr 09 '19 at 16:01
  • Thanks @Eskapp. I was able to get the column using vec[:,i]. – Subham Kumar Apr 09 '19 at 16:05

0 Answers0