Mateusz Paprocki wrote:
> Hi,
>
> On Tue, Jun 30, 2009 at 08:14:38AM -0400, Alan Bromborsky wrote:
>
>> I am trying to define a non-communicative symbol. If I do:
>>
>> a = sympy.Symbol('a')
>> A = sympy.Symbol('A',communicative=False)
>> B = sympy.Symbol('B',communicative=False)
>> print a,A,B
>> print A+B == B+A
>> print A*B == B*A
>> print a*A == A*a
>>
>> I get:
>>
>> a A B
>> True
>> True
>> True
>>
>>
>> What am I doing wrong. I could not find anything in the docs. I would
>> think the second test would be False?
>>
>>
>
> you mean commutative, right?
>
> In [1]: a = Symbol('a')
>
> In [2]: A = Symbol('A', commutative=False)
>
> In [3]: B = Symbol('B', commutative=False)
>
> In [4]: A+B == B+A
> Out[4]: True
>
> In [5]: A*B == A*B
> Out[5]: True
>
> In [6]: A*B == B*A
> Out[6]: False
>
> In [7]: a*A == A*a
> Out[7]: True
>
>
Thank you, my lack of spelling ability proves that I was once an engineer.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---