I am implementing the group of units mod n (the multiplicative group of invertible elements of the ring Z_n). Mostly I am interested in a non-trivial example of an infinite family of finite groups for students to work with, which can then also be used as an example of a direct product in accord with the classification of finite abelian groups. Simple properties - order (group, elements), cyclic/non- cyclic, generators, subgroups - are of the most interest. Doing so prompts the following observations and questions:
AdditiveAbelianGroup This is a new addition to Sage, built on top of free modules over ZZ (which is itself around a year old). Basically elements are represented as vectors of integers in a quotient of modules. I have an implementation of the group-of-units built on top of this, using the vectors as exponents on generators. But of course the base class is additive and my group is multiplicative, requiring adjustments such as redefining multiplication in the group of units in terms of addition in the additive group. There are comments in the code suggesting subgroups could be coming. AbelianGroup This older class is really about multiplicative abelian groups. It internally represents elements as vectors of exponents (as above), but prints elements as strings like f1^2*f2^3 in accordance with GAP notation for groups described by generators. There seems to be some dependence on GAP. There is a command to get *all* subgroups (which would be very nice to use with beginning students). I think I could have built my group of units on top of this class by redefiing some of the representations and making the parent/element relationship general enough to support derived classes. This class already has the redefinitions of multiplicative operations (mul, pow, div) in terms of additive operations. Curiously, the new AdditiveAbelianGroup classes derive (secondarily) from AbelianGroup, though I don't see just how this manifests itself. CommutativeAdditiveGroups This is part of the category framework. I don't see CommutativeMultiplicativeGroups yet. My group-of-units shows an "addition_table" available in tab-completion (additive as you might expect), but an attempt to call it results in an error that it is not available. Again, for students, it would be nice to have the "multiplication_table" routine of the category code automatically available for the group-of-units. Questions: 1. Will there be a MultiplicativeAbelianGroup class? Should there be? Should it derive from AdditiveAbelianGroup? Or should it exist in parallel (so as to not confuse additive and multiplicative operations)? 2. How should all this plug-in to the categories framework? Is this a simple matter? Short-term: I'm not sure where to direct my energies for my group-of- units. Long-term: After a few days of head-scratching, and some previous experience adding to the categories code, I have learned enough that I can probably contribute to this corner of the code. Comments, explanations, speculations, opinions, advice welcome. Rob -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
