From: Michael Orlitzky Date: Fri, 12 Mar 2021 12:48:59 +0000 (-0500) Subject: eja: add superalgebra_embedding() for subalgebras. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=757cc5c671346394eff0a6de15c879598e508c61;p=sage.d.git eja: add superalgebra_embedding() for subalgebras. --- diff --git a/mjo/eja/eja_subalgebra.py b/mjo/eja/eja_subalgebra.py index 4458a7e..68f1ce4 100644 --- a/mjo/eja/eja_subalgebra.py +++ b/mjo/eja/eja_subalgebra.py @@ -1,4 +1,5 @@ from sage.matrix.constructor import matrix +from sage.misc.cachefunc import cached_method from mjo.eja.eja_algebra import FiniteDimensionalEJA from mjo.eja.eja_element import FiniteDimensionalEJAElement @@ -84,7 +85,7 @@ class FiniteDimensionalEJASubalgebraElement(FiniteDimensionalEJAElement): True """ - return self.parent().superalgebra()(self.to_matrix()) + return self.parent().superalgebra_embedding()(self) @@ -221,4 +222,35 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): return self._superalgebra + @cached_method + def superalgebra_embedding(self): + r""" + Return the embedding from this subalgebra into the superalgebra. + + EXAMPLES:: + + sage: J = HadamardEJA(4) + sage: A = J.one().subalgebra_generated_by() + sage: iota = A.superalgebra_embedding() + sage: iota + Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: + [1/2] + [1/2] + [1/2] + [1/2] + Domain: Euclidean Jordan algebra of dimension 1 over Algebraic Real Field + Codomain: Euclidean Jordan algebra of dimension 4 over Algebraic Real Field + sage: iota(A.one()) == J.one() + True + + """ + from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + mm = self._module_morphism(lambda j: self.superalgebra()(self.monomial(j).to_matrix()), + codomain=self.superalgebra()) + return FiniteDimensionalEJAOperator(self, + self.superalgebra(), + mm.matrix()) + + + Element = FiniteDimensionalEJASubalgebraElement