Ask Your Question
0

how to make an Macaulay matrix from polynoms over GF(2)

asked 2017-11-05 13:57:50 +0200

this post is marked as community wiki

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 flag offensive close merge delete

Comments

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.

B r u n o gravatar imageB r u n o ( 2017-11-06 14:12:42 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-07 12:55:05 +0200

dan_fulea gravatar image

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]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-11-05 13:57:50 +0200

Seen: 430 times

Last updated: Nov 07 '17