On May 24, 9:37 pm, luisfe <lftab...@yahoo.es> wrote:
> I am not sure if this is a bug or an unexpected bud valid behavior,
> since we are dealing with conversions instead of coercions.
>
> {{{
> sage: K1=PolynomialRing(QQ, 't',10, order=TermOrder('degrevlex', 4) +
> TermOrder('degrevlex', 6) )
> sage: K2=PolynomialRing(ZZ, 't',10)
> sage: [K2(f) for f in K1.gens()]
> [t6, t7, t8, t9, t2, t2, t0*t2, t1*t2, t2, t2]
>
> }}}
>
> If K2 has the same termorder as K1 I get the expected result.
>
> {{{
> sage: K2=PolynomialRing(ZZ, 't',10, order=TermOrder('degrevlex',
> 4)+TermOrder('degrevlex',6))
> sage: [K2(f) for f in K1.gens()]
> [t0, t1, t2, t3, t4, t5, t6, t7, t8, t9]
>
> }}}

After some tryings, it seems to me that non-standard term orders are
broken in the coercion model

{{{
sage: K1=PolynomialRing(QQ, ('x,y'))
sage: x,y=K1.gens()
sage: (x-y)*vector([1,2,3])
(x - y, 2*x - 2*y, 3*x - 3*y)
sage: K1=PolynomialRing(QQ, ('x,y'),order='deglex')
sage: x,y=K1.gens()
sage: (x-y)*vector([1,2,3])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/home/luisfe/trabajo/algoritmos/sage/reparametrization/<ipython
console> in <module>()

/opt/SAGE/sage-devel/local/lib/python2.6/site-packages/sage/structure/
element.so in sage.structure.element.RingElement.__mul__ (sage/
structure/element.c:11449)()

/opt/SAGE/sage-devel/local/lib/python2.6/site-packages/sage/structure/
coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6996)()

TypeError: unsupported operand parent(s) for '*': 'Multivariate
Polynomial Ring in x, y over Rational Field' and 'Ambient free module
of rank 3 over the principal ideal domain Integer Ring'
}}}

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to