5 | | sage: M=Matrix(GF(3),[[1,2],[1,1]]) |
6 | | sage: G=MatrixGroup([M]) |
7 | | sage: g=G.0 |
8 | | sage: p=x*y^2 |
9 | | sage: g(p) |
10 | | x^3 + x^2*y - x*y^2 - y^3 |
11 | | sage: _==(x+2*y)*(x+y)^2 |
| 5 | sage: M = Matrix(GF(3),[[1,2],[1,1]]) |
| 6 | sage: N = Matrix(GF(3),[[2,2],[2,1]]) |
| 7 | sage: G = MatrixGroup([M,N]) |
| 8 | sage: m = G.0 |
| 9 | sage: n = G.1 |
| 10 | sage: R.<x,y> = GF(3)[] |
| 11 | sage: m*x |
| 12 | x + y |
| 13 | sage: x*m |
| 14 | x - y |
| 15 | sage: (n*m)*x == n*(m*x) |
| 16 | True |
| 17 | sage: x*(n*m) == (x*n)*m |
15 | | Although it concerns `matrix_group_element.py`, I believe this ticket belongs to Commutative Algebra, for two reasons: |
16 | | 1. An efficient implementation probably requires knowledge of the guts of MPolynomialElement. |
17 | | 2. My long-term goal is to re-implement my algorithms for the computation of non-modular invariant rings. The current implementation is in the `finvar.lib` library of Singular -- the slow Singular interpreter sometimes is a bottle necks. |
18 | | |
19 | | One more general technical question: It is `matrix_group_element.py`, hence seems to be pure python. Is it possible to define an additional method in some `.pyx` file using Cython? I don't know if this would be reasonable to do here, but perhaps this could come in handy at some point... |
| 21 | On the other hand, we still want to have the usual action on vectors or matrices: |
| 22 | {{{ |
| 23 | sage: x = vector([1,1]) |
| 24 | sage: x*m |
| 25 | (2, 0) |
| 26 | sage: m*x |
| 27 | (0, 2) |
| 28 | sage: (n*m)*x == n*(m*x) |
| 29 | True |
| 30 | sage: x*(n*m) == (x*n)*m |
| 31 | True |
| 32 | }}} |
| 33 | {{{ |
| 34 | sage: x = matrix([[1,2],[1,1]]) |
| 35 | sage: x*m |
| 36 | [0 1] |
| 37 | [2 0] |
| 38 | sage: m*x |
| 39 | [0 1] |
| 40 | [2 0] |
| 41 | sage: (n*m)*x == n*(m*x) |
| 42 | True |
| 43 | sage: x*(n*m) == (x*n)*m |
| 44 | True |
| 45 | }}} |