See https://trac.sagemath.org/ticket/34854 to fix this.
On Sat, Dec 17, 2022 at 2:01 PM Dima Pasechnik <dimp...@gmail.com> wrote: > > > > On Mon, 12 Dec 2022, 23:58 'Travis Scrimshaw' via sage-devel, > <sage-devel@googlegroups.com> wrote: >> >> The entire computation in PermutationGroup.molien_series() all appears to be >> done in libgap. Sage's wrapper around characters is never really invoked at >> all AFAICS. Here is a curious data point: >> >> sage: PG = PermutationGroup(["(1,2,3,4,5,6,7)","(5,6,7)"]) >> sage: g = PG._libgap_() >> sage: pi = g.NaturalCharacter() >> sage: pi += g.TrivialCharacter() * len(PG.fixed_points()) >> sage: pi2 = libgap.VirtualCharacter(g.CharacterTable(), pi) >> sage: pi2.MolienSeries() >> ( 1-z^3+z^6-z^9+z^12-z^15+z^18 ) / ( >> (1-z^7)*(1-z^5)*(1-z^4)*(1-z^3)^2*(1-z^2)*(1-z) ) >> sage: PG.molien_series() >> (-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) >> >> I just ran the code in PG.molien_series() directly first, and then calling >> it now works. > > > I can't reproduce this, to me it Molien series of a virtual character breaks. > sage: PG = PermutationGroup(["(1,2,3,4,5,6,7)","(5,6,7)"]) > sage: pi = PG._libgap_().NaturalCharacter() > sage: M = libgap.VirtualCharacter(PG._libgap_().CharacterTable(), > pi).MolienSeries() > --------------------------------------------------------------------------- > GAPError Traceback (most recent call last) > Cell In [6], line 1 > ----> 1 M = libgap.VirtualCharacter(PG._libgap_().CharacterTable(), > pi).MolienSeries() > > File /mnt/opt/Sage/sage-dev/src/sage/libs/gap/element.pyx:2678, in > sage.libs.gap.element.GapElement_MethodProxy.__call__() > 2676 return GapElement_Function.__call__(self, * > ([self.first_argument] + list(args))) > 2677 else: > -> 2678 return GapElement_Function.__call__(self, self.first_argument) > 2679 > 2680 > > File /mnt/opt/Sage/sage-dev/src/sage/libs/gap/element.pyx:2524, in > sage.libs.gap.element.GapElement_Function.__call__() > 2522 try: > 2523 sig_GAP_Enter() > -> 2524 sig_on() > 2525 if n == 0: > 2526 result = CALL_0ARGS(self.value) > > GAPError: Error, ^ cannot be used here to compute roots (use `RootInt' > instead?) > sage: pi.MolienSeries() > ( 1-z^3+z^6-z^9+z^12-z^15+z^18 ) / ( > (1-z^7)*(1-z^5)*(1-z^4)*(1-z^3)^2*(1-z^2)*(1-z) ) > > I also don't understand what it means mathematically, Molien series of a > virtual character. Is it just the difference of Molien > series of the respective characters? > Why do you even need a virtual character here - you have a "normal" character. > GAP docs are silent on whether this works, and it seems it does not, at least > in GAP 4.12: > > gap> v:=VirtualCharacter(CharacterTable(PG),-pi); > VirtualCharacter( CharacterTable( Alt( [ 1 .. 7 ] ) ), [ -7, 0, 0, -3, -1, > -1, -4, 0, -2 ] ) > gap> MolienSeries(v); # this hangs for me - so it's a GAP bug, they should > check it out > > As to your example, it might be some caching in (lib)GAP that trips you up: > in GAP docs you see > "The return value of MolienSeries stores a value for the attribute > MolienSeriesInfo (72.12-2)." > > > > >> >> Best, >> Travis >> >> On Friday, December 9, 2022 at 8:49:55 PM UTC+9 dim...@gmail.com wrote: >>> >>> On Fri, Dec 9, 2022 at 2:55 AM 'Travis Scrimshaw' via sage-devel >>> <sage-...@googlegroups.com> wrote: >>> > >>> > By running the code in molien_series() directly in Sage, I can do the >>> > computation, but not by calling the method. So it seems to be something >>> > within Sage with the interface with libgap. >>> >>> not really, it's just the character tables in Sage that need work, for >>> a proper conversion to use libgap - they cause the issue with >>> moilen_series. >>> The following (avoiding Sage's characters all together) works just fine: >>> >>> sage: p=PermutationGroup(["(1,2,3,4,5,6,7)","(5,6,7)"]) >>> sage: >>> ms=libgap(p).PermutationCharacter([1..7],libgap.OnPoints).MolienSeries(); >>> ms >>> ( 1-z^3+z^6-z^9+z^12-z^15+z^18 ) / ( >>> (1-z^7)*(1-z^5)*(1-z^4)*(1-z^3)^2*(1-z^2)*(1-z) ) >>> sage: type(ms) >>> <class 'sage.libs.gap.element.GapElement'> >>> sage: ms.sage() >>> (x_1^18 - x_1^15 + x_1^12 - x_1^9 + x_1^6 - x_1^3 + 1)/(-x_1^25 + >>> x_1^24 + x_1^23 + x_1^22 - x_1^21 - 2*x_1^20 - x_1^19 + x_1^17 + >>> x_1^16 + x_1^15 + x_1^13 - x_1^12 - x_1^10 - x_1^9 - x_1^8 + x_1^6 + >>> 2*x_1^5 + x_1^4 - x_1^3 - x_1^2 - x_1 + 1) >>> sage: type(ms.sage()) >>> <class 'sage.rings.fraction_field_element.FractionFieldElement'> >>> >>> I'm working on https://trac.sagemath.org/ticket/26902 (fixing >>> character tables would be a part of it) - and it needs more hands. >>> Dima >>> > >>> > Best, >>> > Travis >>> > >>> > >>> > On Friday, December 9, 2022 at 8:55:15 AM UTC+9 guru....@gmail.com wrote: >>> >> >>> >> Hi, >>> >> i ran into a bug while trying to compute the molien series of a >>> >> permutation group. >>> >> >>> >> SageMath version 9.3, Release Date: 2021-05-09, Using Python 3.7.10. >>> >> Operating system: Windows 11, 64-bit >>> >> >>> >> It works fine for most permutation groups but calling: >>> >> >>> >> PermutationGroup(["(1,2,3,4,5,6,7)","(5,6,7)"]).molien_series() >>> >> >>> >> gives an GAP Error which doesn't make sense to me in the given context. >>> >> >>> >> GAPError: Error, ^ cannot be used here to compute roots (use `RootInt' >>> >> instead?) >>> >> >>> >> Similar examples which also produce the same bug are: >>> >> >>> >> PermutationGroup(["(1,2,3,4,5,7)","(5,6,7)"]).molien_series() >>> >> PermutationGroup(["(1,2,3,4,7)","(5,6,7)"]).molien_series() >>> >> PermutationGroup(["(1,2,3,4,7)","(5,7,8)"]).molien_series() >>> >> >>> >> Thanks for looking into it. >>> >> Kind regards, >>> >> Jonas >>> >> >>> >> >>> > -- >>> > 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/2c1fcce4-946f-43cd-9ae4-a04c73434192n%40googlegroups.com. >> >> -- >> 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+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sage-devel/42c6be87-614e-4a21-9273-91948f0c6216n%40googlegroups.com. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq1RRW9s%3D6im6ephXOBQyhwAUhOJbyt7N3VMVBEeffDtwA%40mail.gmail.com.