From c1a571e4ac42dbc6949a06d43dca502563fd9096 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 26 Jul 2019 12:12:41 -0400 Subject: [PATCH] eja: new class FiniteDimensionalEuclideanJordanAlgebraMorphism. This is the first step towards implementing left-multiplication operators and quadratic-representations properly. --- mjo/eja/euclidean_jordan_algebra.py | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 8bd10cc..fcaf100 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -11,6 +11,77 @@ from sage.structure.category_object import normalize_names from sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra import FiniteDimensionalAlgebra from sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra_element import FiniteDimensionalAlgebraElement +from sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra_morphism import FiniteDimensionalAlgebraMorphism + + +class FiniteDimensionalEuclideanJordanAlgebraMorphism(FiniteDimensionalAlgebraMorphism): + """ + A very thin wrapper around FiniteDimensionalAlgebraMorphism that + does only two 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. + + 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. + """ + def __init__(self, parent, f): + FiniteDimensionalAlgebraMorphism.__init__(self, + parent, + f.transpose(), + unitary=False, + check=False) + + + def _repr_(self): + """ + We override only the representation that is shown to the user, + because we want the matrix to be with respect to COLUMN vectors. + + TESTS: + + Ensure that we see the transpose of the underlying matrix object: + + sage: J = RealSymmetricEJA(3) + sage: x = J.linear_combination(zip(range(len(J.gens())), J.gens())) + sage: L = x.operator() + sage: L + Morphism from Euclidean Jordan algebra of degree 6 over Rational + Field to Euclidean Jordan algebra of degree 6 over Rational Field + given by matrix + [ 0 1 2 0 0 0] + [1/2 3/2 2 1/2 1 0] + [ 1 2 5/2 0 1/2 1] + [ 0 1 0 3 4 0] + [ 0 1 1/2 2 4 2] + [ 0 0 2 0 4 5] + sage: L._matrix + [ 0 1/2 1 0 0 0] + [ 1 3/2 2 1 1 0] + [ 2 2 5/2 0 1/2 2] + [ 0 1/2 0 3 2 0] + [ 0 1 1/2 4 4 4] + [ 0 0 1 0 2 5] + + """ + return "Morphism from {} to {} given by matrix\n{}".format( + self.domain(), self.codomain(), self.matrix()) + + def matrix(self): + """ + Return the matrix of this morphism with respect to a left-action + on column vectors. + """ + return FiniteDimensionalAlgebraMorphism.matrix(self).transpose() + class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): @staticmethod -- 2.44.2