Thoughts on this thread: For finite fields (or any other fields) the concept of additive generator makes no sense -- only finite prime fields have one and it is hardly a useful concept then since every nonzero element is one. It's different if talking about generators (plural!) which I think is what David Kohel meant, but here we are talking about what F.gen() should be.
By contrast F.multiplicative_gen() does make sense for all finite fields so should be provided, though not necessarily computed until requested for the reasons given by Martin. (It seems that with the current implementation of non-prime fiinite fields this comes for free, but that might change.) As for F.gen() it might be worth thinking more generally about what one means by "*the* generator" of a field. Again the concept only makes sense for some fields: those which are generated by a single element over their prime field (so: any number field, any finite field, or the function fields in one variable over QQ or GF(p)); or, more generally for fields constructed as relative extensions of other fields, we could include finite (algebraic) extensions of any field at all, and function fields in one variable over any field. Arguably, neither QQ nor GF(p) require any generators at all, but for consistency with general number fields and finite fields it would be reasonbly to have F.gen() return any nonzero element, and why not fix it as F(1). There should certainly be no expectation that F.gen() be a multiplicative generator, even if it often is -- so perhaps a warning in the documentation should tell users to use F.multiplicative_gen() if that's what they really need. As for order(), I would be happy for it not to be implemented at all for elements of a field! For additive order it is completely redundant since all nonzero elements have the same order depending only on the characteristic. For multiplicative order it is useful (for nonzero elements of course), but would it not be better, if you needed mutiplicative orders, to create the multiplicative group of the field as an abelian group and ask for the order of an element in that context? This links in with something I needed to be able to do: given an element a of GF(q) qith q a non-prime prime power, to return the degree of a, meaning the smallest n such that a is in GF(p^n). One could work this out from the (mutiplicative) order of a, which might be efficient if GF(q)'s multiplicative generator was already known together with the factorization of q-1. Or it's the degree of the minimal polynomial of a over GF(p). More generally, given a field F which is an extension of some base field k and an element a of F it would be nice to be able to construct the subfield k(a) of F together with a suitable embedding into F and an element in it which maps to a. But this is getting too far afield ;), so I'll shut up. John On 22/01/2008, Martin Albrecht <[EMAIL PROTECTED]> wrote: > > > In this case, the docstring needs to be corrected, because the statement > > that "All elements x of self are expressed as log_{self.gen()}(p) > > internally" is not true, right? (Extrapolating from this sentence and my > > two examples led me to make my previous statements.) Probably it is true > > that all elements are expressible as polynomials in x, and perhaps this > > is also the internal representation. > > Hi, > > It is not. For small extension fields of order < 2^16 the elements are > represented using Zech logs internally, so for these finite fields the > docstring "all elements x of self are expressed as log_{self.gen()}(p) > internally" is true. > > Martin > > > -- > name: Martin Albrecht > _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 > _www: http://www.informatik.uni-bremen.de/~malb > _jab: [EMAIL PROTECTED] > > > > > -- John Cremona --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---