<p>我正在使用文档页面上<code>linalg.eigsh</code>,<a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.eigsh.html#scipy.sparse.linalg.eigsh" rel="nofollow noreferrer">here</a>的示例代码:</p>
<pre><code>import scipy.sparse.linalg as sp
import numpy as np
id = np.eye(13)
vals, vecs = sp.eigsh(id, k=6)
len(vals)
# 6
len(vecs)
# 13
</code></pre>
<p>我要求它提供<code>6</code>特征值(<code>k=6</code>),它确实返回6,但是它给了我13个特征向量。<br/>在文档中,当它谈到<code>k</code>时,它说:</p>
<blockquote>
<p>The number of eigenvalues and eigenvectors desired. k must be smaller
than N. It is not possible to compute all eigenvectors of a matrix.</p>
</blockquote>
<p>事实上,我认为Lanczos方法的速度,潜在的<code>eighsh</code>是因为它只找到了eigvector的一个子集。你知道吗</p>
<p>那么它如何返回所有的特征向量呢?你知道吗</p>