I have a very simple question. It is related to the computational tolerance error.
Let me do (see at the end) the eigendecomposition of a matrix A in eigenvector V and diagonal eigenvalues D, and build it again by multiplication V^-1*D*V.
The obtained value is far from being A, the error is quite big.
I would like to know if I am using incorrect functions to do this task or, at least, how can I reduce this error. Thank you in advance
in[1]:import numpy
from scipy import linalg
A=matrix([[16,-9,0],[-9,20,-11],[0,-11,11]])
D,V=linalg.eig(A)
D=diagflat(D)
matrix(linalg.inv(V))*matrix(D)*matrix(V)
out[1]:matrix([[ 15.52275377, 9.37603361, 0.79257097],
[9.37603361, 21.12538282, -10.23535271],
[0.79257097, -10.23535271, 10.35186341]])
Isn’t that backwards?
A*V = V*Dfrom the definition, soA = V*D*V^(-1).but
Aside: there are recipes for using
np.dotto avoid all these conversions to matrix, likewhich I often find cleaner, but YMMV.