On 9 Mar, 18:05, YannLC <yannlaiglecha...@gmail.com> wrote:
> On Mar 9, 6:38 pm, Nick Alexander <ncalexan...@gmail.com> wrote:
>
> > On 9-Mar-09, at 8:48 AM, Noel wrote:
>
> > > Hello Y'all,
>
> > > What's the best way of listing all polynomials of a given degree with
> > > coefficients in a finite field?
>
> > If you want a one liner, you could use
>
> > sage: [ GF(3)['x'](list(t)) for t in  (GF(3)^2) ]
> > [0, 1, 2, x, x + 1, x + 2, 2*x, 2*x + 1, 2*x + 2]
>
> > Nick
>
> if you want another one liner, and an exact degree, you could use
>
> list(GF(3)['x'].polynomials(of_degree=2))

That is better since (without the list) it is an iterator;  also you
can put in max_degree= instead of of_degree= to get all polys up to a
given degree.  Someone else must have needed this and implemented it!

John

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

Reply via email to