-
Notifications
You must be signed in to change notification settings - Fork 166
fix has_gens for certain matrix groups
#5662
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
base: master
Are you sure you want to change the base?
Conversation
Be careful if the matrix group is not suported by GAP.
| G = GL(2, 3) | ||
| @test !has_gens(G) | ||
| GapObj(G) | ||
| @test has_gens(G) |
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.
This kind of violates against the groups conformance tests (cf https://github.com/Nemocas/AbstractAlgebra.jl/blob/fccef26d4c7d226ed8a141d5dbe55e9c415b0b3e/ext/TestExt/Groups-conformance-tests.jl#L61-L73) as there it is tested that gens throws if has_gens returns false. For GL(2, 3) that would not be the case
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.
IMHO, the group conformance tests are simply wrong and need to be adjusted. This part has to be removed:
else
# TODO: throw something more specific
@test_throws ErrorException gens(G)
@test_throws ErrorException ngens(G)Because it contradicts the has_gens documentation, which says:
Note that the result of this function when applied to a specific group instance can change over time, as side
effect of a generating set becoming available for the group.
In particular, one of the function which may have this side effect is gens, another is ngens.
This is not to say we shouldn't also adjust this PR, though.
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.
| function has_gens(G::MatrixGroup) | ||
| isdefined(G,:gens) && return true | ||
| isdefined(G, :X) || return false | ||
| return GAP.Globals.HasGeneratorsOfGroup(GapObj(G))::Bool | ||
| end |
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.
| function has_gens(G::MatrixGroup) | |
| isdefined(G,:gens) && return true | |
| isdefined(G, :X) || return false | |
| return GAP.Globals.HasGeneratorsOfGroup(GapObj(G))::Bool | |
| end | |
| function has_gens(G::MatrixGroup) | |
| isdefined(G, :gens) && return true | |
| F = codomain(_ring_iso(G)) | |
| GAP.Globals.IsBaseRingSupportedForClassicalMatrixGroup(F, GapObj(G.descr)) || return false | |
| return GAP.Globals.HasGeneratorsOfGroup(GapObj(G))::Bool | |
| end |
what about something like this?
Hmm, all There are two docstrings for |
|
The question seems to be what we want: If But is this really what we want? |
If no `GapObj` value is known for a matrix group then regard it as cheap to compute the `GapObj` value if possible and then to check whether this `GapObj` stores generators.
Be careful if the matrix group is not suported by GAP.
resolves #5661