Skip to content

Commit 9eefcc5

Browse files
DOC: sparse.linalg.eigsh: fix inconsistent definitions of OP and OPinv#18214 (scipy#22351)
* solved the issue: inconsistent definitions of OP and OPinv in eigsh scipy#18214 * Apply suggestions from code review [docs only] --------- Co-authored-by: Jake Bowhay <60778417+j-bowhay@users.noreply.github.com>
1 parent 0a67523 commit 9eefcc5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scipy/sparse/linalg/_eigen/arpack/arpack.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,16 +1422,19 @@ def eigsh(A, k=6, M=None, sigma=None, which='LM', v0=None,
14221422
unspecified. This is computed internally via a (sparse) LU
14231423
decomposition for explicit matrices A & M, or via an iterative
14241424
solver if either A or M is a general linear operator.
1425-
Alternatively, the user can supply the matrix or operator OPinv,
1425+
Alternatively, the user can supply the matrix or operator `OPinv`,
14261426
which gives ``x = OPinv @ b = [A - sigma * M]^-1 @ b``.
1427+
Regardless of the selected mode (normal, cayley, or buckling),
1428+
`OPinv` should always be supplied as ``OPinv = [A - sigma * M]^-1``.
1429+
14271430
Note that when sigma is specified, the keyword 'which' refers to
14281431
the shifted eigenvalues ``w'[i]`` where:
14291432
1430-
if mode == 'normal', ``w'[i] = 1 / (w[i] - sigma)``.
1433+
if ``mode == 'normal'``: ``w'[i] = 1 / (w[i] - sigma)``.
14311434
1432-
if mode == 'cayley', ``w'[i] = (w[i] + sigma) / (w[i] - sigma)``.
1435+
if ``mode == 'cayley'``: ``w'[i] = (w[i] + sigma) / (w[i] - sigma)``.
14331436
1434-
if mode == 'buckling', ``w'[i] = w[i] / (w[i] - sigma)``.
1437+
if ``mode == 'buckling'``: ``w'[i] = w[i] / (w[i] - sigma)``.
14351438
14361439
(see further discussion in 'mode' below)
14371440
v0 : ndarray, optional

0 commit comments

Comments
 (0)