From 9a6de831e947f663cacf56e409e99ec3aa086c62 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 25 Nov 2020 21:23:54 -0500 Subject: [PATCH] eja: replace a bunch of "manual" tests with a random one. --- mjo/eja/eja_algebra.py | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 9d53bc5..a51da3e 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -989,38 +989,13 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): Ensure that computing the rank actually works, since the ranks of all simple algebras are known and will be cached by default:: - sage: J = HadamardEJA(4) - sage: J.rank.clear_cache() - sage: J.rank() - 4 - - :: - - sage: J = JordanSpinEJA(4) - sage: J.rank.clear_cache() - sage: J.rank() - 2 - - :: - - sage: J = RealSymmetricEJA(3) - sage: J.rank.clear_cache() - sage: J.rank() - 3 - - :: - - sage: J = ComplexHermitianEJA(2) - sage: J.rank.clear_cache() - sage: J.rank() - 2 - - :: + sage: set_random_seed() # long time + sage: J = random_eja() # long time + sage: caches = J.rank() # long time + sage: J.rank.clear_cache() # long time + sage: J.rank() == cached # long time + True - sage: J = QuaternionHermitianEJA(2) - sage: J.rank.clear_cache() - sage: J.rank() - 2 """ return len(self._charpoly_coefficients()) -- 2.44.2