# how to make an Macaulay matrix from polynoms over GF(2) This post is a wiki. Anyone with karma >750 is welcome to improve it.

I have a PolynomialRing(GF(2),'x1,x2,x3') and over it two polynomials x1*x2 + x1*x3 + x1, x1+x2+1 and I would like to rewrite it in Macaulay matrix in order x1x1, x1x2, x2x2, x1x3, x2x3, x3x3,x1,x2,x3, absolute term so it should be

0 1 0 1 0 0 1 0 0 0
0 0 0 0 0 0 1 1 0 1


Is there something in sage ?

edit retag close merge delete

It seems that the only related function is R.macaulay_resultant(...) if R is your polynomial ring, that takes a list of $n$ homogeneous polynomials (if $n$ is the number of variable) and computes their Macaulay resultant. You can inspect the code (using for instance R.macaulay_resultant??) and copy the parts that are useful for your needs.

Sort by » oldest newest most voted

I suppose that the question wants to build the corresponding matrix in the peculiar order of all monomials of degree $\le 2$ given above, that works for all (not so many) possible polynomials of degree $\le 2$ in the given ring. The hint MacCaulay was actively ignored in my following answer / sample code, since i considered the task as a task of identifying coefficients of polynomials.

F = GF(2)
R.<x1,x2,x3> = PolynomialRing( F )
p, q = x1*x2 + x1*x3 + x1, x1 + x2 + 1

degrees = ( (2,0,0),
(1,1,0),
(0,2,0),
(1,0,1),
(0,1,1),
(0,0,2),
(1,0,0),
(0,1,0),
(0,0,1),
(0,0,0), )
d = len(degrees)

print matrix( F, 2, d, [ [ pol.coefficient( dict( zip( (x1,x2,x3) , degtuple ) ) )
for degtuple in degrees ]
for pol in ( p, q ) ] )


This gives:

[0 1 0 1 0 0 1 0 0 0]
[0 0 0 0 0 0 1 1 0 1]

more