]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/clan/clan.py: new method _test_leftreg_eigenvalues()
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 10 Apr 2026 12:05:21 +0000 (08:05 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 10 Apr 2026 12:05:21 +0000 (08:05 -0400)
The third of the three clan axioms.

mjo/clan/clan.py

index bff8684db8a582373baa5b83df5a342dcf3fed06..846c8bcb7892eb8ff672c4e1c425f8c1fe02ae59 100644 (file)
@@ -152,3 +152,32 @@ class Clan(CombinatorialFreeModule):
         result |= all( check(x, y) for x in xs for y in ys )
 
         return result
+
+    def _test_leftreg_eigenvalues(self):
+        r"""
+        Check the leftreg-eigenvalues-are-real axiom of this clan.
+
+        SETUP::
+
+            sage: from mjo.clan.random import random_clan
+
+        EXAMPLES::
+
+            sage: C = random_clan()              # long time
+            sage: C._test_leftreg_eigenvalues()  # long time
+            True
+
+        """
+        def check(x):
+            return all( ev in self.base_ring()
+                        for ev in x.leftreg().eigenvalues() )
+
+        # Check the basis...
+        b = self.basis()
+        result = all( check(b[i]) for i in b.keys() )
+
+        # And some random elements for good measure
+        xs = ( self.random_element() for _ in range(100) )
+        result |= all( check(x) for x in xs )
+
+        return result