Skip to content

Feat: added CuPy support to LinearOperator.eigs and LinearOperator.cond - #816

Merged
mrava87 merged 23 commits into
PyLops:devfrom
mrava87:feat-eigs_cupy
Oct 17, 2026
Merged

mrava87 merged 23 commits into
PyLops:devfrom
mrava87:feat-eigs_cupy

Conversation

@mrava87

@mrava87 mrava87 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds support for CuPy in LinearOperator.eigs and LinearOperator.cond.

However, since not all methods in scipy are not available in cupy (eg scipy.sparse.linalg.eigs), and some input parameters are missing or have missing options (eg SM in cupyx.scipy.sparse.linalg.eigsh), a number of checks and error raises are required.

Moreover, some cupyx eigenvalue solvers seem to require self.ndim that scipy/cupy.LinearOperator define as self.ndim = len(self.shape) (note that the equivalent scipy eigenvalue solvers don't...). To accommodate for it, every operator that used self.ndim internally (eg FFT) is now modified to use self.ndims so self.ndim can be defined for the baseclass pylops.LinearOperator too and made available to all operators.

@mrava87 mrava87 self-assigned this Oct 9, 2026
@codacy-production

codacy-production Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 9 complexity · 0 duplication

Metric Results
Complexity 9
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@mrava87 mrava87 changed the title Feat: added CuPy support to LinearOperator.eigs Feat: added CuPy support to LinearOperator.eigs and LinearOperator.cond Oct 11, 2026
@mrava87
mrava87 marked this pull request as ready for review October 11, 2026 17:44
Comment thread pylops/linearoperator.py
@mrava87
mrava87 merged commit 62f070d into PyLops:dev Oct 17, 2026
24 checks passed
@mrava87
mrava87 deleted the feat-eigs_cupy branch October 17, 2026 18:13
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

Successfully merging this pull request may close these issues.

2 participants