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

BUG: sparse.linalg: mistake in unsymm. real shift-invert ARPACK eigenvalue selection #11199

Merged
merged 1 commit into from Dec 15, 2019

Conversation

pv
Copy link
Member

@pv pv commented Dec 10, 2019

Reference issue

Closes: gh-11198

What does this implement/fix?

For real-valued unsymmetric problems, ARPACK can in some cases return
one extra eigenvalue. The code that drops the extraneous eigenvalue did not
take into account that in shift-invert mode, the which= keyword applies to the
transformed eigenvalues, and dropped sometimes the wrong eigenvalue.

Moreover, fix sort order in this case for 'LM', 'LR', 'LI' modes
(largest items come first), although arpack itself does not seem to guarantee
any order here.

…value selection

For real-valued unsymmetric problems, ARPACK can in some cases return
one extra eigenvalue.

The code that drops the extraneous eigenvalue did not take into account
that in shift-invert mode, the which= keyword applies to the
*transformed* eigenvalues, and dropped sometimes the wrong eigenvalue.

Moreover, fix sort order in this case for 'LM', 'LR', 'LI' modes
(largest items come first).
Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

LGTM, test seems sensible and Azure coverage results look good for the affected code changes.

@denis-bz does this solve your problem?

We may want to merge soon-ish if this is "ok" since this is one of the two backports PRs under consideration for 1.4.0 "final," I think.

assert_allclose(np.linalg.norm(A.dot(z) - z * w), 0, atol=np.sqrt(eps))

# Check that the set of eigenvalues for `k` is a subset of that for `k+1`
dist = abs(prev_w[:,None] - w).min(axis=1)
Copy link
Contributor

@tylerjereddy tylerjereddy Dec 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the check for the fix for the main complaint in #11198.

@tylerjereddy tylerjereddy added this to the 1.4.0 milestone Dec 15, 2019
@tylerjereddy
Copy link
Contributor

@tylerjereddy tylerjereddy commented Dec 15, 2019

Ok this looks good to me & the original issue submitter, so I will merge & try to put this in 1.4.0 "final."

Thanks Pauli!

@tylerjereddy tylerjereddy merged commit 0db79f6 into scipy:master Dec 15, 2019
11 checks passed
tylerjereddy added a commit to tylerjereddy/scipy that referenced this issue Jan 20, 2020
* update SciPy 1.2.3 LTS release notes
after backporting scipygh-10882, scipygh-11199,
scipygh-10961, and scipygh-10833.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants