On Nov 3, 2006, at 8:39 AM, Bill Page wrote:

> On November 3, 2006 9:48 AM David Harvey wrote:
>>
>> On Nov 3, 2006, at 9:37 AM, Bill Page wrote:
>>
>>>
>>> Maybe it is interesting to consider how Axiom handles these
>>> coercions? For example:
>>>
>>> sage: x = axiom('x::MPOLY([x],INT)')
>>> sage: x.type()
>>> MultivariatePolynomial([x],Integer)
>>> sage: y = axiom('y::MPOLY([y],INT)')
>>> sage: y.type()
>>> MultivariatePolynomial([y],Integer)
>>> sage: z = x*y
>>> sage: z
>>>   y x
>>> sage: z.type()
>>> MultivariatePolynomial([x],MultivariatePolynomial([y],Integer))
>>> sage: w = axiom('(x*y)::MPOLY([x,y],INT)')
>>> sage: w
>>>   y x
>>> sage: w.type()
>>> MultivariatePolynomial([x,y],Integer)
>>
>> What would axiom do if you started off with x and y in a *univariate*
>> polynomial ring?
>>
>
> sage: x=axiom('x::UP(x,INT)')
> sage: y=axiom('y::UP(y,INT)')
> sage: (x*y).type()
> UnivariatePolynomial(x,UnivariatePolynomial(y,Integer))
>
> In Axiom this can be coerced to MultivariatePolynomial
> ([x,y],Integer), but right now I do not yet have a method
> in the Sage/Axiom interface that can easily apply Axiom's
> :: coercion/conversion operator to an Sage Axiom ojbect.
> So if you read my example above carefully and critically
> you will see that the command:
>
>   axiom('(x*y)::MPOLY([x,y],INT)')
>
> is actually bogus, although the result shown is correct.
>
> In axiom.console():
>
> (1) -> x:=x::UP(x,INT)
>
>    (1)  x
>                                         Type:
> UnivariatePolynomial(x,Integer)
> (2) -> y:=y::UP(y,INT)
>
>    (2)  y
>                                         Type:
> UnivariatePolynomial(y,Integer)
> (3) -> x*y
>
>    (3)  y x
>                 Type:
> UnivariatePolynomial(x,UnivariatePolynomial(y,Integer))
> (4) -> (x*y)::MPOLY([x,y],INT)
>
>    (4)  y x
>                                   Type:
> MultivariatePolynomial([x,y],Integer)
>
> Regards,
> Bill Page

I think the problem here is that it _assumes_ that x and y commute,  
which is not the only option.

I am still looking for a convincing reason that

     sage: (1/2) * Matrix(ZZ, 2, 2, [1,2,3,4])

should not give

     [1/2   1]
     [3/2   2]

in MatrixSpace(QQ, 2, 2). Maybe it's just the cleanliness/ 
implementation of the coercion rules.

Robert

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to