From 70a8227fc27d6de57cdabfb7fd1f1a7c00a74132 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 22 Nov 2020 10:22:47 -0500 Subject: [PATCH] eja: fix random_instance() for JordanSpinEJA. --- mjo/eja/eja_algebra.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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): """ -- 2.43.2