- if x in self.base_ring():
- cols = self.domain().dimension()
- rows = self.codomain().dimension()
- x = x*identity_matrix(self.codomain().base_ring(), rows, cols)
- return FiniteDimensionalEuclideanJordanAlgebraMorphism(self, x)
-
-
-class FiniteDimensionalEuclideanJordanAlgebraMorphism(FiniteDimensionalAlgebraMorphism):
- """
- A linear map between two finite-dimensional EJAs.
-
- This is a very thin wrapper around FiniteDimensionalAlgebraMorphism
- that does only a few things:
-
- 1. Avoids the ``unitary`` and ``check`` arguments to the constructor
- that will always be ``False``. This is necessary because these
- are homomorphisms with respect to ADDITION, but the SageMath
- machinery wants to check that they're homomorphisms with respect
- to (Jordan) MULTIPLICATION. That obviously doesn't work.
-
- 2. Inputs and outputs the underlying matrix with respect to COLUMN
- vectors, unlike the parent class.
-
- 3. Allows us to add, subtract, negate, multiply (compose), and
- invert morphisms in the obvious way.
-
- If this seems a bit heavyweight, it is. I would have been happy to
- use a the ring morphism that underlies the finite-dimensional
- algebra morphism, but they don't seem to be callable on elements of
- our EJA, and you can't add/multiply/etc. them.
- """
- def _add_(self, other):
- """
- Add two EJA morphisms in the obvious way.
-
- EXAMPLES::
+ if not (self._domain_eja == other._domain_eja and
+ self._codomain_eja == other._codomain_eja):
+ raise ValueError("operator (co)domains must match")
+ return FiniteDimensionalEuclideanJordanAlgebraOperator(
+ self._domain_eja,
+ self._codomain_eja,
+ VectorSpaceMorphism.__add__(self,other))