Yeah, Aaron has been on me to remove the string from MatrixSymbol.  My
opinion is that we should allow non-basics in args.  This will help us
avoid recreating all of Python.  I generally lose this argument.

Where I win though is with the claim that Symbol is way too magical and big
to be used in Matrix Expressions.  I'm going to claim that Matrix
expressions are much simpler in design than the core.  Part of this is the
use of new assumptions.  Injecting a Symbol, a huge source of magic, right
in the center of matrix expressions makes my skin crawl a tiny bit.  A good
compromise is to make a Symbol object that is only a Symbol object, and not
a scalar value with old assumptions info attached.


On Fri, Apr 25, 2014 at 3:37 AM, Clifford Wolf <[email protected]>wrote:

> On Friday, April 25, 2014 2:49:15 AM UTC+2, Matthew wrote:
>>
>> I haven't thought about this issue much.  Generally speaking though
>> MatrixElement and derivatives and Matrix Expressions are absolutely in a
>> not so perfect state.  Help here is welcome.
>>
>
> I'll see what I can do.
>
> Imo the next thing to fix is this: type(MatrixSymbol.args[0]) is str. It
> is the name of the symbol. I think there is even a docstring somewhere that
> states that all members of .args must be derived from Basic, and it
> actually breaks a couple of functions if this is not the case. For example
> the following code throws an AttributeError because str has no .match:
>
> from sympy import *
> from sympy.abc import n, m
> X = MatrixSymbol('X', n, m)
> X.find(n)
>
> At the moment MatrixSymbol.is_Symbol=False, which kind of makes sense
> because it has arguments (the dimensions) that can be arbitrary
> expressions. But it also means that there is code that tries to clone it by
> performing X.func(*X.args), so the symbol name must be contained in args
> somehow.
>
> I would recommend to sympify the symbol name, i.e. effectively turning
> MatrixSymbol into an operator that turns an ordinary symbol into a matrix
> symbol. This has the downside that mixing Symbol('X') and MatrixSymbol('X',
> n, m) can have strange effects, but it is the best solution I can think of.
>
> Any other ideas how to fix this problem?
>
>
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/138f058b-f8c3-4faa-89da-22f4c8774d51%40googlegroups.com<https://groups.google.com/d/msgid/sympy/138f058b-f8c3-4faa-89da-22f4c8774d51%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJ8oX-F-kaJs4HQXrQ%3DM9JP7t4NsUOxwBoEj8OYCe_C_RB%3Dpew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to