# Why does np.linalg.eig produce an opposite-signed eigenvector?

I am learning SVD by following this MIT course. In this video, the lecturer is finding the SVD for

$$\begin{pmatrix} 5 & 5 \\ -1 & 7 \end{pmatrix},$$

which involves finding the eigenvalues for

$$C^T C = \begin{pmatrix} 26 & 18 \\ 18 & 74 \end{pmatrix}.$$

In the example (at the time in the link above), the lecturer finds eigenvalues

$$\begin{pmatrix}-3/\sqrt{10} \\ 1/\sqrt{10} \end{pmatrix}, \begin{pmatrix} 1/\sqrt{10} \\ 3/\sqrt{10} \end{pmatrix}.$$

But np.linalg.eig produces the opposite vector to the second one:

w, v = np.linalg.eig(C.T*C)
v
matrix([[-0.9486833 , -0.31622777],
[ 0.31622777, -0.9486833 ]])


Why?

• I've had a quick look, but can't see it yet. numpy is calling _umath_linalg.eig ( github.com/numpy/numpy/blob/v1.16.1/numpy/linalg/… ), which seems to in turn use one of the *geev. As the answer in my SO link says, from there you'd need to understand the FORTRAN code underlying that function, and that's deeper than I want to dig for this. – Ben Reiniger Jun 26 at 14:18