-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Enumerate integer vectors modulo the action of a Permutation Group #6812
Comments
comment:3
I fixed some language mistakes. I already tell reviewers that there are probably still some typos, misunderstood or mistakes. I am sorry for that... It's hard! |
This comment has been minimized.
This comment has been minimized.
comment:5
Refactoring : There is no a shortcut in sage to IntegerVectorsUptoPermGroup which is a user friendly parent (with hope). |
Changed keywords from enumaration, integer, list, permutation, group to enumeration, integer, list, permutation, group |
comment:10
Hi! This is not a review yet, just some remarks. Indeed it seems to me that the comments and the documentation should be proof read by a native speaker. I am not a native speaker, I'm afraid. I also suggest to rename some methods. For example, the purpose of "generate_list_of_sum" is not clear from that name:
So, I think "partition_class_representatives" or slightly less precise "partition_classes" would be clearer. And "generate_canonicals": The return value is the list of canonical representatives of all children of the input. So, why not "children_representatives" or "canonical_children"? Best regards, Simon |
comment:11
Hi Simon, Thank for these advises, I start a new cleanup and will update a better version shortly! |
This comment has been minimized.
This comment has been minimized.
comment:12
The patch use now the generic code from Search Forest (breadth_first_search....). So this patch now depends on #8288 |
comment:81
With the patch that I almost finished (not posted yet), I get
Without the patch, I get
So, it is roughly 10% to 50% improvement (even though I am currently still converting the set to sorted lists). |
comment:82
Replying to @simon-king-jena:
Yes, this piece of code is horribly ugly... The point is that the orbit method will work with any integer vector. v doesn't need to be canonical. I don't have a use case but I was thinking it would be more convenient to allow the user to use this method for any integer vector (canonical or not). After for safety, I don't know the consequence of such a choice on the lung run. Anyway, the test is_canonical should be very very much faster than the full expansion of an orbit and a user who want just an orbit can also compute his own function. |
comment:83
Replying to @sagetrac-nborie:
Agreed. So, check=False should be fine. But I do think that the orbit method should try to convert the input vector from a different parent into self, and should certainly not return "None".
Of course. The algorithm for is_canonical looks almost the same as the full expansion of an orbit, but if it is in fact non-canonical then the function will return "False" before finishing the computation of the whole orbit. By the way, I made some further tweaks and am now down to
|
comment:84
Replying to @simon-king-jena:
Yes! None is not an option here. It must return a set or raise an error.
And more than that, there is a king of gardener lemma inside the is_canonical method, the partial_lex comparison cut some branches of the orbit just by reading the first entries. I also think the change from list to set produce more than x2 speedup, it is probably an exponential optimization, you should try before and after with graphs over 7 vertices :
It become to be a large test for this last one. (1044 symmetric matrices of size 7) A student of Florent Hivert had to master project to parallelize SearchForest. Imagine what such module can need by inheritance... (with possible adaptations according changes of SearchForest) |
comment:85
Without patch
With patch
So, yes, it scales well... |
Speed-ups and doc fixes |
comment:86
Attachment: trac_6812_reviewer.patch.gz My patch is posted. I hesitate to directly give it a positive review, since I somehow think that my patch is not just a reviewer patch (in spite of its name), because it changes the code non-trivially. So, please have a closer look on it! Apart from the code changes, I went through the doc strings and tried to fix some grammar. But I am not a native speaker - take my changes with a grain of salt... Apply trac_6812_integer_vectors_mod_permgroup.patch trac_6812_reviewer.patch] |
Changed author from Nicolas Borie to Nicolas Borie, Simon King |
This comment has been minimized.
This comment has been minimized.
comment:87
It seems the patch bot didn't get it. Apply trac_6812_integer_vectors_mod_permgroup.patch trac_6812_reviewer.patch |
Fixing a corner case, adding a doc test |
comment:88
Attachment: trac_6812_reviewer2.patch.gz I posted an additional reviewer patch. Namely, in my first patch, I forgot to add a doctest (shame on me), and consequently the code contained a bug: Integer vectores For the record: I give a positive review to Nicolas' patch. My first reviewer patch needs review, I believe. The second patch is trivial enough to be considered a "real" reviewer patch. Apply trac_6812_integer_vectors_mod_permgroup.patch trac_6812_reviewer.patch trac_6812_reviewer2.patch |
This comment has been minimized.
This comment has been minimized.
comment:89
I was just double checking everything... You really done a lot of work finally, really much as I expected. My first patch was not so much ready. As you posted another reviewer patch, once I will test everything, I will perhaps merge the 3 patches into a final one for the release manager. |
comment:90
Attachment: trac_6812_integer_vectors_mod_permgroup-final.patch.gz I am completely agree with all corrections and improvements provided by the two reviewer patches from Simon. I just merge them into my first proposition. The current implementation pass all my corner cases around invariant theory. All tests pass, the documentation seems good to me and the code looks ready to go. I give the patch a positive review. This is a three years old wanted improvement (beginning of my PhD thesis) and Sage changed so much these last three years.... Thanks you Simon for the hours you spent on finalizing this and thanks you Karl for English suggestions/corrections (especially those sent by mail 6 month ago...) apply trac_6812_integer_vectors_mod_permgroup-final.patch |
This comment has been minimized.
This comment has been minimized.
Changed reviewer from Karl-Dieter Crisman, Simon King to Karl-Dieter Crisman, Simon King, Nicolas Borie |
comment:91
I'm adding a very minor review patch for a few issues. This is an amazing contribution! Also, can you fix this?
|
comment:92
Attachment: trac_6812-reviewer.patch.gz Patchbot apply trac_6812_integer_vectors_mod_permgroup-final.patch and trac_6812-reviewer.patch. |
This comment has been minimized.
This comment has been minimized.
Changed work issues from long time tests, information about listing infinite sets to none |
comment:94
Karl reasonably didn't change the status of the ticket. I definitely agree with his patch which fix a lot of typos. Thanks a lot for this reading and the associated patch which applied smoothly on the previous one. If needed (or just for convenience), the release manager can ask me merging the two patch, if not apply trac_6812_integer_vectors_mod_permgroup-final.patch trac_6812-reviewer.patch |
Merged: sage-5.1.beta4 |
comment:97
Congratulations Nicolas! And thanks you all for getting this great new feature into Sage. |
The goal of this ticket is to enumerate integer vectors up to the action of a Permutation Group.
This will produced a Parent : infinite enumerated set whose element are integer vectors (as list of integer)
Apply
CC: @sagetrac-sage-combinat
Component: combinatorics
Keywords: enumeration, integer, list, permutation, group
Author: Nicolas Borie, Simon King
Reviewer: Karl-Dieter Crisman, Simon King, Nicolas Borie
Merged: sage-5.1.beta4
Issue created by migration from https://trac.sagemath.org/ticket/6812
The text was updated successfully, but these errors were encountered: