-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Cayley tables, add operation tables #7555
Comments
Attachment: trac_7555_cayley_table.txt Experimental Cayley table class, cut/paste into a notebook cell |
comment:2
Patch contains a new class, This is meant for educational applications, and is unlikely to be used for anything much bigger than can be displayed on a screen or a sheet of paper. So the speed (it is a bit slow) is not a concern. Since it only requires a binary operation, I created the groupoids directory, based on the existence of a category by the same name. Next thing will be an application of this class to generic groups, fixing #7340. There are stubs left here for methods to create color and grayscale graphics of the tables. |
comment:3
It seems a better place to place this is within the categories framework, making it available automatically in a large number of situations. So it is being reworked right now. The main routine won't change much at all, so time spent reviewing largely won't need to be redone. But you'll want to wait on testing. I'll have an updated patch soon. |
Attachment: trac_7555_operation_table.patch.gz |
comment:4
I've tied the new The old Cayley table was used to build Latin squares. I believe the behavior now with the new cayley table will be identical - IF the identity is the first element of the group. Had a hard time constructing a nontrivial finite additive semigroup, so the documentation there is barebones right now. As more structures become available in the categories this should be all ready to go, unchanged. Right now it already makes the multiplication table available for all groups, rather than just permutation groups. |
comment:5
Hi Rob! Very nice patch! I'll sure use it soon :-) Replying to @rbeezer:
That's the way to go! Out of curiosity: what are the specific features of groups that could
Isn't that more "if the elements are listed in the same order"?
In waiting for something better, you may want to include a test with a
By the way:
Is better constructed as::
And actually should eventually become:
And for semigroups, which I am very interested in :-) Actually, it I browsed quickly through the patch. Here are some suggestions for
Note: in many other places, we will need a class for matrices with row
Is ascii_table really needed? I would tend to just implement By the way: several other Sage objects (like matrices, partitions, Please add (and use?) a The last issue is the name of the methods. When we discussed this at [1] http://trac.sagemath.org/sage_trac/wiki/CategoriesRoadMap Cheers, |
comment:7
Replying to @nthiery: Dear Nicolas, I knew you'd have some comments! Thanks for all the helpful advice and suggestions, on categories, and in general.
Yes, it certainly is. ;-)
Grab a normal subgroup, as close to size sqrt(n) as you can get (perhaps automatically), then order elements in bunches as cosets. You can sometimes see the quotient structure in the table, especially if done graphically. But maybe this belongs higher up the hierarchy?
That would of course be sufficient. The code is a bit cryptic, but it appeared to me that if the identity was first, then the elements were numbered in the order they were listed. But I didn't study it that carefully, since I was going to pull it out anyway. Hopefully the change doesn't cause anybody any trouble.
I tried this repeatedly. You get
when you try to execute it. Similarly for
Will do.
Yes, I wanted this category. Will there be two - additive and multiplicative? Also called "groupoids" if we want avoid confusion with the CAS. Doing
Guessing was a "feature" before I found categories. It'll go away.
Didn't check, but thought I'd have to add lots more logic to handle this case. Maybe not.
How about "headings"?
The returned dictionary pairs elements with their names. Names can be any string, not just integers, so this doesn't feel like a ranking or an enumerated set to me. It's more of a translation table. So maybe there is a better name. "translation"? But I think rank would be confusing.
OK
Yes, I did much the same thing once already for Sudoku puzzles.
Not sure how you mean this to work? If T is a table, then T[i]=, or T[i,j]=?? More precisely,.....
I really had students in mind as I built this, though everybody might find it useful. "product" is OK, "summation" sounds like more than two terms. In any event, what about having both (ie product and multiplication, summation and addition)? I know people don't like this, and it clutters up tab-completion. Permutation groups had Thanks again for the interest and help! Rob |
comment:8
Hi! Replying to @rbeezer:
:-)
Ok. Or maybe it can be just a helper function for how to list the
See #8562, which you are very welcome to review :-) IntegerModRing's
With groupds, there is a possible confusion with the other use of Thanks to the s, there is no naming clash between Magmas and Magma, so
Great.
Ok; let me know how it goes.
Thinking twice about it, I vote for m.column_keys() / m.row_keys() for
Ah, ok, sorry; I thought it would map an element to its position in
names_of_elements? or just names? labels? element_labels?
Another coming soon usage will be character tables.
They multiplication table looks very much like a matrix, so one would
Yeah, hard point. multiplication / addition is consistent with By the way: congrats on being essentially the first non Sage-Combinat Cheers, |
comment:9
Hi Nicolas, Been working most of the day straightening this up. Allowing more general operations is a big improvement. See example of table of commutators of a finite group once I get a patch up. ;-)
I'll include a note in the source to this effect.
Aah - that answers lots of questions. Thanks. "categorified"?? Your English is excellent, but that is pretty bad. ;-) ;-) ;-) (But it was I might have said too).
Got it.
Not too bad. Empty latex table is nice, empty ascii table is so-so, but not worth anymore effort.
I did index_set. ;-(
Used translation. :-(
OK, that should be easy.
Nice. I like it. I'm a fan. And your ring patch will help me recognize when/how categorification happens. I'm running out of time on this, it's semester break this week, so I'll throw something up soon. Rob |
Illustrates doctest failure |
comment:10
Attachment: trac_7555_doctest_failure.patch.gz Ignore that doctest failure patch - I found the problem. |
comment:11
Attachment: trac_7555_operation_table-categories.patch.gz Patch is complete enough to review.
row_keys/column_keys are the latest name for elements in headings-order. Left
But I'd like this to move forward independently, since my time will be limited for a few weeks. |
comment:12
Hi Rob! Replying to @rbeezer:
Thanks for you work on this. This sounds very good, so will set up a Three minor thing I am hesitating about:
I'll probably post a small reviewer patch with once I can double check Cheers, |
comment:13
Replying to @rbeezer:
Thanks!
Cool :-)
:-)
Cool. Florent will appreciate not to have to handle yet another empty object :-) |
comment:14
Replying to @nthiery:
I only see two, not that I'm looking for trouble.
Coercion here could go away - I've perhaps gone overboard with coercion, envisioning students typing in strings that are not really elements, such as permutations. So I want to keep coercion in
This struck me as a good idea at first, but again, I'd like a chance to coerce the contents of
Sure, you can clean-up Thanks for all your help with this. Rob PS I'm glad I can make Florent's life that much easier. ;-) |
Changed work issues from fix 3 doctests to none |
comment:23
Attachment: trac_7555_operation_table-categories.2.patch.gz Done. Diff to previous version on: http://combinat.sagemath.org/hgwebdir.cgi/patches/diff/233de3ecbcb7/trac_7555_operation_table-categories.patch |
comment:24
This is fantastic. Here are some more very minor things:
And an enhancement:
|
comment:25
(I should add that the enhancement above is not the "needs work" request. Also, I mainly read the documentation, but didn't look at the code too much, so my points above are not a review of the code.) |
comment:26
Replying to @jasongrout:
Jason, Thanks for catching a few details, and for the suggestion. This is getting mixed up with a bunch of other patches, so I'd like to finalize it. I have to come back and improve the documentation for the addition table (once integer mod rings are straightened away), so I'll look into slicing then. Thanks again, |
Attachment: trac_7555_minor-fixups.patch.gz |
comment:27
Hi Nicolas, Your changes all look good - thanks for those. Feel free to add yourself to the author field - it'd be good to "share" a patch with you. So this is a positive review on those. With latest "fixup" patch, passes all tests in Sage library, docs build without warnings and look OK. Now the ball is in your court. A handful of little things, in a separate patch so they are easy to isolate.
So I believe you could check these and we'd be done? Rob |
comment:28
Replying to @rbeezer:
Thanks for the offer! It'd be a pleasure indeed. Now, you really wrote the bulk of the code. I just did my reviewer's job: all in all, my main code contribution is the writing of the Magmas category, which is not much and for which I'll get credit separately. It was a pleasure working as a team on this patch, and I am looking forward writing another patch together :-)
Your fixups look good! I just changed the copyright header as per the I reran the tests on the file itself, and on the category code, which I |
Attachment: trac_7555_minor-fixups-nt.patch.gz |
Attachment: trac_7555_operation_table-categories-all-in-one.patch.gz Apply only this one |
comment:29
Jason: feel free to add yourself as a reviewer |
comment:30
OK, all done. This has a (cumulative) positive review. Thanks, Jason, for the contributions, and thanks, Nicolas, for stepping in with all the prompt help with categories and useful fixes and enhancements. When #8562 is done the addition table docstring can be expanded - doing this is #8596. To do: Add slicing as Jason suggests, make graphical output (#8598). Release manager: This needs #7880 first, then #8579. Apply just the "all-in-one" patch. Once merged, #7340 (the root motivator) can be marked fixed. |
Changed reviewer from Nicolas M. Thiéry to Nicolas M. Thiéry, Jason Grout |
Changed author from Rob Beezer to Rob Beezer, Nicolas M. Thiéry |
comment:31
Merged "trac_7555_operation_table-categories-all-in-one.patch" in 4.4.alpha0 |
Merged: sage-4.4.alpha0 |
Cayley tables for permutation groups are broken, see #7340.
For other finite algebraic structures, it would be useful for educational purposes to have tables for whatever operation(s) may be present.
Text file included here provides a class that creates a Cayley table object, it can be generalized to provide a similar table for any object with an addition or multiplication - general groups and rings would be the first places to use it.
Depends on #8579.
CC: @jasongrout @dimpase @nthiery
Component: algebra
Keywords: cayley table, operation table
Author: Rob Beezer, Nicolas M. Thiéry
Reviewer: Nicolas M. Thiéry, Jason Grout
Merged: sage-4.4.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/7555
The text was updated successfully, but these errors were encountered: