I have a code which finds the eigensystem for a matrix H = H0 + x HInt, where x is a variable which turns on the interaction. H0 is diagonal, and HInt is a sparse matrix (with about 400 states, I hope to go up to 1000) - see the MatrixPlot below:

Unfortunately I need to find pretty much all the eigenvalues and eigenvectors, as I need to adiabatically match them as the interaction is switched so that the eigenstates can be tracked as the interaction is turned on.

Given the sparse nature of the matrix involved, are there ways of speeding up the eigensystem problem? Currently I'm just using

Eigenvalues[H0+ x HInt];


Thanks in advance.

enter image description here


1 Answer 1


Here are couple of quick tips.

Lets say this is your matrix

mat = SparseArray[{{i_, j_} /; Abs[i - j] == 3 -> 1, {i_, i_} -> 1}, {200, 200}];

This is the conventional way to find EigenSystem

Eigensystem[SparseArray[{{i_, j_} /; Abs[i - j] == 3 -> 1, {i_, i_} -> 1},
{200, 200}]]; // AbsoluteTiming

{53.6551, Null}

Now just change the value to floating number, I mean change 1 to 1.

Eigensystem[SparseArray[{{i_, j_} /; Abs[i - j] == 3 -> 1., {i_, i_} -> 1.},
{200, 200}]]; // AbsoluteTiming

{0.115758, Null}

See the difference !

Since you are interested in all the Eigenvalues, I would suggest using a dense matrix instead of Sparse matrix. (Just Use Normal[SparseArray[]])

Eigensystem[SparseArray[{{i_, j_} /; Abs[i - j] == 3 -> 1., {i_, i_} -> 1.},
{200, 200}] // Normal]; // AbsoluteTiming

{0.020899, Null}

  • $\begingroup$ One could also just use N[mat] to get a machine precision version of mat. $\endgroup$
    – user21
    May 12, 2016 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.