Hi, On Monday 21 May 2012, Oleksandr Kazymyrov wrote: > Dear all, > > 1. Why important next functions? > k.a_times_b_minus_c > k.a_times_b_plus_c > k.c_minus_a_times_b
These shouldn't exist I'd say. The reason they do exist is that when I wrapped Givaro it provided these functions so I figured I might as well provide them. So what we should do is deprecate these functions and replace them by functions starting with "_" indicating, that they are kinda internal. Can you open a ticket? > 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? > Why this function are defined as public? > 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? > - sage: *k.cayley_graph() * > > -------------------------------------------------------------------------- > - AttributeError Traceback (most recent call > last) > > /home/hamsin/<ipython console> in <module>() > > > /home/hamsin/bin/sage/local/lib/python2.7/site-packages/sage/categories/se > migroups.pyc in cayley_graph(self, side, simple, elements, generators, > connecting_set) 284 generators = connecting_set > 285 if generators is None: > --> 286 generators = self.semigroup_generators() > 287 if isinstance(generators, (list, tuple)): > 288 generators = dict((self(g), self(g)) for g in > generators) > > > /home/hamsin/bin/sage/local/lib/python2.7/site-packages/sage/structure/par > ent.so in sage.structure.parent.Parent.__getattr__ > (sage/structure/parent.c:6805)() > > > /home/hamsin/bin/sage/local/lib/python2.7/site-packages/sage/structure/par > ent.so in sage.structure.parent.getattr_from_other_class > (sage/structure/parent.c:3248)() > > AttributeError: 'FiniteField_givaro_with_category' object has no > attribute 'semigroup_generators' This is a bug, i.e., K inherits the generic cayley_graph() but does not provide all the machinery needed to make it work. > - sage: *k.has_base()* > *True* > sage: *k.has_base* ? > Type: builtin_function_or_method > Base Class: <type 'builtin_function_or_method'> > String Form: <built-in method has_base of > FiniteField_givaro_with_category object at 0xbb0eaac> > Namespace: Interactive > Definition: k.has_base(self, category=None) > *??????* The base of GF(p^k) is GF(p), the lack of documentation is a bug :) > * > - sage: *k.ngens* *?* > Type: builtin_function_or_method > Base Class: <type 'builtin_function_or_method'> > String Form: <built-in method ngens of FiniteField_givaro_with_category > object at 0xbb0eaac> > Namespace: Interactive > Definition: k.ngens(self) > Docstring: > The number of generators of the finite field. * Always 1.* This is a generic function provided for compatibility with other parents in Sage. > * > * > - sage: *k.normalize_names ?* > Type: builtin_function_or_method > Base Class: <type 'builtin_function_or_method'> > String Form: <built-in method normalize_names of > FiniteField_givaro_with_category object at 0xbb0eaac> > Namespace: Interactive > Definition: k.normalize_names(self, ngens, names=None) > > sage: k.normalize_names() This is a generic method that perhaps could be private, i.e., "_normalize_names()" or moved somewhere else? > - sage: *k.on* > k.one k.one_element > sage: k.one ? > Type: builtin_function_or_method > Base Class: <type 'builtin_function_or_method'> > String Form: <built-in method one_element of > FiniteField_givaro_with_category object at 0xbb0eaac> > Namespace: Interactive > Definition: k.one(self) > Docstring: > Return the one element of this ring (cached), if it exists. > > EXAMPLES: > > sage: ZZ.*one_element()* > 1 > sage: QQ.*one_element()* > 1 > sage: QQ['x'].*one_element()* > 1 > > The result is cached: > > sage: ZZ.*one_element() *is *ZZ.one_element()* > True > > > > - sage: *k.zero ? * > Type: builtin_function_or_method > Base Class: <type 'builtin_function_or_method'> > String Form: <built-in method zero_element of > FiniteField_givaro_with_category object at 0xbb0eaac> > Namespace: Interactive > Definition: k.zero(self) > Docstring: > Return the zero element of this ring (cached). > > EXAMPLES: > > sage: *ZZ.zero_element()* > 0 > sage: *QQ.zero_element()* > 0 > sage: QQ['x'].*zero_element()* > 0 > > The result is cached: > > sage: ZZ.*zero_element()* is ZZ.*zero_element()* > True These are aliases, I don't find this confusing. Anyway, do you want to provide (documentation) patches for the issues you discovered? Cheers, Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF _www: http://martinralbrecht.wordpress.com/ _jab: martinralbre...@jabber.ccc.de -- 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