Group of units in Z_n

306 views
Skip to first unread message

Rob Beezer

unread,
Sep 18, 2009, 11:14:57 PM9/18/09
to sage-devel
Sage-Devel,

I've got it in my head to implement the group of invertible elements
in Z_n as a useful tool for teaching introductory group theory. There
is of course, a very simple and straight-forward classification of
these abelian groups. But for someone new to the topic, they display
quite a bit of variety - sometimes, cyclic, sometimes not, a variety
of orders for the elements, and a variety of subgroups. I'd say they
might even look unpredictable to a novice.

In IntegerModRing there are a few relevant methods whose name begins
with "unit" and a few that begin with "multiplicative." These are
useful for students, and "unit_gens" will be useful for my purposes.
My intent would be to implement the group so that all a student ever
saw was the actual integers mod n. Under the hood, the classification
and generators might provide an efficient implementation. For
example, rather than having "multiplicative_subgroups" return each
subgroup as a list of generators, it might be possible to actually
build the subgroups so they can be queried about order, cyclic-ness,
etc. So I'd try to make the group implementation general enough to
also represent the subgroups.

So this won't necessarily make Sage any more powerful, but it might be
a great teaching tool for basic concepts of group theory, at least up
until the classification of finite abelian groups.

Has this group been implemented somewhere and I missed it? Is there
some other powerful machinery for rings that might make this easier to
implement? Any code elsewhere for a similar structure or purpose that
I might look to for help in designing this? Any general advice or
suggestions? Thanks!

Rob

fwc

unread,
Sep 19, 2009, 5:12:16 AM9/19/09
to sage-devel


On Sep 19, 4:14 am, Rob Beezer <goo...@beezer.cotse.net> wrote:

> Has this group been implemented somewhere and I missed it?  Is there
> some other powerful machinery for rings that might make this easier to
> implement?  Any code elsewhere for a similar structure or purpose that
> I might look to for help in designing this?  

I have a draft of an implementation of the group of units for a finite
field, which overlaps, of course, with the group in question. I
modelled it on John Cremona's unit group code for number fields (sage/
rings/number_field/unit_group.py).

Unfortunately I don't have my draft on this machine, but I'll post a
patch after the weekend. It would certainly be a good idea to make
all these cases as compatible as possible.

Francis

Rob Beezer

unread,
Sep 19, 2009, 10:57:15 PM9/19/09
to sage-devel
Francis,

On Sep 19, 2:12 am, fwc <F.Cla...@Swansea.ac.uk> wrote:
> I have a draft of an implementation of the group of units for a finite
> field, which overlaps, of course, with the group in question.  I
> modelled it on John Cremona's unit group code for number fields (sage/
> rings/number_field/unit_group.py).

Thanks for the pointer to Cremona's work, and I'll take a close look
at your patch. If you put it on Trac, can you cc me (rbeezer)?

Rob

kcrisman

unread,
Sep 21, 2009, 9:17:14 AM9/21/09
to sage-devel
Rob,

Please do this! I am always having to do some hack in my number
theory class for this, and it is very annoying (as you have
discovered) not to have this. It is somewhere very far down my to-do
list for Sage. Actually, I'm surprised there isn't some hidden
structure where it lurks, as you suggest in your last paragraph.
Thanks!

- kcrisman

Rob Beezer

unread,
Sep 21, 2009, 11:50:35 AM9/21/09
to sage-devel
Hi Karl-Dieter,

Well, I guess I *am* doing this as I put together something very quick
and sloppy last night, which has helped formulate my ideas for a
better version (this approach was due to some good advice from
William). Let me know if you need something messy and incomplete, but
serviceable, right away. ;-) Good chance I might call on you for
some number-theoretic advice along the way.

Rob

kcrisman

unread,
Sep 21, 2009, 11:59:18 AM9/21/09
to sage-devel


On Sep 21, 11:50 am, Rob Beezer <goo...@beezer.cotse.net> wrote:
> Hi Karl-Dieter,
>
> Well, I guess I *am* doing this as I put together something very quick
> and sloppy last night, which has helped formulate my ideas for a
> better version (this approach was due to some good advice from
> William).  Let me know if you need something messy and incomplete, but
> serviceable, right away.  ;-)  Good chance I might call on you for
> some number-theoretic advice along the way.

Nope, not teaching it (or anything at all, in fact) this semester;
next up spring 2011. But I think this will help a lot of other
people, since Sage is so natural for NT and plus William's book is
already out there...

- kcrisman

Peter Bruin

unread,
Nov 11, 2014, 7:22:49 PM11/11/14
to sage-...@googlegroups.com, goo...@beezer.cotse.net
Hello,

After more than 5 years, there is now a ticket implementing a unit_group() method for IntegerModRing: http://trac.sagemath.org/ticket/17317 (needs review).

Peter


Op zaterdag 19 september 2009 05:14:57 UTC+2 schreef Rob Beezer:
Reply all
Reply to author
Forward
0 new messages