bug in computing Sylow p-subgroups

16 views
Skip to first unread message

Kenny Brown

unread,
Jul 27, 2010, 10:36:31 PM7/27/10
to sage-support
I seem to have discovered an error with the wrapper to the GAP
function SylowSubgroup.

sage: n = 3^2 * 7^2
sage: G = CyclicPermutationGroup(n)

So far, so good. However,

sage: G.sylow_subgroup(3)
------------------------------------------------------------
File "<string>", line 1
[(1,344,246,148,50,393,295,197,99,),
(2,345,247,149,51,394,296,198,100,),
(3,346,248,150,52,395,297,199,101,),
(4,347,249,151,53,396,298,200,102,),
(5,348,250,152,54,397,299,201,103,),
(6,349,251,153,55,398,300,202,104,),
(7,350,252,154,56,399,301,203,105,),
(8,351,253,155,57,400,302,204,106,),
(9,352,254,156,58,401,303,205,107,),
(10,353,255,157,59,402,304,206,108,),
(11,354,256,158,60,403,305,207,109,),
(12,355,257,159,61,404,306,208,110,),
(13,356,258,160,62,405,307,209,111,),
(14,357,259,161,63,406,308,210,112,),
(15,358,260,162,64,407,309,211,113,),
(16,359,261,163,65,408,310,212,114,),
(17,360,262,164,66,409,311,213,115,),
(18,361,263,165,67,410,312,214,116,),
(19,362,264,166,68,411,313,215,117,),
(20,363,265,167,69,412,314,216,118,),
(21,364,266,168,70,413,315,217,119,),
(22,365,267,169,71,414,316,218,120,),
(23,366,268,170,72,415,317,219,121,),([...],)]

^
SyntaxError: invalid syntax

That's exactly how the error shows up in the console. A similar error
occurs when trying to find the Sylow 7-subgroup. However, the
following works fine:

sage: H = CyclicPermutationGroup(2^2 * 3^2)
sage: H.sylow_subgroup(2)
Permutation Group with generators [(1,10,19,28)(2,11,20,29)(3,12,21,30)
(4,13,22,31)(5,14,23,32)(6,15,24,33)(7,16,25,34)(8,17,26,35)
(9,18,27,36), (1,19)(2,20)(3,21)(4,22)(5,23)(6,24)(7,25)(8,26)(9,27)
(10,28)(11,29)(12,30)(13,31)(14,32)(15,33)(16,34)(17,35)(18,36)]

Simon King

unread,
Jul 28, 2010, 4:01:13 AM7/28/10
to sage-support
Hi Kenny,

On 28 Jul., 04:36, Kenny Brown <im.self.emplo...@gmail.com> wrote:
> ...
> sage: G.sylow_subgroup(3)
> ------------------------------------------------------------
>    File "<string>", line 1
>      [(1,344,246,148,50,393,295,197,99,),
> (2,345,247,149,51,394,296,198,100,),
> ...
> (22,365,267,169,71,414,316,218,120,),
> (23,366,268,170,72,415,317,219,121,),([...],)]

Thank you for the report.

I just had a look at the source code. In the sylow_subgroup method, it
is attempted to get a string representation of a permutation in GAP,
and to translate this into a permutation in Sage. Problem:
gap.eval("gen[%d];"%j) (this is the line were the error occurs) yields
a string, but it is mutilated by ([...],), as shown in the error
message.

I think a solution would be to use gap.eval("Print(gens[1]);")
instead. I'll try this, and create a trac ticket for it.

Cheers,
Simon

Simon King

unread,
Jul 28, 2010, 4:29:27 AM7/28/10
to sage-support
On 28 Jul., 10:01, Simon King <simon.k...@nuigalway.ie> wrote:
> I think a solution would be to use gap.eval("Print(gens[1]);")
> instead. I'll try this, and create a trac ticket for it.

One more issue: The method creates quite common variable names (gens,
G, N) in the GAP interface. This can have very nasty side effects,
because these names could easily be chosen by a user as well.

I resolved it in ticket #9621, which is ready for review (hint...). It
uses your example as doctest.

Cheers,
Simon
Reply all
Reply to author
Forward
0 new messages