Skip to content

Commit 6a8155e

Browse files
author
Release Manager
committed
Trac #34854: molien_series() should not use GAP's VirtualCharacter
One can use GAP's PermutationCharacter() to avoid the troubles. Currently we have a problem here: {{{ sage: PG = PermutationGroup(["(1,2,3,4,5,6,7)","(5,6,7)"]) sage: PG.molien_series() ... weird error... }}} see the report in https://groups.google.com/d/msgid/sage-devel/42c6be87 -614e-4a21-9273-91948f0c6216n%40googlegroups.com URL: https://trac.sagemath.org/34854 Reported by: dimpase Ticket author(s): Dima Pasechnik Reviewer(s): Travis Scrimshaw
2 parents dddf3ca + b7cf604 commit 6a8155e

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/sage/groups/perm_gps/permgroup.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4665,17 +4665,23 @@ def molien_series(self):
46654665
sage: G = PermutationGroup([[(2,)]])
46664666
sage: G.molien_series()
46674667
1/(x^2 - 2*x + 1)
4668-
"""
4669-
pi = self._libgap_().NaturalCharacter()
4670-
# because NaturalCharacter forgets about fixed points:
4671-
pi += self._libgap_().TrivialCharacter() * len(self.fixed_points())
46724668
4673-
# TODO: pi is a Character from a CharacterTable on self, however libgap
4674-
# does not know about this type and when adding two Characters just
4675-
# returns a plain List; this needs to be fixed on the libgap side but
4676-
# in the meantime we can fix by converting pi back to the right type
4677-
pi = libgap.VirtualCharacter(self._libgap_().CharacterTable(), pi)
4669+
TESTS:
4670+
4671+
Check that :trac:`34854` is fixed::
4672+
4673+
sage: PG = PermutationGroup(["(1,2,3,4,5,6,7)","(5,6,7)"])
4674+
sage: PG.molien_series()
4675+
(-x^18 + x^15 - x^12 + x^9 - x^6 + x^3 - 1)/(x^25 - x^24 - x^23 - x^22 + x^21 + 2*x^20 + x^19 - x^17 - x^16 - x^15 - x^13 + x^12 + x^10 + x^9 + x^8 - x^6 - 2*x^5 - x^4 + x^3 + x^2 + x - 1)
46784676
4677+
and 2 extra fixed points are correctly accounted for::
4678+
4679+
sage: PG1 = PermutationGroup(["(9,2,3,4,5,6,7)","(5,6,7)"])
4680+
sage: R.<x> = QQ[]
4681+
sage: PG.molien_series() == PG1.molien_series()*(1-x)^2
4682+
True
4683+
"""
4684+
pi = self._libgap_().PermutationCharacter(list(self.domain()),libgap.OnPoints)
46794685
M = pi.MolienSeries()
46804686

46814687
R = QQ['x']

0 commit comments

Comments
 (0)