# Multiplying elements of D4

I have the following group presentation $D_4 = \langle r,s | r^4 = s^2 = rsrs = 1 \rangle$.

This is written in sage as

F.<r,s> = FreeGroup()
D4 = F / [r^4, s^2, r*s*r*s, 1]
r,s = D4.gens()


Say I wanted to compute s^2, this should equal 1 but sage gives me just s^2.

s^2


output:

s^2


I am doing more involved calculations and I want to return the result in the simplified form. How do I simplify the expression in sage?

edit retag close merge delete

Sort by » oldest newest most voted Reduction here can be performed via rewriting system - like:

R = D4.rewriting_system()
R.reduce(s^2)

more

Thanks, this seems to work. However I got another problem when constructing my expression by using the generators of D4 in a group algebra:

F.<r,s> = FreeGroup()
D4 = F / [r^4, s^2, r*s*r*s, 1]
R = D4.rewriting_system()
A = D4.algebra(QQ)
r,s = A.gens()
e = r + s
R.reduce(e^3)


I get the error "unsupported operand parent(s) for >: 'Integer Ring' and '<class 'tuple'="">'".

When using the permutation group instead of the presentation of the group it seems to give the simplified result directly without needing to use R.reduce(...), but I don't want the result in cycle notation.

Perhaps, you'd need to explicitly apply reduce to the terms of e^3 - like: sum(c*A(R.reduce(t)) for t,c in e^3)