Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate HermitianEig for larger matrices #268

Open
wlandry opened this issue Sep 18, 2018 · 1 comment
Open

Inaccurate HermitianEig for larger matrices #268

wlandry opened this issue Sep 18, 2018 · 1 comment

Comments

@wlandry
Copy link

wlandry commented Sep 18, 2018

Running the attached program gives me the output

eigval: -2514.532332452646371076876843923197100285732340520947510920424934587171685099521383378129109497782512

uncommenting lines 32 or 35 changes the output to

eigval: -2514.532332452646371076876843923197100285732340520947510920424934587171685099521565445322063739285174

These differ around the 80'th digit. This code is running at 1024 bits (308 digit) precision. After some work, I verified that the second result is correct.

It seems that the problem arises within the DivideAndConquer(). DivideAndConquer() calls itself recursively and then calls Merge() to merge the results. When not computing eigenvectors, Merge() expects to get the last eigenvector of the first submatrix and the first eigenvector of the last second. However, the output of Merge() is the middle two eigenvectors, not the first and last eigenvectors. So everything works fine if there is only one level of recursion, but it breaks down with two levels. When I set the cutoff to greater than half of the matrix size, it only does one level of recursion.

The code path is different when computing eigenvalues and eigenvectors, so it does not run into this bug.
Hermitian_bug.txt

@poulson
Copy link
Member

poulson commented Sep 18, 2018

This was a heroic debugging effort. Congratulations, Walter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants