scipy: BUG: `scipy.linalg.eigh` raises `LinAlgError: Internal Error.`

Describe your issue.

scipy.linalg.eigh raises LinAlgError: Internal Error.

image

numpy’s eigh and evd driver will not raise errors image

I’ve uploaded the matrix here, you can load it with np.load.

image

Reproducing Code Example

scipy.linalg.eigh(mat)

Error message

LinAlgError: Internal Error.

SciPy/NumPy/Python version information

1.9.3 1.23.5 sys.version_info(major=3, minor=10, micro=4, releaselevel=‘final’, serial=0)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

@ilayn the error message is defined here. I don’t think it is very descriptive, what do you think about making it more so?

The error message is coming from the LAPACK driver (See the info parameter here; LAPACK dsyevr ). So we don’t have a control over it. In other words, the problem is internal to LAPACK due to the driver we use and can be originating triangularization or some other part of the algorithm.

NumPy also does no different magic but uses the evd driver. Hence you can still use the driver=evd. Covariance problems are known to have ill-conditioning. It is very common for us to receive bug reports about it, I don’t know why people end up with those covariance cases but probably ML folks should look into this algorithmically. Don’t know if this is an active research area. But essentially the full spectrum calculations are the culprit if I have to speculate.

That worked.

I’m trying to run your example now. It seems to be failing on my system too, it hangs and then my terminal closes unexpectedly. I’ll take a look into this and get back to you, it may take a while as I only really have time to work on SciPy over the weekends.