Skip to content
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

Add letters function for PcGroupElem #4202

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

jamesnohilly
Copy link

@jamesnohilly jamesnohilly commented Oct 14, 2024

As a starting point for this PR, I've borrowed the syllable functions for PcGroup from PR #4108 to use as a reference for planned work.

Planned work for this PR:

  • New function letters for (Sub)PcGroupElem.
  • A check in _exponent_vector for whether the input is really "canonical".
  • Test cases in test/Groups/pcgroups.jl for the new functions.
  • Add doc strings for new functions.

Suggestions from @fingolfin

Moved from the mjrodgers-OW_GModules branch.
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.60%. Comparing base (da7acb0) to head (1b80584).
Report is 50 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #4202    +/-   ##
========================================
  Coverage   84.59%   84.60%            
========================================
  Files         631      640     +9     
  Lines       84899    85140   +241     
========================================
+ Hits        71824    72032   +208     
- Misses      13075    13108    +33     
Files with missing lines Coverage Δ
src/Groups/pcgroup.jl 75.34% <100.00%> (+4.61%) ⬆️

... and 57 files with indirect coverage changes

@fingolfin
Copy link
Member

Thanks @jamesnohilly to clarify: what you posted in the description is not (yet) what you did, but a description of the work programme, right? Also, should mention that the code here was taken from PR #4108 by @fieker and is only the starting point.

@jamesnohilly
Copy link
Author

Yes, that's correct! I've now updated the description to make it clearer and also included a note that the code originates from PR #4108 as the starting point.

Copy link
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments. Maybe more directed towards @fingolfin and @ThomasBreuer instead of @jamesnohilly

src/Groups/pcgroup.jl Outdated Show resolved Hide resolved
src/Groups/pcgroup.jl Outdated Show resolved Hide resolved
src/Groups/pcgroup.jl Outdated Show resolved Hide resolved
return res
end

# Convert syllables in canonical form into group element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it only work for syllables in canonical form? I would at least expect the function to test this requirement.
And I think this requirement makes it impossible to construct certain elements in certain groups. Consider < a, b | a^2 = 1, b^2 = 1, aba = bab > (Weyl group of type A2). The element aba has no representation in "syllables in canonical form" (or maybe I misunderstood what canonical form means here)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is that there are different useful ways to encode a group element that is given by some kind of word. For general elements in finitely presented groups, there is no normal form, and an element is represented by a sequence of letters or syllables.
For elements in polycyclic groups, there is a normal form which corresponds to an exponent vector, and many low level functions deal just with these exponent vectors. In situations where one needs a word-like description of an element, it may be necessary to switch from the exponent vector to a syllable description and back. Often it is not needed to do actual computations (such as normalizing the data) in such a case. Testing whether the data are admissible can make sense; in this case, there should be a check = false option that allows one to skip these tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. I might have mixed up FP and PcGroups when thinking about this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this check (enabled by default) to verify if the syllables are in the required canonical form in the latest commit.

@test letters(G[1]^2) == [2, 2]
@test letters(G[1]^2*G[2]^3*G[3]^3) == [2, 2, 3, 4]
@test letters(G[1]^-2*G[2]^-3*G[3]^-3) == [2, 3, 4]
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesnohilly you can apply this suggestion via the web interface by using the "Commit suggestions" button. Though you then should also "fetch" the changes from git into your local branch.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I never noticed this, thanks! I've applied this suggestion in the latest commit.

@fingolfin
Copy link
Member

@jamesnohilly tests are still failing. are on onto that, or do you need assistance?

@jamesnohilly jamesnohilly marked this pull request as ready for review October 31, 2024 12:09
test/Groups/pcgroup.jl Outdated Show resolved Hide resolved
src/Groups/pcgroup.jl Outdated Show resolved Hide resolved
src/Groups/pcgroup.jl Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants