Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X7 [33X[0;0YExamples of [5XSCSCP[105X[101X[1X usage[133X[101X23[33X[0;0YIn this chapter we are going to demonstrate some examples of communication4between client and server using the SCSCP.[133X567[1X7.1 [33X[0;0YProviding services with the SCSCP package[133X[101X89[33X[0;0YYou can try to run the SCSCP server with the configuration file10[11Xscscp/example/myserver.g[111X. To do this, go to that directory and enter [10Xgap11myserver.g[110X. After this you will see some information messages and finally12the server will start to wait for the connection. The final part of the13startup screen may look as follows:[133X1415[4X[32X Example [32X[104X16[4X[28X[128X[104X17[4X[28X#I Installed SCSCP procedure Factorial[128X[104X18[4X[28X#I Installed SCSCP procedure WS_Factorial[128X[104X19[4X[28X#I Installed SCSCP procedure GroupIdentificationService[128X[104X20[4X[28X#I Installed SCSCP procedure IdGroup512ByCode[128X[104X21[4X[28X#I Installed SCSCP procedure WS_IdGroup[128X[104X22[4X[28X#I Installed SCSCP procedure WS_Karatsuba[128X[104X23[4X[28X#I Installed SCSCP procedure EvaluateOpenMathCode[128X[104X24[4X[28X#I Ready to accept TCP/IP connections at localhost:26133 ...[128X[104X25[4X[28X#I Waiting for new client connection at localhost:26133 ...[128X[104X26[4X[28X[128X[104X27[4X[32X[104X2829[33X[0;0YSee further self-explanatory comments in the file [11Xscscp/example/myserver.g[111X.30There also some test files in the directory [11Xscscp/tst/[111X supplied with31detailed comments. First, you may use demonstration files, preliminary32turning on the demonstration mode as it is explained in these files, or just33executing step by step each command from [11Xscscp/tst/demo.g[111X and34[11Xscscp/tst/omdemo.g[111X. Then you can try to use files [11Xscscp/tst/id512.g[111X,35[11Xscscp/tst/idperm.g[111X and [11Xscscp/tst/factor.g[111X for further tests of [5XSCSCP[105X36services.[133X373839[1X7.2 [33X[0;0YIdentifying groups of order 512[133X[101X4041[33X[0;0YWe will give an example guiding you through all steps of creation of your42own [5XSCSCP[105X service.[133X4344[33X[0;0YThe [5XGAP[105X Small Group Library does not provide identification for groups of45order 512 using the function [10XIdGroup[110X:[133X4647[4X[32X Example [32X[104X48[4X[28X[128X[104X49[4X[25Xgap>[125X [27XIdGroup( DihedralGroup( 256 ) );[127X[104X50[4X[28X[ 256, 539 ][128X[104X51[4X[25Xgap>[125X [27XIdGroup(DihedralGroup(512)); [127X[104X52[4X[28XError, the group identification for groups of size 512 is not available [128X[104X53[4X[28Xcalled from[128X[104X54[4X[28X<function "unknown">( <arguments> )[128X[104X55[4X[28X called from read-eval loop at line 71 of *stdin*[128X[104X56[4X[28Xyou can 'quit;' to quit to outer loop, or[128X[104X57[4X[28Xyou can 'return;' to continue[128X[104X58[4X[26Xbrk>[126X [27X[127X[104X59[4X[28X[128X[104X60[4X[32X[104X6162[33X[0;0YHowever, the [5XGAP[105X package [5XANUPQ[105X [GNO] has a function63[10XIdStandardPresented512Group[110X that does this work as demonstrated below:[133X6465[4X[32X Example [32X[104X66[4X[28X[128X[104X67[4X[25Xgap>[125X [27XLoadPackage("anupq");[127X[104X68[4X[28X---------------------------------------------------------------------------[128X[104X69[4X[28XLoading ANUPQ (ANU p-Quotient) 3.1.4[128X[104X70[4X[28XGAP code by Greg Gamble <[email protected]> (address for correspondence)[128X[104X71[4X[28X Werner Nickel (http://www.mathematik.tu-darmstadt.de/~nickel/)[128X[104X72[4X[28X [uses ANU pq binary (C code program) version: 1.9][128X[104X73[4X[28XC code by Eamonn O'Brien (http://www.math.auckland.ac.nz/~obrien)[128X[104X74[4X[28XCo-maintained by Max Horn <[email protected]>[128X[104X75[4X[28X[128X[104X76[4X[28X For help, type: ?ANUPQ[128X[104X77[4X[28X---------------------------------------------------------------------------[128X[104X78[4X[28Xtrue[128X[104X79[4X[25Xgap>[125X [27XG := DihedralGroup( 512 ); [127X[104X80[4X[28X<pc group of size 512 with 9 generators>[128X[104X81[4X[25Xgap>[125X [27XF := PqStandardPresentation( G );[127X[104X82[4X[28X<fp group on the generators [ f1, f2, f3, f4, f5, f6, f7, f8, f9 ]>[128X[104X83[4X[25Xgap>[125X [27XH := PcGroupFpGroup( F );[127X[104X84[4X[28X<pc group of size 512 with 9 generators>[128X[104X85[4X[25Xgap>[125X [27XIdStandardPresented512Group( H );[127X[104X86[4X[28X[ 512, 2042 ][128X[104X87[4X[28X[128X[104X88[4X[32X[104X8990[33X[0;0YThe package [5XANUPQ[105X requires [5XUNIX[105X environment and it is natural to provide an91identification service for groups of order 512 to make it available for92other platforms.[133X9394[33X[0;0YNow we need to decide how the client will transmit a group to the server.95Can we encode this group in [5XOpenMath[105X? But there is no content dictionary for96PcGroups. Should we convert it to a permutation representation to be able to97use existing content dictionaries? But then the resulting [5XOpenMath[105X code will98be not compact. However, the [5XSCSCP[105X protocol provides enough freedom for the99user to select its own data representation, and since we are linking100together two copies of the same system, we may use the [13Xpcgs code[113X to pass the101data to the server (see [2XCodePcGroup[102X ([14XReference: CodePcGroup[114X).[133X102103[33X[0;0YFirst we create a function which accepts the integer number that is the code104for pcgs of a group of order 512 and returns the number of this group in the105GAP Small Groups library:[133X106107[4X[32X Example [32X[104X108[4X[28X[128X[104X109[4X[28XIdGroup512ByCode := function( code )[128X[104X110[4X[28Xlocal G, F, H;[128X[104X111[4X[28XG := PcGroupCode( code, 512 );[128X[104X112[4X[28XF := PqStandardPresentation( G );[128X[104X113[4X[28XH := PcGroupFpGroup( F );[128X[104X114[4X[28Xreturn IdStandardPresented512Group( H );[128X[104X115[4X[28Xend;[128X[104X116[4X[28X[128X[104X117[4X[32X[104X118119[33X[0;0YAfter such function was created on the server, we need to make it [21Xvisible[121X as120an [5XSCSCP[105X procedure:[133X121122[4X[32X Example [32X[104X123[4X[28X[128X[104X124[4X[25Xgap>[125X [27XInstallSCSCPprocedure("IdGroup512", IdGroup512ByCode );[127X[104X125[4X[28XInstallSCSCPprocedure : procedure IdGroup512 installed. [128X[104X126[4X[28X[128X[104X127[4X[32X[104X128129[33X[0;0YNote that this function assumes that the argument is a valid code for some130group of order 512, and we wish the client to make it sure that this is the131case. To do this, and also for the client's convenience, we provide the132client's counterpart for this service. Here the group must be a pc-group of133order 512, otherwise an error message will appear.[133X134135[4X[32X Example [32X[104X136[4X[28X[128X[104X137[4X[25Xgap>[125X [27XIdGroup512 := function( G )[127X[104X138[4X[25X>[125X [27X local code, result;[127X[104X139[4X[25X>[125X [27X if Size( G ) <> 512 then[127X[104X140[4X[25X>[125X [27X Error( "G must be a group of order 512 \n" );[127X[104X141[4X[25X>[125X [27X fi;[127X[104X142[4X[25X>[125X [27X code := CodePcGroup( G );[127X[104X143[4X[25X>[125X [27X result := EvaluateBySCSCP( "IdGroup512ByCode", [ code ], [127X[104X144[4X[25X>[125X [27X "localhost", 26133 );[127X[104X145[4X[25X>[125X [27X return result.object;[127X[104X146[4X[25X>[125X [27Xend;;[127X[104X147[4X[28X[128X[104X148[4X[32X[104X149150[33X[0;0YNow the client can call the function [10XIdGroup512[110X, and the procedure of151getting result is as much straightforward as using [10XIdGroup[110X for those groups152where it works:[133X153154[4X[32X Example [32X[104X155[4X[28X[128X[104X156[4X[25Xgap>[125X [27XIdGroup512(DihedralGroup(512));[127X[104X157[4X[28X[ 512, 2042 ][128X[104X158[4X[28X[128X[104X159[4X[32X[104X160161162163