Macaulay2 » Documentation
Packages » SCSCP :: RemoteObject
next | previous | forward | backward | up | index | toc

RemoteObject -- The class of all remote SCSCP objects

Description

As an example, we store three polynomials on a remote server, compute their product both locally and remotely, and then ask the remote server whether the results are equal. Note that <== and <=== may be used without their first argument if no confusion can arise about the SCSCP server where the computation should take place.
i1 : QQ[x];
i2 : p1 = x^2+1; p2 = x^3-1; p3 = x+17;
i5 : GAP = newConnection "127.0.0.1:26135";
i6 : gp1 = GAP <=== p1

o6 = << Remote GAP object >>

o6 : RemoteObject
i7 : gp2 = GAP <=== p2; gp3 = GAP <=== p3;
i9 : gp = gp1*gp2*gp3

o9 = << Remote GAP object >>

o9 : RemoteObject
i10 : p = p1*p2*p3;
i11 : <== (gp == p)

o11 = true
i12 : close GAP
i13 : 
We create matrices in Macaulay2 and compute the order of the group they generate in GAP. Note that you may have to set 'SCSCPserverAcceptsOnlyTransientCD := false;' in your GAP configuration (particularly scscp/config.g) in order for this example to work.
i1 : m1 = id_(QQ^10)^{1,6,2,7,3,8,4,9,5,0}

o1 = | 0 1 0 0 0 0 0 0 0 0 |
     | 0 0 0 0 0 0 1 0 0 0 |
     | 0 0 1 0 0 0 0 0 0 0 |
     | 0 0 0 0 0 0 0 1 0 0 |
     | 0 0 0 1 0 0 0 0 0 0 |
     | 0 0 0 0 0 0 0 0 1 0 |
     | 0 0 0 0 1 0 0 0 0 0 |
     | 0 0 0 0 0 0 0 0 0 1 |
     | 0 0 0 0 0 1 0 0 0 0 |
     | 1 0 0 0 0 0 0 0 0 0 |

              10        10
o1 : Matrix QQ   <--- QQ
i2 : m2 = id_(QQ^10)^{1,0,2,3,4,5,6,7,8,9}

o2 = | 0 1 0 0 0 0 0 0 0 0 |
     | 1 0 0 0 0 0 0 0 0 0 |
     | 0 0 1 0 0 0 0 0 0 0 |
     | 0 0 0 1 0 0 0 0 0 0 |
     | 0 0 0 0 1 0 0 0 0 0 |
     | 0 0 0 0 0 1 0 0 0 0 |
     | 0 0 0 0 0 0 1 0 0 0 |
     | 0 0 0 0 0 0 0 1 0 0 |
     | 0 0 0 0 0 0 0 0 1 0 |
     | 0 0 0 0 0 0 0 0 0 1 |

              10        10
o2 : Matrix QQ   <--- QQ
i3 : GAP = newConnection "127.0.0.1:26135"

o3 = SCSCP Connection to GAP (4.dev) on 127.0.0.1:26135

o3 : SCSCPConnection
i4 : G = GAP <=== matrixGroup({m1,m2})

o4 = << Remote GAP object >>

o4 : RemoteObject
i5 : <== size G

o5 = 10080
i6 : close GAP
i7 : 

See also

For the programmer

The object RemoteObject is a type, with ancestor classes XMLnode < MutableHashTable < HashTable < Thing.