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 = "example11.g" gap> ### authors Cohen & Gijsbers gap> ### $Id: example11.g,v 1.5 2004/04/16 14:37:37 jwk Exp $

gap> ### THIS IS A GAP PACKAGE FOR COMPUTING NON-COMMUTATIVE GROBNER BASES gap> <#GAPDoc Label="Example11">
The truncated variant on two weighted homogeneous polynomials
Here we exhibit a truncated non-commutative homogeneous weighted Gröbner basis computation. This example uses the functions from Section , the truncation variants (see also Section ).

The input is a set of polynomials in x and y, which are homogeneous when the weight of x is 2 and of y is 3. The input is \{x^3y^2-x^6+y^4,y^2x^3+xyxyx+x^2yxy\}. We truncate the computation at degree 16. The truncated Gröbner basis is \{y^2x^3+xyxyx+x^2yxy,x^6-x^3y^2-y^4,x^3y^2x-x^4y^2-xy^4\} and the dimension of the quotient algebra is 134.

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

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

The variables will be printed as x and y. gap> GBNP.ConfigPrint("x","y");

The level to truncate at is assigned to n.

gap> n := 16;;

Now enter the relations in NP form (see Section ) and the weights.

gap> s1 :=[[[1,1,1,2,2],[1,1,1,1,1,1],[2,2,2,2]],[1,-1,1]];; gap> s2 :=[[[2,2,1,1,1],[1,2,1,2,1],[1,1,2,1,2]],[1,1,1]];; gap> K := [s1,s2];; gap> weights:=[2,3];;

The input can be printed with

gap> PrintNPList(K); x^3y^2 - x^6 + y^4 y^2x^3 + xyxyx + x^2yxy

Verify whether the list K consists only of polynomials that are homogeneous with respect to weights by means of .

gap> CheckHomogeneousNPs(K,weights); #I Input is homogeneous [ 12, 12 ]

Now calculate the truncated Gröbner basis with . The output will only contain homogeneous polynomials of degree at most n.

gap> G := SGrobnerTrunc(K,n,weights);; #I number of entered polynomials is 2 #I number of polynomials after reduction is 2 #I End of phase I #I Input is homogeneous #I Reached level 16 #I end of the algorithm #I The computation took 4 msecs.

The Gröbner basis of the truncated quotient algebra can be printed with :

gap> PrintNPList(G); y^2x^3 + xyxyx + x^2yxy x^6 - x^3y^2 - y^4 x^3y^2x - x^4y^2 + y^4x - xy^4

The standard basis of the quotient of the free noncommutative algebra on n variables, where n is the length of the vector weights, by the homogeneous ideal generated by K up to degree n is obtained by means of the function applied to K, n, and weights.

gap> B := BaseQATrunc(K,n,weights);; #I number of entered polynomials is 2 #I number of polynomials after reduction is 2 #I End of phase I #I Input is homogeneous #I Reached level 16 #I end of the algorithm #I The computation took 0 msecs. gap> i := Length(B); 17 gap> Print("at level ",i-1," the standard monomials are:\n"); at level 16 the standard monomials are: gap> PrintNPList(List(B[i], qq -> [[qq],[1]])); yxyx^4 yx^2yx^3 xyxyx^3 yx^3yx^2 xyx^2yx^2 x^2yxyx^2 y^4x^2 yx^4yx xyx^3yx x^2yx^2yx x^3yxyx y^3xyx y^2xy^2x yxy^3x xy^4x yx^5y xyx^4y x^2yx^3y x^3yx^2y y^3x^2y x^4yxy y^2xyxy yxy^2xy xy^3xy x^5y^2 y^2x^2y^2 yxyxy^2 xy^2xy^2 yx^2y^3 xyxy^3 x^2y^4

The same result can be obtained by using the truncated Gröbner basis found for G instead of K.

gap> B2 := BaseQATrunc(G,n,weights);; #I number of entered polynomials is 3 #I number of polynomials after reduction is 3 #I End of phase I #I Input is homogeneous #I Reached level 16 #I end of the algorithm #I The computation took 0 msecs. gap> B = B2; true

Also, the same result can be obtained by using the leading terms of the truncated Gröbner basis found for G instead of K.

gap> B3 := BaseQATrunc(List( LMonsNP(G), qq -> [[qq],[1]]),n,weights);; #I number of entered polynomials is 3 #I number of polynomials after reduction is 3 #I End of phase I #I Input is homogeneous #I Reached level 16 #I end of the algorithm #I The computation took 0 msecs. gap> B = B3; true

A list of dimensions of the homogeneous parts of the quotient algebra up to degree n is obtained by means of with arguments G, n, and weights.

gap> DimsQATrunc(G,n,weights); #I number of entered polynomials is 3 #I number of polynomials after reduction is 3 #I End of phase I #I Input is homogeneous #I Reached level 16 #I end of the algorithm #I The computation took 4 msecs. [ 1, 0, 1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 10, 16, 17, 24, 31 ]

Even more detailed information is given by the list of frequences up to degree n. This is obtained by means of with arguments G, n, and weights.

gap> FreqsQATrunc(G,n,weights); #I number of entered polynomials is 3 #I number of polynomials after reduction is 3 #I End of phase I #I Input is homogeneous #I Reached level 16 #I end of the algorithm #I The computation took 0 msecs. [ [ [ [ ], 1 ] ], [ [ [ 1, 0 ], 1 ] ], [ [ [ 0, 1 ], 1 ] ], [ [ [ 2, 0 ], 1 ] ], [ [ [ 1, 1 ], 2 ] ], [ [ [ 3, 0 ], 1 ], [ [ 0, 2 ], 1 ] ], [ [ [ 2, 1 ], 3 ] ], [ [ [ 4, 0 ], 1 ], [ [ 1, 2 ], 3 ] ], [ [ [ 3, 1 ], 4 ], [ [ 0, 3 ], 1 ] ], [ [ [ 5, 0 ], 1 ], [ [ 2, 2 ], 6 ] ], [ [ [ 4, 1 ], 5 ], [ [ 1, 3 ], 4 ] ], [ [ [ 3, 2 ], 9 ], [ [ 0, 4 ], 1 ] ], [ [ [ 5, 1 ], 6 ], [ [ 2, 3 ], 10 ] ], [ [ [ 4, 2 ], 12 ], [ [ 1, 4 ], 5 ] ], [ [ [ 6, 1 ], 5 ], [ [ 3, 3 ], 18 ], [ [ 0, 5 ], 1 ] ], [ [ [ 5, 2 ], 16 ], [ [ 2, 4 ], 15 ] ] ]
<#/GAPDoc>