-
Notifications
You must be signed in to change notification settings - Fork 120
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
WIP: next step for documentation of groups #583
WIP: next step for documentation of groups #583
Conversation
src/Groups/GAPGroups.jl
Outdated
|
||
Return the length of the array gens(G). | ||
Return the length of the array `gens(G)`, see [`gens`](@ref). |
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.
Would this work?
Return the length of the array `gens(G)`, see [`gens`](@ref). | |
Return the length of the array [`gens`](@ref)`(G)`. |
src/Groups/GAPGroups.jl
Outdated
Return the nilpotency class of `G`, that is the smallest integer `d` such that `G` has a central series of length `n`. | ||
Return the nilpotency class of `G`, that is, the smallest integer `d` such that `G` has a central series of length `n`. | ||
|
||
An error is signalled if `G` is not nilpotent. |
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.
An error is signalled if `G` is not nilpotent. | |
An exception is thrown if `G` is not nilpotent. |
src/Groups/group_constructors.jl
Outdated
- `free_group(L::String...) -> FPGroup`; return the free group with length(`L`) generators, printed as `L[1]`, `L[2]`, `L[3]`, etc. | ||
- `free_group(L::Array{String,1}) -> FPGroup`; same as above. | ||
- `free_group(n::Int, s::String) -> FPGroup`; return the free group of rank `n`, with generators printed as `"s1"`, `"s2"`, `"s3"`, etc. | ||
The second form, if there are `n` arguments `L...`, |
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.
Maybe this was meant?
The second form, if there are `n` arguments `L...`, | |
The third form, if there are `n` arguments `L...`, |
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.
Yes.
src/Groups/GAPGroups.jl
Outdated
|
||
order(x::Union{GAPGroupElem, GAPGroup}) = order(fmpz, x) | ||
""" | ||
order([::Type{T}, ]x::Union{GAPGroupElem, GAPGroup}) where T |
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 is inspired by GAPDoc convention, where we signal that the first argument is optional. Question is whether this is clear for other people. @fieker @thofma and others: thoughts?
An alternative would be to imiate the Julia convention for default values:
order([::Type{T}, ]x::Union{GAPGroupElem, GAPGroup}) where T | |
order(::Type{T} = fmpz, x::Union{GAPGroupElem, GAPGroup}) where T |
Third alternative would be to list both signatures:
order([::Type{T}, ]x::Union{GAPGroupElem, GAPGroup}) where T | |
order(::Type{T}, x::Union{GAPGroupElem, GAPGroup}) where T | |
order(x::Union{GAPGroupElem, GAPGroup}) |
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.
According to https://docs.julialang.org/en/v1/manual/documentation/ (first item), [ ... ]
is used for optional arguments without default value?
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.
Yes. Thus the first of the two above alternatives fits (and also has the advantage that the default need not be explained in the text).
src/Groups/GAPGroups.jl
Outdated
|
||
order(x::Union{GAPGroupElem, GAPGroup}) = order(fmpz, x) | ||
""" | ||
order([::Type{T}, ]x::Union{GAPGroupElem, GAPGroup}) where T |
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.
Orthogonal to all this: should we restrict T
to be Union{Integer, fmpz}
? And: do we already have a type alias for this probably very common union?
|
||
#T Do we want 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.
I will partially deal with this in my PR for the group libraries, by turning this into an iterator.
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.
Thanks.
@ThomasBreuer What is the status of this? I am somewhat surprised to see that it's still not complete after almost two weeks? What's the holdup? (Also, now it needs to be rebased...) |
@fingolfin Now it is ready for review. Sorry for the delay. |
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.
Thanks! Some more minor comments, but this is basically mergeable already.
src/Groups/GAPGroups.jl
Outdated
""" | ||
rand_pseudo(G::Group) | ||
|
||
Return a random element of the group `G`. It works faster than `rand`, but the elements are not necessarily equally distributed. | ||
Return a pseudo random element of `G`. This works faster than `rand`, | ||
but the returned elements are not necessarily equally distributed. |
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.
but the returned elements are not necessarily equally distributed. | |
but the returned elements are not necessarily uniformly distributed. |
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.
Yes.
src/Groups/GAPGroups.jl
Outdated
function ==(x::PermGroupElem, y::PermGroupElem) | ||
return x.X == y.X && degree(parent(x))==degree(parent(y)) | ||
end | ||
==(x::PermGroupElem, y::PermGroupElem) = x.X == y.X && degree(parent(x))==degree(parent(y)) |
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 realize you are just refactoring the existing code, but while we are at it: perhaps we should first check the degree (as it ought to be fast to get) before comparing the permutations? I.e.,
==(x::PermGroupElem, y::PermGroupElem) = x.X == y.X && degree(parent(x))==degree(parent(y)) | |
==(x::PermGroupElem, y::PermGroupElem) = degree(parent(x))==degree(parent(y)) && x.X == y.X |
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.
Yes.
src/Groups/GAPGroups.jl
Outdated
At the moment, the input vectors of the function `cperm` need not be disjoint. | ||
|
||
!!! warning | ||
If the function `perm` is evaluated in a vector of integers without specifying the group `G`, then the returned value is an element of the AbstractAlgebra.jl type `Perm{Int}`. For this reason, if one wants a permutation of type `GAPGroupElem{PermGroup}` without specifying a parent, one has to use the function `gap_perm`. |
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 long line, maybe wrap it?
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.
Yes.
src/Groups/GAPGroups.jl
Outdated
|
||
Return a Hall `P`-subgroup of `G`. It works only if `G` is solvable. | ||
Return a Hall `P`-subgroup of `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.
A definition of "Hall subgroup" would be nice, possibly taken from the GAP manual. Likewise for an example (again we could borrow from the GAP manual).
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.
Yes.
src/Groups/GAPGroups.jl
Outdated
|
||
Return a Hall `P`-subgroup of `G`. It works only if `G` is solvable. | ||
Return a Hall `P`-subgroup of `G`. | ||
An exception is thrown if `G` is not solvable. |
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 indeed describes what the code does, but... why actually does it? In GAP, I think we support non-solvable groups, too, at least if they have suitable subgroups? Perhaps we don't want to support this here -- fine, but then we should perhaps still elaborate why, i.e. why we throw an exception here?
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.
@fingolfin The GAP function HallSubgroup
works also for (finite) nonsolvable groups, and returns either a Hall P-subgroup (if it is unique up to conjugacy), or a list of Hall P-subgroups (representatives of G-conjugacy classes of these subgroups if there is more than one class), or fail
(if no Hall P-subgroup exists).
For Oscar, we could introduce a function representatives_hall_subgroups
, which always returns a vector of representatives of G-conjugacy classes of Hall P-subgroups.
src/Groups/group_constructors.jl
Outdated
Here, `T` must be one of `PermGroup`, `FPGroup`, or `PcGroup`. | ||
|
||
!!! warning | ||
The type need to be specified in the input of the function `abelian_group`, otherwise a group of type `GrpAbFinGen` is returned, which is not a GAP group type. In future versions of Oscar, this may change. |
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.
Line wrap?
Also, of course we need to properly integrate the abelian groups provided by Hecke.... but that's another PR
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.
Yes.
src/Groups/group_constructors.jl
Outdated
""" | ||
function abelian_group(::Type{T}, v::Vector{Int}) where T <: GAPGroup | ||
v1 = GAP.julia_to_gap(v) | ||
return T(GAP.Globals.AbelianGroup(_gap_filter(T), v1)) | ||
return T(GAP.Globals.AbelianGroup(_gap_filter(T), GAP.julia_to_gap(v))) |
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.
Assuming it works (I didn't test), generally I find this nicer / more "Julia-ish":
return T(GAP.Globals.AbelianGroup(_gap_filter(T), GAP.julia_to_gap(v))) | |
return T(GAP.Globals.AbelianGroup(_gap_filter(T), GAP.GapObj(v))) |
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.
Yes. (I had already replaced several occurrences.)
Return the list of all primitive groups (up to isomorphism) satisfying the conditions in `L`. Here, `L` is a vector whose arguments are organized as `L` = [ `func1`, `arg1`, `func2`, `arg2`, ... ], and the function returns all the groups `G` satisfying the conditions `func1`(`G`) = `arg1`, `func2`(`G`) = `arg2`, etc. An argument can be omitted if it corresponds to the boolean value ``true``. | ||
Return the list of all primitive groups (up to permutation isomorphism) | ||
satisfying the conditions in `L`. | ||
Here, `L` is a vector whose arguments are organized as `L` = [ `func1`, `arg1`, `func2`, `arg2`, ... ], and the function returns all the groups `G` satisfying the conditions `func1`(`G`) = `arg1`, `func2`(`G`) = `arg2`, etc. An argument can be omitted if it corresponds to the boolean value `true`. |
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.
Wrap this line?
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.
Yes.
src/Groups/libraries/smallgroups.jl
Outdated
@@ -13,10 +13,10 @@ export | |||
""" | |||
small_group(n::Int, i::Int) | |||
|
|||
Return the `i`-th group of order `n` in the catalogue of the GAP Small Groups Library. The group is given of type ``PcGroup`` if the group is solvable, ``PermGroup`` otherwise. | |||
Return the `i`-th group of order `n` in the catalogue of the GAP Small Groups Library. The group is given of type `PcGroup` if the group is solvable, `PermGroup` otherwise. |
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.
Wrap?
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.
Yes.
src/Oscar.jl
Outdated
@@ -87,6 +87,7 @@ function __init__() | |||
(GAP.Globals.IsFpGroup, FPGroup), | |||
]) | |||
GAP.Packages.load("forms") | |||
GAP.Packages.load("ctbllib") |
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.
What's this about? Is this preparation for moving your character table code into the "official" part of Oscar.jl (you are still working on that, right?)
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.
Yes, this addition accidentally slipped in ...
@@ -248,21 +254,26 @@ end | |||
""" | |||
issolvable(G::GAPGroup) | |||
|
|||
Return whether the `G` is solvable. | |||
Return whether `G` is solvable, | |||
i. e., whether [`derived_series`](@ref)(`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.
The simpler following version should also work:
i. e., whether [`derived_series`](@ref)(`G`) | |
i. e., whether [`derived_series(G)`](@ref) |
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.
@rfourquet Yes, this works, thanks. However, I prefer the "more involved" variant because it creates a hyperlink on "derived_series", whereas your variant creates a hyperlink on "derived_series(G)".
src/Groups/GAPGroups.jl
Outdated
|
||
Return the length of the array gens(G). | ||
Return the length of the array [`gens`](@ref)`(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.
Return the length of the array [`gens`](@ref)`(G)`. | |
Return the length of the array [`gens(G)`](@ref). |
Return (``true``,nothing) if `G` is the trivial group, (``true``,``p``) if |`G`| is a non-trivial ``p``-power, (``false``,nothing) otherwise. | ||
Return `(true, nothing)` if `G` is the trivial group, | ||
`(true, p)` if |`G`| is a non-trivial power of a prime `p`, | ||
and `(false, nothing)` otherwise. |
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 is potentially inaccurate, as in current GAP versions, IsPGroup
may also return true
for infinite p-groups (not that any are available in GAP, as far as I know...)
test/Groups/constructors.jl
Outdated
else | ||
# @test index(GO(e,n,q),omega_group(e,n,q))==2 | ||
@test index(GO(e,n,q),omega_group(e,n,q))==2 |
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.
Here's a conflict now... please resolve, then merge this
- fixed a few `@docs` blocks in `docs` files such that the correct docstrings are specified - moved text from `docs` files to `src` files where appropriate - made statements about exceptions uniform (say "An exception is thrown if ...") - used `@gapattribute` in more cases - added/extended/corrected docstrings - changed the syntax in lines that show the signatures of the functions such that default values are shown, and removed the related (now unnecessary) sentences from the text. - use LaTeX markup for math mode where appropriate
(as suggested by @fingolfin), and rebased
The test with Julia 1.7 on ubuntu ran out of time and got cancelled. I restart the tests. |
Now the tests passed (except for the nightly tests), within about one hour. |
(e.g., admit a type as optional first argument for
exponent
,index
)ischaracteristic
notischaracteristic_subgroup
(the latter is not needed)