Items tagged with groebner


do not know why Basis got error in this case.

how to calculate this Basis?

prej := Matrix([[diff(eq2,a),diff(eq2,b),diff(eq2,c)],[diff(eq3,a),diff(eq3,b),diff(eq3,c)],[diff(eq4,a),diff(eq4,b),diff(eq4,c)]]);
jaco := Determinant(prej);
jaco := -a*b*c^2+c^2;
g3 := [diff(jaco,a),diff(jaco,b),diff(jaco,c)];
K := [r-g3[1],u-g3[2],v-g3[3]];
G := Basis(K, 'tord', degrevlex(r,u,v));

Error, (in LinearAlgebra:-Basis) invalid input: LinearAlgebra:-Basis expects its 1st argument, V, to be of type {Vector, {list(Vector), set(Vector)}} but received [b*c^2+r, a*c^2+u, 2*a*b*c-2*c+v]


how to calculate the polynomial map for a system of  polynomials

assume system of polynomial is in terms of a,b,c

how to find polynomial map

(r - something in terms of a,b,c)

(u - something in terms of a,b,c)

(v - something in terms of a,b,c)


Good day everyone,


I want to construct groebner bases over rings of differential Operators.

Thus I used the following:



with(Groebner); N := 3;

A := skew_algebra(diff = [D[1], x[1]], diff = [D[2], x[2]], diff = [D[3], x[3]], comm = i, alg_relations = i^2+1); T := MonomialOrder(A, tdeg(D[1], D[2], D[3]));

A["polynomial_indets"];  [returns    {D[1], D[2], D[3]}]

A["rational_indets"];       [returns    {i, x[1], x[2], x[3]}]


So far everything seems as it should be: The ring i wanted to define here is the third Ring of  Differential operators over the field of complex 'rational' functions and maple returns that indeed it will handle the D[i] as monomials and the rest as coefficients for them.


Hover, when i use the Skew product, the following happens:

skew_product(x[1],D[1],A)                    [returns D[1]x[1]+1}]

skew_product(x[1],D[1],A)                    [returns D[1]x[1]]

Both is wrong, but maple seems to 'know' this. It used the correct relation to in the first product, the only thing it didn't do was switch D[1] and x[1]. I think maple handles the result of the skew product as if it was a commutative product and always places the D[i] at the left but still 'knows' what the actual result is.

The actual results should have been x[1]D[1]+1 for the first and x[1]*D[1] for the second product.


In the second product, it seems like maple treated x[1]*D[1] as if the Elements were switched already.


What i want though is for maple to correctly display the skew products and return the products so that in every summand the D[i] are at the right side and their coefficients are at the left side (and if possible (i do not know how to do that yet) sort the result of a skew product in a way that displays every different Power product of the D[i] with their coefficients, so that i get (x[1]+x[2])*D[2] and not x[1]*D[2]+x[2]*D[2]).


Can anyone help me here?



in page 137 of an introduction to groebner bases

how to eliminate the redundant solution (y^2-x*z, 0, -x^2+y*w)

from 3 of them?
eliminate({y,y^2-x*z,-z}, {x, y, z, w});
eliminate({-x,0,y}, {x, y, z});
eliminate({w,-x^2+y*w,-x}, {x, y, z, w});

T := lexdeg([x,y,z],[e1,e2]);
intermsof1 := y;
intermsof2 := -z;
GB := Basis([e1-intermsof1, e2-intermsof2], 'tord',T);
result := NormalForm(y^2-x*z, GB,'tord', T);
result := NormalForm(y^2-x*z, GB, T);

originally Basis do not have error when without parameter 'tord'

after it has argument error, it has to be added extra parameter tord

NormalForm has the same error too.

i do not understand why it has error, how to solve?

i just want to express y^2-x*z in terms of y and -z



g:=Groebner:-Basis([a-2.0*b,b-2], plex);

Groebner:-Reduce(a, g, plex); 

Error, (in content/polynom) general case of floats not handled

How to solve this problem simply?

how to derive poincare series from symmetric function in maple


without specify the characteristic,

what is the default characteristic used in hilbert series?

@Markiyan Hirnyk 

how to calculate for module case

M := [[x*y,y,x],[x^2+x,y+x^2,y],[-y,x,y],[x^2,x,y]];

follow Computing non-commutative Groebner bases and Groebner bases for modules

in maple 12

Error, (in Groebner:-Basis) the first argument must be a list or set of polynomials or a PolynomialIdeal


then i find in maple 15 help file is changed from module M := [seq(Vector(subsop(i+1 = 1, [F[i], 0, 0, 0])), i = 1 .. 3)]

