-
Notifications
You must be signed in to change notification settings - Fork 140
Add dicyclic_group
, is_dicyclic_group
and have quaternion_group
and is_quaternion_group
be aliases of those
#4661
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
Conversation
src/Groups/group_constructors.jl
Outdated
@@ -827,6 +827,8 @@ as an instance of `T`, | |||
where `n` is a power of 2 and `T` is in |
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.
where `n` is a power of 2 and `T` is in | |
where `n` is a multiple of 4 and `T` is in |
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.
I think "power of 2" is what we want here, as that is how (generalized) quaternion groups are defined. For the function that does the exact same construction for "multiple of 4", there is dicyclic_group
below. In particular, this distinction in the docstring matches to how is_quaternion_group
works
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.
Hm, I think that the consensus in #1630 is that both should be the same. Here are some reasons why I think this is the case:
- The definition with 2-powers is unnecessarily restrictive. There are plenty of references that construct quaternion groups of order 4n.
- There is now already code out there that is using the most general definition (that the order is any number
$4n$ ), because this is what people were being told in Dicyclic groups #1630 - Since we don't do any quaternion_group(k) -> group of order 2^k or 2^(k+2) shenanigans, there is no reason to restrict to 2-powers.
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.
Yeah I decided to just treat both commands as exact equals, any artificial restriction benefits nobody but can cause frustration
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.
Note that e.g. Wikipedia allows "generalized quaternion groups" to have order
src/Groups/group_constructors.jl
Outdated
@@ -827,6 +827,8 @@ as an instance of `T`, | |||
where `n` is a power of 2 and `T` is in |
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.
I think "power of 2" is what we want here, as that is how (generalized) quaternion groups are defined. For the function that does the exact same construction for "multiple of 4", there is dicyclic_group
below. In particular, this distinction in the docstring matches to how is_quaternion_group
works
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4661 +/- ##
==========================================
+ Coverage 84.38% 84.77% +0.39%
==========================================
Files 673 681 +8
Lines 90284 91838 +1554
==========================================
+ Hits 76185 77859 +1674
+ Misses 14099 13979 -120
🚀 New features to boost your workflow:
|
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.
Very nice, thanks. But some group theory person should have a look too.
src/Groups/group_constructors.jl
Outdated
|
||
Return the dicyclic group of order `n`, as an instance of `T`, | ||
where `n` is a multiple of 4 and `T` is in | ||
{`PcGroup`, `SubPcGroup`, `PermGroup`,`FPGroup`, `SubFPGroup`}. |
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.
Adjust this to fully mirror the quaternion_group
docstring (including a @ref
link in the other direction).
... or... perhaps we should instead really merge the two, like GAP does: show a single docstring that starts with
"""
dicyclic_group(::Type{T} = PcGroup, n::IntegerUnion)
quaternion_group(::Type{T} = PcGroup, n::IntegerUnion)
...
Then attach that to, say, quaternion_group
, and turn dicyclic_group
into a "true" alias by doing const dicyclic_group = quaternion_group
(I think it'll then get the same docstring). Merge is_quaternion_group and
is_dicyclic_group` similarly.
In the examples use only one (quaternion).
Then instead of This is an alias of
dicyclic_group.
write something more like this:
!!! note
For historical reasons and backwards compatibility, `dicyclic_group` is an alias
of `quaternion_group`. The two functions are fully identical. We recommend always
using `quaternion_group`.
and then similar for the is_*
function.
Thoughts @ThomasBreuer @thofma ?
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.
If it is just an alias, as a user I would not quite understand why you provide an alias that I am happy to find (because "dicyclic group" is the right name in my domain) and use, but then tell me not to use it.
But I don't have a strong opinion on this.
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.
My understanding of the discussion from issue #1630 is that it should be the other way round, that is, we recommend always using dicyclic_group
.
And yes, I think it makes sense to have just one docstring for both names.
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.
I am fine with not making a recommendation, my main concern is that I think it'd be nice to mention why we have two names.
src/Groups/group_constructors.jl
Outdated
true | ||
``` | ||
""" | ||
@gapattribute is_quaternion_group(G::GAPGroup) = GAP.Globals.IsQuaternionGroup(GapObj(G))::Bool | ||
@gapattribute is_dicyclic_group(G::GAPGroup) = | ||
GAP.Globals.IsQuaternionGroup(GapObj(G))::Bool |
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.
I am getting confused.
GAP does the following:
gap> G:= DicyclicGroup(24);;
gap> IsQuaternionGroup(G);
false
gap> G:= DicyclicGroup(32);;
gap> IsQuaternionGroup(G);
true
That is, both QuaternionGroup
and DicyclicGroup
can be used to create the groups in question,
but IsQuaternionGroup
regards only the dicyclic groups of 2-power order as (generalized) quaternion groups.
In fact, GAP seems to have no function that checks whether a group is dicyclic.
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.
As far as I see, the GAP function DoComputeGeneralisedQuaternionGenerators
(which is called by IsQuaternionGroup
) would work as an is_dicyclic
check if one just omits the check for 2-power order.
How shall we proceed? |
I have now merged the docstrings of As for the |
Didn't we decide a while ago that
is not optimal. |
Concerning @thofma's latest comment:
(The current code wants |
Regarding this issue, I believe I became confused regarding GAP's functionality vs. OSCAR functionality throughout the reimplementation of |
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.
Looks good. Thanks.
Just to add another data point that convinces me we are doing the right thing merging the two notations: Keith Conrad also considers them as synonyms in https://kconrad.math.uconn.edu/blurbs/grouptheory/genquat.pdf |
dicyclic_group
, is_dicyclic_group
and have quaternion_group
and is_quaternion_group
be aliases of those
This PR adds a group constructor for Dicyclic Groups (
dicyclic_group
) and changes the constructor for Quaternion Groups to be an alias ofdicyclic_group
.This PR closes #1630