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

ask: Fails to raise inconsistent assumptions exception when Q.positive([a matrix]) is an assumption #25532

Open
TiloRC opened this issue Aug 17, 2023 · 0 comments
Labels
assumptions Wrong Result The output produced by SymPy is mathematically incorrect.

Comments

@TiloRC
Copy link
Contributor

TiloRC commented Aug 17, 2023

from sympy.abc import a
from sympy import ask, Q, MatrixSymbol
X = MatrixSymbol('X', 2, 2)

ask(Q.positive(X)) # returns False as expected as it doesn't make sense for a matrix to be positive

ask(Q.is_true(a),  (Q.is_true(a) & Q.positive(X))) # True instead of raising inconsistent assumptions exception 

ask((Q.positive(X) | Q.positive(a)) & ~Q.positive(a), Q.positive(X) & ~Q.positive(a)) # True instead of False

What's happening here is that satask doesn't think that Q.positive(X) is False but key(*args)._eval_ask(assumptions) does.

@TiloRC TiloRC added Wrong Result The output produced by SymPy is mathematically incorrect. assumptions labels Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assumptions Wrong Result The output produced by SymPy is mathematically incorrect.
Projects
None yet
Development

No branches or pull requests

1 participant