0

I am in the following situation:

S=QQ[x_0..x_n];

for i from 0 to n do for j from i to n do d_{i,j} = x_i*x_j;

Now I would like to construct a vector whose elements are

d_{0,0}=x_0^2,d_{0,1}=x_0*x_1,...,d_{0,n}=x_0*x_n,d_{1,1}=x_1^2,d_{1,2}=x_1*x_2,...,d_{n,n}=x_n^2

How can I do this in MacAulay2? Thank you very much.

BlaCa
  • 103
  • 4

2 Answers2

1

In Macaulay2, vector refers to a column vector, and if we have vector elements, we can construct the following vector:

SQ= for i from 0 to n list d_{i}
vector(SQ)

But since the vector you want is not a column vector, it's best to make a matrix:

d=mutableMatrix genericMatrix(S,n,n)
for i from 0 to n do for j from 0 to n do d_(i,j)=x_i*x_j
tarashi
  • 23
  • 8
1

This may be what you are looking for.

m=ideal(S_*)
m^2_*

The _* operator gets the generators of an ideal. So, m is the maximal ideal, and you are looking for the generators of m^2.

Alternatively

flatten entries basis(2,S)

which simply gives you the vector basis of the ring S in degree 2.

Jay
  • 983
  • 2
  • 8
  • 23