matrix(Permutation('(1,2,3,4)'))
PermutationGroup([(1,2,3,4)]).gens()[0].matrix()
Another bug with PermutationGroup:{{g1,g2 = PermutationGroup([(1,2,3,4), (1,3,2,4)]).gens()
(g1*g2)(3), g1(g2(3))}}should gives two times the same result, but it is not the case...The action of the group on {1,2,3,4} is not an action !
Le lundi 15 juin 2020 16:58:18 UTC+2, Paul Mercat a écrit :Hi !Sage doesn't compute correctly the matrix of a Permutation:
matrix(Permutation('(1,2,3,4)'))
return a wrong answer: it returns the inverse of the correct result.
The product of matrices of permutations must be equal to the matrix of the composition.If we do:
PermutationGroup([(1,2,3,4)]).gens()[0].matrix()
then we get the correct result.
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/e4095a01-08f8-4aa1-924d-2c4494aeddd3o%40googlegroups.com.
On Mon, Jun 15, 2020 at 11:21 AM 'Paul Mercat' via sage-devel <sage-...@googlegroups.com> wrote:Another bug with PermutationGroup:{{g1,g2 = PermutationGroup([(1,2,3,4), (1,3,2,4)]).gens()
(g1*g2)(3), g1(g2(3))}}should gives two times the same result, but it is not the case...The action of the group on {1,2,3,4} is not an action !Did you mean to say the action on {1,2,3,4} is not a left action?Some prefer right actions....
--
Le lundi 15 juin 2020 16:58:18 UTC+2, Paul Mercat a écrit :Hi !Sage doesn't compute correctly the matrix of a Permutation:
matrix(Permutation('(1,2,3,4)'))
return a wrong answer: it returns the inverse of the correct result.
The product of matrices of permutations must be equal to the matrix of the composition.If we do:
PermutationGroup([(1,2,3,4)]).gens()[0].matrix()
then we get the correct result.
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/fa42b74e-c614-426e-96c3-bd7fe48ad4d4o%40googlegroups.com.
Thank you for your answers.It's very confusing to write a right action to the left : we write g(i) and not (i)g.By default it should be a left action.And its very confusing that PermutationGroup and Permutation doesn't give the same matrix for the same permutation.
I think that Sage should be coherent with itself as much as possible, and that it should choose the most natural convention.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/fa42b74e-c614-426e-96c3-bd7fe48ad4d4o%40googlegroups.com.
This is turning into a political discussion:-) I'm not taking sides!You can say something similar about left-kernels vs right-kernels ofmatrices, about left-eigenvectors vs right-eigenvectors. Differentlinear algebra textbooks are different. Likewise, for permutationsacting on the left vs the right. Different group theory textbooks aredifferent.Personally, I find it easier to get used to what is coded up than to rewrite code:-)
There's obviously the choice for letting permutations/matrices on the left/right, but I think there's a definite preferred choice for how to convert to a permutation matrix: the one that makes it a homomorphism. And for that, "Permutation" fails presently:sage: matrix(Permutation('(1,2,3)')*Permutation('(1,3)')) == matrix(Permutation('(1,2,3)'))*matrix(Permutation('(1,3)'))
False
so, "Permutation" objects aren't really meant to be a group:
For several more points of view (some articulated by people on the current thread), see also the (long) discussion that the ticket you mention led to on this forum, seven years ago: https://groups.google.com/forum/#!topic/sage-devel/tAAb42Edh9o
so, "Permutation" objects aren't really meant to be a group:I think this is the salient point. Is there any documentation that already has matrix(Permutation(...)) ?
That's quite a thread. One thing I'd like to highlight from there that didn't seem to get so much traction is a point Marco Streng made about possible notations for right actions:If G is a group acting on the right on a ring R, and a,b in R and s in G then denoting right-action by right-multiplication has a problem:(a*b)*s would suggest it's equal to a*(b*s), which it is generally not. Exponential notation (a*b)^s does not suffer from this problem. That disqualifies right-multiplication as a general notation for right-actions to me.
Am Dienstag, 16. Juni 2020 19:03:40 UTC+2 schrieb Nils Bruin:That's quite a thread. One thing I'd like to highlight from there that didn't seem to get so much traction is a point Marco Streng made about possible notations for right actions:If G is a group acting on the right on a ring R, and a,b in R and s in G then denoting right-action by right-multiplication has a problem:(a*b)*s would suggest it's equal to a*(b*s), which it is generally not. Exponential notation (a*b)^s does not suffer from this problem. That disqualifies right-multiplication as a general notation for right-actions to me.I would also be in favor of using a different notation for actions. My suggestion would be to use the shift operator << to denote right actions and, similarly, the right shift operator >> for left actions. This makes it explicit what kind operation is intended; for example, `a*b << s*t` and `a*b << s << t` would do exactly what one expects.
I assume that would need a pretty major change in the preparser? Does other mathematical software use this as a convention? (Just asking, no presuppositions here.)
I would like to vote for exponentiation for a right group action. This is standard mathematical notation (as has already been said), at least in several fields that I know of. Using the shift operators looks too much like a computer-sciency solution to me. Sage has always tried to keep its notation close to what a mathematician (including students) would expect -- for example (almost the only one), re-purposing ^ to mean exponentiation rather than the python default.
All students learning permutations get confused about the order of multiplcation and just need to learn that there are two conventions and you *have to* know which is being used when you read something since otherwise half of what you read will not make sense.When I was a student I had two tutors who I handed work in to each week. One was (is) a group theorist (https://en.wikipedia.org/wiki/Peter_M._Neumann) for whom we had to write xf for the result of applying function f to object x, so fg meant "do f then g". The other was/is an analyst who only allowed f(x) and the other convention. I had to keep both happy (and get the right answers) so I leant fast.John
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/a0d38f53-cbf0-4667-9ba1-ab6a3b0c48dbo%40googlegroups.com.
My problem is that if a group acts on itself, conjugation actions (be
it h|->ghg^-1 or h|->g^-1 hg)
are vastly different from regular actions (left or right).
How are you going to use '^' for both?
All this disappears once we are happy using functions with two parameters as "action operation":left = G.acting_on_the_left_on(M) # or left = M.left_action_by(G)left(g,m)left = G.acting_on_the_right_on(M) # or left = M.right_action_by(G)
right(m,g)
sage: G = SymmetricGroup(3)
sage: M = MatrixSpace(QQ, 3)
sage: right = coercion_model.get_action(M, G)
sage: right(M.diagonal_matrix([1,2,3]), G('(2,3)')) # with #29808
⎛1 0 0⎞
⎜0 0 2⎟
⎝0 3 0⎠
sage: class CallAction(sage.categories.action.Action):
....: def _act_(self, g, a):
....: return g(a)
sage: G = SymmetricGroup(3); g, h = G('(1,2,3)'), G('(2,3)')
sage: right = CallAction(G, ZZ, is_left=False, op=operator.pow)
sage: right(right(1, g), h)
3
sage: ZZ._unset_coercions_used()
sage: ZZ.register_action(right)
sage: (1 ^ g) ^ h
3
sage: 1 ^ (g * h)
3