The correctness of matrix algorithms, particularly the rref algorithm
and those that rely on it, rely on the ability to determine if entries
are identically zero or not.  For symbolic matrices, this means that
if you end up with an entry like 1/(1/x - 1/(x + 1)) - x**2 - x, and
it works under the assumption that it is not zero, you will get the
wrong answer. So at each step where it checks if it is zero, it needs
to first simplify the expression. But calling simplify() is expensive
in general. However, if you know that your entries are rational
functions, then you can call a very specialized simplification
routine. Basically just write it as polynomial/polynomial, and it will
be identically zero iff it reduces to zero.

This is a problem that's been worked around in the current
implementation, but it's hackish and slow. The future implementation
will be more elegant, and faster. But it will work completely in the
background. You won't need to worry about it unless you specifically
care about what is going on. So you should just write your module
without worrying about these things, and when they are fixed, it will
just start to work better. At worst, you may just need to make sure
that you define the iszerofunction function or set the simplify flag
correctly whenever you call rref or some algorithm that uses it like
nullspace.

Aaron Meurer

On Sat, Apr 6, 2013 at 6:07 PM, Ankit Agrawal <aaaagra...@gmail.com> wrote:
>
>
> On Sunday, April 7, 2013 4:50:46 AM UTC+5:30, Aaron Meurer wrote:
>>
>> OK, so this is something that will probably be slow now for large
>> systems.
>
>
> The size of the system that I expect the user to be able to solve would have
> A matrix of the size of 12 x 12 (slightly on the higher side).
>
>> You'll also currently need to be careful about zero
>> equivalence. As the matrices move to ground types, though, this
>> problem will go away.
>
>
> I am not sure I got the exact meaning of 'zero equivalence' in this context.
> Can you please elaborate on it?
>
> Thank you.
> Ankit Agrawal.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to