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

Overloads for scipy.linalg functions #82

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jessegrabowski
Copy link

This PR provides numba overloads for functions in the scipy linalg library, including:

linalg.schur
linalg.qz
linalg.ordqz
linalg.solve_discrete_lyapunov
linalg.solve_continuous_lyapunov

The implementations are modeled on the numba.np.linalg implementations, although without special cython wrappers. Instead, i use intrinsics and ctypes as suggested here and here. Functions can be called on all data types supported by LAPACK.

It's not completely ready to be merged. For one thing, the overloads from linalg.overloads aren't automatically loaded via import numba_scipy. In addition, the function signatures don't exactly match those in scipy.linalg. Specifically, arguments related to configuring LAPACK functions, such as overwrite_a and lwork in linalg.schur, are not supported. Instead, a workspace query is always run in any function that requires a workspace.

These functions were admittedly chosen somewhat randomly (based on my personal needs), but it is my hope this PR can serve as a starting point for a conversation about a larger effort to numbfy the scipy.linalg package. Notably, #43 and #33 request linalg.logm, which requires schur decomposition, so this PR would be a first step towards meeting those needs. It also suggests an extendable framework that allows more LAPACK wrappers to be easily written and transformed into overloads for linalg functions.

@jessegrabowski jessegrabowski changed the title overloads for scipy.linalg.schur, .qz, .ordqz, .solve_discrete_lyapun… Overloads for scipy.linalg functions Jun 29, 2022
@jessegrabowski jessegrabowski marked this pull request as draft June 30, 2022 07:10
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.

1 participant