<p dir="auto"><code class="notranslate">scipy.linalg.eigvalsh()</code> throws ValueError() for large matrices. The bug appears for arbitrary matrices.</p>
<p dir="auto">However, it also shows up in trivial examples, such as a large identity matrix, and large diagonal matrices with random coefficients in [0,1].</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np 
import scipy.linalg as la

H=np.eye(6470)
#np.random.seed(0)
#H=np.diag(np.random.uniform(size=6470))
E=la.eigvalsh(H)"><pre class="notranslate"><code class="notranslate">import numpy as np 
import scipy.linalg as la

H=np.eye(6470)
#np.random.seed(0)
#H=np.diag(np.random.uniform(size=6470))
E=la.eigvalsh(H)
</code></pre></div>
<h3 dir="auto">Error message:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;example0.py&quot;, line 7, in &lt;module&gt;
    E=la.eigvalsh(H)
  File &quot;/Users/mbukov/anaconda3/lib/python3.6/site-packages/scipy/linalg/decomp.py&quot;, line 734, in eigvalsh
    check_finite=check_finite)
  File &quot;/Users/mbukov/anaconda3/lib/python3.6/site-packages/scipy/linalg/decomp.py&quot;, line 384, in eigh
    iu=a1.shape[0], overwrite_a=overwrite_a)
ValueError: On entry to DSBRDB parameter number 12 had an illegal value"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "example0.py", line 7, in &lt;module&gt;
    E=la.eigvalsh(H)
  File "/Users/mbukov/anaconda3/lib/python3.6/site-packages/scipy/linalg/decomp.py", line 734, in eigvalsh
    check_finite=check_finite)
  File "/Users/mbukov/anaconda3/lib/python3.6/site-packages/scipy/linalg/decomp.py", line 384, in eigh
    iu=a1.shape[0], overwrite_a=overwrite_a)
ValueError: On entry to DSBRDB parameter number 12 had an illegal value
</code></pre></div>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0.19.1 1.13.0 sys.version_info(major=3, minor=6, micro=2, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">0.19.1 1.13.0 sys.version_info(major=3, minor=6, micro=2, releaselevel='final', serial=0)
</code></pre></div>
<p dir="auto">Hello,</p>
<p dir="auto">I am getting an error with large arrays when using scipy.linalg.eigvalsh:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; from scipy.linalg import eigvalsh
&gt;&gt;&gt; eigvalsh(np.zeros((6143,6143)))
array([ 0.,  0.,  0., ...,  0.,  0.,  0.])
&gt;&gt;&gt; eigvalsh(np.zeros((6144,6144)))
Traceback (most recent call last):
File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
File &quot;/users/gauthe/Library/anaconda2/lib/python2.7/site-packages/scipy/linalg/decomp.py&quot;, line 684, in eigvalsh
check_finite=check_finite)
File &quot;/users/gauthe/Library/anaconda2/lib/python2.7/site-packages/scipy/linalg/decomp.py&quot;, line 345, in eigh
iu=a1.shape[0], overwrite_a=overwrite_a)
ValueError: On entry to DSBRDB parameter number 12 had an illegal value"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; from scipy.linalg import eigvalsh
&gt;&gt;&gt; eigvalsh(np.zeros((6143,6143)))
array([ 0.,  0.,  0., ...,  0.,  0.,  0.])
&gt;&gt;&gt; eigvalsh(np.zeros((6144,6144)))
Traceback (most recent call last):
File "&lt;stdin&gt;", line 1, in &lt;module&gt;
File "/users/gauthe/Library/anaconda2/lib/python2.7/site-packages/scipy/linalg/decomp.py", line 684, in eigvalsh
check_finite=check_finite)
File "/users/gauthe/Library/anaconda2/lib/python2.7/site-packages/scipy/linalg/decomp.py", line 345, in eigh
iu=a1.shape[0], overwrite_a=overwrite_a)
ValueError: On entry to DSBRDB parameter number 12 had an illegal value
</code></pre></div>
<p dir="auto">The issue seems close to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="112616186" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/5401" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/5401/hovercard" href="https://github.com/scipy/scipy/issues/5401">#5401</a>, but refers to another LAPACK function. It is a pure effect of size, since 6143 * 6143 is ok, but 6144 * 6144 is not. 6144 = 3 * (2**11) is big, but not that big. I have no problem on my macbook, with an older scipy (0.14.0), I think it's a LAPACK bug.</p>
<p dir="auto">Version I'm using;<br>
scipy version 0.18.1<br>
numpy version 1.11.1<br>
Python 2.7.12<br>
Anaconda 4.2.0 (64-bit)<br>
openSUSE 13.2 (Harlequin)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; scipy.__config__.show()
lapack_opt_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
blas_opt_info:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
openblas_lapack_info:
  NOT AVAILABLE
lapack_mkl_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
blas_mkl_info:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
mkl_info:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; scipy.__config__.show()
lapack_opt_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
blas_opt_info:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
openblas_lapack_info:
  NOT AVAILABLE
lapack_mkl_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
blas_mkl_info:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
mkl_info:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
    library_dirs = ['/users/gauthe/anaconda2/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/users/gauthe/anaconda2/include']
</code></pre></div>