Dear Simon, let me thank You for Your time and patience

On 29 Jul., 14:20, Simon King <[email protected]> wrote:
> Hi Thomas! (sorry, previously I made a wrong guess on your name)
>
> On Jul 29, 10:02 am, eggartmumie <[email protected]> wrote:
>
> > ...
> > Later I need the coefficients of the Goppa polynomial as linear
> > combination of monomials.
>
> I don't understand what that means. Please provide explicit examples!

a Goppa polynomial is any polynomial over a finite field F, in
practice over GF(2^m), in some indeterminant. In order to define a
Goppa polynomial I wanted to write something like

def goppapolynomial(F,z):
    # returns a polynomial over F in indeterminant z
    X = PolynomialRing(F,repr(z)).gen();
    return (X^3+F(1))*X

expecting it the function would return a polynomial over F in
indeterminant z.
I thought the indeterminant essential, because the elements of F, e.g.
in case F = GF(2^2), are given as polynomials in another
indeterminant.

Then, in the following I need the coefficients of the Goppa
polynomial, in my contrived example above
I expect to get an coefficient array c=[0,1,0,0,1] of elements in F
with
y=var('y'); goppapolynomial(F,y) == c[0]*y^0+c[1]*y^1+c[2]*y^2+....

> Currently I can only jump from assumption to vague interpretation to
> guess; that makes it very difficult to provide any help.
> Thus, I think I should ask you more precise questions as well.
>
> So far, I thought we are talking about a univariate polynomial,
> something like
>   sage: R.<x> = QQ[]
>   sage: p = R.random_element()
>   sage: p
>   -x^2 + 4/9*x - 2
>
> Question 1:
> Is that your setting, or what exactly is the ring you are working
> with?

yes, only I need coefficients in finite fields, like e.g.
Phi.<x>=GF(2^4)

> Concerning coefficients:
>   sage: p.coefficients()
>   [-2, 4/9, -1]
>
> A "coefficient" is an element of the base ring (QQ, in my example).
> I know two conventions for monomials:
> 1) Some people say that a monomial is a power product of variables,
> like x^3.
> 2) Other people say that a monomial is the product of a coefficient
> with some power product of variables, like 4/9*x (the first sort of
> people would call this a "term") :/

I use coefficient to mean Your factor 4/9.

> In either case, I really don't see what it could mean to express "the
> coefficients as linear combinations of monomials". The best I can come
> up with are some associations.

sorry, I meant coefficients in the linear combination of monomials,
and not coefficients with a Newton base or a Lagrange base.

> First association:
> Get the part of the polynomial that is divisible by a certain monomial
>  sage: p>>1
>  -x + 4/9

sorry, in reading reference.pdf I never came across this operation,
I just did not know that You can shift a polynomial! Just to explain a
newbies situation,
I searched reference.pdf for >>, got 27 hits, would have looked at the
first which looks at least something like dealing with polynomials and
landed in a section about 'p-Adic ZZ_pX CR Element' (quote 'This file
implements elements of Eisenstein and unramified extensions of Zp and
Qp with capped relative precision.'). To be honest, I would not have
looked further, and all this assuming I'd known that SAGE (or Python
or ?) overloads the shift operator.

> Meaning: p == x*(-x+4/9)+remaining terms not divisible by x.
>
> Second association:
> Start with a multivariate polynomial
>  sage: R.<x,y,z> = GF(3)[]
>  sage: p = R.random_element(6)
>  sage: p
>  -x*y^5 + x^4*y*z + x^2*z^2 - y^2*z
>  sage: p.coefficient(z)
>  x^4*y - y^2
> So, here we have a coefficient that, itself, is a linear combination
> of monomials.

Goppa polynomials are univariate polynomials even though the
coefficients may introduce other indeterminants as shown above.

> Third association:
> A polynomial ring over a polynomial ring
>  sage: R.<x> = ZZ['t'][]
>  sage: R
>  Univariate Polynomial Ring in x over Univariate Polynomial Ring in t
> over Integer Ring
>  sage: p = R.random_element()
>  sage: p
>  (-3*t^2 - t - 1)*x^2 + (t^2 - t + 1)*x - 3*t - 2
>  sage: p.coeffs()
>  [-3*t - 2, t^2 - t + 1, -3*t^2 - t - 1]
> So, again, each coefficient is a polynomial (but in a different ring).

This is exactly what I intended to get by calling the function (!)
goppapolynomial with parameters ZZ['t'] and var('x'), expecting it to
return the polynomial
(-3*t^2 - t - 1)*x^2 + (t^2 - t + 1)*x - 3*t - 2
over ZZ['t'] in indeterminant x. I was confused by the different
result I get on f = goppapolynomial(F,z) when printing
type(f)
or
f.parent()

Even though I use tab completion quite a lot I did not find the
methods coefficient and coeffs because I only tried the tab completion
on the rings and not on their elements, the polynomials.

> Question 2:
> Is any of my associations close to what you mean? Otherwise, please
> provide an example.

see above

> > In order to be able to once define the Goppa polynomial in a function
> > I tried to compute the coefficients from the given function goppapolynomial.
>
> Question 3:
> What exactly is the "function" goppapolynomial supposed to do / to
> be?
> Is it a function that returns a polynomial? Or is it a polynomial
> function, itself?
> Please specify input and output. Is it really just returning X^(N-K)
> (what are N and K, anyway?)?

some global integer parameters

> Cheers,
> Simon

I did not want to bother everybody but saw no alternative.
Although I now know how to get the coefficients I'd still like to know
whether I can coerce some
polynomial to an symbolic expression so I can do differentiation or
integration an it and coerce
the result back to a polynomial in the original polynomial ring. Again
thank You for Your helpfulness, Th

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

Reply via email to