]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_element.py
eja: combine several slow trace_inner_product() tests.
[sage.d.git] / mjo / eja / eja_element.py
index 90c236af8ef4dd46784007cb4927d00ba6b4e33e..d787c5fc1366411fe6f6a3b549d8dbd285037d8b 100644 (file)
@@ -709,6 +709,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement):
         SETUP::
 
             sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
+            ....:                                  RealSymmetricEJA,
             ....:                                  random_eja)
 
         TESTS:
@@ -758,6 +759,20 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement):
             sage: x.apply_univariate_polynomial(p)
             0
 
+        The minimal polynomial is invariant under a change of basis,
+        and in particular, a re-scaling of the basis::
+
+            sage: set_random_seed()
+            sage: n = ZZ.random_element(1,5)
+            sage: J1 = RealSymmetricEJA(n)
+            sage: J2 = RealSymmetricEJA(n,QQ,False)
+            sage: X = random_matrix(QQ,n)
+            sage: X = X*X.transpose()
+            sage: x1 = J1(X)
+            sage: x2 = J2(X)
+            sage: x1.minimal_polynomial() == x2.minimal_polynomial()
+            True
+
         """
         if self.is_zero():
             # We would generate a zero-dimensional subalgebra
@@ -1161,21 +1176,18 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement):
 
         TESTS:
 
-        The trace inner product is commutative::
-
-            sage: set_random_seed()
-            sage: J = random_eja()
-            sage: x = J.random_element(); y = J.random_element()
-            sage: x.trace_inner_product(y) == y.trace_inner_product(x)
-            True
-
-        The trace inner product is bilinear::
+        The trace inner product is commutative, bilinear, and satisfies
+        the Jordan axiom:
 
             sage: set_random_seed()
             sage: J = random_eja()
-            sage: x = J.random_element()
+            sage: x = J.random_element();
             sage: y = J.random_element()
             sage: z = J.random_element()
+            sage: # commutative
+            sage: x.trace_inner_product(y) == y.trace_inner_product(x)
+            True
+            sage: # bilinear
             sage: a = J.base_ring().random_element();
             sage: actual = (a*(x+z)).trace_inner_product(y)
             sage: expected = ( a*x.trace_inner_product(y) +
@@ -1187,15 +1199,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement):
             ....:              a*x.trace_inner_product(z) )
             sage: actual == expected
             True
-
-        The trace inner product satisfies the compatibility
-        condition in the definition of a Euclidean Jordan algebra::
-
-            sage: set_random_seed()
-            sage: J = random_eja()
-            sage: x = J.random_element()
-            sage: y = J.random_element()
-            sage: z = J.random_element()
+            sage: # jordan axiom
             sage: (x*y).trace_inner_product(z) == y.trace_inner_product(x*z)
             True