-
-
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
#36986 has broken .subgroup(...)
badly
#37744
Comments
A quick way to back out the wrong change is to download |
What happened is that the ambient space code assumes that the generators are all distinct, but the subgroups can violate this. We just need to tell the ambient space to use the abelian invariants rather than the group generators. |
Okay, so this is a mess. There is a major issue with how the subgroups were implemented IMO. On #36986, that was fixing an issue, but this shows it was not done in the correct way (which it was unfortunate that there were no doctests for the case when there was redundancy with the generators). Now I am thinking we need to go back to the "reduced" generators, but the subgroup needs to keep track of the lifting (and perhaps also the defining generators). |
Am I correct that Abelian groups in Sage are implemented via Smith Normal Form algorithms, and related things? |
It is done that way and via GAP. I was just battling with GAP to find something that works, which I finally figured out can be done with https://github.com/tscrim/sage/tree/groups/abelian_subgroups-36986 However, it doesn't work (quickly) for large groups. I'm playing whack-a-mole with problems. Really we just need some way to remove redundant generators. We might need a very refined strategy here to keep construction quick, perhaps with check for word problem solutions iteratively for certain group sizes. I need to sleep now. Hopefully you can figure something out where everything works. |
Can we use the following code for finding independent generators? independent_gens = []
mat = []
curr_rank = 1
for row in gens:
mat.append(row.exponents())
if matrix(mat).rank() == curr_rank:
curr_rank += 1
independent_gens.append(row) I tried it here and it worked fine |
I think that would get it down to something close to an independent set, but it probably isn’t sufficient for the torsion subgroup. |
I think it should be well-known how to deal with this problem as efficiently as possible, so it's a question of finding a reference. We have a f.g. Abelian group So the question is how to tie all this up together. Should I ask on Mathoverflow or some other place, such as GAP forum? PS. I've asked here: https://mathoverflow.net/q/468433/11100 PPS. The SNF of the matrix |
Mathoverflow should be good. My current WIP branch uses what is already provided by GAP, but it just takes very long in “obvious” cases. In the short term, we might just want to revert #36986. The inconsistency addressed there is (far) less bad than the errors we are getting here IMO. I believe the following bug was still there before #36986:
This is clearly not true as We might just have to either do some heuristics for the “obvious” independent case to still handle some large groups and otherwise just take the speed loss for correctness. Although there might be a better linear algebra approach using the relations of the generators. I vaguely remember learning something about how to do this in my algebra course, but I don’t remember much. |
On 5 April 2024 14:44:53 CEST, Travis Scrimshaw ***@***.***> wrote:
Mathoverflow should be good. My current WIP branch uses what is already provided by GAP, but it just takes very long in “obvious” cases.
In the short term, we might just want to revert #36986. The inconsistency addressed there is (far) less bad than the errors we are getting here IMO.
I believe the following bug was still there before #36986:
```
sage: A.<a,b> = AbelianGroup([0,0])
sage: S = A.subgroup([a,b,a*b])
sage: S
Multiplicative Abelian subgroup isomorphic to Z x Z x Z generated by {a, b, a*b}
sage: S.equals(A)
False
```
This is clearly not true as `S` is clearly all of `A`.
We might just have to either do some heuristics for the “obvious” independent case to still handle some large groups and otherwise just take the speed loss for correctness. Although there might be a better linear algebra approach using the relations of the generators. I vaguely remember learning something about how to do this in my algebra course, but I don’t remember much.
I am not sure whether GAP does proper Kannan-Bachem algorithm for HNF/SNF - or whatever the best currently know is.
|
see https://mathoverflow.net/a/468442/11100 |
I don’t quite see how from that to extract some generators that realize the |
I think Derek took my question so that one has to swap B and A/B. We have Now, we have B generated by two generators he gives. Taking these two row vectors and D gives us the kernel for the homomorphism Still, computing C there in Derek's answer looks like magic to me (but I am on vacation:-)) |
I am not sure you're correct about what is being considered. My understanding is we should get |
You can see Derek's comment to his answer, where he insists that |
https://mathoverflow.net/a/468601/11100 - it's more coherent answer |
Yes, it is more coherent, but it also has more typos and imprecision: The matrix
However, what we need to know is how to get the generators in the ambient group Side remark: There are inconsistencies with HNF between dense and sparse matrices!
This is because HNF is simply the generic |
Perhaps @AurelPage - the author of the MO answer - can point out more details? |
Just as a reminder, as we get closer to the stable release, we might be better off reverting #36986 since that is a "less bad" bug if we cannot find another workable method. |
let's revert that while we work on a fix |
Reverted changes made in sagemath#36986 The bug in sagemath#36974 remains unsolved. Efforts are being made in sagemath#37744 to resolve the bug. Fixes sagemath#37744 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#37850 Reported by: Aman Moon Reviewer(s):
Reverted changes made in sagemath#36986 The bug in sagemath#36974 remains unsolved. Efforts are being made in sagemath#37744 to resolve the bug. Fixes sagemath#37744 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#37850 Reported by: Aman Moon Reviewer(s):
This has broken
.subgroup(...)
rather badly, see sage-devele.g. with this one gets
Originally posted by @dimpase in #36986 (comment)
The text was updated successfully, but these errors were encountered: