Ask Your Question

Gap Length error when Length not called

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

AreaMan gravatar image

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

Running the code below gives me an error:

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


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

  File "/private/var/folders/1p/k79gxccd5r538784rqx_15fh0000gt/T/tmpc0eEFP/", line 5, in <module>
    for g in G:
  File "/Applications/", line 642, in __iter__
    for i in range(1, len(self)+1):
  File "/Applications/", line 1014, in __len__
    return int(self.Length())
  File "/Applications/", line 588, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
  File "/Applications/", line 896, in function_call
    ['%s=%s'%(key, for key, value in kwds.items()])))
  File "/Applications/", line 570, in eval
    result = Expect.eval(self, input_line, **kwds)
  File "/Applications/", line 1224, in eval
    for L in code.split('\n') if L != ''])
  File "/Applications/", 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

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

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


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

Seen: 308 times

Last updated: Jul 19 '15