MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $A$ be a noncommutative finitely generated algebra with a finitely generated set of relations. Moreover, assume that $A$ is finite dimensional as a vector space.

What I want to know is, can Mathematica (or any other package) be used to find the dimension of $A$ given only the generators of $A$ and the generators of the set of relations? Or, even better, can Mathematica (or any other package) be used to find a basis of $A$ given only the generators of $A$ and the generators of the set of relations?

Basic examples would be particularily helpful.

share|cite|improve this question
I use GAP ( and the non-commutative Gröbner basis package gbnp ( You will find examples in the manual. – Leandro Vendramin Feb 2 '12 at 16:16
I used to use Steve Linton's Vector Enumeration but this is now deprecated. – Bruce Westbury Feb 2 '12 at 16:18
Not really related, but still:… – Alexander Chervov Feb 2 '12 at 17:48
If you know A to be a basic algebra then this can be done in Magma. Magma may also be able to do more general types of algebra, have a look at the Algebras section of the handbook. There is an online calculator if you don't have institutional access to Magma but it is limited to computations taking at most a minute. – M T Feb 2 '12 at 18:46
up vote 4 down vote accepted

As it was mentioned in my comment, you can use GAP and the noncommutative Gröbner bases package gbnp, written by Arjeh M. Cohen and Jan Willem Knopper.

Here you have an example:

Assume that you want to compute the dimension and a basis for the algebra $A$ with generators $a,b,c$ and relations $a^2 =b^2=c^2=0$, $ab + ca + bc = 0$ and $ba + cb + ac = 0$.

(This algebra is related to Schubert calculus and it was first discovered by Fomin and Kirillov, see MR1667680 (2001a:05152).)

gap> LoadPackage("gbnp");
Loading  GBNP 0.9.5 (Non-commutative Gröbner bases)
by A.M. Cohen ( and
   D.A.H. Gijsbers (
gap> A := FreeAssociativeAlgebraWithOne(Rationals, "a", "b", "c");;
gap> a := A.a;;
gap> b := A.b;;
gap> c := A.c;;
gap> rels := [a^2, b^2, c^2, a*b+c*a+b*c, b*a+c*b+a*c];;
gap> K := GP2NPList(rels);;                             
gap> G := SGrobner(K);;
gap> Display(DimQA(G,3));
gap> PrintNPList(BaseQA(G, 3, 0));

Here is the complete reference related to this algebra:

Fomin, Sergey; Kirillov, Anatol N. Quadratic algebras, Dunkl elements, and Schubert calculus. Advances in geometry, 147--182, Progr. Math., 172, Birkhäuser Boston, Boston, MA, 1999. MR1667680 (2001a:05152).)

share|cite|improve this answer
Great. That looks like just what I want! But I'm having installing the package. On the package page it says: %%%%%%%%%%%%%% unpack GBNP-1.0.1.tar.gz in the pkg subdirectory of your GAP installation (or in the pkg subdirectory of any other GAP root directory, for example one added with the -l argument) with the following command: tar -xvzf GBNP-1.0.1.tar.gz. %%%%%%%%%%%% I typed this into GAP and got an error. What/Where is the pkg subdirectory? – Mihail Matrix Feb 4 '12 at 19:02
Where have you installed GAP? Usually the GAP package directory is gap4r4/pkg/. – Leandro Vendramin Feb 4 '12 at 19:27
@Leandro, do you know if there is a way to do this sort of thing in GAP when the algebra is defined over a field of rational functions? – MTS Feb 25 '14 at 0:24
@MTS, Maybe not, but I am not sure. What about Magma? – Leandro Vendramin Feb 25 '14 at 6:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.