gap> ######################### BEGIN COPYRIGHT MESSAGE ######################### GBNP - computing Gröbner bases of noncommutative polynomials Copyright 2001-2010 by Arjeh M. Cohen, Dié A.H. Gijsbers, Jan Willem Knopper, Chris Krook. Address: Discrete Algebra and Geometry (DAM) group at the Department of Mathematics and Computer Science of Eindhoven University of Technology.

For acknowledgements see the manual. The manual can be found in several formats in the doc subdirectory of the GBNP distribution. The acknowledgements formatted as text can be found in the file chap0.txt.

GBNP is free software; you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License as published by the Free Software Foundation (FSF); either version 2.1 of the License, or (at your option) any later version. For details, see the file 'LGPL' in the doc subdirectory of the GBNP distribution or see the FSF's own site: http://www.gnu.org/licenses/lgpl.html gap> ########################## END COPYRIGHT MESSAGE ##########################

gap> ### filename = "example01.g" gap> ### authors Cohen & Gijsbers gap> ### $Id: example01.g,v 1.7 2006/12/18 15:43:18 jwk Exp $

gap> ### THIS IS A GAP PACKAGE FOR COMPUTING NON-COMMUTATIVE GROBNER BASES gap> gap> ### Last change: August 22 2001. gap> ### amc

<#GAPDoc Label="Example01">
A simple commutative Gröbner basis computation
In this commutative example the relations are x^2y-1 and xy^2-1; we add xy-yx to enforce that x and y commute. The answer should be \{x^3-1, x-y, xy-yx\}, as the reduction ordering is total degree first and then lexicographic with x smaller than y.

First load the package and set the standard infolevel to 2 and the time infolevel to 1 (for more information about the info level, see Chapter ).

gap> LoadPackage("GBNP","0",false);; gap> SetInfoLevel(InfoGBNP,2); gap> SetInfoLevel(InfoGBNPTime,1);

Then input the relations in NP format (see Section ). They will be put in the list Lnp.

gap> Lnp := [ [[[1,2],[2,1]],[1,-1]] ]; [ [ [ [ 1, 2 ], [ 2, 1 ] ], [ 1, -1 ] ] ] gap> x2y := [[[1,1,2],[]],[1,-1]]; [ [ [ 1, 1, 2 ], [ ] ], [ 1, -1 ] ] gap> AddSet(Lnp,x2y); gap> xy2 := [[[1,2,2],[]],[1,-1]]; [ [ [ 1, 2, 2 ], [ ] ], [ 1, -1 ] ] gap> AddSet(Lnp,xy2);

The relations can be exhibited with :

gap> PrintNPList(Lnp); a^2b - 1 ab - ba ab^2 - 1

Let the variables be printed as x and y instead of a and b by means of gap> GBNP.ConfigPrint("x","y");

The Gröbner basis can now be calculated with :

gap> GB := SGrobner(Lnp); #I number of entered polynomials is 3 #I number of polynomials after reduction is 3 #I End of phase I #I End of phase II #I length of G =1 #I length of todo is 1 #I length of G =2 #I length of todo is 0 #I List of todo lengths is [ 1, 1, 0 ] #I End of phase III #I G: Cleaning finished, 0 polynomials reduced #I End of phase IV #I The computation took 4 msecs. [ [ [ [ 2 ], [ 1 ] ], [ 1, -1 ] ], [ [ [ 1, 1, 1 ], [ ] ], [ 1, -1 ] ] ]

When printed, it looks like:

gap> PrintNPList(GB); y - x x^3 - 1

The dimension of the quotient algebra can be calculated with . The arguments are the Gröbner basis GB and the number of variables is 2:

gap> DimQA(GB,2); 3

A basis of this quotient algebra can be calculated with . The arguments are a Gröbner basis GB, the number of variables t (=2) and a variable maxno for returning partial quotient algebras (0 means full basis). The calculated basis will be printed as well.

gap> B:=BaseQA(GB,2,0);; gap> PrintNPList(B); 1 x x^2

The strong normal form of the element xyxyxyx can be found by use of . The arguments are this element and the Gröbner basis GB.

gap> f:=[[[1,2,1,2,1,2,1]],[1]];; gap> PrintNP(f); xyxyxyx gap> p:=StrongNormalFormNP(f,GB);; gap> PrintNP(p); x
<#/GAPDoc>