[sage-support] Re: remote mathematica, magma and so on

2007-08-14 Thread Jack Schmidt

You can just put a shell script in $SAGE_ROOT/local/bin/math (or
whatever the binary name is supposed to be) with the contents:

#!/bin/sh
exec ssh -t [EMAIL PROTECTED] math
$*

You need to setup some sort of password-less authentication from your
laptop to the mathematica server if you have not already.  There are
lots of simple ways to do this. Two easy and elementary ways are the
ControlMaster option or the program ssh-agent, as described in the man
pages for ssh_config and ssh-agent.

I don't have access to mathematica, but this works for gap, kash, and
magma.

On Aug 14, 4:48 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> i know about ssh tunneling and so on but i am posting this on sage-
> support...
> the point was to have a sage session on my laptop interacting with a
> remote mathematica (for instance)
> paul
>
> On Aug 14, 9:09 pm, Chris Chiasson <[EMAIL PROTECTED]> wrote:
>
> > you can use mathematica remotely anyway
> > method 1: remote kernel (don't know if mathplayer can be made to
> > connect to one of these)
> > method 2: ssh tunneling, possibly with x windows (this should work,
> > but you will probably need to learn a lot to make it work)
>
> > plain method:
> > ssh and execute
> > math
> > to enter a mathematica terminal mode session (sans front end)
>
> > On Aug 14, 12:40 pm, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > hi all
> > > i was wondering if anyone had already implemented this:
> > > my computing setup is not the greatest. i don't pay for mathematica or
> > > magma so i don't have them available on my laptop. on the other hand
> > > my university does pay for them, and i have a user account on the
> > > machines where they are run. but then those machines don't have a very
> > > current version of sage...
> > > so i was curious whether it would be possible to have sage run
> > > mathematica on a remote server and interact with it just as if it was
> > > also installed on my machine?
> > > thanks
> > > paul


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Cayley graphs in SAGE

2007-08-06 Thread Jack Schmidt

Yup, but the C = line was missing:

gens = [(1,2),(2,3)]
G = PermutationGroup(gens)._gap_()
C = G.CayleyGraph(G.GeneratorsOfGroup())
E = C.UndirectedEdges()
V = C.Vertices().Elements()
L = [sum([[y[i] for y in [x for x in E if v in x] if y[i]!=v]
for i in range(1,len(gens)+1)],[]) for v in V]
d = dict(zip(V,L))
Gamma = Graph(d)
show(Gamma.plot())

Can you color the edges based on which generator?  Would directed
edges be prettier for higher order elements?

On Aug 6, 12:19 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
> Thanks very much Jack. I think the following code works generally,
> doesn't it?
>
> sage: gens = [(1,2),(2,3)]
> sage: G = PermutationGroup(gens)._gap_()
> sage: E = C.UndirectedEdges()
> sage: V = C.Vertices().Elements()
> sage: L = [sum([[y[i] for y in [x for x in E if v in x] if y[i]!=v]
> for i in range(1,len(gens)+1)],[]) for v in V]
> sage: d = dict(zip(V,L))
> sage: Gamma = Graph(d)
> sage: show(Gamma.plot())
>
> On 8/6/07, Jack Schmidt <[EMAIL PROTECTED]> wrote:
>
>
>
> > The gap.eval's can be removed like this:
>
> > C3 = CyclicPermutationGroup(3)._gap_()
> > C = C3.CayleyGraph(C3.GeneratorsOfGroup())
> > V = C.Vertices().Elements()
> > E = C.UndirectedEdges()
> > L = [[y[1] for y in [x for x in E if v in x] if y[1]!=v]+[y[2]
> > for y in [x for x in E if v in x] if y[2]!=v] for v in V]
> > d = dict(zip(V,L))
> > G = Graph(d)
> > show(G.plot())
>
> > GAP lists are indexed from 1, not 0, so I changed the line for L.
> > This was needed to get it to work onhttps://sage.math.washington.edu:8103/
>
> > On Aug 6, 7:46 am, "David Joyner" <[EMAIL PROTECTED]> wrote:
> > > Here is an example of constructing a Cayley graph in SAGE (this uses 
> > > grape):
>
> > > sage: gap.eval("C := CayleyGraph(Group([(1,2,3)]),[(1,2,3)])")
> > > 'rec( isGraph := true, order := 3, group := Group([ (1,2,3) ]), \n
> > > schreierVector := [ -1, 1, 1 ], adjacencies := [ [ 2, 3 ] ], \n
> > > representatives := [ 1 ], names := [ (), (1,2,3), (1,3,2) ], \n
> > > isSimple := true )'
> > > sage: V = eval(gap.eval("Elements(Vertices(C))"))
> > > sage: E = eval(gap.eval("UndirectedEdges(C)"))
> > > sage: L = [[y[0] for y in [x for x in E if v in x] if y[0]!=v]+[y[1]
> > > for y in [x for x in E if v in x] if y[1]!=v] for v in V]
> > > sage: d = dict(zip(V,L))
> > > sage: G = Graph(d)
> > > sage: show(G.plot())
>
> > > Question: Can anyone this of a simpler way to do this?
>
> > > - David Joyner


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Cayley graphs in SAGE

