# Subgroups of Linear Groups

I want to find the subgroup which is generated by two elements.

G = SL(2,GF(3))

D = G.subgroup([G[1],G[2]])

Why do I have this error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_50.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 --\n" + >_support_.preparse_worksheet_cell(base64.b64decode("RyA9IFNMKDIsR0YoMykpCkQgPSBH>LnN1Ymdyb3VwKFtCWzFdLEJbMl1dKQ=="),globals())+"\n"); >execfile(os.path.abspath("___code___.py")) File "", line 1, in <module>

File "/private/var/folders/rp/rpRaJRnOEQyzp4ftzijESU+++TI/-Tmp-/tmpGFGoqT/___code___.py", line 4, in <module> exec compile(u'D = G.subgroup([B[_sage_const_1 ],B[_sage_const_2 ]]) File "", line 1, in <module>

File "parent.pyx", line 620, in sage.structure.parent.Parent.__getattr__ >(sage/structure/parent.c:5943) File "misc.pyx", line 200, in sage.structure.misc.getattr_from_other_class >(sage/structure/misc.c:1427) AttributeError: 'SpecialLinearGroup_finite_field_with_category' object has no >attribute 'subgroup'

edit retag close merge delete

Sort by » oldest newest most voted

put all code a line,it can run normal,your code only choose the first and second gens of 24.better use like :if G.subgroup().gens()==2

G = SL(2,GF(3));D = G.subgroup([G[1],G[2]]);D

Matrix group over Finite Field of size 3 with 2 generators ( [0 1] [0 1] [2 1], [2 2] ) G = SL(2,GF(3)).list();G;len(G)

( [0 1] [0 1] [0 1] [0 2] [0 2] [0 2] [1 0] [1 0] [1 0] [1 1] [2 0], [2 1], [2 2], [1 0], [1 1], [1 2], [0 1], [1 1], [2 1], [0 1],

[1 1] [1 1] [1 2] [1 2] [1 2] [2 0] [2 0] [2 0] [2 1] [2 1] [1 2], [2 0], [0 1], [1 0], [2 2], [0 2], [1 2], [2 2], [0 2], [1 1],

[2 1] [2 2] [2 2] [2 2] [2 0], [0 2], [1 0], [2 1] ) 24

more

You should tell us how B is constructed, otherwise we will not be able to understand where is your problem coming from. As for me, it works as expected:

sage: G = SL(2,GF(3)) ; G
Special Linear Group of degree 2 over Finite Field of size 3
sage: a = G.gens()[0] ; a
[1 1]
[0 1]
sage: H = G.subgroup([a]) ; H
Matrix group over Finite Field of size 3 with 1 generators (
[1 1]
[0 1]
)
sage: a^2 in H
True
sage: G.gens()[1]
[0 1]
[2 0]
sage: G.gens()[1] in H
False

more

It is not working on mu SAGE. I have following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_26.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("RyA9IFNMKDIsR0YoMykpCmEgPSBHLmdlbnMoKVswXSA7IGEKSCA9IEcuc3ViZ3JvdXAoW2FdKSA7IEg="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module> File "/private/var/folders/rp/rpRaJRnOEQyzp4ftzijESU+++TI/-Tmp-/tmpYB4kTc/___code___.py", line 5, in <module> exec compile(u'H = G.subgroup([a]) ; H File "", line 1, in <module> File "parent.pyx", line 620, in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:5943) File "misc

( 2014-01-15 08:09:25 -0500 )edit