Difference between revisions of "ApCoCoA-1:HowTo:Run ApCoCoA on a Computing Server"

From ApCoCoAWiki
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
This HowTo shows you how to run ApCoCoA on a Linux server with terminal.
+
This HowTo shows you how to run ApCoCoA on a Linux server at terminal.
  
  
 
==Prerequisites==
 
==Prerequisites==
* Download [[:ApCoCoA:Downloads#Well-known_Qt-GUI | ApCoCoA QT]] and unzip the file. (This HowTo takes ApCoCoA 1.9.0 as an example.)
+
* Download [[:ApCoCoA:Downloads#Well-known_Qt-GUI | ApCoCoA QT]] and unzip the file. This HowTo will take ApCoCoA 1.9.0 as an example.
 
  wget http://www.apcocoa.org/download/apcocoa/linux-x86_64/apcocoa-1.9.0-QT-linux-x86_64.tgz
 
  wget http://www.apcocoa.org/download/apcocoa/linux-x86_64/apcocoa-1.9.0-QT-linux-x86_64.tgz
 
  tar xzvf apcocoa-1.9.0-QT-linux-x86_64.tgz
 
  tar xzvf apcocoa-1.9.0-QT-linux-x86_64.tgz
Line 11: Line 11:
  
 
==Run ApCoCoA==
 
==Run ApCoCoA==
Go to the folder ApCoCoA-1.9.0. The contents in the folder are as follows.  
+
 
 +
===ApCoCoA with Text Interface===
 +
Go to the folder ApCoCoA-1.9.0. The contents in the folder are as follows. In the following, assume that you are working at the directory ApCoCoA-1.9.0/.
  
 
[[Image:ApCoCoA_files.jpg]]
 
[[Image:ApCoCoA_files.jpg]]
  
In the following, assume that you are working at the directory ApCoCoA-1.9.0/.
 
 
 
===ApCoCoA with Text Interface===
 
 
Run the following command at terminal to start the ApCoCoA text interface.
 
Run the following command at terminal to start the ApCoCoA text interface.
 
  ./apcocoa_text
 
  ./apcocoa_text
Line 37: Line 35:
 
[[Image:ApCoCoA_Server0.jpg]]
 
[[Image:ApCoCoA_Server0.jpg]]
  
Observe that the ApCoCoAServer is running on the default port 49344 (0xc0c0). One can change the port number to n by using option -p as follows.
+
Observe that the ApCoCoAServer is running on the default port 49344 (0xc0c0). You can run the ApCoCoAServer on another port n by using option -p as follows.
 
  ./ApCoCoAServer -p n
 
  ./ApCoCoAServer -p n
 
 
Now let us switch to the terminal session for the ApCoCoA text interface again. Execute the following commands.
 
Now let us switch to the terminal session for the ApCoCoA text interface again. Execute the following commands.
 
  X:="xy";
 
  X:="xy";
Line 54: Line 51:
  
 
===ApCoCoA Program Files===
 
===ApCoCoA Program Files===
Sometimes it is useful to write commands or functions in ApCoCoA program files.
+
Sometimes it is useful to write commands or functions in ApCoCoA program files. For example, we define a function for computing Fibonacci numbers as follows.
 
 
For example, the following function computes Fibonacci numbers. Assume that we write the function in a ApCoCoA program file, say test.coc, in the directory ApCoCoA-1.9.0/.
 
 
  Define Fib(N)
 
  Define Fib(N)
 
   If N<=1 Then
 
   If N<=1 Then
Line 66: Line 61:
 
   EndIf;
 
   EndIf;
 
  EndDefine;
 
  EndDefine;
Using the following command, ApCoCoA process
+
In order to load this function to ApCoCoA, we write the function in a ApCoCoA program file, say test.coc, in the directory ApCoCoA-1.9.0/. Then, using the following command, we run ApCoCoA which processes the file test.coc as a batch file. Then, we can use the function Fib(N) to compute Fibonacci numbers in ApCoCoA.
 
+
  ./apcocoa test.coc
Then we can process the file as batch files and then ask ApCoCoA to process them when it starts.
 
 
 
For example, we have a presentation for SL(3,8) as follows. and we wa
 
put the following commands in a file named SL_3_8.coc.
 
 
 
/* SL(3,8) has a presentation with generators a, b, c, d, e and the following relators
 
    a^2, b^2, c^7, de, ed,
 
    (cb)^2,
 
    (ba)^3,
 
    (acac^6)^2,
 
    c^2ac^6ac^5ac,
 
    dbe^2,
 
    (ce)^2cd^2
 
    aead(ae)^2babd^2,
 
    eadae^2babd^2(ae)^2babd^2,
 
    ec^6daecdc^6aca,
 
    ec^6daecec^6d^2ae^2cd^2,
 
    ec^6daecec^6d^2ae^2cd^2.
 
    The following commands check whether the last relator, i.e. ec^6daecec^6d^2ae^2cd^2
 
    can be rewritten by the others, via Groebner basis techniques.
 
*/
 
Use ZZ/(2)[a,b,c,d,e];
 
  G:=[[[a^2], [1]],
 
    [[b^2], [1]],
 
    [[c^7], [1]],
 
    [[d, e], [1]],
 
    [[e, d], [1]],
 
    [[c, b, c, b], [1]],
 
    [[b, a, b, a, b, a], [1]],
 
    [[a, c, a, c^6, a, c, a, c^6], [1]],
 
    [[c^2, a, c^6, a, c^5, a, c], [1]],
 
    [[b, d, b, e^2], [1]],
 
    [[c, e, c, e, c, d^2], [1]],
 
    [[a, e, a, d, a, e, a, e, b, a, b, d^2], [1]],
 
    [[e, a, d, a, e^2, b, a, b, d^2, a, e, a, e, b, a, b, d^2], [1]],
 
    [[e, c^6, d, a, e, c, d, c^6, a, c, a], [1]]];
 
F:=[ [e,c^6, d, a, e, c, e, c^6, d^2, a, e^2, c, d^2] ];
 
Gb:=NC.GB(G,31,1,100,5000);
 
NC.NR(F,Gb);
 
  
 +
[[Image:ApCoCoA_text3.jpg]]
  
  

Revision as of 23:56, 19 June 2013

Introduction

This HowTo shows you how to run ApCoCoA on a Linux server at terminal.


Prerequisites

  • Download ApCoCoA QT and unzip the file. This HowTo will take ApCoCoA 1.9.0 as an example.
wget http://www.apcocoa.org/download/apcocoa/linux-x86_64/apcocoa-1.9.0-QT-linux-x86_64.tgz
tar xzvf apcocoa-1.9.0-QT-linux-x86_64.tgz


Run ApCoCoA

ApCoCoA with Text Interface

Go to the folder ApCoCoA-1.9.0. The contents in the folder are as follows. In the following, assume that you are working at the directory ApCoCoA-1.9.0/.

ApCoCoA files.jpg

Run the following command at terminal to start the ApCoCoA text interface.

./apcocoa_text

ApCoCoA text.jpg

You can run any (Ap)CoCoA command in this interface.

ApCoCoA text1.jpg


ApCoCoAServer

In many cases you also need to run the ApCoCoAServer. Here, assume that you have some terminal tools, like "screen", "tmux", etc., to create new terminal sessions, and that you are able to switch between terminal sessions without having to stop the running program.

Create a new terminal session for the ApCoCoAServer and run the following command to start the ApCoCoAServer.

./ApCoCoAServer

ApCoCoA Server0.jpg

Observe that the ApCoCoAServer is running on the default port 49344 (0xc0c0). You can run the ApCoCoAServer on another port n by using option -p as follows.

./ApCoCoAServer -p n

Now let us switch to the terminal session for the ApCoCoA text interface again. Execute the following commands.

X:="xy";
M:=["xxx","yxy","xyx"];
NCo.IsFinite(X, M); -- Check whether <x,y>/<x^3,yxy,xyx> is finite

The function NCo.IsFinite uses the ApCoCoAServer. You will get the following result in the ApCoCoA text interface.

ApCoCoA text2.jpg

And you can see the following message in the terminal session for the ApCoCoAServer.

ApCoCoA Server1.jpg


ApCoCoA Program Files

Sometimes it is useful to write commands or functions in ApCoCoA program files. For example, we define a function for computing Fibonacci numbers as follows.

Define Fib(N)
  If N<=1 Then
    Return 0;
  Elif N=2 Then
    Return 1;
  Else
    Return Fib(N-2)+Fib(N-1);
  EndIf;
EndDefine;

In order to load this function to ApCoCoA, we write the function in a ApCoCoA program file, say test.coc, in the directory ApCoCoA-1.9.0/. Then, using the following command, we run ApCoCoA which processes the file test.coc as a batch file. Then, we can use the function Fib(N) to compute Fibonacci numbers in ApCoCoA.

./apcocoa test.coc

ApCoCoA text3.jpg