# how to identify if a vector is an eigenvector of a given matrix

I am asked to identify from a list of vectors if any of them are eigenvectors of a given matrix. I have applied what it is explained in:

Verify a vector is an eigenvector of a matrix

It is indicated to inspect visually if the dot product of the matrix times the corresponding vector is equivalent to multiply the vector times an scalar. In the following Python code the matrix is identified as A, and the vectors as a, b, c, and d. The dot products are calculated and printed.

import numpy as np
A = np.matrix([[3,0],[4,5]])
a = np.array([3,0])
b = np.array([0,0])
c = np.array([-1,-1/2])
d = np.array([2,1])
print ("Is np.dot(A,a):",np.dot(A,a), "equivalent to multiply a:",a,"by
an scalar?")


The final question is repeated for each vector.

I have difficulties to identify the correct answer.

For example, for the first vector (a = [3,0]) I obtain the corresponding transformed vector [ 9, 12], that is, the dot product of the matrix A times the vector a, but I am not able to answer if it is also the result of multiplying the vector by any scalar.

How do I know if a given vector is the scalar multiple of another one?

• the question is whether $[9,12]$ is the product of $[3,0]$ by any scalar. In this case, it is not, since if $[9,12]=\lambda[3,0]$ then on one hand $9=\lambda3$ so $\lambda=9/3=3$ but on the other hand $12\not=\lambda0$. As a different example, if $v=[1,-2]$ then np.dot$(A,v)=[3,-6]=3v$, so $v$ is an eigenvector – Mirko Aug 13 at 21:59
$$\begin{bmatrix} a \\ b \end{bmatrix}$$ is a scalar multiple of $$\begin{bmatrix} c \\ d \end{bmatrix}$$ iff $$\frac{d}{b} = \frac{c}{a}$$ with the special requirement that $$b=0$$ should imply $$d=0$$, and similarly for $$a$$ and $$c$$.
• @HermesMorales It fits with what I said: the $0$ in $[0,4]$ is matched by a $0$ in $[0,2]$, the other pair we needn't check as there is no $0$ among them. If we had $3$-vectors we'd have to consider the 2 other coordinates, but here only one coordinate-pair is left and its quotient is $\frac{4}{2}=2$, the eigenvalue. – Henno Brandsma Aug 14 at 19:58
For nonzero vectors $$\mathbf{x}$$ and $$\mathbf{y}$$, they are scalar multiples of each other if and only if $$(\mathbf{x}\cdot\mathbf{y})^2 = (\mathbf{x}\cdot\mathbf{x})(\mathbf{y}\cdot\mathbf{y}),$$ which should be easy to implement in python.