Get non normalized eigenvectors in scipy

故事扮演 提交于 2019-12-06 04:31:24

According to various related threads (1) (2) (3), there is no such thing as a "non normalized" eigenvector.

Indeed, an eigenvector v corresponding to the eigenvalue l of the matrix A is defined by,

A*v = l*v

and can therefore be multiplied by any scalar and remain valid.

While depending on the algorithm, the computed eigenvector can have a norm different from 1, this does not hold any particular meaning (physical or otherwise), and should not be relied on. It is customary to return a normalized eigenvector in most numerical libraries (scipy, R, matlab, etc).

You should have a look at sympy. This package tries to solve this stuff by means of algebraic calculations instead of numeric ones (as numpy does).

import sympy as sp
sp.init_printing(use_unicode=True)

mat_a = sp.Matrix([[-3, 2], [-1, 0]])
mat_a.eigenvects()

Result is (eigenvalue, multiplicity, eigenvector):

[(-2, 1, [[2],[1]]), (-1, 1, [[1],[1]])]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!