EXAMPLES:
sage: from sage.structure.coerce_actions import IntegerMulAction
sage: act = IntegerMulAction(ZZ, CDF)
sage: ~act
...
TypeError: No generic module division by Z.
EXAMPLES:
sage: from sage.structure.coerce_actions import IntegerMulAction
sage: act = IntegerMulAction(ZZ, GF(101))
sage: act(3, 9)
27
sage: act(3^689, 9)
42
sage: 3^689 * mod(9, 101)
42
Use round off error to verify this is doing actual repeated addition instead of just multiplying:
sage: act = IntegerMulAction(ZZ, RR)
sage: act(49, 1/49) == 49*RR(1/49)
False
EXAMPLES:
sage: from sage.structure.coerce_actions import IntegerMulAction
sage: IntegerMulAction(ZZ, GF(5))
Left Integer Multiplication by Integer Ring on Finite Field of size 5
A left module action is an action that takes the ring element as the first argument (the left side) and the module element as the second argument (the right side).
EXAMPLES:
sage: from sage.structure.coerce_actions import LeftModuleAction
sage: R.<x> = QQ['x']
sage: A = LeftModuleAction(ZZ, R)
sage: A(5, x+1)
5*x + 5
sage: R.<x> = ZZ['x']
sage: A = LeftModuleAction(QQ, R)
sage: A(1/2, x+1)
1/2*x + 1/2
sage: A._call_(1/2, x+1) # safe only when arguments have exactly the correct parent
1/2*x + 1/2
The default name of this action type, which is has a sane default.
EXAMPLES:
sage: from sage.structure.coerce_actions import LeftModuleAction, RightModuleAction
sage: A = LeftModuleAction(ZZ, ZZ['x']); A
Left scalar multiplication by Integer Ring on Univariate Polynomial Ring in x over Integer Ring
sage: A._repr_name_()
'scalar multiplication'
sage: RightModuleAction(GF(5), GF(5)[['t']])
Right scalar multiplication by Finite Field of size 5 on Power Series Ring in t over Finite Field of size 5
The codomain of self, which may or may not be equal to the domain.
EXAMPLES:
sage: from sage.structure.coerce_actions import LeftModuleAction
sage: A = LeftModuleAction(QQ, ZZ['x,y,z'])
sage: A.codomain()
Multivariate Polynomial Ring in x, y, z over Rational Field
The domain of self, which is the module that is being acted on.
EXAMPLES:
sage: from sage.structure.coerce_actions import LeftModuleAction
sage: A = LeftModuleAction(QQ, ZZ['x,y,z'])
sage: A.domain()
Multivariate Polynomial Ring in x, y, z over Integer Ring
A right module action is an action that takes the module element as the first argument (the left side) and the ring element as the second argument (the right side).
EXAMPLES:
sage: from sage.structure.coerce_actions import RightModuleAction
sage: R.<x> = QQ['x']
sage: A = RightModuleAction(ZZ, R)
sage: A(x+5, 2)
2*x + 10
sage: A._call_(x+5, 2) # safe only when arguments have exactly the correct parent
2*x + 10