From: Michael Orlitzky Date: Fri, 10 Apr 2026 12:05:21 +0000 (-0400) Subject: mjo/clan/clan.py: new method _test_leftreg_eigenvalues() X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=bbd5f7c52147dd9295b7ea88554f425caa669d20;p=sage.d.git mjo/clan/clan.py: new method _test_leftreg_eigenvalues() The third of the three clan axioms. --- diff --git a/mjo/clan/clan.py b/mjo/clan/clan.py index bff8684..846c8bc 100644 --- a/mjo/clan/clan.py +++ b/mjo/clan/clan.py @@ -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