-
Notifications
You must be signed in to change notification settings - Fork 125
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
introduce on_points
, on_tuples
, ...
#127
introduce on_points
, on_tuples
, ...
#127
Conversation
Regarding the syntax, we could additionally overload directly |
Thank you! (if you haven't already, please also see PR #119, which I just merged (and which is super boring and nothing much happens, I thought it'd be good for you to be aware), and issue #108, which still lacks details ). I envision that we will do two things in parallel:
In the second approach, what Tommy wrote absolutely makes sense, as we can "automatically" decide for the "correct" action. In fact, I'd just implement the actions as such. (However, I am not quite sure how to implement Anyway, I'll look at this PR after our status meeting :-) |
Codecov Report
@@ Coverage Diff @@
## master #127 +/- ##
==========================================
- Coverage 33.12% 32.81% -0.31%
==========================================
Files 20 21 +1
Lines 2992 3023 +31
==========================================
+ Hits 991 992 +1
- Misses 2001 2031 +30
|
""" | ||
on_tuples(tuple::GAP.GapObj, x::GAPGroupElem) | ||
on_tuples(tuple::Vector{T}, x::GAPGroupElem) where T | ||
on_tuples(tuple::T, x::GAPGroupElem) where T <: Tuple |
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.
How about this instead:
on_tuples(tuple::T, x::GAPGroupElem) where T <: Tuple | |
on_tuples(tuple::Tuple{Vararg{T}}, x::GAPGroupElem) where T |
Going beyond this (and perhaps beyond this PR): as mentioned already, for tuples, it'd also be natural to just define a ^
method directly, as it is "clear" how to act on that. Just as I'd argue that the default action for a vector ought to be OnRight, for a Set
or BitSet
OnSets etc. -- and then nested, i.e. a Set{Set{Int}}
suggest OnSetsSets
, while Set{Tuple{Vararg{Int8}}}
suggests OnSetsTuples
etc.
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.
In my variant, the tuple need not be homogeneous, and it is simpler to create the result object of the right type.
src/Groups/action.jl
Outdated
""" | ||
on_points(pnt::GAP.GapObj, x::GAPGroupElem) = GAP.Globals.OnPoints(pnt, x.X) | ||
|
||
on_points(pnt::GAPGroupElem, x::GAPGroupElem) = inv(x) * pnt * 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.
That's inefficient, e.g. for permutations, conjugation can be computed much more efficiently than that. So I think it really should be this:
on_points(pnt::GAPGroupElem, x::GAPGroupElem) = inv(x) * pnt * x | |
on_points(pnt::GAPGroupElem, x::GAPGroupElem) = pnt ^ x |
src/Groups/action.jl
Outdated
""" | ||
on_points(pnt::GAP.GapObj, x::GAPGroupElem) | ||
on_points(pnt::GAPGroupElem, x::GAPGroupElem) | ||
on_points(pnt::Int, x::PermGroupElem) |
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.
Honest question: What is the purpose in having on_points
over just using :^
? I.e. where one passes on_points
as argument, couldn't one just pass ^
instead? It's quite likely I am missing something, but what? Note that I occasionally wonder the same about GAP.
src/Groups/action.jl
Outdated
""" | ||
on_right(pnt::GAP.GapObj, x::GAPGroupElem) | ||
on_right(pnt::GAPGroupElem, x::GAPGroupElem) | ||
on_right(v::Vector{T}, x::MatrixGroupElem) 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.
As for OnPoints
/ on_points
, what is the advantage of having on_right
, as compared to just passing :*
as "the action" whenever needed?
@ThomasBreuer I just realized that I actually already left some feedback here, so waiting for your reply here now :-) |
@ThomasBreuer do you plan to update this PR? |
@fingolfin Yes. |
This is a first attempt to introduce action functions. Once it is clear that this idea is o.k., more such functions have to follow, more methods have to be provided (for example `on_right` for right cosets and group elements), and then functions for orbits, stabilizers, induced permutations, etc. can be added. For example, `on_right`
- added a description what this is about - define `^` as default action of permutations on (pos.) integers - added natural action of permutations on multivariate polynomials by permuting indeterminates - do not introduce `on_points`, `on_right`
on_indeterminates(f::GAP.GapObj, p::PermGroupElem) | ||
on_indeterminates(f::Nemo.MPolyElem{T}, p::PermGroupElem) where T | ||
|
||
Returns the image of `f` under `p`, w.r.t. permuting the indeterminates |
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.
Returns the image of `f` under `p`, w.r.t. permuting the indeterminates | |
Return the image of `f` under `p`, w.r.t. permuting the indeterminates |
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, thanks for the hint.
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.
Looks OK to me. I still would like us to also install default methods for ^ for acing on Tuple
, Set
, etc. "in the usual way", but that doesn't have to hold up this PR. Also, we'll still need dedicated actions anyway. E.g. when acting on a tuple or vector, while I'd consider on_tuples
the "default", of course one could also act by permuting the tuple entries (on_positions
? on_indices
?)
Also, this should be consolidated with the to-be-fleshed-out concept of G-sets, but again, no need to hold this up for now.
Merge this at will?
On Fri, Sep 04, 2020 at 01:41:43AM -0700, Max Horn wrote:
@fingolfin approved this pull request.
Looks OK to me. I still would like us to also install default methods for ^ for acing on `Tuple`, `Set`, etc. "in the usual way", but that doesn't have to hold up this PR. Also, we'll still need dedicated actions anyway. E.g. when acting on a tuple or vector, while I'd consider `on_tuples` the "default", of course one could also act by permuting the tuple entries (`on_positions`? `on_indices`?)
Also, this should be consolidated with the to-be-fleshed-out concept of G-sets, but again, no need to hold this up for now.
Merge this at will?
Yep. at will....
…
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#127 (review)
|
@fingolfin I do not understand your latest comment. The default methods for |
@ThomasBreuer Sorry for the confusion. Apparently I was looking at an outdated version of the PR. I've force-reloaded and now see those |
Closing and re-opening to re-run the tests |
This is a first attempt to introduce action functions.
Once it is clear that this idea is o.k.,
more such functions have to follow, more methods have to be provided
(for example
on_right
for right cosets and group elements),and then functions for orbits, stabilizers, induced permutations, etc.
can be added.