X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_algebra.py;h=9f8a2585d456b7d82f1c59f1ca067eebf23d0d60;hb=1d6c0d98ea24be9bcfec236ad94d6d125dabd8f4;hp=3671e367359d5eeb7b86c76fe98ec4e90edb2f6e;hpb=fa3651ef28df68f4c37b16339074fbf86b8feff4;p=sage.d.git diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 3671e36..9f8a258 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1447,26 +1447,13 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): # For a general base ring... maybe we can trust this to do the # right thing? Unlikely, but. V = self.vector_space() - v = V.random_element() - - if self.base_ring() is AA: - # The "random element" method of the algebraic reals is - # stupid at the moment, and only returns integers between - # -2 and 2, inclusive: - # - # https://trac.sagemath.org/ticket/30875 - # - # Instead, we implement our own "random vector" method, - # and then coerce that into the algebra. We use the vector - # space degree here instead of the dimension because a - # subalgebra could (for example) be spanned by only two - # vectors, each with five coordinates. We need to - # generate all five coordinates. - if thorough: - v *= QQbar.random_element().real() - else: - v *= QQ.random_element() + if self.base_ring() is AA and not thorough: + # Now that AA generates actually random random elements + # (post Trac 30875), we only need to de-thorough the + # randomness when asked to. + V = V.change_ring(QQ) + v = V.random_element() return self.from_vector(V.coordinate_vector(v)) def random_elements(self, count, thorough=False): @@ -2450,7 +2437,7 @@ class OctonionHermitianEJA(HermitianMatrixEJA, RationalBasisEJA, ConcreteEJA): @staticmethod def _max_random_instance_size(max_dimension): r""" - The maximum rank of a random QuaternionHermitianEJA. + The maximum rank of a random OctonionHermitianEJA. """ # There's certainly a formula for this, but with only four # cases to worry about, I'm not that motivated to derive it. @@ -3767,3 +3754,9 @@ class ComplexSkewSymmetricEJA(RationalBasisEJA, ConcreteEJA): field=field, matrix_space=A, **kwargs) + + # This algebra is conjectured (by me) to be isomorphic to + # the quaternion Hermitian EJA of size n, and the rank + # would follow from that. + #self.rank.set_cache(n) + self.one.set_cache( self(-J) )