> This still doesn't work the right way for finite extension fields:
>
> sage: k.<a> = GF(2^8)
> sage: P.<x,y> = k[]
> sage: P
> Multivariate Polynomial Ring in x, y over Finite Field in a of size 2^8
>
> sage: r = P._singular_()
> sage: coerce_ring_from_singular(r)
> Multivariate Polynomial Ring in x, y over Univariate Quotient Polynomial Ring
> in abar over Finite Field of size 2 with modulus a^8 + a^4 + a^3 + a^2 + 1
>
> >     R=PolynomialRing(fiel,vars)
> >     return R
>


Corrected:

def coerce_ring_from_singular(r):
    cha=str(r.charstr())
    vars=str(r.varstr()).rsplit(',')
    ch=cha.partition(',')[0]
    if ch=='real':
        fiel=RR
    elif ch=='0':
        fiel=QQ
    elif ch=='complex':
        fiel=ComplexField()
    else:
        fiel=GF(sage_eval(ch))
    if ',' in cha and ch!='complex' and ch!='real':
        generator=cha.partition(',')[2]
        fielx=PolynomialRing(fiel,generator)
        minpoly=r.ringlist()[1][4][1]
        minpoly=minpoly.sage_polystring()
        minpoly=sage_eval(minpoly,locals={generator:fielx.gen()})
        if ch=='0':
            fiel=NumberField(minpoly,generator)
        else:
 
fiel=GF(sage_eval(ch)^minpoly.degree(),generator,modulus=minpoly)
    R=PolynomialRing(fiel,vars)
    return R



now working in the ordering support.


Best.

Miguel Marco.
--~--~---------~--~----~------------~-------~--~----~
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to