1 | initial version |
How is this?
sage: dim=4
sage: F = PolynomialRing(QQ, dim,'X')
sage: I = F.ideal([x*y for x,y in tuples(F.gens(),2)])
sage: pol = [I.reduce(F.random_element()) for i in range(dim)]
sage: pol
[-3*X2, -39/2*X1 - 1/18*X2, -1/10*X0 - 3*X1 - X2 - 1/5*X3, X2 + 6*X3]
sage: matrix(dim,lambda i,j:pol[i].coefficient(F.gen(j)))
[ 0 0 -3 0]
[ 0 -39/2 -1/18 0]
[-1/10 -3 -1 -1/5]
[ 0 0 1 6]