interpreted to be far less than the dimension) should override
with a smaller number.
"""
- return 5
+ raise NotImplementedError
def _repr_(self):
"""
Beware, this will crash for "most instances" because the
constructor below looks wrong.
"""
- if cls is TrivialEJA:
- # The TrivialEJA class doesn't take an "n" argument because
- # there's only one.
- return cls(field)
-
n = ZZ.random_element(cls._max_random_instance_size() + 1)
return cls(n, field, **kwargs)
**kwargs)
self.rank.set_cache(n)
+ @staticmethod
+ def _max_random_instance_size():
+ return 5
+
def inner_product(self, x, y):
"""
Faster to reimplement than to use natural representations.
**kwargs)
self.rank.set_cache(min(n,2))
+ @staticmethod
+ def _max_random_instance_size():
+ return 5
+
def inner_product(self, x, y):
r"""
Half of the trace inner product.
# largest subalgebra generated by any element.
self.rank.set_cache(0)
+ @classmethod
+ def random_instance(cls, field=AA, **kwargs):
+ # We don't take a "size" argument so the superclass method is
+ # inappropriate for us.
+ return cls(field, **kwargs)
class DirectSumEJA(FiniteDimensionalEuclideanJordanAlgebra):
r"""