-
Notifications
You must be signed in to change notification settings - Fork 160
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
Ensure fp groups for which Size
successfully computes the order can also be enumerated (previously this could run out of memory)
#5677
Conversation
If this PR gets any traction I'll try to implement a proper enumerator method that returns an enumerator rather than a list, and add some doc for the added attribute. This is why the pr is marked as a draft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change to FinIndex...
is harmless, but does not catch if there is, say, (ab)^100.
The new enumerator method has two problems:
- How will
AsList(H)
work? Presumably this will require an element comparison, which in some cases might cause problems by itself. - The
RightTransversal
returned by the original method will have aPosition
method that makes the right element action quick. The new method just constructs a plain list, in which position can only be found by n^2 element comparisons in the whole group.
Thanks for the comments @hulpke, I'll amend the PR as indicated. |
e222f46
to
2c5bb8f
Compare
Thanks again @hulpke for the comments. I've updated the PR accordingly. Some counter-comments:
I wrote some code that would detect powers like this, but this made one of the bugfix tests fail in
I've replaced the list with a proper enumerator using
versus without the changes in this PR:
I'm not completely sure that it's fair to characterise:
as a problem, in this example, because nothing was returned before (it ran out of memory after a number of seconds), but this is anyway hopefully resolved with the changes anyway. |
That is certainly in the right direction. But I suspect the
in this particular example. But there are other groups, and in many other examples it did. |
Thanks @hulpke.
I agree, on all counts, I think the speed up in this example (and similar examples), makes this still a change worth making however. |
@hulpke are there any further changes that you'd like me to make to this PR? After some playing around I don't think
It also doesn't seem to be the case that any of the enumerations in the tests are slower as a result of the changes in this PR, if you have any examples where it is, I'll be happy to investigate further. |
It does not do in this example, because there is already a way to compare elements (through a faithful permutation representation) But in any case, we cannot promise that all of this is guaranteed to work for Fp groups, so this at least makes some examples work better, so let's do the change. |
Thanks @hulpke much appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
We need to apply a release notes label, either deciding this needs no release notes entry, or else adding a release notes text (the easiest would be to edit the PR title to something meaningful and use that). E.g. "Ensure computations with fp groups work in more cases" or "Ensure fp groups for which Size successfully computed the order can also be enumerated (previously this could run out of memory)" or something in this vein. |
@james-d-mitchell do you have any preferences or input regarding the changelog entry? Is one of the two I suggested OK, or maybe you have something else in mind? |
Ah sorry @fingolfin I didn't properly read your comment, hopefully everything is ok now? |
…lso be enumerated (previously this could run out of memory) (#5677) * grpfp: detect relators that are powers * grpfp: fix enumerator for fp groups with a known cyclic subgroup * grpfp: fix "working horse" -> "workhorse"
Size
successfully computes the order can also be enumerated (previously this could run out of memory)
This PR does what I suggested in the discussion on Issue #5671, it stores the cyclic subgroup used to compute the size of an fp group (and contains a minor optimisation for finding that cyclic subgroup in the first place).
With the changes in this PR we get:
before this PR we get:
I've checked that
testinstall.g
andtestbugfix.g
run with the changes in this PR, but not any further.