Ask Your Question
0

Gap Length error when Length not called

asked 2015-07-19 22:23:02 +0100

AreaMan gravatar image

updated 2015-07-19 22:33:41 +0100

Running the code below gives me an error:

Sg = [];
G = gap.SmallGroup(12,3);
for g in G:
        Sg.append(g);
Sg;

Error:

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

  File "/private/var/folders/1p/k79gxccd5r538784rqx_15fh0000gt/T/tmpc0eEFP/___code___.py", line 5, in <module>
    for g in G:
  File "/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 642, in __iter__
    for i in range(1, len(self)+1):
  File "/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 1014, in __len__
    return int(self.Length())
  File "/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 588, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 896, in function_call
    ['%s=%s'%(key,value.name()) for key, value in kwds.items()])))
  File "/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 570, in eval
    result = Expect.eval(self, input_line, **kwds)
  File "/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 1224, in eval
    for L in code.split('\n') if L != ''])
  File "/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 769, in _eval_line
    raise RuntimeError(message)
RuntimeError: Gap produced error output
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `Length' on 1 arguments

   executing Length($sage3);

How can I fix this?

I want to do elementary operations and comparisons with elements of the GAP group G, and then store them in a list and do further comparisons.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-07-19 23:09:08 +0100

AreaMan gravatar image

I resolved this by making the group into a permutation group:

H = gap.SmallGroup(order,i);
G = PermutationGroup(gap_group = gap.Image(gap.IsomorphismPermGroup(H)));
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-19 22:23:02 +0100

Seen: 349 times

Last updated: Jul 19 '15