-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Congruence testing for odd modular subgroups #11598
Comments
comment:1
Hi Vincent, Any chance you could take a look at this? I don't think we should go changing the definition of "congruence"! I missed this issue when I reviewed #11422, so I did this little patch to change it. |
Changed dependencies from 11422 to #11422 |
comment:2
Just realised that, since the new algorithm in the odd case is extremely slow, it is better to not call it from the generic test routine! Here's a new patch. |
comment:3
Replying to @loefflerd: I was asking myself what should be the definition of congruence subgroup. In order to use Wohlfart's theorem it is necessary to use the projective definition and that's why it was implemented that way. For all standard congruence groups it makes no difference. Could you explain me a concrete case where the difference matter ? In any case, you should add an example of an odd arithmetic subgroup which is not of congruence but which becomes one when we add the element -id. Do you know a method, given an even subgroup, to build all odd subgroups it may come from ?
For that particular question, it should be possible, following Hsu method (who produces uniform presentation for PSL(Z,Z/pZ)), to get a congruence test method for odd subgroups. |
Reviewer: Vincent Delecroix |
comment:4
Replying to @videlec:
Here's one: the group of index 24 with
There is one in the K-S-V paper but it uses Farey symbols heavily. I can think of an algorithm which produces some examples of such subgroups using the permutation representation (which is how I found the one above) but it's not totally obvious to me if it produces all of them.
I've actually thought of another approach, which is slower and less elegant than Hsu's approach but much better than the patch I just made :-). Rather than finding generators for Better still, if G isn't congruence, then this algorithm calculates the smallest congruence subgroup containing G (the congruence closure), which is an interesting thing to calculate in itself. I will do a new patch tomorrow. |
Attachment: trac_11598-odd_congroup_change.patch.gz |
comment:5
Here's a new patch, which:
There are probably far better ways of doing the congruence test, as you suggest; but I'd rather get something that works in quickly, rather than having to release a Sage version that uses a different definition and then change it back to the conventional definition later. I haven't implemented congruence closure yet, because I'm working on a patch that will introduce a new class for generic congruence subgroups defined by a finite group of matrices in Thanks Vincent for the helpful feedback on my previous patch! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:7
Replying to @loefflerd: Very nice!
I definitely agree. If you are OK, with my changes, you can put the ticket in positive review. |
comment:8
I've done some tests. You made several changes: setting "check=False" in the constructor; adding a custom BEFORE
AFTER
But one part puzzles me a little. I can see that the first two changes lead to a dramatic speedup, but it's not totally clear to me what the advantage of using a set type for the Also, you have a random |
comment:9
Replying to @loefflerd:
To check if an element is in a list is linear in the size of the list, but checking if an element is in a set is constant time (up to a critical size). The reason is that Python set are implemented using a hash table. Now, the test "if HH not in bucket" is made exactly "n" times in your algorithm and bucket grows quite fast if the centralizer of G is small. The gain of complexity is dramatic.
The way you generate the odd subgroups is somewhat canonical and the output is sorted that way. If the returned value is "list(bucket)" then the output is randomized. But, I'm not too much convinced by having at the same time a list and a set containing exactly the same values. It's up to you to make the change.
It is not time critical if the function is called once. But if somebody want 100 random odd subgroups then it would be better to disable the check parameter (done in the reviewer patch).
Thanks, I changed the test (see the reviewer patch). I am not so familiar with how is tested the random stuff in Sage. |
Attachment: trac_11598-reviewer.patch.gz |
comment:10
I'm not totally sold on the new version of the random doctest either, since it has a positive probability of failing! We can't have that, I'm afraid. I'm about to upload a new patch. This incorporates all the changes from both my previous patch and yours, together with some more tiny changes: I've cleaned up the docstrings slightly, added a few more doctests (mostly to illustrate how things fail on invalid inputs), and rearranged the order of the validity checks in the constructor function slightly (mainly for code clarity, but also giving a tiny efficiency gain by doing the most expensive test last). Let me know if you're happy with this version. I'm off to a conference tomorrow morning, so hopefully this will be the last iteration. Thanks for your patience with all this reviewing! |
Work Issues: docstrings |
comment:11
Attachment: trac_11598-all.patch.gz Replying to @loefflerd: I'm perfectly ok with your changes in the code.
Actually, it doesn't. Sage reinitialize the random seed with the same value before performing the tests. It is safe, but perhaps not pedagogic, to let it in the doctest. I vote for letting the current version. Since you made some changes in the documentation. I quickly reread it and there are some misprints.
That's all. |
Apply over trac_11598-all.patch |
comment:12
Attachment: trac_11598-docfixes.patch.gz Here's a patch which corrects the docstrings as you suggest. If there are any further documentation fixes, can I suggest we agree to keep them for a future ticket? |
This comment has been minimized.
This comment has been minimized.
Changed work issues from docstrings to none |
Rebased for latest patch at #11422. Apply only this patch. |
comment:15
Attachment: trac_11598-foldedrebased.patch.gz The unpickling bug that I recently spotted and fixed at #11422 causes the patches here to fail to merge. I've rebased the relevant patches and qfolded them into a single patch. As there is no change to the actual code, I hope it's fair to leave this as positive review. |
This comment has been minimized.
This comment has been minimized.
Merged: sage-4.7.2.alpha3 |
The new functionality added in ticket #11422 makes it possible to manipulate arbitrary finite index (not necessarily congruence) subgroups of SL2Z. This massively extends my old code which only worked for subgroups containing -1.
The "is_congruence" method in the new code, though, defines a subgroup to be congruence if its image modulo -1 is a congruence subgroup of PSL2Z. This is not the same as the conventional definition of a congruence subgroup of SL2Z. The patch below modifies the algorithm so it uses the conventional notion of "congruence". It also adds functionality for enumerating all the liftings of a projective modular subgroup.
Part of a series of tickets: #10335 - #11422 - this one - #5048 - #10453 - #11601.
Apply:
Depends on #11422
CC: @videlec
Component: modular forms
Keywords: modular congruence subgroup
Author: David Loeffler
Reviewer: Vincent Delecroix
Merged: sage-4.7.2.alpha3
Issue created by migration from https://trac.sagemath.org/ticket/11598
The text was updated successfully, but these errors were encountered: