LIB "tst.lib"; tst_init(); LIB "central.lib"; ring A = 0,(e(1..4)),dp; matrix D[4][4]=0; D[2,4] = -e(1); D[3,4] = -e(2); // This is A_4_1 - the first real Lie algebra of dimension 4. def A_4_1 = nc_algebra(1,D); setring A_4_1; ideal F = variablesSorted(); F; // the center of A_4_1 is generated by // e(1) and -1/2*e(2)^2+e(1)*e(3) // therefore one may consider computing it in the following way: // 1. Compute a PBW basis consisting of // monomials with exponent <= (1,2,1,0) ideal V = PBW_maxMonom( e(1) * e(2)^ 2 * e(3) ); // 2. Compute the centralizer of F within the vector space // spanned by these monomials: ideal C = centralizeSet( F, V ); C; inCenter(C); // check the result tst_status(1);$