From: Michael Orlitzky Date: Sun, 22 Nov 2020 15:22:47 +0000 (-0500) Subject: eja: fix random_instance() for JordanSpinEJA. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=70a8227fc27d6de57cdabfb7fd1f1a7c00a74132;p=sage.d.git eja: fix random_instance() for JordanSpinEJA. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 8ca501d..4cbc88e 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -2292,6 +2292,16 @@ class JordanSpinEJA(BilinearFormEJA): B = matrix.identity(field, n) super(JordanSpinEJA, self).__init__(B, field, **kwargs) + @classmethod + def random_instance(cls, field=AA, **kwargs): + """ + Return a random instance of this type of algebra. + + Needed here to override the implementation for ``BilinearFormEJA``. + """ + n = ZZ.random_element(cls._max_random_instance_size() + 1) + return cls(n, field, **kwargs) + class TrivialEJA(FiniteDimensionalEuclideanJordanAlgebra): """