[SciPy-User] Eigenvectors of sparse symmetric matrix

Lutz Maibaum lutz.maibaum at gmail.com
Tue Oct 26 01:48:13 EDT 2010


On Mon, Oct 25, 2010 at 9:26 PM, Hao Xiong <hao at biostat.ucsf.edu> wrote:
> Second, changing tolerance to 1e-4, 1e-5, 1e-15, all quash warning but
> do not solve the problem: all zero eigenvalues and eigenvectors.

Interesting. Did you get a warning about non-convergence before? I'm
not sure what's going on with the 1e-15 tolerance, but the other ones
are probably too large because the smallest eigenvalues seem to be
very close to zero. For your matrix, I get

In [28]: scipy.sparse.linalg.eigen_symmetric(a,3, which='SM',
tol=1e-12, maxiter=10000000)
Out[28]:
(array([  2.13492457e-17,   9.54397558e-07,   1.77823892e-06]),
 array([[-0.1       ,  0.05414805, -0.03697394],
       [-0.1       ,  0.04864488,  0.12934357],
       [-0.1       ,  0.09785515, -0.02710373],
       [-0.1       ,  0.12079696, -0.095882  ],
       [-0.1       , -0.0923547 ,  0.06131896],
       [-0.1       ,  0.08566995,  0.02677637],
       [-0.1       , -0.00999687, -0.03477074],
       [-0.1       ,  0.10420394,  0.0904605 ],
       [-0.1       , -0.01824658,  0.12656016],
       [-0.1       ,  0.03850215, -0.16266434],
       [-0.1       ,  0.10411247,  0.12564386],
       [-0.1       ,  0.0847864 , -0.08006353],
       [-0.1       ,  0.06881941, -0.03651171],
       [-0.1       ,  0.02100945,  0.12596802],
       [-0.1       ,  0.00698142, -0.14227155],
       [-0.1       , -0.0994901 , -0.01865521],
       [-0.1       ,  0.05150979, -0.13437869],
       [-0.1       ,  0.12983085,  0.10247783],
       [-0.1       ,  0.20811634,  0.04037155],
       [-0.1       ,  0.14284242,  0.07440172],
       [-0.1       ,  0.08759283,  0.00897286],
       [-0.1       ,  0.11652933,  0.11583934],
       [-0.1       ,  0.08273911, -0.12928089],
       [-0.1       ,  0.15103551,  0.08544608],
       [-0.1       , -0.10887856, -0.03683742],
       [-0.1       ,  0.08946787,  0.01810116],
       [-0.1       , -0.21466925,  0.08808048],
       [-0.1       ,  0.01112506,  0.11875543],
       [-0.1       ,  0.03862264, -0.03816272],
       [-0.1       , -0.08819346,  0.0469191 ],
       [-0.1       , -0.08715582, -0.10397484],
       [-0.1       ,  0.09957673,  0.12540574],
       [-0.1       , -0.10165562,  0.10154619],
       [-0.1       , -0.02138075,  0.06997714],
       [-0.1       , -0.02087899, -0.04523328],
       [-0.1       ,  0.07205966,  0.00801408],
       [-0.1       ,  0.06474043,  0.00830429],
       [-0.1       ,  0.08648864, -0.00438077],
       [-0.1       ,  0.09298343,  0.04886763],
       [-0.1       ,  0.07158097,  0.0782138 ],
       [-0.1       ,  0.01239778, -0.15765419],
       [-0.1       , -0.05888361,  0.03320853],
       [-0.1       ,  0.08010641,  0.08588525],
       [-0.1       ,  0.03127534, -0.15888655],
       [-0.1       ,  0.15375382, -0.00072328],
       [-0.1       ,  0.1309185 ,  0.01948518],
       [-0.1       , -0.21072633,  0.05625481],
       [-0.1       ,  0.00123581, -0.19868411],
       [-0.1       , -0.04948594, -0.1179604 ],
       [-0.1       ,  0.03724257, -0.18880828],
       [-0.1       , -0.05376647,  0.11361879],
       [-0.1       ,  0.05143578, -0.11411724],
       [-0.1       , -0.04570302,  0.13384669],
       [-0.1       , -0.05617232, -0.09347502],
       [-0.1       , -0.20512585,  0.0484587 ],
       [-0.1       , -0.027912  , -0.1848302 ],
       [-0.1       ,  0.14621125, -0.00988872],
       [-0.1       , -0.10030626, -0.09077817],
       [-0.1       , -0.0363287 ,  0.02784762],
       [-0.1       , -0.21623947,  0.06780762],
       [-0.1       , -0.06138235, -0.1349    ],
       [-0.1       , -0.09814152, -0.04398249],
       [-0.1       ,  0.12720599,  0.00705402],
       [-0.1       , -0.01507454, -0.18508998],
       [-0.1       , -0.00798772, -0.23027451],
       [-0.1       ,  0.0084914 , -0.14105232],
       [-0.1       , -0.00326878,  0.1905542 ],
       [-0.1       , -0.11332749, -0.01003244],
       [-0.1       ,  0.16373491,  0.07366324],
       [-0.1       , -0.15722344,  0.05073253],
       [-0.1       ,  0.04282908,  0.05747035],
       [-0.1       , -0.11459224,  0.1258188 ],
       [-0.1       , -0.03079556,  0.12889243],
       [-0.1       , -0.06469642,  0.15025778],
       [-0.1       ,  0.18106343,  0.04211254],
       [-0.1       , -0.11284705,  0.05143415],
       [-0.1       , -0.14384552, -0.01344659],
       [-0.1       ,  0.00723068, -0.19844225],
       [-0.1       , -0.05921825, -0.12152038],
       [-0.1       , -0.20116698,  0.08917197],
       [-0.1       , -0.17052863,  0.05183343],
       [-0.1       , -0.01618908, -0.05137175],
       [-0.1       , -0.04433511, -0.06585839],
       [-0.1       ,  0.03211274,  0.1278789 ],
       [-0.1       ,  0.12588347, -0.08004173],
       [-0.1       , -0.08788273, -0.10250587],
       [-0.1       ,  0.01156012, -0.00283793],
       [-0.1       , -0.05788733, -0.08254978],
       [-0.1       ,  0.08076025, -0.03895826],
       [-0.1       ,  0.02232925,  0.1221555 ],
       [-0.1       , -0.11745394, -0.02053012],
       [-0.1       ,  0.01355673,  0.12304368],
       [-0.1       , -0.17090312,  0.03684983],
       [-0.1       ,  0.21020815,  0.00314479],
       [-0.1       , -0.05367038, -0.13541344],
       [-0.1       , -0.11600589, -0.07075897],
       [-0.1       , -0.02728704,  0.09827715],
       [-0.1       , -0.09539752,  0.04939529],
       [-0.1       ,  0.0058363 ,  0.18280319],
       [-0.1       , -0.04509233, -0.0022041 ]]))

which seems in good agreement with the dense solution.

Best,

  Lutz



More information about the SciPy-User mailing list