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

Symbolic arguments #40

Open
asmeurer opened this issue Jun 15, 2020 · 0 comments
Open

Symbolic arguments #40

asmeurer opened this issue Jun 15, 2020 · 0 comments

Comments

@asmeurer
Copy link
Member

It would be useful to allow symbolic arguments to ndindex functions. The best way to do it is to allow the inputs to be SymPy expressions. This would require rewriting all the functions so that they can return SymPy expressions. In particular, functions would either have to be nested somehow, or else return sympy.Piecewise objects. Some functions use more advanced things like the Chinese Remainder Theorem, so it isn't clear to me how to represent those completely symbolically.

Aside from allowing people to do calculations on expressions, one advantage of doing this is that it would provide a way for people to generate functions for indexed operations that do not depend on ndindex. The idea would be symbolic input -> ndindex -> sympy expression -> codegen to Python.

An open question is how to handle None as an input to Slice. Clearly an expression like x + 1 cannot be None, but should we allow a single Symbol x to be None? And if so, how do we represent that symbolically?

This is a very long term goal. I want to get things working with numeric arguments first.

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

No branches or pull requests

2 participants