I'm forwarding this entry from trac#3999 to sage-devel so it gets a
wider readership.

I certainly agree that the "main" abelian groups implementation in
Sage should be based on (additive) Z-modules.  Then this wrapper idea
would be the way to go to implement multiplcative notation.  But
that's premature right now, since no-one has yet done the "great
 abelian groups rewrite".

The existing abelian groups code has an underlying additive structure
(at heart every element is a vector of integers, the group op is
componentwise addition with reduction mod n if the associated
generators has order n), but the element class is derived from
MultiplicativeGroupElement, and it is that which makes trying to use
additive notation a pain.

I might spend a little more time doing the additive interface to the
current AbelianGroup class, but not a lot since it's only a stop-gap
until we have an all-new AbelianGroups class, which would take more
time than I have right now.

John


---------- Forwarded message ----------
From: SAGE <[EMAIL PROTECTED]>
Date: 2008/9/3
Subject: Re: [SAGE] #3999: [with patch, needs review] Wrapper class to
treat additive groups as multiplicative goups
To:
Cc: [EMAIL PROTECTED]


#3999: [with patch, needs review] Wrapper class to treat additive groups as
multiplicative goups
------------------------------+---------------------------------------------
 Reporter:  robertwb          |        Owner:  somebody
    Type:  defect            |       Status:  new
 Priority:  major             |    Milestone:  sage-3.1.2
Component:  basic arithmetic  |   Resolution:
 Keywords:                    |
------------------------------+---------------------------------------------
Comment (by robertwb):

 > I am trying hard to see how this might actually be useful in practice.

 The first thing that comes to mind is the generic discrete log code that
 you wrote a while back. One then wouldn't have to use the cumbersome (and
 slower) op(x,y) notation for the group operations to be able to handle
 both additive (via the wrapper) and multiplicative groups.

 I had assumed the implementation of abelian groups was, at its core,
 additive using Z-modules and all (this seems more natural to me, as well
 as much more efficient). I'm not sure if this is part of the "great
 abelian groups rewrite" or not, but IMHO I think it should be. I also
 wrote the patch this direction because (in Sage) additive groups are all
 abelien (they inherit from modules), and there is a functor from them to
 generic non-abelien groups but not the other way around. It could also be
 handy in trying to (formally) implement Z[G] where G is initially
 presented as an additive group.

 Trying to add additive notation to these would be difficult, as they do
 not inherit from ModuleElement. Were you trying to make it so if I took
 elements of a multiplicative group (say, a permutation group) and did
 {{{a+b}}} it would instead do {{{a*b}}}. I would probably rather have it
 throw an error in this case.

 I could pretty easily write a patch going the other way if you would find
 it useful (though strange stuff might happen if one tries to use it on
 non-abelien groups, depending on the assumptions people make throughout
 the rest of the Sage library).

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/3999#comment:3>
SAGE <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to