I'm no expert, but for installation you could try
sage -gap [[[whatever it takes to install packages normally]]]
- Robert
> Well, I'm not sure how to normally install it. The directions are on
> the author's site (http://www.math.wayne.edu/~kaym/research/), and say
> to download a folder, then
>
> "The files appear in a subdirectory called "braid". Open a GAP window
> and type
> Read("assemble.g"). This reads all the program files."
>
> I've downloaded the folder, and that's where I've been stuck.
Are you using Sage via the notebook, or the command line? If from the
command line, cd into the directory you downloaded, and then run sage
there.
sage: gap('Read("assemble.g")')
I would imagine that would do the trick. If from the notebook, you
might have to
sage: os.chdir("/path/to/files")
sage: gap('Read("assemble.g")')
- Robert
Instead, just do
sage: gap.eval('Read("assemble.g")')
William
Try
sage: gap.eval("Braid(g,t)")
> I can run Braid in 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)")
Gap and Sage each have their own environments. The Braid package lives
entirely inside Gap, and can't be directly called with things in the
Sage environment, Sage can just ask Gap to do things in the Gap
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 the gap environment, call gap's
Braid() on them, then return the result.
- Robert
>
> 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: Gap produced error output
> Error, no 1st choice method found for `IsConjugate' on 3 arguments
>
> executing Braid($sage9,$sage16);
Hmm... Not sure about this. I'm guessing t is not the right thing.
> 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.
Yes, that should be
sage: gap.eval("Braid(%s,%s)" % (gap(g), gap(t)) )
But will probably give the same error. Is this what t is supposed to
be in GAP?
sage: t = [(2,1),(2,1)]
sage: gap(t)
[ [ 2, 1 ], [ 2, 1 ] ]
Or did you want something like
sage: sage: g = SymmetricGroup(3)
sage: t = [g((2,1)), g((3,1))] # let t be a list of group elements
(not a list of tuples)
sage: gap(t)
[ (1,2), (1,3) ]
sage: gap.Braid(g,t) # this is more likely to work
Sorry this is so rough around the edges. Usually what happens is
someone wraps the functionality nicely, so all this happens behind the
scenes and it "just works," but that obviously hasn't happened for the
Braids package.
- Robert