title: Scipy.linalg.eig() giving different eigenvectors from GNU Octave's eig()
body: <p>I want to compute the eigenvalues for a generalized eigenvalue problem with lambda * M * v = K * v, where lambda is the eigenvalue, v is an eigenvector, and M and K are matrices. Let's say we have</p>
  
  <pre><code>K =
  
     1.8000 + 0.0000i  -1.0970 + 0.9550i
    -1.0970 - 0.9550i   1.8000 + 0.0000i
  
  M = 
  
     209     0
       0   209
  </code></pre>
  
  <p>In Octave, if I do <code>[V,D]=eig(K,M)</code>, I get:</p>
  
  <pre><code>V =
  
     0.53332 - 0.46429i  -0.53332 + 0.46429i
     0.70711 + 0.00000i   0.70711 + 0.00000i
  
  D =
  
  Diagonal Matrix
  
     0.34555         0
           0   3.25445
  </code></pre>
  
  <p>However, if I do scipy.linalg.eig(K, b=M) using Scipy in python, I get a different result:</p>
  
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; import scipy as sp
  &gt;&gt;&gt; import scipy.linalg
  &gt;&gt;&gt; K = np.mat([[1.8, -1.097+0.995j], [-1.097-0.955j, 1.8]])
  &gt;&gt;&gt; M = np.mat([[209., 0.], [0., 209.]])
  &gt;&gt;&gt; M
  matrix([[ 209.,    0.],
          [   0.,  209.]])
  &gt;&gt;&gt; K
  matrix([[ 1.800+0.j   , -1.097+0.955j],
          [-1.097-0.955j,  1.800+0.j   ]])
  &gt;&gt;&gt; D, V = sp.linalg.eig(K, b=M)
  &gt;&gt;&gt; D
  array([ 0.00165333 -1.99202696e-19j,  0.01557155 +0.00000000e+00j])
  &gt;&gt;&gt; V
  array([[ 0.70710678 +0.00000000e+00j, -0.53332494 +4.64289256e-01j],
         [ 0.53332494 +4.64289256e-01j,  0.70710678 -8.38231384e-18j]])
  </code></pre>
  
  <p>The eigenvalues should be the ones in the D array. </p>
  
  <p>Why are the eigenvalues different in these two examples? Am I misunderstanding something?</p>
  
  <p>edit: corrected typo and redid calculation.</p>
  
  <p>edit: I used Octave 3.8.2. in Mac OS X 10.10.3. </p>