axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: Commutative symbols


From: Ralf Hemmecke
Subject: [Axiom-developer] Re: Commutative symbols
Date: Mon, 26 Mar 2007 17:02:24 +0200
User-agent: Thunderbird 2.0b2 (X11/20070116)

On 03/26/2007 02:36 PM, Ondrej Certik wrote:
Hmmm, I would have thought that commutativity is a property of the
multiplication of the domain you are working in and not a property of a
symbol.

I know - originaly I had a special class NCMul, for noncommutative
multiplication. But first it duplicates some code and second - some
symbols are commutative and some are not and I want to mix that. It's
like when computing with matrices, like:

A*3*x*B,

where x is a variable and A,B matrices, then you want this to evaluate to:

3*x *A*B

Maybe this is not what you want...

(6) -> A: Matrix Integer := [[1,2],[5,9],[7,11],[3,1]]
(6) ->
        +1  2 +
        |     |
        |5  9 |
   (6)  |     |
        |7  11|
        |     |
        +3  1 +
                             Type: Matrix Integer
(7) -> B: Matrix Integer := [[1,2,3],[5,7,9]]
(7) ->
        +1  2  3+
   (7)  |       |
        +5  7  9+
                             Type: Matrix Integer
(8) -> A*3*x*B
        +33x   48x   63x +
        |                |
        |150x  219x  288x|
   (8)  |                |
        |186x  273x  360x|
        |                |
        +24x   39x   54x +
                              Type: Matrix Polynomial Integer
(11) -> B*3*x*A
 11) ->
   >> Error detected within library code:
   can't multiply matrices of incompatible dimensions

and when you think about it, it's actually the symbols, that have this
property - either you can commute it out of the expression, or you
cannot.

Yes, here A and B are actually matrices, not symbols. It depends on what you want.

Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]