# We need to supply something here to avoid getting the
# default Homset of the parent FiniteDimensionalAlgebra class,
- # which messes up e.g. equality testing.
- parent = Hom(domain_eja, codomain_eja, VectorSpaces(F))
+ # which messes up e.g. equality testing. We use FreeModules(F)
+ # instead of VectorSpaces(F) because our characteristic polynomial
+ # algorithm will need to F to be a polynomial ring at some point.
+ # When F is a field, FreeModules(F) returns VectorSpaces(F) anyway.
+ parent = Hom(domain_eja, codomain_eja, FreeModules(F))
# The Map initializer will set our parent to a homset, which
# is explicitly NOT what we want, because these ain't algebra
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):
sage: lhs == rhs
True
+ Test the first polarization identity from my notes, Koecher Chapter
+ III, or from Baes (2.3)::
+
+ sage: set_random_seed()
+ sage: J = random_eja()
+ sage: x = J.random_element()
+ sage: y = J.random_element()
+ sage: Lx = x.operator()
+ sage: Ly = y.operator()
+ sage: Lxx = (x*x).operator()
+ sage: Lxy = (x*y).operator()
+ sage: bool(2*Lx*Lxy + Ly*Lxx == 2*Lxy*Lx + Lxx*Ly)
+ True
+
+ Test the second polarization identity from my notes or from
+ Baes (2.4)::
+
+ sage: set_random_seed()
+ sage: J = random_eja()
+ sage: x = J.random_element()
+ sage: y = J.random_element()
+ sage: z = J.random_element()
+ sage: Lx = x.operator()
+ sage: Ly = y.operator()
+ sage: Lz = z.operator()
+ sage: Lzy = (z*y).operator()
+ sage: Lxy = (x*y).operator()
+ sage: Lxz = (x*z).operator()
+ sage: bool(Lx*Lzy + Lz*Lxy + Ly*Lxz == Lzy*Lx + Lxy*Lz + Lxz*Ly)
+ True
+
+ Test the third polarization identity from my notes or from
+ Baes (2.5)::
+
+ sage: set_random_seed()
+ sage: J = random_eja()
+ sage: u = J.random_element()
+ sage: y = J.random_element()
+ sage: z = J.random_element()
+ sage: Lu = u.operator()
+ sage: Ly = y.operator()
+ sage: Lz = z.operator()
+ sage: Lzy = (z*y).operator()
+ sage: Luy = (u*y).operator()
+ sage: Luz = (u*z).operator()
+ sage: Luyz = (u*(y*z)).operator()
+ sage: lhs = Lu*Lzy + Lz*Luy + Ly*Luz
+ sage: rhs = Luyz + Ly*Lu*Lz + Lz*Lu*Ly
+ sage: bool(lhs == rhs)
+ True
+
"""
if not other in self.parent():
raise TypeError("'other' must live in the same algebra")
Our parent class defines ``left_matrix`` and ``matrix``
methods whose names are misleading. We don't want them.
"""
- raise NotImplementedError("use operator_matrix() instead")
+ raise NotImplementedError("use operator().matrix() instead")
matrix = left_matrix
# We get back a symbolic polynomial in 'x' but want a real
# polynomial in 't'.
- p_of_x = elt.operator_matrix().minimal_polynomial()
+ p_of_x = elt.operator().matrix().minimal_polynomial()
return p_of_x.change_variable_name('t')
"""
P = self.parent()
+ fda_elt = FiniteDimensionalAlgebraElement(P, self)
return FiniteDimensionalEuclideanJordanAlgebraOperator(
- P,P,
- self.operator_matrix() )
-
-
-
- def operator_matrix(self):
- """
- Return the matrix that represents left- (or right-)
- multiplication by this element in the parent algebra.
-
- We implement this ourselves to work around the fact that
- our parent class represents everything with row vectors.
-
- EXAMPLES:
-
- Test the first polarization identity from my notes, Koecher Chapter
- III, or from Baes (2.3)::
-
- sage: set_random_seed()
- sage: J = random_eja()
- sage: x = J.random_element()
- sage: y = J.random_element()
- 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
-
- Test the second polarization identity from my notes or from
- Baes (2.4)::
-
- sage: set_random_seed()
- sage: J = random_eja()
- sage: x = J.random_element()
- sage: y = J.random_element()
- sage: z = J.random_element()
- 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
-
- Test the third polarization identity from my notes or from
- Baes (2.5)::
-
- sage: set_random_seed()
- sage: J = random_eja()
- sage: u = J.random_element()
- sage: y = J.random_element()
- sage: z = J.random_element()
- 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)
- True
-
- Ensure that our operator's ``matrix`` method agrees with
- this implementation::
-
- sage: set_random_seed()
- sage: J = random_eja()
- sage: x = J.random_element()
- sage: x.operator().matrix() == x.operator_matrix()
- True
-
- """
- fda_elt = FiniteDimensionalAlgebraElement(self.parent(), self)
- return fda_elt.matrix().transpose()
+ P,
+ P,
+ fda_elt.matrix().transpose() )
def quadratic_representation(self, other=None):
sage: x.subalgebra_generated_by().is_associative()
True
- Squaring in the subalgebra should be the same thing as
- squaring in the superalgebra::
+ Squaring in the subalgebra should work the same as in
+ the superalgebra::
sage: set_random_seed()
sage: x = random_eja().random_element()
sage: u = x.subalgebra_generated_by().random_element()
- sage: u.operator_matrix()*u.vector() == (u**2).vector()
+ sage: u.operator()(u) == u^2
True
"""
s = 0
minimal_dim = V.dimension()
for i in xrange(1, V.dimension()):
- this_dim = (u**i).operator_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.operator_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