to array M := [seq( s^3*F[i] + s^(3-i), i=1..3)];

though it can run, but when apply other example can not run

such as


F := [2*x^2+3*y+z^2, x^2*z^2+z+2*x, x^4*y^7+3*x];
M := [seq( s^3*F[i] + s^(3-i), i=1..3)];
A := poly_algebra(x,y,z,s);
T := MonomialOrder(A, lexdeg([s], [x,y,z]), {s});
G := Groebner[Basis](M, T);
Error, (in Groebner:-Basis) the first argument must be a list or set of polynomials or a PolynomialIdeal

G1 := select(proc(a) evalb(degree(a,s)=3) end proc, G);
[seq(Vector([seq(coeff(j,s,3-i), i=0..3)]), j=G1)];
C := Matrix([seq([seq(coeff(j,s,3-i), i=1..3)], j=G1)]);
GB := map(expand, convert(C.Vector(F), list));
Groebner[Basis](F, tdeg(x,y,z));

follow Computing non-commutative Groebner bases and Groebner bases for modules

using LeadingMonomials(f, lexdeg([s],[x,y]));

f:=[y^2+2*x^2*y, y^2];



LeadingMonomial(g[1], lexdeg([s],[x,y]));
LeadingMonomial(g[2], lexdeg([s],[x,y]));
LeadingMonomial(g[1], lexdeg([s],[y,x]));
LeadingMonomial(g[2], lexdeg([s],[y,x]));


no result is (0,y^2)

where is wrong?


What is Groebner? That was asked in different forms several times in MaplePrimes and MathStackExchange (for example, see ). In view of this I think the presented post on Groebner basis will be useful. This post consists of two parts: its mathematical background and examples of solutions of polynomial systems by hand and with Maple.

