Hi,
I agree with Martin, especially about private methods.
> sage: k.some_elements ?
> > ...
> > Returns a collection of elements of this finite field *for use
> > in unit testing.*
> The function is indeed used in unitests as confirmed by
> search_src("some_elements"). Perhaps it should start with an underscore?
In my opinion it must start with an underscore. The method
k.random_element() return a random element and it is enough for users.
>> 2. Also a few misunderstanding functions
> >>
> >> - sage: *k.cardinality* ?
> >> Type: builtin_function_or_method
> >> Base Class: <type 'builtin_function_or_method'>
> >> String Form: <built-in method cardinality of
> >> FiniteField_givaro_with_category object at 0xbb0eaac>
> >> Namespace: Interactive
> >> Definition: k.cardinality(self)
> >> Docstring:
> >> Return the order of this finite field (*same as
> self.order()*).
> >
> > Why is this confusing?
> I can't understand the confusion either. Some people say "order" and
> some people say "cardinality" when they refer to the number of elements
> of a group or field. Personally, I'd tend to say "cardinality" in the
> case of a set (but a field *is* as set!), and "order" in the case of a
> field or group. But why shouldn't one offer both, if both is used by
> people?
In most of books "Finite Fields" you can find definition "order" (imho).
But if some use it, then it's no problem.
In general I can't understand why it is important to have two (or more)
functions with the same functionality in user space. If some of them are
used for compatibility, then maybe they should be private?
>> - sage: *k.ngens* *?*
> >> Docstring:
> >> The number of generators of the finite field. * Always 1.*
> >
> > This is a generic function provided for compatibility with other parents
> in
> > Sage.
> At that point one should mention "duck typing", I guess. Sometimes one
> writes generic code, that is supposed to work with various kinds of
> objects, and the type of these objects does not (and should not) matter.
> In some cases, all what one wants to know is whether the object
> is defined in terms of generators (e.g., a polynomial ring is, but a set
> is not), and how many generators there are. ngens() answers both
> questions.
Ok, but the finite field has a set of generators. I'm a bit confused.
sage: R.<x>=ZZ[]
sage: K=GF(2^8,name='a',modulus=x^8+x^4+x^3+x+1)
sage: m=[i.multiplicative_order() for i in K if i != 0]
sage: m.count(255)
128
Anyway, do you want to provide (documentation) patches for the issues you
> discovered?
My English is not so good for documentation, but I can provide some code
(logic and programming) patches after my registration at trac.sagemath.org.
--
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