Processing math: 100%
Ask Your Question
1

How to express the coefficients of an iterated group action on a basis as a matrix?

asked 3 years ago

tzeentch gravatar image

updated 3 years ago

I have a basis (bi)iI=(1,y1,y2,y21,y1y2,y22,y21y2,y1y22,y21y22), and a group action g on that basis, where g acts by:

g(y1)=y1+1, and g(y2)=y2y21y1.

For each basis element bi, I want the array (bi,g(bi),g2(bi),...,g8(bi)). I want to see the dimension of the vector space spanned by those values.

My first and foremost question is as follows: How can I get sage to put the coefficients of the array of polynomials (in a quotient ring) into columns of a matrix?

I can't seem to get sage to spit out the coefficients at all! I tried S(b_i).coefficients() and S(b_i).list(), and I got AttributeError: 'QuotientRing_generic_with_category.element_class' object has no attribute 'coefficients'

Here is my code for context:

R.<y1, y2> = PowerSeriesRing(GF(3), default_prec = 5)
I = R.ideal(y1^3, y2^3)
S = R.quotient_ring(I)
#defining the group action
g(y1) = y1 + 1
h(y2) = y2 - y1^2 - y1

#defining the basis
b1(y1,y2)= y1
b2(y1,y2)= y1^2
b3(y1,y2)= y1*y2
b4(y1,y2)= y2
b5(y1,y2)= y2^2
b6(y1,y2)= y1^2*y2
b7(y1,y2)= y1*y2^2
b8(y1,y2)= y1^2*y2^2

Secondly, how can I more concisely run the iteration itself? Here is how I implemented an iterated group action on a basis element. I list only the b4 example for readability, the others are the same but with bi

g1b4(y1, y2) = b4(g(y1), h(y2)).expand()
g2b4(y1, y2) = g1b4(g(y1), h(y2)).expand()
g3b4(y1, y2) = g2b4(g(y1), h(y2)).expand()
g4b4(y1, y2) = g3b4(g(y1), h(y2)).expand()
g5b4(y1, y2) = g4b4(g(y1), h(y2)).expand()
g6b4(y1, y2) = g5b4(g(y1), h(y2)).expand()
g7b4(y1, y2) = g6b4(g(y1), h(y2)).expand()
g8b4(y1, y2) = g7b4(g(y1), h(y2)).expand()
g9b4(y1, y2) = g8b4(g(y1), h(y2)).expand()
print(S(g1b4))
print(S(g2b4))
print(S(g3b4))
print(S(g4b4))
print(S(g5b4))
print(S(g6b4))
print(S(g7b4))
print(S(g8b4))
print(S(g9b4))

Edit: I also realized that for b3, the output of iteration has y31 in it, even though we are considering its image in the quotient ring. How could this be happening?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 3 years ago

vdelecroix gravatar image

updated 3 years ago

When you write b1(y1,y2)= y1 this defines b1 as a symbolic function, not a polynomial. Note the difference

sage:     b1(y1,y2)= y1                                                                                                                                                                        
sage: type(b1)                                                                                                                                                                                 
<class 'sage.symbolic.expression.Expression'>
sage: R.<y1,y2> = PolynomialRing(GF(3))                                                                                                                                                        
sage: b1 = y1                                                                                                                                                                                  
sage: type(b1)                                                                                                                                                                                 
<class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>

Because these are different they behave differently.

In the following snippet, I show how to compute the matrix of g, that is [g(1), g(y1), g(y1^2), ...]

R.<y1, y2> = PolynomialRing(GF(3))   # NOTE: don't use series but polynomials
I = R.ideal(y1^3, y2^3)
S = R.quotient_ring(I)

# NOTE: use Python functions
# group action
def transform(poly):
    return S(poly.lift().subs(y1=y1 + 1, y2=y2 - y1^2 - y1))

# defining the basis together with an inverse map
B = list(map(S, [1, y1, y1^2, y1*y2, y2, y2^2, y1^2*y2, y1*y2^2, y1^2*y2^2]))
indices = {monom: i for i, monom in enumerate(B)}

mat = []
for poly in B:
    v = [0] * len(B)
    image = transform(poly).lift()
    for c, m in zip(image.coefficients(), image.monomials()):
        v[indices[m]] = c
    mat.append(v)
mat = matrix(mat).transpose()
print(mat)
Preview: (hide)
link

Comments

If I understand correctly, your code outputs one matrix: (g(e)) for each e in E, that is: (g(1), g(y1), g(y1^2), ...., g(y1^2y2^2)). However, I would like a matrix recursively applying the group action ((e, g(e), ..., g^8(e)) for each e in E, giving 9 matrices. How can one encode the recursive use of the group action?

tzeentch gravatar imagetzeentch ( 3 years ago )
1

You are right. To turn it into an answer to your question, you just need to change the lines building the matrix. You can design a simple loop for making the list mat = [poly, transform(poly), transform(transform(poly)), ...].

vdelecroix gravatar imagevdelecroix ( 3 years ago )
1

answered 3 years ago

tzeentch gravatar image

updated 3 years ago

Just in case this is helpful for anyone else, here is the functional code answering my original question:

R.<y1, y2> = PolynomialRing(GF(3))   
I = R.ideal(y1^3, y2^3)
S = R.quotient_ring(I)

# group action
def transform(poly):
    return S(poly.lift().subs(y1=y1 + 1, y2=y2 - y1^2 - y1))

#iterating the group action
def right_iterate(n, g, poly):
    gg = poly
    for k in range(n):
        gg = g(gg)
    return gg 

#defining the basis
E = list(map(S, [1, y1, y1^2, y1*y2, y2, y2^2, y1^2*y2, y1*y2^2, y1^2*y2^2]))
indices = {monom: i for i, monom in enumerate(E)}

for poly in E:
    mat = []
    for i in range(9):
        v = [0]*len(E)
        image = right_iterate(i,transform,poly).lift()
        for c, m in zip(image.coefficients(), image.monomials()):
            v[indices[m]] = c
        mat.append(v)
    mat = matrix(mat).transpose()
    print("__")
    print(poly)
    print(mat.echelon_form().row_space())
Preview: (hide)
link

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 385 times

Last updated: Apr 26 '21