Hi, > > So, if you want a general framework, I could imagine that the following > > could work. Provide Parent with a method, say, > > def to_generator_data(self,x) > > which by default raises a NotImplementedError. > > And then, there could be a method > > def from_generator_data(self, data, gens=None) > > that constructs an element out of the data returned by to_generator_data, > > but with an optional argument `gens` that defaults to the list of > > generators. > > > > The specification is: > > self.from_generator_data(self.to_generator_data(x))==x > > for all x in self. Such a method could be useful anyway, because it > > provides copying and pickling of elements. > > > > And if R, S are parents and the generators of R are > > mapped to a list gens_images, then > > S.from_generator_data(R.from_generator_data(x), gens_images) > > should return the image of an element x of R under a morphism from R to > > S given by gens_images. > > Yes, I that sounds like a reasonable proposal. However, there's still > the question as to which category you're considering the generators > over--we'd probably have to make that explicit. > > > Only problem: Someone needs to implement it. There could be general > > implementations on the category level, though.
Yes ! This is something which is at least planned and some Category are starting to support such features. There are at least S.semigroup_generators for a semi group (no inverse) S.group_generators for a group A.algebra_generators for an algebra All these methods should return a Family (G_i)_{i in I} which are some king of Lazy/Intelligent dictionaries. One solution which is not performance-wise optimal but mathematically sound is to have to_generator_data actually return an element of the free(Group/Algebra/Whatever) generated by the index-set I. Then building a generic morphism form the FreeWhatever to A is easy to implement in a generic way. The extra cost comes from building an actual Element of the FreeWhatever compared to the underlying data-structure. I've implemented something like that in Operads on Sage-Combinat queue. Cheers, Florent -- You received this message because you are subscribed to the Google Groups "sage-devel" group. 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. Visit this group at http://groups.google.com/group/sage-devel?hl=en.