-
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 3 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 |
|---|---|---|
|
|
@@ -150,3 +150,27 @@ end | |
| @test is_bijective(f) | ||
| end | ||
| end | ||
|
|
||
| @testset "pcgroup code and reconstruction" begin | ||
| # Define the groups | ||
| groups = [ | ||
| cyclic_group(6), | ||
| cyclic_group(12), | ||
| dihedral_group(10), | ||
| small_group(PcGroup, 12, 2) | ||
| ] | ||
|
|
||
| for G in groups | ||
| # Get the code from the group | ||
| code = code_pcgroup(G) | ||
|
|
||
| # Decode the code depending on its type | ||
| H = isa(code, Int) ? pcgroup_code(code, G) : pcgroup_code(code) | ||
varuntrehan7 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Test that the original and reconstructed groups are isomorphic | ||
| @test is_isomorphic(G, H) | ||
|
||
|
|
||
| # Test that encoding the reconstructed group gives the same code | ||
| @test code_pcgroup(H) == code | ||
| end | ||
| 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.
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