# Fast Eigensystem calculation

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];


etc.

• – user9660
May 12 '16 at 12:32

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}

• One could also just use N[mat] to get a machine precision version of mat. May 12 '16 at 20:54