2007-08-06 Thread Jack Schmidt

The gap.eval's can be removed like this:

C3 = CyclicPermutationGroup(3)._gap_()
C = C3.CayleyGraph(C3.GeneratorsOfGroup())
V = C.Vertices().Elements()
E = C.UndirectedEdges()
L = [[y[1] for y in [x for x in E if v in x] if y[1]!=v]+[y[2]
for y in [x for x in E if v in x] if y[2]!=v] for v in V]
d = dict(zip(V,L))
G = Graph(d)
show(G.plot())

GAP lists are indexed from 1, not 0, so I changed the line for L.
This was needed to get it to work on https://sage.math.washington.edu:8103/

On Aug 6, 7:46 am, "David Joyner" <[EMAIL PROTECTED]> wrote:
> Here is an example of constructing a Cayley graph in SAGE (this uses grape):
>
> sage: gap.eval("C := CayleyGraph(Group([(1,2,3)]),[(1,2,3)])")
> 'rec( isGraph := true, order := 3, group := Group([ (1,2,3) ]), \n
> schreierVector := [ -1, 1, 1 ], adjacencies := [ [ 2, 3 ] ], \n
> representatives := [ 1 ], names := [ (), (1,2,3), (1,3,2) ], \n
> isSimple := true )'
> sage: V = eval(gap.eval("Elements(Vertices(C))"))
> sage: E = eval(gap.eval("UndirectedEdges(C)"))
> sage: L = [[y[0] for y in [x for x in E if v in x] if y[0]!=v]+[y[1]
> for y in [x for x in E if v in x] if y[1]!=v] for v in V]
> sage: d = dict(zip(V,L))
> sage: G = Graph(d)
> sage: show(G.plot())
>
> Question: Can anyone this of a simpler way to do this?
>
> - David Joyner


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Bug in combinatorics package

2007-06-30 Thread Jack Schmidt

In sage 2.6 on a 64bit AMD machine running debian I get:

sage: number_of_partitions(147007)-number_of_partitions_list(147007)
3

In SAGE's Pari/GP:
? numbpart(147007) % 1000
%1 = 536


On a 32bit ubuntu machine I get the majority answer (533) from
everyone: the vendor supplied Pari/GP, from SAGE, and from GAP.



On Jun 30, 5:29 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
> Thank you for you bug report. The function
> number_of_partitions is not in combinat, though it
> is mentioned there in the documentation. The combinat contains
> mostly GAP and Maxima wrappers. The number_of_partitions
> is actually contained in rings/arith.py and is a PARI
> wrapper.
>
> That said, the corresponding GAP function, number_of_partition_list,
> *is* wrapped in combinat.py and yields the same answer:
>
> sage: number_of_partitions_list(147007)-number_of_partitions(147007)
> 0
>
> So, according to your calculation (I don't have Mma to check it),
> either Mma and Combinatorica are both wrong or
> GAP and Pari are both wrong.
>
> ++
>
> On 6/30/07, Jonathan Hseu <[EMAIL PROTECTED]> wrote:
>
>
>
> > Here's an example to reproduce the bug (on Linux x86-64):
>
> > from sage.combinat.combinat import *
> > x=147007
> > number_of_partitions(x)==mathematica('PartitionsP['+str(x)+']')
> > >>False
> > x=147006
> > number_of_partitions(x)==mathematica('PartitionsP['+str(x)+']')
> > >>True
>
> > That's the exact point at which mathematica and sage disagree on the
> > number of partitions.  I verified through another source that
> > mathematica is correct (using Combinatorica... unless both turn out to
> > be wrong).
>
> > Thanks,
> > Jonathan Hseu


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---