From: Michael Orlitzky Date: Fri, 5 Jul 2019 15:36:18 +0000 (-0400) Subject: eja: use random_eja() where applicable in tests. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=eabb7b6ad9c1be19f90c9125e79c00eb09a0b68c;p=sage.d.git eja: use random_eja() where applicable in tests. --- diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 96b62a3..038de61 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -98,8 +98,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): EXAMPLES: sage: set_random_seed() - sage: J = eja_ln(5) - sage: x = J.random_element() + sage: x = random_eja().random_element() sage: x.matrix()*x.vector() == (x**2).vector() True @@ -168,23 +167,13 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): The identity element is never nilpotent:: sage: set_random_seed() - sage: n = ZZ.random_element(2,10).abs() - sage: J = eja_rn(n) - sage: J.one().is_nilpotent() - False - sage: J = eja_ln(n) - sage: J.one().is_nilpotent() + sage: random_eja().one().is_nilpotent() False The additive identity is always nilpotent:: sage: set_random_seed() - sage: n = ZZ.random_element(2,10).abs() - sage: J = eja_rn(n) - sage: J.zero().is_nilpotent() - True - sage: J = eja_ln(n) - sage: J.zero().is_nilpotent() + sage: random_eja().zero().is_nilpotent() True """ @@ -282,18 +271,14 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): EXAMPLES:: sage: set_random_seed() - sage: n = ZZ.random_element(1,10).abs() - sage: J = eja_rn(n) - sage: x = J.random_element() + sage: x = random_eja().random_element() sage: x.degree() == x.minimal_polynomial().degree() True :: sage: set_random_seed() - sage: n = ZZ.random_element(1,10).abs() - sage: J = eja_ln(n) - sage: x = J.random_element() + sage: x = random_eja().random_element() sage: x.degree() == x.minimal_polynomial().degree() True @@ -358,13 +343,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): TESTS:: sage: set_random_seed() - sage: n = ZZ.random_element(1,10).abs() - sage: J = eja_rn(n) - sage: x = J.random_element() - sage: x.subalgebra_generated_by().is_associative() - True - sage: J = eja_ln(n) - sage: x = J.random_element() + sage: x = random_eja().random_element() sage: x.subalgebra_generated_by().is_associative() True @@ -372,8 +351,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): squaring in the superalgebra:: sage: set_random_seed() - sage: J = eja_ln(5) - sage: x = J.random_element() + sage: x = random_eja().random_element() sage: u = x.subalgebra_generated_by().random_element() sage: u.matrix()*u.vector() == (u**2).vector() True