ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 29 Mar 2017 06:14:38 -0500Computation of reduced Grobner basishttp://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/ Currently I am reading one research paper http://www.ijpam.eu/contents/2010-62-4/11/11.pdf on page 486 equation 9 and 10 are describing an ideal, whereas on page 487 , Grobner basis has been calculated w.r.t ideal associated with ternary Goaly code.I understood the proof on page 486, but unable to compute the Grobner basis by using sage.Sat, 03 Dec 2016 07:31:57 -0600http://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/Comment by Nilesh for <p>Currently I am reading one research paper <a href="http://www.ijpam.eu/contents/2010-62-4/11/11.pdf">http://www.ijpam.eu/contents/2010-62-...</a> on page 486 equation 9 and 10 are describing an ideal, whereas on page 487 , Grobner basis has been calculated w.r.t ideal associated with ternary Goaly code.I understood the proof on page 486, but unable to compute the Grobner basis by using sage.</p>
http://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/?comment=35908#post-id-35908No, I am not getting, how to define this ideal? I have created following generator matrix of a linear code i.e.ternary Golay code using sage
G2=matrix(FiniteField(3),[[1,0,0,0,0,0,1,1,1,1,1],
[0,1,0,0,0,0,0,1,2,2,1],
[0,0,1,0,0,0,1,0,1,2,2],
[0,0,0,1,0,0,2,1,0,1,2],
[0,0,0,0,1,0,2,2,1,0,1],
[0,0,0,0,0,1,1,2,2,1,0]])
print(G2)
C = LinearCode(G2); C
C.length()
But then not able to construct the ideal viz:
I=<x^c-x^c' /c-c' belongs to C>+<xi^p-1 / 1<=i<=n>,
I think,once ideal is constructed, then next thing will be easy.Sun, 04 Dec 2016 00:27:23 -0600http://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/?comment=35908#post-id-35908Comment by slelievre for <p>Currently I am reading one research paper <a href="http://www.ijpam.eu/contents/2010-62-4/11/11.pdf">http://www.ijpam.eu/contents/2010-62-...</a> on page 486 equation 9 and 10 are describing an ideal, whereas on page 487 , Grobner basis has been calculated w.r.t ideal associated with ternary Goaly code.I understood the proof on page 486, but unable to compute the Grobner basis by using sage.</p>
http://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/?comment=35897#post-id-35897@Nilesh --
Please describe what you have tried so far. Have you been able to define the ideal?Sat, 03 Dec 2016 08:41:50 -0600http://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/?comment=35897#post-id-35897Answer by dan_fulea for <p>Currently I am reading one research paper <a href="http://www.ijpam.eu/contents/2010-62-4/11/11.pdf">http://www.ijpam.eu/contents/2010-62-...</a> on page 486 equation 9 and 10 are describing an ideal, whereas on page 487 , Grobner basis has been calculated w.r.t ideal associated with ternary Goaly code.I understood the proof on page 486, but unable to compute the Grobner basis by using sage.</p>
http://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/?answer=37124#post-id-37124If i've got the right message of the cited paper, than the following sage code computes the toric ideal `I` of the ($\mathbb{Z}$-lift of the) parity check matrix for the linear code `C` of `G=G2` posted above, also associates the ideal `J` generated by the $X_j^3-1$, $X_j$ being a running variable through the ones of the polynomial ring of `I`, then takes the sum `K = I + J` . Its generator list is the sum of the two generator lists for `I` and `J`.
This `K` is the ideal $I_{\mathcal C}$ from (9) and (10) of loc. cit.
We finally compute the Groebner basis of `K` as in the Example of loc. cit., page 487.
(In order to get the right basis, it is important to have the lex order on the ring $R$, where $I, J, K$ live in. The default order leads to a mess. So the first line is the important one, then we pass this polynomial ring to the `ToricIdeal` constructor.)
R.<X01, X02, X03, X04, X05, X06, X07, X08, X09, X10, X11> \
= PolynomialRing( QQ, order='lex' ) # sine lex, nulla salus
G = matrix( GF(3),
[ [1,0,0,0,0,0, 1,1,1,1,1] ,
[0,1,0,0,0,0, 0,1,2,2,1] ,
[0,0,1,0,0,0, 1,0,1,2,2] ,
[0,0,0,1,0,0, 2,1,0,1,2] ,
[0,0,0,0,1,0, 2,2,1,0,1] ,
[0,0,0,0,0,1, 1,2,2,1,0] ] )
# This is [ I | M ] as in loc. cit., Example, page 487.
print G
C = LinearCode( G )
print C
H = C.parity_check_matrix()
# we do not print H
I = ToricIdeal( H, polynomial_ring = R )
J = ideal( z^3-1 for z in I.parent().ring().gens() )
K = I + J
print "\nI is generated by:"
for pol in I.gens(): print " %s" % pol
print "\nJ is generated by:"
for pol in J.gens(): print " %s" % pol
print "\nK is generated by:"
for pol in K.gens(): print " %s" % pol
print "\nK has the Groebner basis:"
for pol in K.groebner_basis(): print " %s" % pol
This delivers:
[1 0 0 0 0 0 1 1 1 1 1]
[0 1 0 0 0 0 0 1 2 2 1]
[0 0 1 0 0 0 1 0 1 2 2]
[0 0 0 1 0 0 2 1 0 1 2]
[0 0 0 0 1 0 2 2 1 0 1]
[0 0 0 0 0 1 1 2 2 1 0]
Linear code of length 11, dimension 6 over Finite Field of size 3
I is generated by:
-X01*X02*X03^2*X04^2*X05 + X11
-X01*X02*X03*X05^2 + X10
-X01*X03^2*X04*X05^2 + X09
-X01*X02^2*X03*X04^2 + X08
-X01*X02^2*X04*X05 + X07
-X02^2*X03^2*X04^2*X05^2 + X06
J is generated by:
X01^3 - 1
X02^3 - 1
X03^3 - 1
X04^3 - 1
X05^3 - 1
X06^3 - 1
X07^3 - 1
X08^3 - 1
X09^3 - 1
X10^3 - 1
X11^3 - 1
K is generated by:
-X01*X02*X03^2*X04^2*X05 + X11
-X01*X02*X03*X05^2 + X10
-X01*X03^2*X04*X05^2 + X09
-X01*X02^2*X03*X04^2 + X08
-X01*X02^2*X04*X05 + X07
-X02^2*X03^2*X04^2*X05^2 + X06
X01^3 - 1
X02^3 - 1
X03^3 - 1
X04^3 - 1
X05^3 - 1
X06^3 - 1
X07^3 - 1
X08^3 - 1
X09^3 - 1
X10^3 - 1
X11^3 - 1
K has the Groebner basis:
X01 - X07^2*X08^2*X09^2*X10^2*X11^2
X02 - X08^2*X09*X10*X11^2
X03 - X07^2*X09^2*X10*X11
X04 - X07*X08^2*X10^2*X11
X05 - X07*X08*X09^2*X11^2
X06 - X07^2*X08*X09*X10^2
X07^3 - 1
X08^3 - 1
X09^3 - 1
X10^3 - 1
X11^3 - 1
And matches.Wed, 29 Mar 2017 06:14:38 -0500http://ask.sagemath.org/question/35894/computation-of-reduced-grobner-basis/?answer=37124#post-id-37124