return self.from_vector(coords)
+ @staticmethod
+ def _max_test_case_size():
+ """
+ Return an integer "size" that is an upper bound on the size of
+ this algebra when it is used in a random test
+ case. Unfortunately, the term "size" is quite vague -- when
+ dealing with `R^n` under either the Hadamard or Jordan spin
+ product, the "size" refers to the dimension `n`. When dealing
+ with a matrix algebra (real symmetric or complex/quaternion
+ Hermitian), it refers to the size of the matrix, which is
+ far less than the dimension of the underlying vector space.
+
+ We default to five in this class, which is safe in `R^n`. The
+ matrix algebra subclasses (or any class where the "size" is
+ interpreted to be far less than the dimension) should override
+ with a smaller number.
+ """
+ return 5
+
+
def _repr_(self):
"""
Return a string representation of ``self``.
Euclidean Jordan algebra of dimension...
"""
-
- # The max_n component lets us choose different upper bounds on the
- # value "n" that gets passed to the constructor. This is needed
- # because e.g. R^{10} is reasonable to test, while the Hermitian
- # 10-by-10 quaternion matrices are not.
- (constructor, max_n) = choice([(RealCartesianProductEJA, 6),
- (JordanSpinEJA, 6),
- (RealSymmetricEJA, 5),
- (ComplexHermitianEJA, 4),
- (QuaternionHermitianEJA, 3)])
- n = ZZ.random_element(1, max_n)
+ constructor = choice([RealCartesianProductEJA,
+ JordanSpinEJA,
+ RealSymmetricEJA,
+ ComplexHermitianEJA,
+ QuaternionHermitianEJA])
+ n = ZZ.random_element(1, constructor._max_test_case_size())
return constructor(n, field=QQ)
natural_basis=S,
**kwargs)
+ @staticmethod
+ def _max_test_case_size():
+ return 5
class ComplexHermitianEJA(FiniteDimensionalEuclideanJordanAlgebra):
**kwargs)
+ @staticmethod
+ def _max_test_case_size():
+ return 4
+
@staticmethod
def natural_inner_product(X,Y):
Xu = _unembed_complex_matrix(X)
natural_basis=S,
**kwargs)
+ @staticmethod
+ def _max_test_case_size():
+ return 3
+
@staticmethod
def natural_inner_product(X,Y):
Xu = _unembed_quaternion_matrix(X)