Skip to content

Commit b7cf604

Browse files
committed
don't use virtual chars in Molien series computation
Also, add a test that domains are correctly handled
1 parent bb7ee85 commit b7cf604

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
@@ -4666,17 +4666,23 @@ def molien_series(self):
46664666
sage: G = PermutationGroup([[(2,)]])
46674667
sage: G.molien_series()
46684668
1/(x^2 - 2*x + 1)
4669-
"""
4670-
pi = self._libgap_().NaturalCharacter()
4671-
# because NaturalCharacter forgets about fixed points:
4672-
pi += self._libgap_().TrivialCharacter() * len(self.fixed_points())
46734669
4674-
# TODO: pi is a Character from a CharacterTable on self, however libgap
4675-
# does not know about this type and when adding two Characters just
4676-
# returns a plain List; this needs to be fixed on the libgap side but
4677-
# in the meantime we can fix by converting pi back to the right type
4678-
pi = libgap.VirtualCharacter(self._libgap_().CharacterTable(), pi)
4670+
TESTS:
4671+
4672+
Check that :trac:`34854` is fixed::
4673+
4674+
sage: PG = PermutationGroup(["(1,2,3,4,5,6,7)","(5,6,7)"])
4675+
sage: PG.molien_series()
4676+
(-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)
46794677
4678+
and 2 extra fixed points are correctly accounted for::
4679+
4680+
sage: PG1 = PermutationGroup(["(9,2,3,4,5,6,7)","(5,6,7)"])
4681+
sage: R.<x> = QQ[]
4682+
sage: PG.molien_series() == PG1.molien_series()*(1-x)^2
4683+
True
4684+
"""
4685+
pi = self._libgap_().PermutationCharacter(list(self.domain()),libgap.OnPoints)
46804686
M = pi.MolienSeries()
46814687

46824688
R = QQ['x']

0 commit comments

Comments
 (0)