Items tagged with groebner groebner Tagged Items Feed

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

 

restart;
with(Groebner):
F := [x+y+z, x*y+y*z+z*x, x*y*z-1];
M := [seq( s^3*F[i] + s^(3-i), i=1..3)];
M := [[x*y,y,x],[x^2+x,y+x^2,y],[-y,x,y],[x^2,x,y]];
with(Ore_algebra);
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];
f1:=[x*y-y,x^2];
f2:=[x,y^2-x];

g:=[f1,f2];

 

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?...

November 14 2014 Markiyan Hirnyk 6208 Maple

What is Groebner? That was asked in different forms several times in MaplePrimes and MathStackExchange (for example, see http://math.stackexchange.com/questions/3550/using-gr?bner-bases-for-solving-polynomial-equations ). 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 http://en.wikipedia.org/wiki/Gr%C3%B6bner_basis ,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 (https://zbmath.org/?q=an:05864974) 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 http://en.wikipedia.org/wiki/Ideal_%28ring_theory%29)). 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.
Hence,
[{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.

 

with(Groebner):

[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]

(1)

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

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

(2)

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

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

(3)

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

c^3+c^2

(4)

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

-1, 0, 0

(5)

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}]

(6)

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}

(7)

NULL

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]

(8)

GB2 := remove(has, GB1, a)

[b^2+b*c+c^2+b+c]

(9)

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

(10)

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

(11)

``

 

Download groebner.mw

 in maple 12, it can not read table T in another worksheet.

i just want to read table T whenever i want during the running of big loop in procedure manman

 

restart;
with(Groebner):
AllMatrices := proc (A::set, k::posint, n::posint)
local B, C, E:
B := [[]]:
C := proc ()
B := [seq(seq([A[i], op(B[j])], i = 1 .. nops(A)), j = 1 .. nops(B))]:
end proc:
E := (C@@(k*n))(B):
seq(Matrix(k, n, E[m]), m = 1 .. nops(A)^(k*n));
end proc:
mm := AllMatrices({0, 1}, 3, 3);
GetRing := proc(sol)
ringequation := 0;
mono1 := 0;
for j from 1 to 3 do
mono1 := 1;
for i from 1 to nops(sol[1][j]) do
mono1 := mono1*op(i, sol[1][j]);
od:
ringequation := ringequation + mono1;
od:
return ringequation;
end proc;
with(LinearAlgebra):
polylistresult := [];
for i from 1 to nops([mm]) do
sol := MatrixMatrixMultiply(Matrix([[a,b,c]]), op(i,[mm]));
sol := GetRing(sol);
polylistresult := [op(polylistresult), sol];
od:
with(Groebner):
with(Threads):
T := Table();
m := Threads[Mutex][Create]();
manman := proc(T2, m2);
indexlistresult := [];
for i from 2 to nops(polylistresult) do
for j from 2 to nops(polylistresult) do
if i < j then
for k from 2 to nops(polylistresult) do

if j < k then
print("find");
F := [polylistresult[i], polylistresult[j], polylistresult[k]];
h := HilbertSeries(F, {x, y, z}, s);
if h <> 0 then
#if not assigned(T[h]) then
print(h);
Threads[Mutex][Lock]( m2 );
T2[h] := [op(T2[h]), F];
Threads[Mutex][Unlock]( m2 );
end if:
end if:
od:
end if:
od:
od:
end proc:
manman(T, m);
Threads[Mutex][Destroy](m);

