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

index 038de61f481c4036dec9032806f22bdf5d2e2602..d07425f6516e0261030afc3052ddbfd8660e6722 100644 (file)
@@ -323,6 +323,35 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
             return elt.minimal_polynomial()
 
 
+        def quadratic_representation(self):
+            """
+            Return the quadratic representation of this element.
+
+            EXAMPLES:
+
+            The explicit form in the spin factor algebra is given by
+            Alizadeh's Example 11.12::
+
+                sage: n = ZZ.random_element(1,10).abs()
+                sage: J = eja_ln(n)
+                sage: x = J.random_element()
+                sage: x_vec = x.vector()
+                sage: x0 = x_vec[0]
+                sage: x_bar = x_vec[1:]
+                sage: A = matrix(QQ, 1, [x_vec.inner_product(x_vec)])
+                sage: B = 2*x0*x_bar.row()
+                sage: C = 2*x0*x_bar.column()
+                sage: D = identity_matrix(QQ, n-1)
+                sage: D = (x0^2 - x_bar.inner_product(x_bar))*D
+                sage: D = D + 2*x_bar.tensor_product(x_bar)
+                sage: Q = block_matrix(2,2,[A,B,C,D])
+                sage: Q == x.quadratic_representation()
+                True
+
+            """
+            return 2*(self.matrix()**2) - (self**2).matrix()
+
+
         def span_of_powers(self):
             """
             Return the vector space spanned by successive powers of