On Dec 5, 1:58 pm, eggartmumie <eggartmu...@googlemail.com> wrote:
> Hi,
> I am a newbie working in polynomial quotient rings:
> I want to implement the Patterson algorithm to decode Goppa Codes.
> Therefore, I need to split a polynomial p in a quotient ring in its
> even part p0 and its odd part p1
> such that p(z) = p0^2(z)+z*p1^2(z). I run into several problems to do
> so in SAGE:
> I define

I guess you mean p0(z^2)+zp1(z^2), you can use list filters

{{{
sage: K.<x>=QQ[x]
sage: p = 3+4*x^4+5*x^3+6*x^7+8*x^9+10*x^12
sage: p0 = K(p.list()[::2])
sage: p1 = K(p.list()[1::2])
sage: p0
10*x^6 + 4*x^2 + 3
sage: p1
8*x^4 + 6*x^3 + 5*x
sage: p0(x^2)+x*p1(x^2)-p
0
}}}

Read about list slicing

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

Reply via email to