return self.from_vector(coords)
@staticmethod
- def _max_test_case_size():
+ def _max_random_instance_size():
"""
Return an integer "size" that is an upper bound on the size of
this algebra when it is used in a random test
# there's only one.
return cls(field)
- n = ZZ.random_element(cls._max_test_case_size() + 1)
+ n = ZZ.random_element(cls._max_random_instance_size() + 1)
return cls(n, field, **kwargs)
@cached_method
class MatrixEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebra):
@staticmethod
- def _max_test_case_size():
+ def _max_random_instance_size():
# Play it safe, since this will be squared and the underlying
# field can have dimension 4 (quaternions) too.
return 2
The dimension of this algebra is `(n^2 + n) / 2`::
sage: set_random_seed()
- sage: n_max = RealSymmetricEJA._max_test_case_size()
+ sage: n_max = RealSymmetricEJA._max_random_instance_size()
sage: n = ZZ.random_element(1, n_max)
sage: J = RealSymmetricEJA(n)
sage: J.dimension() == (n^2 + n)/2
@staticmethod
- def _max_test_case_size():
+ def _max_random_instance_size():
return 4 # Dimension 10
Embedding is a homomorphism (isomorphism, in fact)::
sage: set_random_seed()
- sage: n_max = ComplexMatrixEuclideanJordanAlgebra._max_test_case_size()
+ sage: n_max = ComplexMatrixEuclideanJordanAlgebra._max_random_instance_size()
sage: n = ZZ.random_element(n_max)
sage: F = QuadraticField(-1, 'I')
sage: X = random_matrix(F, n)
The dimension of this algebra is `n^2`::
sage: set_random_seed()
- sage: n_max = ComplexHermitianEJA._max_test_case_size()
+ sage: n_max = ComplexHermitianEJA._max_random_instance_size()
sage: n = ZZ.random_element(1, n_max)
sage: J = ComplexHermitianEJA(n)
sage: J.dimension() == n^2
Embedding is a homomorphism (isomorphism, in fact)::
sage: set_random_seed()
- sage: n_max = QuaternionMatrixEuclideanJordanAlgebra._max_test_case_size()
+ sage: n_max = QuaternionMatrixEuclideanJordanAlgebra._max_random_instance_size()
sage: n = ZZ.random_element(n_max)
sage: Q = QuaternionAlgebra(QQ,-1,-1)
sage: X = random_matrix(Q, n)
The dimension of this algebra is `2*n^2 - n`::
sage: set_random_seed()
- sage: n_max = QuaternionHermitianEJA._max_test_case_size()
+ sage: n_max = QuaternionHermitianEJA._max_random_instance_size()
sage: n = ZZ.random_element(1, n_max)
sage: J = QuaternionHermitianEJA(n)
sage: J.dimension() == 2*(n^2) - n
two here so that said elements actually exist::
sage: set_random_seed()
- sage: n_max = max(2, JordanSpinEJA._max_test_case_size())
+ sage: n_max = max(2, JordanSpinEJA._max_random_instance_size())
sage: n = ZZ.random_element(2, n_max)
sage: J = JordanSpinEJA(n)
sage: y = J.random_element()
and in particular, a re-scaling of the basis::
sage: set_random_seed()
- sage: n_max = RealSymmetricEJA._max_test_case_size()
+ sage: n_max = RealSymmetricEJA._max_random_instance_size()
sage: n = ZZ.random_element(1, n_max)
sage: J1 = RealSymmetricEJA(n)
sage: J2 = RealSymmetricEJA(n,normalize_basis=False)