1 | initial version |
@tmonteil's answer says it all. What I have to add is more a comment than an answer.
For a question on ask-sage, why not use simpler names and provide readable code?
sage: Z9 = Zmod(9)
sage: R.<a,b,c,d> = PolynomialRing(Z9)
sage: m = matrix(R, 2, [[1+3*a,3*b],[3*c,1+3*d]])
sage: g = matrix(R, 2,[[2,1],[2,6]])
sage: gi = matrix(R, 2,[[6,8],[7,2]]) # this is g inverse
sage: g * gi
[1 0]
[0 1]
sage: g * m * gi
[ 6*b + 3*d + 1 3*a + 3*b + 6*c + 6*d]
[ 6*b 3*a + 3*b + 1]
sage: (m * gi)[0,0] * g[1,0] + (m * gi)[1,0] * g[1,1]
6*b