Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran90: Subroutine DSYEV and associating eigenvalues and eigenvectors.

  1. Nov 7, 2011 #1
    Greetings. I am using the LAPACK (Linear Algebra Package) software package to find the eigenvalues and eigenvectors of a large symmetrical real matrix. Specifically, I calculate a scalar from each eigenvector, and I want to graph it against its associated eigenvalue.

    I am using the subroutine DSYEV of LAPACK to do this. However, DSYEV outputs the eigenvalues in ascending order, and I'm not sure how it orders the eigenvectors. Is there a way to associate each eigenvector with its eigenvalue?

    Edit: The official page for DSYEV is here: http://www.netlib.org/lapack/double/dsyev.f
    Here is another page about it: http://www.nag.co.uk/numeric/fl/nagdoc_fl22/xhtml/F08/f08faf.xml
  2. jcsd
  3. Nov 7, 2011 #2


    User Avatar
    Science Advisor
    Homework Helper

    The eigenvectors are returned in the A matrix in the same order as the eigenvalues.

    A(1:N, 1) is the vector for W(1), A(1:N, 2) is the vector for W(2), etc.
  4. Nov 7, 2011 #3
    Thank you very much for the reply.

    Just to be completely clear: the columns of the matrix A are the eigenvectors?
  5. Nov 7, 2011 #4


    User Avatar
    Science Advisor
    Homework Helper

    If you set JOBV = "V", then yes. Otherwise, no!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook