Coverage for kwant/linalg/decomp_ev.py : 67%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright 2011-2013 Kwant authors. # # This file is part of Kwant. It is subject to the license terms in the file # LICENSE.rst found in the top-level directory of this distribution and at # http://kwant-project.org/license. A list of Kwant authors can be found in # the file AUTHORS.rst at the top-level directory of this distribution and at # http://kwant-project.org/authors.
"""Compute the eigenvalues and -vectors of the matrix pencil (a,b), i.e. of the generalized (unsymmetric) eigenproblem a v = lambda b v where a and b are square (unsymmetric) matrices, v the eigenvector and lambda the eigenvalues.
The eigenvalues are returned as numerator alpha and denominator beta, i.e. lambda = alpha/beta. This is advantageous, as lambda can be infinity which is well-defined in this case as beta = 0.
Parameters ---------- a : array, shape (M, M) b : array, shape (M, M) `a` and `b` are the two matrices defining the generalized eigenproblem left : boolean Whether to calculate and return left eigenvectors right : boolean Whether to calculate and return right eigenvectors
overwrite_ab : boolean Whether to overwrite data in `a` and `b` (may improve performance)
Returns ------- alpha : complex array, shape (M,) beta : real or complex array, shape (M,) The eigenvalues in the form ``alpha/beta``
(if left == True) vl : double or complex array, shape (M, M) The left eigenvector corresponding to the eigenvalue ``alpha[i]/beta[i]`` is the column ``vl[:,i]``.
(if right == True) vr : double or complex array, shape (M, M) The right eigenvector corresponding to the eigenvalue ``alpha[i]/beta[i]`` is the column ``vr[:,i]``. """
raise ValueError("gen_eig requires both a and be to be matrices")
raise ValueError("gen_eig requires square matrix input")
raise ValueError("gen_eig requires a and be to have the same shape")
|