On Monday, July 25, 2016 at 11:24:56 AM UTC+1, [email protected] wrote:
>
> Hello,
>
> I'm stalled try to calculate a division in a polynomial ring defined over 
> a field that is a finite field.
>
> sage: _.<z> = GF(2)[]
> sage: K.<z> = GF(2^8, modulus=z^8+z^4+z^3+z+1)
>

this looks fishy, to re-use z this way. See below.
 

> sage: R = PolynomialRing(K,'x')
> sage: l = x^4 + 1
> sage: c = (z+1)*x^3+x^2+x+(z)
> sage: l/c
> (x^4 + 1)/((z + 1)*x^3 + x^2 + x + z)
>
> But I like to find the quotient and the reminder of this division. How 
> should I write it?
>

sage: _.<z0>=GF(2)[]
sage: K.<z> = GF(2^8, modulus=z0^8+z0^4+z0^3+z0+1)
sage: R.<x>=K[]
sage: l = x^4 + 1
sage: c = (z+1)*x^3+x^2+x+(z)
sage: l.quo_rem(c)
((z^7 + z^6 + z^5 + z^4 + z^2 + z)*x + z^6 + z^4 + z,
 (z^7 + z^5 + z^2)*x^2 + (z^7 + z^5 + z^2 + 1)*x + z^7 + z^5 + z^2 + 1)
sage: qo,re=l.quo_rem(c)
sage: qo*c+re
x^4 + 1


So qo and re are what you are looking for.


> I've tried in all the ways I've thought and searched for similar 
> questions, but looks like using a finite field to define the ring may need 
> something specific.
>
> Thanks
>
> /Sergi.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to