[Python] Generalized eigen-value problem python. what am I doing wrong?

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to solve the genralized eigen value problem (Ax=bBx where A and B are mxm matrices and I am trying to find b (which is a number)) in python. I have ran into a problem. I am using eigh from scipy.linalg, my matrices A and B are both hermitian and 8x8 yet I keep getting an error message

    I have matrices A, and B. I have tried the following:

    from scipy.linalg import eigh

    . . .

    b,x= eigh(A, B)

    The error I am getting is: LinAlgError: The leading minor of order 1 of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.

    Sorry in advance for the formating This is A:

    1 0 0 0 1.0596 0 0 0

    0 1 0 0 -0 -0.04155 -0 0

    0 0 1 0 -0 -0 -0.04155 0

    0 0 0 1 0 0 0 0.8325

    1.0596 0 0 0 1 0 0 0

    -0 -0.04155 -0 0 0 1 0 0

    -0 -0 -0.04155 0 0 0 1 0

    0 0 0 0.8325 0 0 0 1

    This is B

    14.7142 0 0 0 -23.6112 -0 -0 0

    0 -8.8262 0 0 0 -0.67335 0 0

    0 0 -0.67335 0 0 0 0 0

    0 0 0 -2.8794 0 0 0 -13.1346

    -23.6112 -0 -0 0 14.7142 0 0 0

    0 -0.67335 0 0 0 -8.8262 0 0

    0 0 0 0 0 0 -0.67335 0

    0 0 0 -13.1346 0 0 0 -2.8794

    Continue reading...

Compartilhe esta Página