$$A= \begin{bmatrix} 0.9 & 0.15 & 0.25 \\ 0.075 & 0.8 & 0.25 \\ 0.025 & 0.05 & 0.5 \\ \end{bmatrix} $$
I need to use a Python script to compute $A^{1000}$.
I can use numpy's linalg.eig function to find my eigenvalues and eigen vectors. Doing so should yield eigenvalues
$$\begin{bmatrix} 1& 0.741 & 0.459 \\ \end{bmatrix} $$
and eigenvectors $$ \begin{bmatrix} 0.891 & 0.737 & -0.276 \\ 0.445 & -0.673 & -0.528 \\ 0.089 & -0.063 & 0.803 \\ \end{bmatrix} $$
Given this information, I am unsure how to proceed with computing $A^{1000}$
I have tried to use $A^{1000} = PD^{1000}P^{-1}$, where
$$P= \begin{bmatrix} 0.891 & 0.737 & -0.276 \\ 0.445 & -0.673 & -0.528 \\ 0.089 & -0.063 & 0.803 \\ \end{bmatrix} $$
$$P^{-1}= \begin{bmatrix} 0.702 & 0.702 & 0.702 \\ 0.495 & -0.904 & -0.424 \\ -0.039 & -0.149 & 1.134 \\ \end{bmatrix} $$
and
$$D= \begin{bmatrix} 1 & 0 & 0 \\ 0.445 & 0.741 & 0 \\ 0 & & 1.134 \\ \end{bmatrix} $$
You seem to understand all the steps, so you just need the syntax. Note that this kind of question should be asked on Stack Overflow.
Solution with exponentiation by squaring (using the numpy
matrix_powerfunction) and solution with eigenvalues and eigenvectors.For both the output is the following matrix (the norm of the difference is close to $1.6\cdot10^{-13}$).