Cathy Kriloff

172 days ago by WilliamStein

%gap s := (1,2,3)*(2,5) 
       
(1,5,2,3)
(1,5,2,3)
       
Traceback (click to the left of this block for traceback)
...
NameError: name 's' is not defined
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_8.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmp6FTGMT/___code___.py", line 2, in <module>
    exec compile(u's
  File "", line 1, in <module>
    
NameError: name 's' is not defined
t = gap('s') 
       
print t 
       
(1,5,2,3)
(1,5,2,3)
type(t) 
       
<class 'sage.interfaces.gap.GapElement'>
<class 'sage.interfaces.gap.GapElement'>
t.Order() 
       
4
4
%gap Order(s) 
       
4
4
t = gap('(1,2,3)*(2,5)(7,13)') 
       
       
( 1, 5, 2, 3)( 7,13)
( 1, 5, 2, 3)( 7,13)
t.name() 
       
'$sage2'
'$sage2'
PermutationGroup([t]) 
       
Permutation Group with generators [(1,5,2,3)(7,13)]
Permutation Group with generators [(1,5,2,3)(7,13)]
 
       
gap.eval('a := 2 + 3;\nb := a+1; b') 
       
'5\n6\n6'
'5\n6\n6'
%gap Print(a) 
       
5
5
       
(1,5,2,3)
(1,5,2,3)
       
(1,5,2,3)
(1,5,2,3)