return FiniteDimensionalEuclideanJordanAlgebraMorphism(self, x)
+ def one(self):
+ """
+ Return the identity morphism, but as a member of the right
+ space (so that we can add it, multiply it, etc.)
+ """
+ cols = self.domain().dimension()
+ rows = self.codomain().dimension()
+ mat = identity_matrix(self.base_ring(), rows, cols)
+ return FiniteDimensionalEuclideanJordanAlgebraMorphism(self, mat)
+
+
+
class FiniteDimensionalEuclideanJordanAlgebraMorphism(FiniteDimensionalAlgebraMorphism):
"""
A linear map between two finite-dimensional EJAs.
__mul__ = _lmul_
+ def __pow__(self, n):
+ """
+
+ TESTS::
+
+ sage: J = JordanSpinEJA(4)
+ sage: e0,e1,e2,e3 = J.gens()
+ sage: x = -5/2*e0 + 1/2*e2 + 20*e3
+ sage: Qx = x.quadratic_representation()
+ sage: Qx^0
+ Morphism from Euclidean Jordan algebra of degree 4 over Rational
+ Field to Euclidean Jordan algebra of degree 4 over Rational Field
+ given by matrix
+ [1 0 0 0]
+ [0 1 0 0]
+ [0 0 1 0]
+ [0 0 0 1]
+ sage: (x^0).quadratic_representation() == Qx^0
+ True
+
+ """
+ if n == 0:
+ # We get back the stupid identity morphism which doesn't
+ # live in the right space.
+ return self.parent().one()
+ elif n == 1:
+ return self
+ else:
+ return FiniteDimensionalAlgebraMorphism.__pow__(self,n)
+
+
def _neg_(self):
"""
Negate this morphism.
sage: n = ZZ.random_element(1,10)
sage: J = JordanSpinEJA(n)
sage: x = J.random_element()
- sage: while x.is_zero():
+ sage: while not x.is_invertible():
....: x = J.random_element()
sage: x_vec = x.vector()
sage: x0 = x_vec[0]
sage: x_bar = x_vec[1:]
- sage: coeff = 1/(x0^2 - x_bar.inner_product(x_bar))
+ sage: coeff = ~(x0^2 - x_bar.inner_product(x_bar))
sage: inv_vec = x_vec.parent()([x0] + (-x_bar).list())
sage: x_inverse = coeff*inv_vec
sage: x.inverse() == J(x_inverse)