I'd like to do it this way, running everything through sage, but it
doesn't work. Here is what I'm getting:
sage: g = SymmetricGroup(3)
sage: t = [(2,1),(2,1)]
sage: gap.Braid(g,t)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
/Users/adamsorkin/Desktop/braid_dir/<ipython console> in <module>()
/Applications/sage/local/lib/python2.5/site-packages/sage/interfaces/
expect.pyc in __call__(self, *args, **kwds)
1356
1357 def __call__(self, *args, **kwds):
-> 1358 return self._parent.function_call(self._name, list
(args), kwds)
1359
1360 def _sage_doc_(self):
/Applications/sage/local/lib/python2.5/site-packages/sage/interfaces/
gap.pyc in function_call(self, function, args, kwds)
883 self.eval('$__SAGE_LAST__ := %s;;'%marker)
884 res = self.eval("%s(%s)"%(function, ",".join([s.name()
for s in args]+
--> 885 ['%s=%s'%
(key,value.name()) for key, value in kwds.items()])))
886
887 if gap.eval('last') != marker:
/Applications/sage/local/lib/python2.5/site-packages/sage/interfaces/
gap.pyc in eval(self, x, newlines, strip, **kwds)
478 input_line += ';'
479
--> 480 result = Expect.eval(self, input_line, **kwds)
481
482 if not newlines:
/Applications/sage/local/lib/python2.5/site-packages/sage/interfaces/
expect.pyc in eval(self, code, strip, synchronize, locals, **kwds)
973 try:
974 with gc_disabled():
--> 975 return '\n'.join([self._eval_line(L, **kwds)
for L in code.split('\n') if L != ''])
976 except KeyboardInterrupt:
977 # DO NOT CATCH KeyboardInterrupt, as it is being
caught
/Applications/sage/local/lib/python2.5/site-packages/sage/interfaces/
gap.pyc in _eval_line(self, line, allow_use_file, wait_for_prompt)
720 return ''
721 else:
--> 722 raise RuntimeError, message
723
724 except KeyboardInterrupt:
RuntimeError: Gap produced error output
Error, no 1st choice method found for `IsConjugate' on 3 arguments
executing Braid($sage9,$sage16);
I get a different error using
gap.eval("Braid(%s,%s)" % gap(g), gap(t))
Specifically,
sage: gap.eval("Braid(%s,%s)" % gap(g), gap(t) )
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/adamsorkin/Desktop/braid_dir/<ipython console> in <module>()
TypeError: not enough arguments for format string
Perhaps this one is easier to fix.
Adam
On Nov 6, 11:21 am, Robert Bradshaw <[email protected]>
wrote:
> On Nov 6, 2009, at 11:07 AM, Adam Sorkin wrote:
>
> > I can runBraidin gap_console() inside of Sage. Trying to run it in
> > Sage proper gives gives the following run-time error:
>
> > sage:gap.eval('Read("assemble.g")')
> > ''
> > sage: g=SymmetricGroup(3)
> > sage: t=[(2,1),(2,1),(2,1),(2,1)]
> > sage:gap.eval("Braid(g,t)")
>
> Gapand Sage each have their own environments. TheBraidpackage lives
> entirely insideGap, and can't be directly called with things in the
> Sage environment, Sage can just askGapto do things in theGap
> environment. What you can do is
>
> sage: g=SymmetricGroup(3)
> sage: t=[(2,1),(2,1),(2,1),(2,1)]
> sage:gap.eval("Braid(%s,%s)" %gap(g),gap(t))
>
> Even easier, you can do
>
> sage:gap.Braid(g, t)
>
> which will create copies of g and t in thegapenvironment, callgap's Braid()
> on them, then return the result.
>
> - Robert
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---