]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add superalgebra_embedding() for subalgebras.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 12 Mar 2021 12:48:59 +0000 (07:48 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 12 Mar 2021 12:48:59 +0000 (07:48 -0500)
mjo/eja/eja_subalgebra.py

index 4458a7e06d9d905ab276665a210eb7dc8275320b..68f1ce4cf8b5f07087e4474069ad4ebe5c6a4998 100644 (file)
@@ -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