From bbd5f7c52147dd9295b7ea88554f425caa669d20 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 10 Apr 2026 08:05:21 -0400 Subject: [PATCH] mjo/clan/clan.py: new method _test_leftreg_eigenvalues() The third of the three clan axioms. --- mjo/clan/clan.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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 -- 2.53.0