another sheet:
Threads[Mutex][Lock]( m );
for i in indices(T) do
print(i);
od:
Threads[Mutex][Unlock]( m );

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);
T3:=lexdeg([a,b,c,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;
T2:=lexdeg([a,b,c],[x,y,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

is it possible to find the input ideal from given hilbert series ?

i ask this because maple out of memory when computing all combination of ideals

which book teach how to design hilbert series

i want to research hilbert series and construct similar invariants to classify ideals

i do not know how many memory in order to do this. hope maple can display how much memory need before computation of all combination and display how long will wait for it finish computation.

my home computer can not afford this computation

 

EDIT:
Let f:X->f(X)  be a polynomial function from C^n to C^p. Let r(X) be the rank of the Jacobian matrix of f in X. What is the maximal value of r(X) when X goes throught C^n ?

In other words, I'd want to obtain the maximal dimension of the components of im(f). 

How to proceed ?

Thanks in advance.

I try to sort a polynomial using the graded reverse lexicograpic order. According to the Documentation this is achieved via tdeg.
So here is what i tried:

 

with(Groebner):
sort( x+y+z, order = tdeg(x,y,z));

or

sort(x+y+z, [x,y,z], tdeg);

In both cases maple returns "x+y+z" instead of the expected "z+y+x". What am i doing wrong?

 

 

computer a Gröbner basis for <f_[1] = x^2*y - 2*y*z + 1, f_[2] = x*y^2-z^2+ 2*x,  f_[3] = y^2*z - x^2+ 5 > belong to Q[x,y,z], using ≺= <_grlex with x≺y≺z. compare your output to the Gröbner basis the Maple computers with a different order.

how to basis this...

January 17 2014 rit 235

with(Groebner):
with(LinearAlgebra):
T := lexdeg([x1,x2,x3],[e1,e2,e3]);
GB := Basis([e1+.999987406876435, e2-.999919848203811],T):

Error, (in LinearAlgebra:-Basis) invalid input: LinearAlgebra:-Basis expects its 1st argument, V, to be of type {Vector, {set(Vector), list(Vector)}} but received [e1+HFloat(0.9999874068764352), e2-HFloat(0.9999198482038109)]


with(Groebner):
with(LinearAlgebra):
T := lexdeg([x1,x2,x3,x4,x5,x6,x7,x8],[e1,e2]);
GB := Basis([e1-x4*x2^3*x5/(x3*x1^4*x6), e2-x1*x8/(x3*x7)],T):

Error, (in LinearAlgebra:-Basis) invalid input: LinearAlgebra:-Basis expects its 1st argument, V, to be of type {Vector, {set(Vector), list(Vector)}} but received [e1-x4*x2^3*x5/(x3*x1^4*x6), e2-x1*x8/(x3*x7)]

with(Groebner):
with(LinearAlgebra):
T := lexdeg([x1,x2,x3],[e1,e2,e3]);
hello1 := proc(xx,yy)
return MatrixMatrixMultiply(xx,yy);
end proc:
hello2 := proc(xx,yy)
return xx+yy- MatrixMatrixMultiply(xx,yy);
end proc:
m1 := Matrix(3, 3, {(1, 1) = -.737663975994461+0.*I, (1, 2) = -.588973463383001+0.*I, (1, 3) = .330094104689369+0.*I, (2, 1) = -.588012653178741+0.*I, (2, 2) = .320157823261769+0.*I, (2, 3) = -.742792089286083+0.*I, (3, 1) = -.331802619371428+0.*I, (3, 2) = .742030476217061+0.*I, (3, 3) = .582492741708719+0.*I});
m2 := Matrix(3, 3, {(1, 1) = -.742269137704830+0.*I, (1, 2) = -.590598631673326+0.*I, (1, 3) = .316590877121441+0.*I, (2, 1) = -.593533033362923+0.*I, (2, 2) = .360143915024171+0.*I, (2, 3) = -.719732518911068+0.*I, (3, 1) = -.311054762892221+0.*I, (3, 2) = .722142379823161+0.*I, (3, 3) = .617863510611693+0.*I});
m3 := Matrix(3, 3, {(1, 1) = -.751491355856820+0.*I, (1, 2) = -.574908634018322+0.*I, (1, 3) = .323636840615627+0.*I, (2, 1) = -.575794245520782+0.*I, (2, 2) = .332066412772496+0.*I, (2, 3) = -.747123071744916+0.*I, (3, 1) = -.322058579916187+0.*I, (3, 2) = .747804760642505+0.*I, (3, 3) = .580574121936877+0.*I});
AA := hello1(m1, m2);
BB := hello2(m1, m2);
GB := Basis([e1- AA,e2- BB],T):
NormalForm(m3, GB, T);

Two questions:

The algortihms that Groebner[Basis] uses at each step computes some "tentative" or "pseudo-basis". The "tentative" basis is not a Groebner basis but it is in the ideal generated by the original system of polynomial eq.

1) Is this correct ? Provided this is correct, then

2) How can one retrive the last "tentative" basis?
 If I just use timelimit I can abort the computations but how can one retrive the last computation?

 

I have been struggling (reading Ore/Weyl Algebra documentation) to understand how to input a PDE system with polynomial coeff. in Weyl algebra notation so I can compute a Groebner basis for it. I would be very grateful if someone could  show, using the simple example below, which differential operators in Ore_algebra[diff_algebra] should one declare to express the system in Weyl algebra notation. The systems I'm working are more complicated but all have many dependent variables, f and g functions in this example:

pdesys:= [ x*diff( f(x,y,z),x)- z*diff( g(x,y,z),y) = 0, (x^2-y)*diff( f(x,y,z),z)- y*diff( g(x,y,z),z) = 0 ]

1 2 3 Page 1 of 3