title: Efficient solving of generalised eigenvalue problems in python
body: <p>Given an eigenvalue problem <strong>Ax = λBx</strong> what is the more efficient way to solve it out of the two shown here:</p>
  <pre><code>import scipy as sp
  import numpy as np
  
  def geneivprob(A,B):
      # Use scipy
      lamda, eigvec = sp.linalg.eig(A, B)
      return lamda, eigvec
  
  def geneivprob2(A,B):
      # Reduce the problem to a standard symmetric eigenvalue problem
      Linv = np.linalg.inv(np.linalg.cholesky(B))
      C = Linv @ A @ Linv.transpose()
      #C = np.asmatrix((C + C.transpose())*0.5,np.float32)
      lamda,V = np.linalg.eig(C)
      return lamda, Linv.transpose() @ V   
  
  </code></pre>
  <p>I saw the second version in a codebase and was wondering if it was better than simply using scipy.</p>