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 = "example17.g" gap> ### authors Knopper

gap> ### THIS IS A GAP PACKAGE GBNP gap> ### FOR COMPUTING WITH NON-COMMUTATIVE POLYNOMIALS gap> ### $Id: example17.g,v 1.4 2004/04/15 15:07:40 jwk Exp $

<#GAPDoc Label="Example17">
An algebra over a finite field
A small example over a field other than the rationals, using the conversion functions from . The input relations define the symmetric group of degree 3, denoted S_3.

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);

Let F be the field GF(2). The relations can be entered as elements of a free associative algebra with one A (see ).

gap> F:=GF(2);; gap> A:=FreeAssociativeAlgebraWithOne(F,"a","b"); <algebra-with-one over GF(2), with 2 generators> gap> g:=GeneratorsOfAlgebraWithOne(A); [ (Z(2)^0)*a, (Z(2)^0)*b ]

Enter the relations \{a^2-1,b^2-1,(ab)^3-1\}, convert them to NP-form, see Section , with and print them with :

gap> KI_GP := [ g[1]^2-g[1]^0, g[2]^2-g[1]^0, (g[1]*g[2])^3-g[1]^0]; [ (Z(2)^0)*<identity ...>+(Z(2)^0)*a^2, (Z(2)^0)*<identity ...>+(Z(2)^0)*b^2, (Z(2)^0)*<identity ...>+(Z(2)^0)*(a*b)^3 ] gap> KI:=GP2NPList(KI_GP);; gap> PrintNPList(KI); a^2 + Z(2)^0 b^2 + Z(2)^0 ababab + Z(2)^0

Now calculate the Gröbner basis with and print it with :

gap> GB:=SGrobner(KI);; #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 =3 #I length of todo is 2 #I length of G =3 #I length of todo is 1 #I length of G =3 #I length of todo is 0 #I List of todo lengths is [ 2, 2, 1, 0 ] #I End of phase III #I G: Cleaning finished, 0 polynomials reduced #I End of phase IV #I The computation took 0 msecs. gap> PrintNPList(GB); a^2 + Z(2)^0 b^2 + Z(2)^0 bab + aba

Now calculate the dimension of the quotient algebra with (2 symbols) and a base with (2 symbols, 0 for whole base) and print the base. This will give a list of elements of the group.

gap> DimQA(GB,2); 6 gap> B:=BaseQA(GB,2,0);; gap> PrintNPList(B); Z(2)^0 a b ab ba aba

We can print the Gröbner basis and the basis of the quotient algebra, converted back to GAP polynomials with . The functions used to convert the polynomials also require the algebra as an argument. The result is useful for further computations in A.

gap> NP2GPList(GB,A); [ (Z(2)^0)*a^2+(Z(2)^0)*<identity ...>, (Z(2)^0)*b^2+(Z(2)^0)*<identity ...>, (Z(2)^0)*b*a*b+(Z(2)^0)*a*b*a ] gap> NP2GPList(B,A); [ (Z(2)^0)*<identity ...>, (Z(2)^0)*a, (Z(2)^0)*b, (Z(2)^0)*a*b, (Z(2)^0)*b*a, (Z(2)^0)*a*b*a ]

The matrix of right multiplication with the image of the first variable can be computed by . gap> Display(MatrixQA(1,B,GB)); . 1 . . . . 1 . . . . . . . . . 1 . . . . . . 1 . . 1 . . . . . . 1 . .

<#/GAPDoc>