]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add non-working trace_inner_product() for EJA elements.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 5 Jul 2019 21:35:23 +0000 (17:35 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index d07425f6516e0261030afc3052ddbfd8660e6722..7820db524ac2f5858947f48411c00b1d9b4d3eed 100644 (file)
@@ -503,6 +503,16 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
                 raise ValueError('charpoly had fewer than 2 coefficients')
 
 
+        def trace_inner_product(self, other):
+            """
+            Return the trace inner product of myself and ``other``.
+            """
+            if not other in self.parent():
+                raise ArgumentError("'other' must live in the same algebra")
+
+            return (self*other).trace()
+
+
 def eja_rn(dimension, field=QQ):
     """
     Return the Euclidean Jordan Algebra corresponding to the set