Maps of monomials to monomials
Let us assume I have a function F that takes say degree 1 monomials to degree 2 monomials and degree 3 monomials in variable x,y (example: multiplication by x+y2). I have a basis for degree 1 monomials given by x,y; a basis for degree 2 given by x2,xy,y2, and a basis for degree 3 monomials given by x3,x2y,xy2,y3. So if I want to express F as a matrix, I can say g1= F(x), g2=F(y).
Then the first row of my matrix will be coefficient of x2 in g1, coefficient of xy in g1, coefficient of y2 in g1, coefficient of x3 in g1, ...., coefficient of y3 in g1. The second row will just be the same with g1 replaced with g2.
The issue is if I want degree 10 monomials, the writing out each basis element is too much, especially if there were more variables. I was wondering if there was a simpler way in Sage to write this in coding language without writing out each basis element. Suppose I want degree k monomials to degree m and n monomials. Basically, I feel I need some command like the following. I feel there should be a package for this maybe?
- Define F. Let B be a k x (m+n) matrix. Take the space of all degree k monomials (maybe ordered lexigraphically?). Apply F to that space. For each element F is applied to, in the image, extract degree m part. Write it out as a vector in the space of degree m monomials. Same for degree n part. Put vector into part of matrix B.