-
Notifications
You must be signed in to change notification settings - Fork 126
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
Cosets changes #126
Cosets changes #126
Conversation
Codecov Report
@@ Coverage Diff @@
## master #126 +/- ##
==========================================
+ Coverage 30.07% 33.29% +3.22%
==========================================
Files 19 19
Lines 2820 3205 +385
==========================================
+ Hits 848 1067 +219
- Misses 1972 2138 +166
|
Return the coset `gH`. | ||
!!! note | ||
Since GAP supports right cosets only, the underlying GAP object of `left_coset(H,g)` is the right coset `H^(g^-1) * 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.
While this describes what the code does, this strikes me as deeply problematic. It means that you have to creates lots of new subgroups by conjugating H around.
My idea would be to represent gH
by Hg^{-1}
, using that fact that the inversion map induces a bijection between them.
That said, I am actually still sceptical about the whole idea of providing left cosets. Perhaps it's a good idea to do so, but I'd really like to see some concrete applications in order to figure out what the "right" way (or at least a "somewhat useful way") to go about them might be.
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 idea would be to represent gH by Hg^{-1}, using that fact that the inversion map induces a bijection between them.
This would be much faster during the creation of the coset (I don't have to create the conjugate subgroup), but would it be slower every time I need to access to it?
If lc=gH
, and I save it as Hg^-1
, every time I type something like rand(lc)
or elements(lc)
, or some intersection involving lc
, I need to compute an inverse. A possible syntax for the rand
function could be
> function rand(lc::Coset)
> x=rand(lc)
> if isleft(lc) then x=x^-1 end
> return x
> 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 think it is perfectly realizable, maybe with a little care about the fact that the underlying GAP object is not the object I'm interested (but its image under the inverse function), but is it really faster?
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.
Well, that exactly is my point: what is "faster" depends entirely on the use case. But no matter how you implement the left cosets, one thing stays the same: as long as they simply (ab)use GAP's right cosets, it will always be faster if you rewrite your code to use right cosets instead of left cosets.
Anyway: as long as this is an implementation detail is hidden from the user, this is fine. But I would not want to mention it to the user! The user should not have to care about this.
Next thing: GAP doesn't really do much with RightCosets
anyway. So we could think about simply not using GAP objects of type RightCoset
at all, and simply implement our own two types RightCoset
and LeftCoset
, which simply wrap a group element g
plus a subgroup H
. Implementing things like rand
or elements
then is easy: e.g. rand(H) * g
to get a random element. I'll put this idea into another issue
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.
It seems good. Do I try this new type on the same branch? Or do we open a new one?
d6d6288
to
730d3ce
Compare
I want to merge the branch
coset-changes
into the master branch before going on with the work in the manual. This branch deals the questions raised in the Issue #118. In particular:isrightcoset
andas_right_coset
that says whether a coset is right and turning a coset into a right coset. Same for the left.x * yH --> (xy) * H
and similar ). Now it is also possible to define a coset just multiplying an element by a coset (e.g.x * H --> left_coset(H,x)
).