]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add trace linearity and charpoly homogeneity tests.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Jan 2021 19:04:41 +0000 (14:04 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Jan 2021 19:05:10 +0000 (14:05 -0500)
mjo/eja/eja_algebra.py
mjo/eja/eja_element.py

index 39703dd1b65d416865af044f41164e6ac4c3ee48..7c8adc7400880b0c4a95f7d73dec6cd11113aec6 100644 (file)
@@ -1101,6 +1101,21 @@ class FiniteDimensionalEJA(CombinatorialFreeModule):
         r"""
         The `r` polynomial coefficients of the "characteristic polynomial
         of" function.
+
+        SETUP::
+
+            sage: from mjo.eja.eja_algebra import random_eja
+
+        TESTS:
+
+        The theory shows that these are all homogeneous polynomials of
+        a known degree::
+
+            sage: set_random_seed()
+            sage: J = random_eja()
+            sage: all(p.is_homogeneous() for p in J._charpoly_coefficients())
+            True
+
         """
         n = self.dimension()
         R = self.coordinate_polynomial_ring()
index 66138b2089cfcc2190c4282393c221e2c7c188fc..c2f2b7c12ff92dbc0a57036057afad55acd63ddd 100644 (file)
@@ -1526,6 +1526,15 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement):
             sage: J.random_element().trace() in RLF
             True
 
+        The trace is linear::
+
+            sage: set_random_seed()
+            sage: J = random_eja()
+            sage: x,y = J.random_elements(2)
+            sage: alpha = J.base_ring().random_element()
+            sage: (alpha*x + y).trace() == alpha*x.trace() + y.trace()
+            True
+
         """
         P = self.parent()
         r = P.rank()