Now we demonstrate the NCProcess command by “solving” FAC as already discussed in Chapter 14. While we show an interactive session the user probably will want to type the commands into a file and load them into your session. This is standard practice among Mathematica users and saves lots of time.
As shown in §14.2, the prestrategy starts as follows.
In[1]:=Get["NCGB.m"];
In[2]:=SetNonCommutative[A,B,C0,m1,m2,n1,n2]; In[3]:=SetKnowns[A,B,C]; In[4]:=SetUnknowns[m1,m2,n1,n2,a,b,c,e,f,g]; In[5]:=FAC = {A**m1 - m1**a - m2**f**c, A**m2 - m2**e, B - m1**b - m2**f, -c + C0**m1, -g + C0**m2, n1**m1 - 1, n1**m2, n2**m1, n2**m2 - 1, m1**n1 + m2**n2 - 1}; In[6]:= result = NCProcess1[FAC,2,"Spreadsheet1"]; |
The first command simply loads the noncommutative Gröbner basis package into Mathematica. Then we set the variables to be noncommutative.
The third and fourth commands sets the monomial order that will be used in solving for and eliminating variables as explained in Chapter 18. The list FAC is the set of relations that describe the problem as explained in §14.2. The call to NCProcess1 will run two iterations on FAC before creating the file “Spreadsheet1.dvi” and returning the final result as Mathematica output.
The file “Spreadsheet1.dvi” is the same as the one which was produced in Chapter 16. It exists outside of Mathematica and is only for viewing. It cannot be used to create a list of polynomials for Mathematica. The strategy that the user follows at this point was described in §14.3. Recall that it led the user to select the relations
Next we describe how this is input to NCProcess1 in order to produce the second spreadsheet from §14.3.
The Mathematica output of any of the NCProcess commands is a list containing three lists. In the example above, that list is named result. Recall that in Mma the way to get sublist number j inside result is to type result[[j]].
The second round of this strategy session is
In[7]:= SetKnowns[A,B,C,P1];
In[8]:= digested = result[[2]] In[9]:= undigested = result[[3]] In[10]:= interesting = {m1**n1-P1,n1**m1-1,n2**m2-1,m2**n2-1+m1**n1}; In[11]:= nextinput = Union[digested,interesting,undigested] In[12]:= NCProcess1[nextinput,2,"Spreadsheet2", UserSelect->discovered, DegreeCap->3,DegreeSumCap->6]; |
Now we discuss the input to NCProcess1 above. The variables digested and undigested hold the the last two lists from the list result which the first NCProcess1 command returned, and discovered includes the new definition of P1. The union of these three lists is taken as the input for the second NCProcess1 run. Once again we used two iterations. This is a good number of iterations with which to start. More iterations can be used if there is a lack of progress. The next argument is a string which refers to a file name which will store the spreadsheet. Unlike the first call to NCProcess1, this call uses non-default values for the options. The UserSelect option (as described in §15.3.1) causes the discovered relations to be given high priority. The DegreeCaps are set in order to save time (as explained in §15.3.2).
The file “Spreadsheet2.dvi” is the same as the second spreadsheet which was produced in Chapter 16. As we saw in §14.4, this spreadsheet leads directly to the main theorem about factoring systems.
For another demonstration of strategies using NCProcess see Chapter 17.