]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix random_instance() for JordanSpinEJA.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 22 Nov 2020 15:22:47 +0000 (10:22 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 22 Nov 2020 15:22:47 +0000 (10:22 -0500)
mjo/eja/eja_algebra.py

index 8ca501d6ba944a539901d384a78a5c8a0f45a7ca..4cbc88eb883d78bb5e85a9860b53330c9b980845 100644 (file)
@@ -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):
     """