-
Notifications
You must be signed in to change notification settings - Fork 162
Add encode and pc_group for encoding finite pc groups into integers and back
#5456
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?
Changes from 12 commits
90bc8c5
f76780b
a216c4e
4cb5b93
744d0bc
eeaddfd
ad08e81
dd10a1b
876a802
eb3233a
a9aa27c
018769f
f3f9745
e1873c7
49934f3
c452989
b7fec6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -923,3 +923,57 @@ function collector(::Type{T}, G::PcGroup) where T <: IntegerUnion | |||||||
| end | ||||||||
|
|
||||||||
| collector(G::PcGroup) = collector(ZZRingElem, G) | ||||||||
|
|
||||||||
| # GAP wrappers for group encoding / decoding | ||||||||
|
|
||||||||
| """ | ||||||||
| code_pcgroup(G::PcGroup) | ||||||||
|
|
||||||||
| Return a `ZZRingElem` representing the polycyclic group `G`, using the same | ||||||||
| encoding as GAP's `CodePcGroup` and Magma's `SmallGroupEncoding`. | ||||||||
| Currently only defined for `PcGroup`, not `SubPcGroup`. | ||||||||
|
|
||||||||
| # Examples | ||||||||
| ```jldoctest | ||||||||
| julia> G = small_group(12, 2) | ||||||||
| Pc group of order 12 | ||||||||
|
|
||||||||
| julia> code = code_pcgroup(G) | ||||||||
| 266 | ||||||||
|
|
||||||||
| julia> H = pcgroup_code(code, order(G)) | ||||||||
| Pc group of order 12 | ||||||||
|
|
||||||||
| julia> code_pcgroup(G) == code_pcgroup(H) | ||||||||
| true | ||||||||
| ``` | ||||||||
| """ | ||||||||
| function code_pcgroup(G::PcGroup) | ||||||||
| return ZZ(GAP.Globals.CodePcGroup(GapObj(G))::GapInt) | ||||||||
| end | ||||||||
|
|
||||||||
| """ | ||||||||
| pcgroup_code(code::IntegerUnion, order::IntegerUnion) | ||||||||
|
|
||||||||
| Given an integer `code` and an integer `order`, return the polycyclic group it encodes. | ||||||||
| Both `code` and `order` can be of type `Int`, `BigInt`, or `ZZRingElem`. Internally, these are converted to `GapInt` before calling the GAP function `PcGroupCode`. | ||||||||
fingolfin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
| The accepted codes and resulting groups match those of GAP's `PcGroupCode` and Magma's `SmallGroupDecoding`. | ||||||||
|
|
||||||||
| # Examples | ||||||||
| ```jldoctest | ||||||||
| julia> G = small_group(12, 2) | ||||||||
| Pc group of order 12 | ||||||||
|
|
||||||||
| julia> code = code_pcgroup(G) | ||||||||
| 266 | ||||||||
|
|
||||||||
| julia> H = pcgroup_code(code, order(G)) | ||||||||
| Pc group of order 12 | ||||||||
|
|
||||||||
| julia> code_pcgroup(G) == code_pcgroup(H) | ||||||||
| true | ||||||||
| ``` | ||||||||
| """ | ||||||||
lgoettgens marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| function pcgroup_code(code::IntegerUnion, order::IntegerUnion) | ||||||||
| return PcGroup(GAP.Globals.PcGroupCode(GAP.GapInt(BigInt(code)),GAP.GapInt(BigInt(order)))) | ||||||||
|
||||||||
| return PcGroup(GAP.Globals.PcGroupCode(GAP.GapInt(BigInt(code)),GAP.GapInt(BigInt(order)))) | |
| return PcGroup(GAP.Globals.PcGroupCode(GapInt(code), GapInt(order))) |
At the same time, please change
Line 38 in c0fadd1
| GAP = "0.16.0" |
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.
GAP.jl 0.16.1 is out now, so this can be done.
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 have some doubts about the function names now: in OSCAR convention we don't normally denote the input type. So by that logic, this function should just be called
code.The reverse function
pcgroup_codecould then either be called justpc_group(it'd be different from other methods for that in that it would take twoZZRingElemas argument); or have a speaking name, such aspcgroup_from_code.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 I ref to #5456 (comment) and #5456 (comment), at least Thomas and I agree with you