sage: set_random_seed()
sage: x = random_eja().random_element()
- sage: x.operator_matrix()*x.vector() == (x^2).vector()
+ sage: x.operator()(x) == (x^2)
True
A few examples of power-associativity::
sage: x = random_eja().random_element()
sage: m = ZZ.random_element(0,10)
sage: n = ZZ.random_element(0,10)
- sage: Lxm = (x^m).operator_matrix()
- sage: Lxn = (x^n).operator_matrix()
+ sage: Lxm = (x^m).operator()
+ sage: Lxn = (x^n).operator()
sage: Lxm*Lxn == Lxn*Lxm
True
"""
- A = self.parent()
if n == 0:
- return A.one()
+ return self.parent().one()
elif n == 1:
return self
else:
- return A( (self.operator_matrix()**(n-1))*self.vector() )
+ return (self.operator()**(n-1))(self)
def apply_univariate_polynomial(self, p):