]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add natural_representation() for elements.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 18 Jul 2019 22:57:44 +0000 (18:57 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index 3124132b61e5f196268cb027ce1bd26028aaa942..59e1537854a09f7058498cdd0959bbc82ccbde8d 100644 (file)
@@ -461,6 +461,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
             return self.span_of_powers().dimension()
 
 
+
         def operator_matrix(self):
             """
             Return the matrix that represents left- (or right-)
@@ -528,6 +529,34 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
             return fda_elt.matrix().transpose()
 
 
+        def natural_representation(self):
+            """
+            Return a more-natural representation of this element.
+
+            Every finite-dimensional Euclidean Jordan Algebra is a
+            direct sum of five simple algebras, four of which comprise
+            Hermitian matrices. This method returns the original
+            "natural" representation of this element as a Hermitian
+            matrix, if it has one. If not, you get the usual representation.
+
+            EXAMPLES::
+
+                sage: J = ComplexHermitianSimpleEJA(3)
+                sage: J.one()
+                e0 + e5 + e8
+                sage: J.one().natural_representation()
+                [1 0 0 0 0 0]
+                [0 1 0 0 0 0]
+                [0 0 1 0 0 0]
+                [0 0 0 1 0 0]
+                [0 0 0 0 1 0]
+                [0 0 0 0 0 1]
+
+            """
+            B = self.parent().natural_basis()
+            W = B[0].matrix_space()
+            return W.linear_combination(zip(self.vector(), B))
+
 
         def minimal_polynomial(self):
             """