Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 4047 by [email protected]: Matrix.rank and .rref do not properly support symbols
http://code.google.com/p/sympy/issues/detail?id=4047

In [1]: a, b, c = symbols('a b c')
In [2]: Matrix( ((a,b),(a,c)) ).rank()
Out[2]: 2

This result is correct iff a!=0 and b!=c. In the case of b==c, the rank is actually 1. And if a==b==c==0, rank is 0. No information is known about the values of a, b, and c, so a definitive result is incorrect.

To some extent, the issue lies with the default iszerofunc (which simply checks .is_zero). It returns None for any possibly-zero value, but .rref treats it the same as False, assuming it to be definitely not zero, thereby giving the highest possible rank for the given values. Swapping iszerofunc for a function that treats possibly-zero values as True instead gives the lowest possible rank. So with a little effort, the range of possible ranks can be found, but the conditions for each are still unknown.

I would like to see .rref and .rank return conditional values, like Piecewise or ITE, to properly capture the possibilities in a symbolic matrix. What do you think of that?

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to