From: Michael Orlitzky Date: Thu, 26 Nov 2020 02:23:54 +0000 (-0500) Subject: eja: replace a bunch of "manual" tests with a random one. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=9a6de831e947f663cacf56e409e99ec3aa086c62;p=sage.d.git eja: replace a bunch of "manual" tests with a random one. --- 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())