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
Make assumptions about indexed symbols #13992
Labels
Comments
Can I work on this? |
Yes, you can. |
@Nirvan101 any progress on this? |
+1 |
Since it doesn't subclass from Symbol, it should reapply the logic in the Symbol constructor: Lines 233 to 235 in cd98ba0
Specifically, create a |
bsamseth
added a commit
to bsamseth/sympy
that referenced
this issue
Feb 26, 2019
``Indexed`` and ``IndexedBase`` now accepts a new keyword argument allowing the specification of assumptions on indexed symbols.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this should be possible to do:
Without assumptions, it's hard to do algebra with indexed symbols, e.g., get
sqrt(x[1]**2)
to simplify tox[1]
.I understand that the class Indexed inherits from Expr, not from Symbol, and there are no assumptions on Expr. Still, we already have some quasi-assumptions on Indexed and IndexedBase in the form of
is_commutative=True
class property. And the objects of class Idx, which also inherits from Expr, have them in the formobj._assumptions["finite"] = True
as seen here.Could
IndexedBase.__new__
parse and use the**kwargs
that it accepts, instead of trying to pass them toExpr.__new__
?Optionally, maybe even
Indexed.__new__
could do that, so an assumption can be added to a particular indexed object?By the way, any attempt to pass
**kwargs
toExpr.__new__
is a potential bug because this method, inherited fromBasic.__new__
, does not accept any keyword arguments.The text was updated successfully, but these errors were encountered: