Code to find the smalles eigenvalue of a matrix