I create an arbitrary 2x2 matrix:
In [87]: mymat = np.matrix([[2,4],[5,3]])
In [88]: mymat
Out[88]:
matrix([[2, 4],
[5, 3]])
I attempt to calculate eigenvectors using numpy.linalg.eig:
In [91]: np.linalg.eig(mymat)
Out[91]:
(array([-2., 7.]),
matrix([[-0.70710678, -0.62469505],
[ 0.70710678, -0.78086881]]))
In [92]: eigvec = np.linalg.eig(mymat)[1][0].T
In [93]: eigvec
Out[93]:
matrix([[-0.70710678],
[-0.62469505]])
I multiply one of my eigenvectors with my matrix expecting the result to be a vector that is a scalar multiple of my eigenvector.
In [94]: mymat * eigvec
Out[94]:
matrix([[-3.91299375],
[-5.40961905]])
However it is not. Can anyone explain to me what is going wrong here?