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

-- 
Mateusz

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to