Let us start. Up to Wiki ,Groebner basis computation can be seen as a multivariate, non-linear generalization of both Euclid's algorithm for computing polynomial greatest common divisors, and Gaussian elimination for linear systems. This is implemented in Maple trough the Groebner package.
The simplest introduction to the topic I know is a well-written book of Ivan Arzhantsev ( which includes the proofs of all the claimed theorems and the solutions of all the exercises. Here is its digest groebner.pdf done by me (The reader is assumed to be familiar with the ideal notion and ring notion (one may refresh her/his knowledge, looking in It should be noted that there is no easy reading about this serious matter.
Referring to the digest as appropriate, we solve the system
S:={a*b = c^2+c, a^2 =a+ b*c, a*c = b^2+b} by hand and with the Groebner package.
For the order a > b > c we construct its ideal
J(S):=<f1 = a*b-c^2-c,f2 = a^2-a-b*c, f3 = a*c-b^2-b>.
The link between f1 and f2 gives
f1*a-f2*b = (-c^2-c)*a + (a + b*c)*b = a*b -a*c + b^2*c -
a*c^2 =f4.
The reduction with f1 produces
f4 ->-a*c^2- a*c + b^2*c + c^2 +c =: f4.
Now the reduction with f3 produces
f4 -> -b^2- b - b*c +c^2 + c =:f4.
The link between f2 and f3 gives:
f2*c - f3*a = a*b +a*b^2 -a*c -b*c^2 = f5.
The reduction with f1 produces
f5 -> -a*c + c*b +c^2 +c =:f5.
The reduction with f3 produces
f5 -> -b^2 -b + c*b +c^2 +c =:f5.
The reduction with f4 produces
f5 -> 2b*c =: f5.
The link between f1 and f3
f1*c - f3*b = b^3 + b^2 -c^3 -c^2=:f6.
The reduction with f4 produces
f6 -> 2b*c + 2b*c^2 -2c^3 -2c^2=:f6.
At last, we reduce f6 by f5, obtaining f6:= -2c^3 -2c^2.
We see the minimal reduced Groebner basis of S consists of
a^2 -a -b*c, -b^2 -b- b*c +c^2 +c, -2c^3 - 2c^2.
Now we find the solution set of the system under consideration. The equation -2c^3 - 2c^2 = 0 implies
c=0, c=0, c=-1. The the equation -b^2 - b - b*c +c^2 + c = 0 gives
b = 0 , b = -1, b = 0, b = -1, b = 0, b = 0 respectively.
At last, knowing b and c, we find a from a^2 -a -b*c = 0.
[{a = 0, b = 0, c = 0}, {a = 1, b = 0, c = 0}, {a = 0, b = -1, c = 0}], [{a = 0, b = 0, c = 0}, {a = 1, b = 0, c = 0}, {a = 0, b = -1, c = 0}], [{a = 0, b = 0, c = -1}].
The solution of the system under consideration by the Groebner package is somewhat different because Maple does not find the minimal reduced Groebner basis directly.



[b*c, a*c-c^2-c, b^2-c^2+b-c, a*b-c^2-c, a^2-a, c^3+c^2]


GB2 := remove(has, GB1, a);

[b*c, b^2-c^2+b-c, c^3+c^2]


GB3 := Basis(GB2, lexdeg([b, c]))

[b*c, b^2-c^2+b-c, c^3+c^2]


op(remove(has, GB3, {b}))



solc := solve(c^3+c^2);

-1, 0, 0


solb := [seq(op(map(`union`, [solve(eval(GB3, c = i), {b})], {c = i})), i = solc)]

[{b = 0, c = -1}, {b = -1, c = 0}, {b = 0, c = 0}, {b = -1, c = 0}, {b = 0, c = 0}]


sol := seq(op(map(`union`, [solve(eval(GB1, i))], i)), i = solb)

{a = 0, b = 0, c = -1}, {a = 0, b = -1, c = 0}, {a = 0, b = 0, c = 0}, {a = 1, b = 0, c = 0}, {a = 0, b = -1, c = 0}, {a = 0, b = 0, c = 0}, {a = 1, b = 0, c = 0}



S2 := {a*c-b^2-b, a*b-c^2-c, a^2-b*c+a}:

GB1 := Basis(S2, lexdeg([a, b, c]))

[a*c+b*c+c^2+c, b^2+b*c+c^2+b+c, a*b-c^2-c, a^2-b*c+a]


GB2 := remove(has, GB1, a)



sol1 := solve(GB2, b)

{b = -(1/2)*c-1/2+(1/2)*(-3*c^2-2*c+1)^(1/2)}, {b = -(1/2)*c-1/2-(1/2)*(-3*c^2-2*c+1)^(1/2)}


map(proc (c) options operator, arrow; `union`(c, sol1[1]) end proc, map(proc (C) options operator, arrow; solve(C, {a}) end proc, eval(S2, sol1[1])))

{{a = 2*c*(c+1)/(-c-1+(-3*c^2-2*c+1)^(1/2)), b = -(1/2)*c-1/2+(1/2)*(-3*c^2-2*c+1)^(1/2)}, {a = -1/2-(1/2)*(1+2*c*(-3*c^2-2*c+1)^(1/2)-2*c^2-2*c)^(1/2), b = -(1/2)*c-1/2+(1/2)*(-3*c^2-2*c+1)^(1/2)}, {a = -1/2+(1/2)*(1+2*c*(-3*c^2-2*c+1)^(1/2)-2*c^2-2*c)^(1/2), b = -(1/2)*c-1/2+(1/2)*(-3*c^2-2*c+1)^(1/2)}, {a = -(1/2)*c-1/2-(1/2)*(-3*c^2-2*c+1)^(1/2), b = -(1/2)*c-1/2+(1/2)*(-3*c^2-2*c+1)^(1/2)}}





if DegreeLexicographic is T2:=lexdeg([a,b,c],[x,y,z]);

DegreeReverseLexicographic = T2:=lexdeg([c,b,a],[z,y,x])  ?

how to calculate hlibert series as in maple with Gröbner Bases

would like to know the algorithm and try in another programming language such as F#

i find the algorithm in book Singular introduction to commutative algebra

page 320 and 322 

1. is it equal to the hilbert series function in maple?

eq1a := Homogenize(eq1, h);
eq2a := Homogenize(eq2, h);
eq3a := Homogenize(eq3, h);
GB := Basis([eq1a,eq2a,eq3a], T3); #a

MonomialHilbertPoincare(LeadingMonomial(GB[1],T3), LeadingMonomial(GB[2],T3), LeadingMonomial(GB[3],T3));

F:=[LeadingMonomial(GB[1],T3), LeadingMonomial(GB[2],T3), LeadingMonomial(GB[3],T3)];
InterReduce(F, ???);

 2. what is the maple function for degree reverse lex ordering ?

eq1a := Homogenize(eq1, h);
eq2a := Homogenize(eq2, h);
eq3a := Homogenize(eq3, h);
David Cox using Algebraic Geometry page 82 use resultant to eliminate variable h
eq1b := eq1a - x;
eq2b := eq2a - y;
eq3b := eq3a - z;
GB := Basis([eq1b,eq2b,eq3b], T2);
r1 := resultant(eq1b, eq2b, h);
r2 := resultant(eq1b, eq3b, h);
r1 = r2

page 82 teach how to eliminate, after do question 2, discover r1 and r2 are the same.

how to eliminate the variable h with resultant after homogenize ideal with variable h

1 2 3 4 Page 2 of 4