sage: set_random_seed()
sage: x = random_eja().random_element()
- sage: x.matrix()*x.vector() == (x^2).vector()
+ sage: x.operator_matrix()*x.vector() == (x^2).vector()
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).matrix()
- sage: Lxn = (x^n).matrix()
+ sage: Lxm = (x^m).operator_matrix()
+ sage: Lxn = (x^n).operator_matrix()
sage: Lxm*Lxn == Lxn*Lxm
True
elif n == 1:
return self
else:
- return A.element_class(A, (self.matrix()**(n-1))*self.vector())
+ return A( (self.operator_matrix()**(n-1))*self.vector() )
def characteristic_polynomial(self):
if not other in self.parent():
raise ArgumentError("'other' must live in the same algebra")
- A = self.matrix()
- B = other.matrix()
+ A = self.operator_matrix()
+ B = other.operator_matrix()
return (A*B == B*A)
sage: J = random_eja()
sage: x = J.random_element()
sage: y = J.random_element()
- sage: Lx = x.matrix()
- sage: Ly = y.matrix()
- sage: Lxx = (x*x).matrix()
- sage: Lxy = (x*y).matrix()
+ sage: Lx = x.operator_matrix()
+ sage: Ly = y.operator_matrix()
+ sage: Lxx = (x*x).operator_matrix()
+ sage: Lxy = (x*y).operator_matrix()
sage: bool(2*Lx*Lxy + Ly*Lxx == 2*Lxy*Lx + Lxx*Ly)
True
sage: x = J.random_element()
sage: y = J.random_element()
sage: z = J.random_element()
- sage: Lx = x.matrix()
- sage: Ly = y.matrix()
- sage: Lz = z.matrix()
- sage: Lzy = (z*y).matrix()
- sage: Lxy = (x*y).matrix()
- sage: Lxz = (x*z).matrix()
+ sage: Lx = x.operator_matrix()
+ sage: Ly = y.operator_matrix()
+ sage: Lz = z.operator_matrix()
+ sage: Lzy = (z*y).operator_matrix()
+ sage: Lxy = (x*y).operator_matrix()
+ sage: Lxz = (x*z).operator_matrix()
sage: bool(Lx*Lzy + Lz*Lxy + Ly*Lxz == Lzy*Lx + Lxy*Lz + Lxz*Ly)
True
sage: u = J.random_element()
sage: y = J.random_element()
sage: z = J.random_element()
- sage: Lu = u.matrix()
- sage: Ly = y.matrix()
- sage: Lz = z.matrix()
- sage: Lzy = (z*y).matrix()
- sage: Luy = (u*y).matrix()
- sage: Luz = (u*z).matrix()
- sage: Luyz = (u*(y*z)).matrix()
+ sage: Lu = u.operator_matrix()
+ sage: Ly = y.operator_matrix()
+ sage: Lz = z.operator_matrix()
+ sage: Lzy = (z*y).operator_matrix()
+ sage: Luy = (u*y).operator_matrix()
+ sage: Luz = (u*z).operator_matrix()
+ sage: Luyz = (u*(y*z)).operator_matrix()
sage: lhs = Lu*Lzy + Lz*Luy + Ly*Luz
sage: rhs = Luyz + Ly*Lu*Lz + Lz*Lu*Ly
sage: bool(lhs == rhs)
fda_elt = FiniteDimensionalAlgebraElement(self.parent(), self)
return fda_elt.matrix().transpose()
+ #
+ # The plan is to eventually phase out "matrix()", which sounds
+ # too much like "matrix_representation()", in favor of the more-
+ # accurate "operator_matrix()". But we need to override matrix()
+ # to keep parent class methods happy in the meantime.
+ #
+ operator_matrix = matrix
+
def minimal_polynomial(self):
"""
elif not other in self.parent():
raise ArgumentError("'other' must live in the same algebra")
- return ( self.matrix()*other.matrix()
- + other.matrix()*self.matrix()
- - (self*other).matrix() )
+ L = self.operator_matrix()
+ M = other.operator_matrix()
+ return ( L*M + M*L - (self*other).operator_matrix() )
def span_of_powers(self):
sage: set_random_seed()
sage: x = random_eja().random_element()
sage: u = x.subalgebra_generated_by().random_element()
- sage: u.matrix()*u.vector() == (u**2).vector()
+ sage: u.operator_matrix()*u.vector() == (u**2).vector()
True
"""
s = 0
minimal_dim = V.dimension()
for i in xrange(1, V.dimension()):
- this_dim = (u**i).matrix().image().dimension()
+ this_dim = (u**i).operator_matrix().image().dimension()
if this_dim < minimal_dim:
minimal_dim = this_dim
s = i
# Beware, solve_right() means that we're using COLUMN vectors.
# Our FiniteDimensionalAlgebraElement superclass uses rows.
u_next = u**(s+1)
- A = u_next.matrix()
+ A = u_next.operator_matrix()
c_coordinates = A.solve_right(u_next.vector())
# Now c_coordinates is the idempotent we want, but it's in